@font-face {
  font-family: Noto Sans Armenian;
  src: url('/assets/fonts/noto-sans-armenian.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}
@font-face {
  font-family: Noto Sans Armenian;
  src: url('/assets/fonts/noto-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}
@font-face {
  font-family: Noto Serif Armenian;
  src: url('/assets/fonts/noto-serif-armenian.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}
@font-face {
  font-family: Noto Serif Armenian;
  src: url('/assets/fonts/noto-serif-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}

:root {
  --paper: #f7f8f3;
  --ink: #202b23;
  --muted: #526055;
  --line: #dce2d8;
  --white: #fff;
  --sans: "Noto Sans Armenian", system-ui, sans-serif;
  --serif: "Noto Serif Armenian", Georgia, serif;
  color-scheme: light;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}

body {
  --theme-dark: #203f2f;
  --theme-light: #e5f0b5;
  --theme-soft: #edf2e4;
  --theme-ink: #385c31;
  margin: 0;
}
[data-theme="pollinators"] {
  --theme-dark: #47371e;
  --theme-light: #f7df9c;
  --theme-soft: #f7edd7;
  --theme-ink: #6a4918;
}
[data-theme="mental-health"] {
  --theme-dark: #183d3a;
  --theme-light: #d9efcd;
  --theme-soft: #e7f0e7;
  --theme-ink: #285c52;
}
[data-theme="trees-air-water"] {
  --theme-dark: #203b45;
  --theme-light: #cfebed;
  --theme-soft: #e6eff1;
  --theme-ink: #2d5666;
}
[data-theme="biodiversity"] {
  --theme-dark: #353e22;
  --theme-light: #e7edaa;
  --theme-soft: #eef0dc;
  --theme-ink: #495b25;
}
[data-theme="medicinal-plants"] {
  --theme-dark: #3f3248;
  --theme-light: #efd9eb;
  --theme-soft: #f1e9f2;
  --theme-ink: #634771;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
a[href], button { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #267b70; outline-offset: 4px; }
[hidden] { display: none !important; }

.shell { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 12px 18px;
  transform: translateY(-150%);
  background: var(--white);
}
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
}
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 12px; }
.brand { text-decoration: none; }
.brand-mark {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: #214634;
  color: #e5f0b5;
  border-radius: 13px;
}
.brand-mark svg { width: 32px; height: 32px; }
.brand-name {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.header-actions { display: flex; gap: 10px; }
.header-button, .read-button, .sidebar-share, .small-button, .close-button, .contents-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}
.header-button { padding: 0 15px; background: transparent; border: 1px solid transparent; }
.share-button { background: var(--white); border-color: var(--line); }
.header-button:hover, .sidebar-share:hover, .small-button:hover, .close-button:hover { background: var(--theme-soft); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr);
  min-height: 525px;
  margin-top: 33px;
  overflow: hidden;
  background: var(--theme-dark);
  color: #fffdf8;
  border-radius: 22px;
  isolation: isolate;
}
.hero-copy {
  align-self: center;
  position: relative;
  container-type: inline-size;
  padding: 49px clamp(35px, 4.65vw, 72px);
}
.hero-category {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--theme-light);
  font-size: .875rem;
  font-weight: 650;
}
.hero-category svg { width: 17px; height: 17px; }
.hero h1 {
  max-width: 16ch;
  margin: 23px 0 20px;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.65vw, 4.15rem);
  font-weight: 650;
  letter-spacing: -.042em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
[data-theme="mental-health"] .hero h1,
[data-theme="trees-air-water"] .hero h1 { font-size: clamp(2rem, 3.8vw, 3.5rem); }
[data-theme="biodiversity"] .hero h1 {
  max-width: none;
  font-size: min(2.8rem, 7.9cqi);
  text-wrap: balance;
}
.hero p {
  max-width: 36ch;
  margin: 0;
  color: #f0f3e9;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.75;
}
.read-button {
  width: fit-content;
  margin-top: 30px;
  padding: 0 19px;
  background: var(--theme-light);
  color: var(--theme-dark);
}
.read-button:is(:hover, :focus-visible) { background: #f7f9ed; }
.hero-image { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
[data-theme="mental-health"] .hero-image { object-position: 54% center; }

.reading-layout {
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 258px) minmax(0, 730px);
  align-items: start;
  gap: clamp(38px, 6vw, 94px);
  margin: 65px auto 0;
  scroll-margin-top: 28px;
}
.sidebar { position: sticky; top: 28px; }
.contents {
  padding: 22px 19px 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fbfcf8;
}
.contents-label, .contents-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--theme-ink);
}
.contents-toggle { display: none; }
.contents ol {
  list-style: none;
  counter-reset: contents;
  display: grid;
  gap: 1px;
  margin: 13px 0 0;
  padding: 0;
}
.contents li { counter-increment: contents; }
.contents a {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: baseline;
  gap: 5px;
  padding: 7px 4px 7px 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
  text-decoration: none;
}
.contents a::before { content: counter(contents, decimal-leading-zero); color: var(--theme-ink); font-size: .75rem; font-weight: 700; }
.contents a:hover { background: var(--theme-soft); color: var(--ink); }
.sidebar-share { margin-top: 13px; padding-inline: 12px; background: transparent; border: 0; color: var(--theme-ink); }

.article-body {
  font-size: clamp(1.0625rem, 1.32vw, 1.1875rem);
  line-height: 1.85;
  overflow-wrap: break-word;
}
.article-body p { margin: 0 0 1.1em; }
.article-body ul { margin: .5em 0 1.13em; padding-inline-start: 1.35em; }
.article-body li { margin-block: .37em; padding-inline-start: .15em; }
.article-body li::marker { color: var(--theme-ink); }
.article-lead > p:first-child {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.58rem);
  font-weight: 600;
  line-height: 1.65;
  color: var(--theme-dark);
}
.article-section {
  margin-top: 38px;
  padding-top: 27px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 25px;
}
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 33px;
  height: 28px;
  padding-inline: 6px;
  border-radius: 6px;
  color: var(--theme-ink);
  background: var(--theme-soft);
  font-size: .8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.article-section h2 {
  color: var(--theme-dark);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.6vw, 1.94rem);
  font-weight: 650;
  letter-spacing: -.018em;
  line-height: 1.33;
  margin: 13px 0 18px;
}
.article-section > :last-child { margin-bottom: 0; }
.reflection {
  padding: 29px clamp(19px, 4.5vw, 42px);
  border: 0;
  border-radius: 17px;
  background: var(--theme-soft);
}
.reflection-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--theme-ink);
  border-radius: 50%;
  color: var(--theme-ink);
}
.reflection h2 { margin-top: 13px; }
.reflection > :last-child { font-weight: 600; }

.more { max-width: 1100px; margin: 60px auto; }
.next-topic {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  min-height: 110px;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  overflow: hidden;
  text-decoration: none;
}
.next-topic:hover { border-color: var(--theme-ink); }
.next-topic img { width: 100%; height: 100%; min-height: 110px; object-fit: cover; }
.next-topic span { display: grid; gap: 4px; padding: 12px 15px 12px 0; overflow-wrap: break-word; }
.next-topic small { color: var(--muted); font-size: .875rem; }
.next-topic strong { font-family: var(--serif); font-size: clamp(1.05rem, 2.3vw, 1.5rem); line-height: 1.35; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.footer-brand { font-size: .875rem; font-weight: 700; }
.footer-brand svg { color: #214634; width: 26px; height: 26px; }
.footer-link { border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; padding: 10px 0; font-size: .875rem; }

.panel {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--paper);
  color: var(--ink);
  width: min(570px, calc(100% - 30px));
  max-height: calc(100dvh - 30px);
  padding: 0;
  box-shadow: 0 24px 90px #101d1b40;
}
.panel::backdrop { background: #14241dd0; }
.panel-inner { padding: clamp(16px, 4vw, 27px); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.panel-heading h2 { font-family: var(--serif); font-size: clamp(1.3rem, 4vw, 1.7rem); margin: 0; }
.close-button { width: 44px; border: 1px solid var(--line); background: var(--white); }
.topics-list { display: grid; gap: 7px; }
.topics-list a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  overflow-wrap: break-word;
}
.topics-list a:is(:hover, [aria-current="page"]) { background: var(--theme-soft); border-color: var(--line); }
.topics-list img { width: 62px; height: 49px; object-fit: cover; border-radius: 5px; }
.topics-list small, .topics-list strong { display: block; line-height: 1.5; }
.topics-list small { color: var(--theme-ink); font-size: .8125rem; margin-bottom: 2px; }

.share-dialog { max-width: 460px; }
.share-content { display: grid; justify-items: stretch; }
.share-content > p:first-child { margin: 0; text-align: center; font-weight: 600; }
.qr-code { justify-self: center; width: min(212px, 100%); height: auto; margin: 15px 0; border: 1px solid var(--line); border-radius: 9px; }
.url-label { font-size: .875rem; font-weight: 650; margin-bottom: 7px; }
.copy-row { display: flex; gap: 7px; }
.copy-row input {
  min-width: 0;
  flex: 1;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: .875rem;
}
.small-button { padding-inline: 10px; color: var(--theme-dark); background: var(--white); border: 1px solid var(--line); text-align: center; }
.copy-status { min-height: 1.35em; margin: 4px 0 8px; color: var(--theme-ink); font-size: .875rem; }
.qr-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

@media (max-width: 1050px) {
  .shell { width: calc(100% - 60px); }
  .hero { min-height: 445px; }
  .reading-layout { grid-template-columns: minmax(0, 224px) minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .shell { width: calc(100% - 38px); }
  .header-inner { min-height: 70px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-top: 19px; border-radius: 17px; }
  .hero-copy { padding: 35px clamp(23px, 5.6vw, 49px); }
  .hero h1 { max-width: 20ch; font-size: clamp(2.25rem, 6.8vw, 3.8rem); }
  [data-theme="mental-health"] .hero h1,
  [data-theme="trees-air-water"] .hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
  .hero-image { height: clamp(220px, 55vw, 380px); }
  .reading-layout { grid-template-columns: minmax(0, 1fr); gap: 27px; margin-top: 30px; }
  .sidebar { position: static; }
  .contents { padding: 9px 12px; }
  .enhanced .contents-label { display: none; }
  .enhanced .contents-toggle { display: flex; width: 100%; padding: 0; border: 0; justify-content: flex-start; background: transparent; }
  .contents-toggle svg:last-child { margin-left: auto; transition: transform .2s ease; }
  .contents-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
  .contents ol { margin: 3px 0 7px; }
  .contents a { min-height: 44px; }
  .sidebar-share { display: none; }
  .more { margin-block: 35px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 28px); }
  .header-actions { gap: 5px; }
  .header-button { gap: 5px; padding-inline: 8px; }
  .brand { gap: 7px; }
  .brand-mark { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; }
  .brand-name { font-size: .6875rem; }
  .share-button { width: 44px; }
  .share-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hero-category { gap: 7px; }
  .hero h1 { margin-block: 17px 15px; }
  .read-button { margin-top: 22px; }
  .next-topic { grid-template-columns: 85px minmax(0, 1fr); gap: 13px; }
}

@media (max-width: 335px) {
  .topics-button { padding-inline: 7px; }
  .topics-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
