/* Self-hosted font (variable, latin subset) */
@font-face {
  font-family: "Josefin Slab";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/fonts/josefin-slab.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --pico-font-family-sans-serif: "Josefin Slab", serif;
  --pico-background-color: #1a1714f9;
  --pico-color: #e8e0d5;
  --pico-primary: #c4935a;
  --pico-primary-hover: #d4a96a;
  --pico-primary-focus: #c4935a60;
  --pico-primary-underline: #c4935a80;
  --pico-primary-background: #c4935a;
  --pico-secondary: #7eac53;
  --pico-secondary-border: #7eac5344;
  --pico-card-background-color: #211e1b;
  --pico-card-sectioning-background-color: #1f1b19;
  --pico-card-border-color: #2e2925;
  --pico-muted-color: #a89880;
  --pico-muted-border-color: #2e2925;
  --pico-h1-color: #f0e6d6;
  --pico-h2-color: #ddd0be;
  --pico-h3-color: #c9bba8;
}

body {
  background-repeat: repeat;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.layout {
  display: flex;
  width: 960px;
  max-width: 100%;
  margin: 0 auto;
  flex: 1;
  background-color: var(--pico-background-color);
}

.sidebar {
  flex: 0 0 200px;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--pico-muted-border-color);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2rem;
}

.sidebar__brand {
  font-size: 1rem;
  text-decoration: none;
  color: var(--pico-h1-color);
  letter-spacing: 0.02em;
  text-align: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar ul a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  transition: color 0.2s;
}

.sidebar ul a:hover {
  color: var(--pico-color);
}

.content {
  flex: 1;
  min-width: 0;
  max-width: 740px;
  padding: 2rem 3rem;
  overflow-wrap: break-word;
}

.bg-credit {
  align-self: flex-end;
  margin: 0.5rem -1rem -1.5rem;
  font-size: 0.7rem;
  color: var(--pico-color);
  opacity: 0.6;
  transition: opacity 0.2s;
}

.bg-credit a {
  color: inherit;
  text-decoration: none;
}

.bg-credit:hover {
  opacity: 1;
}

.recent-activity {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.recent-activity__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.recent-activity__col {
  min-width: 0;
}

.recent-activity__col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.recent-updates {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-updates li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.recent-updates .muted {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── Recent comments widget ── */

.recent-comments .isso-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Comments (Isso thread + recent-comments widget) ── */

.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.isso-comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  min-width: 0;
}

.isso-comment:last-child {
  border-bottom: none;
}

.isso-comment-header {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.isso-comment-topic {
  width: 100%;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.isso-author {
  font-weight: bold;
}

#isso-thread .isso-permalink {
  color: var(--pico-muted-color);
  text-decoration: none;
  pointer-events: none;
}

.isso-spacer {
  color: var(--pico-muted-color);
}

.identicon {
  border-radius: 3px;
  vertical-align: middle;
}

.isso-text {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  overflow-wrap: break-word;
  min-width: 0;
}

.isso-text p {
  margin: 0;
}

.isso-comment-footer {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.isso-comment-footer a,
.isso-comment-footer .isso-vote {
  color: var(--pico-muted-color);
  text-decoration: none;
  font-size: 0.8rem;
}

.isso-comment-footer a:hover,
.isso-upvote:hover,
.isso-downvote:hover {
  color: var(--pico-primary);
}

/* Hide Isso's auto-generated comment count heading */
#isso-thread > h4 {
  display: none;
}

/* Isso form - push to bottom, 2-col grid layout */
#isso-thread {
  display: flex;
  flex-direction: column;
}

.isso-postbox {
  order: 99;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.isso-form-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.isso-auth-section {
  display: contents;
}

/* Row 1: name, website */
.isso-input-wrapper:nth-child(1) { order: 1; }
.isso-input-wrapper:nth-child(3) { order: 1; }

/* Row 2: email */
.isso-input-wrapper:nth-child(2) { order: 2; }

.isso-textarea-wrapper {
  grid-column: 1 / -1;
  order: 3;
  margin-bottom: 0.5rem;
}

.isso-input-wrapper {
  margin: 0;
}

.isso-input-wrapper label {
  display: none;
}

.isso-postbox input[type="text"],
.isso-postbox input[type="email"] {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--pico-color);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.25rem;
}


.isso-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--pico-color);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.25rem;
  min-height: 6rem;
  resize: vertical;
}

.isso-textarea:focus,
.isso-postbox input:focus {
  border-color: var(--pico-primary);
  outline: none;
}

.isso-preview {
  grid-column: 1 / -1;
  order: 3;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 0.25rem;
}

.isso-preview::before {
  content: 'Preview:';
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.isso-post-action:has(input[name="edit"]),
.isso-post-action:has(input[name="preview"]) {
  display: none;
}

.isso-post-action {
  margin: 0;
  order: 2;
}

.isso-post-action input[type="submit"] {
  background: var(--pico-primary-background);
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.isso-post-action input[type="submit"]:hover:not(:disabled) {
  background: var(--pico-primary-hover);
}

.isso-post-action input[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.isso-notification-section {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  order: 2;
}

/* Save button (edit mode) - same style as submit but smaller */
.isso-comment .isso-post-action input[type="submit"] {
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
}

/* Space between comment header and edit box */
.isso-comment .isso-textarea-wrapper {
  margin-top: 0.5rem;
}

/* Hide main comment form while a reply box is open */
#isso-thread:has(.isso-comment .isso-postbox) > .isso-postbox {
  display: none;
}

/* Nested replies */
.isso-follow-up {
  margin-left: 1.5rem;
  border-left: 2px solid var(--pico-muted-border-color);
  padding-left: 1rem;
}

.note-content {
  overflow-x: auto;
}

.note-back {
  font-size: 0.9rem;
}

.note-back + h1 {
  margin-top: 0.25rem;
}

.muted {
  color: var(--pico-muted-color);
}

.js-loading {
  display: none;
}

.js .js-loading {
  display: block;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  display: block;
  position: relative;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  text-decoration: none;
  color: var(--pico-color);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--pico-primary);
}

.card h2 {
  margin: 0;
  font-size: 1rem;
}

.card p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.stage {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  text-transform: capitalize;
}

.stage::before {
  content: "";
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.stage--seedling {
  color: var(--pico-secondary);
  border-color: var(--pico-secondary-border);
}

.stage--seedling::before {
  -webkit-mask-image: url("/images/growth-stages/seedling.svg");
  mask-image: url("/images/growth-stages/seedling.svg");
}

.stage--budding {
  color: var(--pico-secondary);
  border-color: var(--pico-secondary-border);
}

.stage--budding::before {
  -webkit-mask-image: url("/images/growth-stages/budding.svg");
  mask-image: url("/images/growth-stages/budding.svg");
}

.stage--evergreen {
  color: var(--pico-secondary);
  border-color: var(--pico-secondary-border);
}

.stage--evergreen::before {
  -webkit-mask-image: url("/images/growth-stages/evergreen.svg");
  mask-image: url("/images/growth-stages/evergreen.svg");
}

.task-list-item-checkbox:checked,
.task-list-item-checkbox:checked:active,
.task-list-item-checkbox:checked:focus {
  background-color: var(--pico-secondary);
  border-color: var(--pico-secondary);
}

.topic-card span {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.note-meta .updated {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
}

.finds-card__creator {
  color: var(--pico-muted-color);
  font-size: 0.75rem;
}

.finds-card__feed {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  color: var(--pico-secondary);
  border: 1px solid var(--pico-secondary);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

/* ── Sidebar toggle (mobile) ── */

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--pico-muted-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.35rem;
  font-size: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 767.98px) {
  body {
    padding: 1rem;
  }

  .sidebar-toggle {
    display: flex;
    align-self: flex-start;
    margin: 1rem 0 -0.5rem 1rem;
    z-index: 110;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 200px;
    z-index: 100;
    background: var(--pico-background-color);
    border-right: 1px solid var(--pico-muted-border-color);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: 6rem;
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .bg-credit {
    margin: 0.5rem 0 -0.5rem;
  }

  .recent-activity__columns {
    grid-template-columns: 1fr;
  }

}
