/* TOCC Plant Atlas — responsive stylesheet */
/* Gentium Book Plus 700 (SIL Open Font License), self-hosted */
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-italic-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-italic-latin.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;
}
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-normal-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-normal-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Gentium Book Plus';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gentium-book-plus-700-normal-latin.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 {
  --sand: #f6f1e7;
  --paper: #fffdf8;
  --ink: #2b2118;
  --muted: #6b5d4f;
  --line: #e2d8c6;
  --accent: #a3412a;      /* saguaro fruit */
  --accent-dark: #7d2f1d;
  --sage: #5f7a52;
  --sage-soft: #e8eee2;
  --header: #3e5b3a;   /* saguaro green */
  --header-dark: #2c4229;
  --radius: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --serif: "Gentium Book Plus", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 90%; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 15.3px/1.44 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* Header */
.site-header { color: #f6efe4; background-color: var(--header);
  /* Oʼodham basket-weave texture from the original banner, tinted by the header color */
  background-image: url("header-texture.png"); background-position: center top; background-repeat: no-repeat;
  background-size: auto 128px; background-blend-mode: soft-light; }
.site-header .bar { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.brand strong { font: 700 1.35rem/1.1 var(--serif); letter-spacing: .01em; display: block; }
.brand small { font-size: .8rem; opacity: .75; display: block; }
.brand:hover { color: #fff; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search input { width: 100%; font: inherit; font-size: 1rem; padding: 9px 12px 9px 38px; border-radius: 999px; border: 1px solid transparent; background: #fffdf8; color: var(--ink); }
.search input:focus { outline: 3px solid #e7b58f; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); list-style: none; margin: 0; padding: 6px; max-height: 70vh; overflow: auto; }
.search-results[hidden] { display: none; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--sage-soft); }
.search-results img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.search-results .sci { font-style: italic; font-weight: 600; }
.search-results .sub { font-size: .85rem; color: var(--muted); display: block; line-height: 1.3; }
.search-results .none { padding: 10px; color: var(--muted); }

.nav { background: rgba(0,0,0,.28); }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 6px var(--gutter); overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; white-space: nowrap; color: #ead9c3; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .92rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }

/* Menu button (narrow screens) */
.menu-btn { display: none; align-items: center; gap: 6px; background: transparent; color: #f6efe4; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 7px 14px 7px 10px; font: 600 .95rem var(--sans); cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:hover { background: rgba(255,255,255,.08); }
@media (max-width: 1139px) {
  .menu-btn { display: inline-flex; }
  .site-header .bar { gap: 12px; }
  .search { flex-basis: 100%; max-width: none; order: 3; }
  .js .nav { display: none; }
  .js .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; overflow: visible; padding-top: 8px; padding-bottom: 12px; }
  .nav a { border-radius: 8px; padding: 10px 12px; font-size: 1rem; }
  .menu-btn[aria-expanded="true"] .l2 { opacity: 0; }
  .menu-btn[aria-expanded="true"] .l1 { transform: translateY(5px) rotate(45deg); transform-origin: 12px 7px; }
  .menu-btn[aria-expanded="true"] .l3 { transform: translateY(-5px) rotate(-45deg); transform-origin: 12px 17px; }
}

/* Page */
main { padding: 28px 0 56px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
h1 { font: 700 clamp(1.8rem, 4.5vw, 2.6rem)/1.15 var(--serif); margin: 0 0 6px; }
h1 em, .sci-name { font-style: italic; }
h2 { font: 700 1.3rem/1.3 var(--serif); margin: 0 0 12px; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 20px; }

/* Plant page */
.plant-head { margin-bottom: 22px; }
.plant-head .common { font-size: 1.2rem; color: var(--muted); margin: 0; }
.plant-head .oodham-line { font: 700 1.3rem/1.3 var(--serif); margin: 6px 0 0; }
.plant-head .oodham-line .label { font-family: var(--sans); font-weight: 400; }
.plant-head .oodham-line .label { color: var(--muted); font-size: .9rem; margin-right: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.tag { font-size: .82rem; padding: 3px 10px; border-radius: 999px; background: var(--sage-soft); color: #3f5536; }
.tag a { color: inherit; text-decoration: none; }
.tag.warn { background: #fbe3dc; color: var(--accent-dark); font-weight: 600; }
.plant-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.plant-layout > * { min-width: 0; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.facts dt { color: var(--muted); font-size: .9rem; padding-top: 2px; }
.facts dd { margin: 0; }
.oodham { font-size: 1.15rem; }
.play { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; border: 0; cursor: pointer; background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 10px 3px 7px; font: 600 .78rem/1.4 var(--sans); margin: 0 4px; }
.play svg { width: 14px; height: 14px; }
.play:hover { background: var(--accent-dark); }
.play.playing { background: var(--sage); }
.description { font-size: 1.05rem; }
.description p:first-child { margin-top: 0; }
.cite { font-size: .8em; vertical-align: super; line-height: 0; }

/* Gallery: every photo the same width */
.gallery { columns: 1; column-gap: 16px; margin: 24px 0 0; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; cursor: zoom-in; }
.gallery figcaption { padding: 8px 12px; font-size: .9rem; color: var(--muted); }
@media (min-width: 620px) { .gallery { columns: 2; } }

.taxonomy { margin: 0; padding: 0; list-style: none; font-size: .93rem; }
.taxonomy li { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.taxonomy li:first-child { border-top: 0; }
.taxonomy .rank { color: var(--muted); }
.taxonomy .common-tax { color: var(--muted); display: block; font-size: .88em; }
.refs { padding-left: 1.4em; font-size: .92rem; margin: 12px 0 0; }
.refs li { margin-bottom: 6px; overflow-wrap: anywhere; }
.description, .card { overflow-wrap: break-word; }
.refs li:target { background: #fff3c4; }

@media (min-width: 980px) {
  .plant-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .plant-layout aside { position: sticky; top: 16px; }
}

/* Growth form */
.tag.habit { background: #efe6d4; color: #6b4a1f; }
.facts .def { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.group-note { margin: -10px 0 20px; font-size: .92rem; color: var(--muted); max-width: 70ch; }
.tile .habit-label { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #efe6d4; color: #6b4a1f; font-size: .75rem; }

/* Group / index grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(60,40,20,.12); color: inherit; }
.tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.tile span { padding: 8px 10px 10px; font-size: .92rem; line-height: 1.3; }
.tile .sci { padding: 0; display: block; font-style: italic; color: var(--muted); font-size: .85rem; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog.lightbox::backdrop { background: rgba(20,14,10,.92); }
.lightbox .frame { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 12px 12px; }
.lightbox img { max-height: calc(100vh - 110px); width: auto; max-width: 100%; border-radius: 6px; }
.lightbox p { color: #eee; margin: 10px 0 0; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .close { top: 10px; right: 10px; }
.lightbox .prev { left: 10px; top: 50%; }
.lightbox .next { right: 10px; top: 50%; }

/* Footer */
.site-footer { background: var(--header-dark); color: #d8c8b4; font-size: .9rem; padding: 24px 0; }
.site-footer a { color: #f1d3b8; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media print {
  .site-header, .nav, .site-footer, .play { display: none; }
  .gallery { columns: 2; }
}

/* Name indexes */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; position: sticky; top: 0; background: var(--sand); padding: 8px 0; z-index: 5; }
.letters a { min-width: 34px; text-align: center; padding: 4px 6px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.name-index { columns: 1; column-gap: 32px; }
@media (min-width: 700px) { .name-index { columns: 2; } }
@media (min-width: 1050px) { .name-index { columns: 3; } }
.name-index section { break-inside: avoid; margin-bottom: 18px; scroll-margin-top: 60px; }
.name-index h2 { color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 2px; margin-bottom: 6px; }
.name-index ul { list-style: none; margin: 0; padding: 0; }
.name-index li { padding: 3px 0; }
.name-index .extra { color: var(--muted); font-size: .9rem; }
.name-index .sub { display: block; font-style: italic; }

/* Compare */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.compare { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare select { width: 100%; font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.compare-photo { margin: 14px 0 0; }
.compare-pane { display: flex; flex-direction: column; }
.compare .card + .card { margin-top: 0; }
.compare-photo .frame { aspect-ratio: 1 / 1; max-height: 72vh; width: 100%; display: flex; align-items: center; justify-content: center; background: #efe8da; border-radius: 6px; overflow: hidden; }
.compare-photo .frame a { display: contents; }
.compare-photo img { width: 100%; height: 100%; object-fit: contain; }
.compare-photo figcaption { min-height: 2.8em; }
.compare-photo figcaption { margin-top: 6px; font-size: .9rem; }
.compare-photo .empty { color: var(--muted); margin: 0; }
.compare-photo .frame.blank { background: transparent; border: 2px dashed var(--line); }

/* Forms, prose */
.contact { display: grid; gap: 14px; max-width: 640px; }
.contact label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.contact input, .contact textarea { font: inherit; font-weight: normal; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.contact input:focus, .contact textarea:focus { outline: 3px solid #e7b58f; border-color: transparent; }
.req { color: var(--accent); }
.actions { display: flex; gap: 10px; }
.btn { font: 600 1rem var(--sans); padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.prose { max-width: 760px; }
.prose h2 + p { margin-top: 0; }
.logos { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 20px; }
.logos img { max-height: 80px; width: auto; }
@media (max-width: 480px) {
  .menu-btn { padding: 8px; }
  .menu-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .brand { gap: 10px; }
  .brand img { width: 38px; height: 38px; }
}

/* Phones: all text 10% larger (2026-11-05). Remove this block to roll back. */
@media (max-width: 700px) {
  html { font-size: 99%; }
  body { font-size: 16.83px; line-height: 1.584; }
  /* Phones: line spacing 10% larger (2026-11-05) */
  h1 { line-height: 1.265; }
  .tile span, .search-results .sub { line-height: 1.43; }
}
