/* Apothecary Journal — editorial / vintage scientific (scope: body.theme-apothecary) */
@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400..700;1,400..700&family=Source+Sans+3:ital,wght@0,400..700;1,400..700&display=swap");

body.theme-apothecary {
  --aj-paper: #F4F0E6;
  --aj-paper-2: #EDE6D8;
  --aj-ink: #2A2118;
  --aj-ink-soft: #4A4036;
  --aj-moss: #4F6F52;
  --aj-moss-dark: #3D5A40;
  --aj-rust: #6B4F3B;
  --aj-rule: #D7CFC0;
  --aj-serif: "Crimson Pro", "Times New Roman", Times, serif;
  --aj-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--aj-paper);
  color: var(--aj-ink);
  font-family: var(--aj-sans);
}

body.theme-apothecary h1,
body.theme-apothecary h2,
body.theme-apothecary h3,
body.theme-apothecary .topic-section-head h2,
body.theme-apothecary .logo-text {
  font-family: var(--aj-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Density (spacing scale) --- */
body.theme-apothecary.aj-density-compact {
  --aj-pad-section: 1.25rem;
  --aj-pad-card: 0.85rem;
  --aj-gap: 0.75rem;
}
body.theme-apothecary.aj-density-balanced {
  --aj-pad-section: 1.75rem;
  --aj-pad-card: 1.1rem;
  --aj-gap: 1rem;
}
body.theme-apothecary.aj-density-airy {
  --aj-pad-section: 2.35rem;
  --aj-pad-card: 1.35rem;
  --aj-gap: 1.25rem;
}

/* --- Radius modes (stack with generator --radius where useful) --- */
body.theme-apothecary.aj-radius-0 .article-card,
body.theme-apothecary.aj-radius-0 .ticker-card,
body.theme-apothecary.aj-radius-0 .btn-primary,
body.theme-apothecary.aj-radius-0 .pbn-ff-pill,
body.theme-apothecary.aj-radius-0 .aj-rail-card,
body.theme-apothecary.aj-radius-0 .aj-hero__plate,
body.theme-apothecary.aj-radius-0 .aj-product-media,
body.theme-apothecary.aj-radius-0 .aj-product-detail {
  border-radius: 0 !important;
}
body.theme-apothecary.aj-radius-8 .article-card,
body.theme-apothecary.aj-radius-8 .ticker-card,
body.theme-apothecary.aj-radius-8 .btn-primary,
body.theme-apothecary.aj-radius-8 .pbn-ff-pill,
body.theme-apothecary.aj-radius-8 .aj-rail-card,
body.theme-apothecary.aj-radius-8 .aj-hero__plate,
body.theme-apothecary.aj-radius-8 .aj-product-media,
body.theme-apothecary.aj-radius-8 .aj-product-detail {
  border-radius: 8px !important;
}
body.theme-apothecary.aj-radius-pill .btn-primary,
body.theme-apothecary.aj-radius-pill .pbn-ff-pill,
body.theme-apothecary.aj-radius-pill .search-btn {
  border-radius: 999px !important;
}
body.theme-apothecary.aj-radius-pill .article-card,
body.theme-apothecary.aj-radius-pill .ticker-card,
body.theme-apothecary.aj-radius-pill .aj-rail-card {
  border-radius: 18px !important;
}

/* --- Masthead --- */
body.theme-apothecary .site-header.aj-masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 240, 230, 0.94);
  border-bottom: 1px solid var(--aj-rule);
  backdrop-filter: saturate(1.1) blur(6px);
}
body.theme-apothecary .aj-masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aj-gap);
  padding: 0.65rem 0;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
body.theme-apothecary .aj-masthead__tagline {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 10px;
  font-size: 0.82rem;
  color: var(--aj-ink-soft);
  border-bottom: 1px dashed var(--aj-rule);
}
body.theme-apothecary .site-nav.aj-masthead__nav a {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
  color: var(--aj-ink);
}
body.theme-apothecary .site-nav.aj-masthead__nav a:hover {
  color: var(--aj-moss-dark);
}

/* --- Home shell + sidebar --- */
body.theme-apothecary .aj-home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(300px, 32vw);
  gap: clamp(1rem, 2.5vw, 2.25rem);
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--aj-pad-section) 16px 48px;
}
body.theme-apothecary .aj-home-main > * + * {
  margin-top: var(--aj-pad-section);
}
@media (max-width: 960px) {
  body.theme-apothecary .aj-home-shell {
    grid-template-columns: 1fr;
  }
  body.theme-apothecary .aj-home-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    position: static;
  }
}
@media (max-width: 520px) {
  body.theme-apothecary .aj-home-rail {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .aj-home-rail {
  position: sticky;
  top: 72px;
  align-self: start;
}
body.theme-apothecary .aj-rail-card {
  background: var(--aj-paper-2);
  border: 1px solid var(--aj-rule);
  padding: var(--aj-pad-card);
  margin-bottom: 12px;
}
body.theme-apothecary .aj-rail-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
body.theme-apothecary .aj-rail-list,
body.theme-apothecary .aj-rail-topics {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
body.theme-apothecary .aj-rail-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--aj-ink-soft);
}

/* --- 3-col article grids --- */
body.theme-apothecary .aj-articles-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
@media (max-width: 900px) {
  body.theme-apothecary .aj-articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  body.theme-apothecary .aj-articles-grid {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .article-card {
  background: #fffdf8;
  border: 1px solid var(--aj-rule);
  box-shadow: none;
}
body.theme-apothecary .topic-section-head {
  border-bottom: 2px solid var(--aj-moss);
  padding-bottom: 8px;
}

/* --- Archive rail --- */
body.theme-apothecary .aj-archive-rail {
  border: 1px solid var(--aj-rule);
  background: linear-gradient(180deg, #fffdf8, var(--aj-paper-2));
  padding: var(--aj-pad-card);
}
body.theme-apothecary .aj-archive-rail__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
body.theme-apothecary .aj-archive-rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.theme-apothecary .aj-archive-rail__link {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--aj-rule);
  text-decoration: none;
  color: inherit;
}
body.theme-apothecary .aj-archive-rail__list li:first-child .aj-archive-rail__link {
  border-top: none;
}
body.theme-apothecary .aj-archive-rail__date {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--aj-moss-dark);
}
@media (max-width: 540px) {
  body.theme-apothecary .aj-archive-rail__link {
    grid-template-columns: 1fr;
  }
}

/* --- Hero variants --- */
body.theme-apothecary .aj-hero {
  margin: 0 auto 8px;
  max-width: 1120px;
  padding: 0 16px;
}
body.theme-apothecary .aj-hero__eyebrow {
  text-transform: none;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--aj-moss-dark);
  margin: 0 0 8px;
}
body.theme-apothecary .aj-hero__deck {
  color: var(--aj-ink-soft);
  max-width: 52ch;
}
body.theme-apothecary .aj-hero__cta {
  margin-top: 14px;
  display: inline-block;
}

/* specimen */
body.theme-apothecary .aj-hero--specimen-cover .aj-hero__specimen-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--aj-rule);
  background: #fffdf8;
  min-height: 280px;
}
@media (max-width: 720px) {
  body.theme-apothecary .aj-hero--specimen-cover .aj-hero__specimen-grid {
    grid-template-columns: 1fr;
  }
  body.theme-apothecary .aj-hero__specimen-meta {
    flex-direction: row !important;
    flex-wrap: wrap;
    border-right: none !important;
    border-bottom: 1px solid var(--aj-rule);
  }
}
body.theme-apothecary .aj-hero__specimen-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  border-right: 1px solid var(--aj-rule);
  background: var(--aj-paper-2);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--aj-ink-soft);
}
body.theme-apothecary .aj-hero__specimen-k {
  display: block;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--aj-rule);
}
body.theme-apothecary .aj-hero__plate,
body.theme-apothecary .aj-hero__plate.is-static {
  min-height: 280px;
  background-image: linear-gradient(180deg, rgba(42, 33, 24, 0.55), rgba(42, 33, 24, 0.78)), var(--hero-bg, linear-gradient(120deg, var(--aj-paper-2), var(--aj-paper)));
  background-size: cover;
  background-position: center;
}
body.theme-apothecary .aj-hero__plate-inner {
  padding: clamp(1.5rem, 4vw, 2.75rem);
  color: #fffdf8;
  max-width: 52ch;
}
body.theme-apothecary .aj-hero--specimen-cover .aj-hero__plate-inner h1,
body.theme-apothecary .aj-hero--specimen-cover .aj-hero__plate-inner h2 {
  color: #fffdf8;
}

/* notebook */
body.theme-apothecary .aj-hero--notebook-split .aj-hero__notebook {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0;
  border: 1px solid var(--aj-rule);
  background: #fffdf8;
  min-height: 300px;
}
@media (max-width: 820px) {
  body.theme-apothecary .aj-hero--notebook-split .aj-hero__notebook {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .aj-hero__notebook-text {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(79, 111, 82, 0.08) 28px
  );
  border-right: 1px solid var(--aj-rule);
}
body.theme-apothecary .aj-hero__notebook-visual {
  position: relative;
  min-height: 260px;
}
body.theme-apothecary .aj-hero__nb-slide,
body.theme-apothecary .aj-hero__nb-static {
  min-height: 260px;
  background-image: linear-gradient(180deg, rgba(42, 33, 24, 0.45), rgba(42, 33, 24, 0.75)), var(--hero-bg, var(--aj-paper-2));
  background-size: cover;
  background-position: center;
}
body.theme-apothecary .aj-hero__nb-slide-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background: linear-gradient(0deg, rgba(244, 240, 230, 0.96), transparent);
  color: var(--aj-ink);
}
body.theme-apothecary .aj-hero__nb-slide-cap h2 a {
  color: inherit;
}

/* archive minimal */
body.theme-apothecary .aj-hero--archive-minimal .aj-hero__archive {
  border: 1px solid var(--aj-rule);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: #fffdf8;
}
body.theme-apothecary .aj-hero--archive-minimal .aj-hero__archive-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.2em 0;
}
body.theme-apothecary .aj-hero__archive-slides {
  margin-top: 1.25rem;
}
body.theme-apothecary .aj-hero__archive-slide {
  padding: 12px 0;
  border-top: 1px solid var(--aj-rule);
}

/* --- Ticker skins --- */
body.theme-apothecary .ticker-wrap {
  background: var(--aj-paper-2);
  border-bottom: 1px solid var(--aj-rule);
}
body.theme-apothecary .aj-ticker--field-notes .ticker-card {
  border: 1px solid var(--aj-moss);
  background: #fffdf8;
}
body.theme-apothecary .aj-ticker--archive-strip.ticker-wrap--marquee .ticker-content {
  animation-duration: 96s;
}
body.theme-apothecary .aj-ticker--archive-strip .ticker-chip {
  border-radius: 4px;
  border: 1px dashed var(--aj-rust);
  background: #fffdf8;
}
body.theme-apothecary .aj-ticker--label-ribbon .ticker-slide.is-active .ticker-cards-grid {
  border: 1px solid var(--aj-rule);
  padding: 8px;
  background: linear-gradient(90deg, rgba(79, 111, 82, 0.12), transparent);
}

/* --- Counters --- */
body.theme-apothecary .aj-counters {
  margin: var(--aj-pad-section) 0;
}
body.theme-apothecary .aj-counters__title {
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--aj-moss-dark);
  margin: 0 0 12px;
}
body.theme-apothecary .aj-counters--herbarium-inline .aj-counters__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}
body.theme-apothecary .aj-counter-pin {
  border: 1px solid var(--aj-rule);
  padding: 10px 14px;
  background: #fffdf8;
  min-width: 120px;
}
body.theme-apothecary .aj-counter-pin__value {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 1.6rem;
  color: var(--aj-moss-dark);
}
body.theme-apothecary .aj-counter-pin__label {
  font-size: 0.78rem;
  color: var(--aj-ink-soft);
}
body.theme-apothecary .aj-counters--archive-cards .aj-counters__card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
@media (max-width: 600px) {
  body.theme-apothecary .aj-counters--archive-cards .aj-counters__card-grid {
    grid-template-columns: 1fr 1fr;
  }
}
body.theme-apothecary .aj-counter-card {
  border: 1px solid var(--aj-rule);
  padding: 14px;
  background: linear-gradient(145deg, #fffdf8, var(--aj-paper-2));
}
body.theme-apothecary .aj-counter-card__value {
  font-family: var(--aj-serif);
  font-size: 2rem;
  color: var(--aj-moss-dark);
  display: block;
}
body.theme-apothecary .aj-counters--registry-row .aj-counters__registry {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--aj-rule);
  background: #fffdf8;
}
@media (max-width: 640px) {
  body.theme-apothecary .aj-counters--registry-row .aj-counters__registry {
    flex-direction: column;
  }
  body.theme-apothecary .aj-counters__registry-rule {
    display: none;
  }
}
body.theme-apothecary .aj-counters__registry-cell {
  flex: 1 1 120px;
  padding: 12px 16px;
  text-align: center;
}
body.theme-apothecary .aj-counters__registry-num {
  font-family: ui-monospace, monospace;
  font-size: 1.5rem;
  display: block;
  color: var(--aj-moss-dark);
}
body.theme-apothecary .aj-counters__registry-rule {
  width: 1px;
  background: var(--aj-rule);
  align-self: stretch;
}

/* --- Forms (comment grid) --- */
body.theme-apothecary .comment-fake-form .pbn-fake-form__comment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
  margin-bottom: 14px;
}
body.theme-apothecary .comment-fake-form .pbn-fake-form__comment-row > .pbn-ff-inline--grow {
  grid-column: 1 / -1;
}
body.theme-apothecary .pbn-ff-textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--aj-rule);
  background: #fffdf8;
}

/* --- Footer + random products --- */
body.theme-apothecary .aj-random-products {
  background: var(--aj-paper-2);
  border-top: 1px solid var(--aj-rule);
  padding: var(--aj-pad-section) 0;
}
body.theme-apothecary .aj-footer {
  background: #2A2118;
  color: #ede6d8;
  border-top: 4px solid var(--aj-moss);
}
body.theme-apothecary .aj-footer a {
  color: #f5eedf;
}
body.theme-apothecary .aj-footer__grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--aj-pad-section) 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 900px) {
  body.theme-apothecary .aj-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  body.theme-apothecary .aj-footer__grid {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .aj-footer__lede,
body.theme-apothecary .aj-footer__meta {
  font-size: 0.88rem;
  opacity: 0.92;
}

/* --- Shop --- */
body.theme-apothecary .aj-shop-intro h1 {
  margin: 0 0 8px;
}
body.theme-apothecary .aj-shop-intro__lead {
  margin: 0;
  max-width: 60ch;
  color: var(--aj-ink-soft);
}
body.theme-apothecary .aj-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 900px) {
  body.theme-apothecary .aj-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  body.theme-apothecary .aj-shop-grid {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .aj-product-grid {
  display: grid;
  grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  body.theme-apothecary .aj-product-grid {
    grid-template-columns: 1fr;
  }
}
body.theme-apothecary .aj-product-media,
body.theme-apothecary .aj-product-detail {
  background: #fffdf8;
  border: 1px solid var(--aj-rule);
  overflow: hidden;
}
body.theme-apothecary .aj-product-vendor {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--aj-moss-dark);
  text-transform: none;
}
body.theme-apothecary .aj-product-detail {
  padding: 20px;
}
body.theme-apothecary .aj-product-buy {
  display: inline-block;
  padding: 12px 20px;
  background: var(--aj-moss);
  color: #fffdf8;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius, 8px);
}
body.theme-apothecary .aj-product-buy:hover {
  filter: brightness(1.05);
}

/* --- Generic pages --- */
body.theme-apothecary .aj-page-main--narrow {
  padding-left: 16px;
  padding-right: 16px;
}
