/* Ankhclave Learn - matches the ankhclave.org (Shopify Dawn) store theme. */
@font-face { font-family: "Quattrocento Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/quattrocento-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Quattrocento Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/quattrocento-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Quattrocento Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/quattrocento-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: Trirong; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/trirong-400.woff2") format("woff2"); }

:root {
  --navy: 7, 27, 77;
  --text: rgba(255, 255, 255, .75);
  --strong: #fff;
  --muted: rgba(255, 255, 255, .6);
  --line: rgba(255, 255, 255, .18);
  --line-strong: rgba(255, 255, 255, .55);
  --surface: #0b0b0b;
  --surface-2: #141414;
  --body-font: "Quattrocento Sans", system-ui, sans-serif;
  --heading-font: Trirong, Georgia, serif;
  color-scheme: dark;
  font-family: var(--body-font);
  font-size: 15px;
  letter-spacing: .04em;
  line-height: 1.6;
  color: var(--text);
  background: #000;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
body.menu-open { overflow: hidden; }
main { flex: 1; }
h1, h2, h3, h4, #paper-title { font-family: var(--heading-font); font-weight: 400; color: var(--strong); letter-spacing: .03em; line-height: 1.3; }
h1 { margin: .2rem 0; font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.45rem; } h3 { margin: .5rem 0; font-size: 1.15rem; } h4 { font-size: 1.15rem; }
a { color: var(--strong); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 3px; box-shadow: 0 0 0 5px #000; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: #fff; color: #000; padding: .6rem 1rem; border-radius: 5px; }
.skip-link:focus { top: 1rem; }

/* Store header ------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 5; background: #fff; color: rgba(var(--navy), .75); color-scheme: light; letter-spacing: .06em; }
.site-header :focus-visible { outline-color: rgba(var(--navy), .75); box-shadow: 0 0 0 5px #fff; }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "left heading icons" "nav nav nav"; align-items: center; max-width: 1100px; margin: 0 auto; padding: 20px 50px 12px; }
.header-left { grid-area: left; display: flex; align-items: center; margin-left: -12px; }
.site-title { grid-area: heading; justify-self: center; text-align: center; font-family: var(--heading-font); font-size: 25.2px; letter-spacing: .025em; line-height: 1.3; color: rgba(var(--navy), .75); text-decoration: none; padding: .45rem .5rem; }
.site-title:hover { color: rgb(var(--navy)); text-decoration: none; }
.header-icons { grid-area: icons; justify-self: end; display: flex; align-items: center; margin-right: -12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: rgb(var(--navy)); cursor: pointer; border-radius: 0; }
.icon-button:hover { filter: none; transform: scale(1.07); }
.icon { width: 20px; height: 20px; }
#menu-toggle .icon-close { display: none; }
#menu-toggle[aria-expanded="true"] .icon-open { display: none; }
#menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.site-nav { grid-area: nav; justify-self: center; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 12px; font-size: 14px; letter-spacing: .6px; color: rgba(var(--navy), .75); text-decoration: none; line-height: 1.5; }
.site-nav a:hover, .site-nav a[aria-current] { color: rgb(var(--navy)); text-decoration: underline; text-underline-offset: 3px; }
#account { display: flex; align-items: center; gap: .2rem; font-size: 14px; }
#account a, #account button { color: rgba(var(--navy), .75); }
.account-button { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 10px; border: 0; background: none; color: rgb(var(--navy)); font: inherit; letter-spacing: .06em; cursor: pointer; }
.account-button:hover { filter: none; text-decoration: underline; text-underline-offset: 3px; }
.account-email { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(var(--navy), .75); }
.menu-drawer { position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - var(--header-height, 73px)); height: calc(100dvh - var(--header-height, 73px)); overflow-y: auto; display: flex; flex-direction: column; background: #fff; border-top: 1px solid rgba(var(--navy), .08); }
.menu-drawer[hidden] { display: none; }
.menu-drawer ul { list-style: none; margin: 0; padding: 1.2rem 0; }
.menu-drawer nav a { display: block; padding: 11px 30px; font-size: 18px; color: rgb(var(--navy)); text-decoration: none; letter-spacing: .06em; }
.menu-drawer nav a:hover, .menu-drawer nav a[aria-current] { background: rgba(var(--navy), .04); }
.drawer-account { margin-top: auto; background: rgba(var(--navy), .04); padding: 1.2rem 30px 1.6rem; color: rgb(var(--navy)); }
.drawer-account .account-button { padding: 0; font-size: 16px; }
.drawer-account .account-email { display: block; max-width: none; margin-bottom: .2rem; font-size: 14px; }

/* Page --------------------------------------------------------------------- */
.library-hero, .notices, main, .site-footer { width: 100%; max-width: 1450px; margin-left: auto; margin-right: auto; }
.library-hero { padding: 2.6rem 50px .6rem; }
.library-hero p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .25em; font-size: .78rem; color: var(--muted); }
#progress { color: var(--muted); font-size: .95rem; }
.notices { padding: .8rem 50px 0; }
.notice { margin: 0 0 .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: .75rem 1rem; font-size: .9rem; line-height: 1.6; border-radius: 5px; }
.notice.info { border-color: rgba(150, 185, 255, .45); color: var(--strong); }
.notices .notice[hidden] { display: none; }
main { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; padding: 0 50px 2rem; }
main:focus { outline: none; }
aside { padding: 1.4rem 1.6rem 1.4rem 0; border-right: 1px solid var(--line); min-width: 0; }
.results { padding: 1.4rem 0 1.4rem 2rem; min-width: 0; }
label { display: block; margin: 1.1rem 0 .4rem; font-size: .9rem; color: var(--strong); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input, select, textarea, button { font: inherit; letter-spacing: .04em; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 45px; border: 1px solid var(--line-strong); background: #000; border-radius: 5px; padding: .55rem .8rem; color: var(--strong); font-size: 16px; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .8); }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .45); }
select { text-overflow: ellipsis; }
textarea { display: block; margin-bottom: .7rem; line-height: 1.6; resize: vertical; }
button { cursor: pointer; min-height: 45px; border: 1px solid #fff; background: #fff; color: #000; border-radius: 5px; padding: .5rem 1.2rem; font-size: 15px; letter-spacing: .08em; }
button:hover { filter: none; box-shadow: 0 0 0 1px #fff; }
button:disabled { cursor: default; opacity: .4; box-shadow: none; }
button.secondary { background: transparent; color: var(--strong); border-color: rgba(255, 255, 255, .75); }
button.small { min-height: 36px; padding: .2rem .7rem; font-size: 13.5px; }
button.danger { background: transparent; color: #ffad99; border-color: #ffad99; margin-top: .8rem; display: block; }
.link-button { min-height: 32px; border: 0; background: none; color: var(--strong); padding: .2rem 0; text-align: left; text-decoration: underline; text-underline-offset: .2em; font-size: .92rem; letter-spacing: .03em; overflow-wrap: anywhere; }
.link-button:hover { box-shadow: none; text-decoration-thickness: 2px; }
.search-row { display: flex; gap: .5rem; } .search-row input { flex: 1; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 32px; }
.check input { width: 20px; min-height: 0; height: 20px; flex: none; accent-color: #fff; }
.muted { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.collapsible { border: 0; border-radius: 0; padding: 0; margin: .8rem 0 0; background: none; }
.collapsible > summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding-right: 6px; list-style: none; cursor: pointer; color: var(--strong); font-family: var(--heading-font); font-size: 1.2rem; border-bottom: 1px solid var(--line); }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.collapsible[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.collapsible > summary h2 { margin: 0; font-size: inherit; }
#filter-count { font-family: var(--body-font); font-size: .85rem; color: var(--muted); }
#clear { margin-top: 1.2rem; width: 100%; }
.panel { margin-top: 2rem; }
.panel > h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
.panel h3 { font-family: var(--body-font); font-size: .82rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 1.3rem 0 .4rem; }
.panel p { margin: .4rem 0; }
#promo-signin { width: 100%; margin-top: .6rem; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.plain-list li .link-button { flex: 1 1 8rem; }
.inline-form { display: flex; gap: .4rem; margin: .6rem 0; }
.inline-form input { flex: 1; }
.inline-form button { white-space: nowrap; padding: .4rem .8rem; font-size: 14px; }
#export-data { display: inline-block; margin-top: .3rem; font-size: .92rem; }

/* Results ------------------------------------------------------------------ */
.results-head, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.results-head h2 { margin: .2rem 0 1rem; }
.card { background: var(--surface); padding: 1.3rem 1.5rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 6px; transition: border-color .15s; }
.card:hover { border-color: rgba(255, 255, 255, .4); }
.card h3 { margin: .3rem 0 0; }
.card p { font-size: .95rem; line-height: 1.7; margin: .7rem 0; color: var(--text); overflow-wrap: anywhere; }
.title-link { min-height: 0; border: 0; background: none; color: var(--strong); padding: .3rem 0; text-align: left; font-family: var(--heading-font); font-size: 1.22rem; line-height: 1.45; letter-spacing: .02em; overflow-wrap: anywhere; }
.title-link:hover { box-shadow: none; text-decoration: underline; text-underline-offset: .2em; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.badge { padding: .2rem .6rem; border-radius: 40px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--strong); font-size: .78rem; letter-spacing: .05em; }
.badge.compound { background: rgba(185, 150, 255, .14); border-color: rgba(185, 150, 255, .35); }
.badge.species { background: rgba(110, 205, 165, .13); border-color: rgba(110, 205, 165, .35); }
.badge.study, .badge.method { background: rgba(120, 170, 255, .13); border-color: rgba(120, 170, 255, .35); }
.card-footer .mine { color: var(--strong); font-weight: 700; }
.pagination { padding: 1rem 0; font-size: .92rem; }
#error, .error { background: #2a0e08; color: #ffc2b3; border: 1px solid #7a2d1d; border-radius: 5px; padding: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-footer { padding: 1.5rem 50px 2.5rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.site-footer p { margin: 0; }

/* Reader ------------------------------------------------------------------- */
dialog { width: min(1450px, 96vw); max-height: 94vh; border: 1px solid var(--line); padding: 0; border-radius: 8px; color: var(--text); background: #000; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0, 0, 0, .8); }
.reader-bar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; color: rgb(var(--navy)); padding: .5rem 1.5rem; z-index: 2; color-scheme: light; font-family: var(--heading-font); font-size: 1.1rem; }
.reader-bar button.secondary { color: rgb(var(--navy)); border-color: rgba(var(--navy), .6); font-family: var(--body-font); }
.reader-bar :focus-visible { outline-color: rgb(var(--navy)); box-shadow: 0 0 0 5px #fff; }
#reader-content { padding: 1.5rem 2rem 2rem; }
#reader-content > h2 { max-width: 1000px; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.35; overflow-wrap: anywhere; }
.paper-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 1rem 0; }
.paper-links a { display: inline-block; padding: .3rem 0; }
details { border: 1px solid var(--line); border-radius: 5px; padding: .8rem 1rem; margin: 1rem 0; background: var(--surface); }
summary { cursor: pointer; color: var(--strong); font-size: 1rem; padding: .35rem 0; }
.evidence { border-top: 1px solid var(--line); margin: .8rem 0; padding: .7rem 0; font-size: .92rem; }
.evidence strong { color: var(--strong); }
.evidence small { display: block; color: var(--muted); }
.evidence button { margin-top: .3rem; }
blockquote { margin: .5rem 0 .6rem; padding-left: .9rem; border-left: 2px solid var(--line); line-height: 1.6; overflow-wrap: anywhere; }
.mine-panel { background: var(--surface-2); }
.mine-row { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 1.5rem; }
.mine-row label { margin-bottom: .4rem; }
.mine-row select { width: 13rem; }
.paper-lists { border: 1px solid var(--line); border-radius: 5px; padding: .6rem 1rem; margin-top: 1.2rem; }
.paper-lists legend { color: var(--strong); font-size: .92rem; padding: 0 .3rem; }
.list-boxes { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.list-boxes .check { margin: .3rem 0; }
.paper-lists .inline-form { max-width: 30rem; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; position: sticky; top: 61px; background: #000; padding: .7rem 0; z-index: 1; border-bottom: 1px solid var(--line); }
.page-tools select { width: 170px; } .page-tools input { width: 240px; }
#found-state { color: var(--muted); font-size: .9rem; }
#page-body h3 { margin-top: 1.2rem; }
#page-body h3:focus { outline: none; }
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.page-text { background: var(--surface); padding: 1.6rem; border: 1px solid var(--line); border-radius: 5px; font-family: var(--heading-font); color: rgba(255, 255, 255, .88); min-width: 0; }
.page-text h4 { margin: 1rem 0 .5rem; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; font-size: 1.06rem; letter-spacing: .01em; }
.page-original { margin: 0; align-self: start; min-width: 0; }
.page-original img { width: 100%; height: auto; display: block; margin: .7rem 0; background: #fff; border-radius: 3px; }

.mobile-only { display: none !important; }

@media (max-width: 989px) {
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .header-inner { grid-template-areas: "left heading icons"; padding: 10px 15px; min-height: 60px; }
  .header-left { margin-left: -6px; }
  .header-icons { margin-right: -6px; }
  .site-title { font-size: 21px; line-height: 1; padding: .3rem .5rem; }
  .library-hero { padding: 1.8rem 20px .4rem; }
  .notices { padding: .6rem 20px 0; }
  main { grid-template-columns: minmax(0, 1fr); padding: 0 20px 1.5rem; }
  aside { padding: .6rem 0 0; border-right: 0; }
  .results { padding: 1.2rem 0; }
  .panel { margin-top: 1.4rem; }
  #signin-promo h2 { display: none; }
  .notice { font-size: .85rem; }
  .card { padding: 1.1rem; }
  .site-footer { padding: 1.4rem 20px 2rem; }
  dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .reader-bar { padding: .4rem 1rem; }
  #reader-content { padding: 1rem 1rem 2rem; }
  .page-layout { grid-template-columns: minmax(0, 1fr); }
  .page-tools { position: static; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 0; }
  .page-tools select, .page-tools input { width: 100%; grid-column: 1 / -1; }
  #previous-paper-page { grid-column: 1; grid-row: 1; }
  #next-paper-page { grid-column: 2; grid-row: 1; }
  #found-state { grid-column: 1 / -1; }
  .page-text { padding: 1.1rem; }
  .mine-row select { width: 100%; }
  .mine-row > div { flex: 1 1 12rem; }
}
@media (max-width: 480px) {
  .library-hero { padding-top: 1.4rem; }
  .card { padding: 1rem .9rem; }
  .results-head .muted { display: none; }
  .pagination { gap: .5rem; }
  .pagination button { padding: .4rem .8rem; }
  .inline-form { flex-wrap: wrap; }
  .inline-form button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
