/* Site materials, typography, and responsive layouts. */
@font-face { font-family: DM Sans; src: url('/fonts/dm-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Fraunces; src: url('/fonts/fraunces.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Fraunces; src: url('/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #f3f5f0;
  --wash: #e0e9dd;
  --warm-wash: #f5eee3;
  --surface: #fcfdf9;
  --field: #f2f5ef;
  --ink: #203029;
  --muted: #4e5f54;
  --accent: #255841;
  --on-accent: #fff;
  --accent-hover: #194430;
  --tint: #ddeddb;
  --tint-hover: #cce2ca;
  --line: #d2dbd0;
  --edge: #a3b2a7;
  --glass: rgb(247 251 244 / 74%);
  --glass-edge: rgb(255 255 255 / 88%);
  --shadow: 0 12px 32px rgb(30 55 40 / 9%), 0 2px 8px rgb(30 55 40 / 5%);
  --glass-shadow: 0 8px 28px rgb(26 50 37 / 12%), inset 0 1px 1px rgb(255 255 255 / 72%);
  --hero: #18362c;
  --hero-ink: #fffdf4;
  --hero-muted: #e7eee3;
  --hero-accent: #d7edc9;
  --focus: #80512d;
  --error: #922e23;
  --heading: Fraunces, Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, 'DM Sans', system-ui, sans-serif;
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 15px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17211c;
    --wash: #26382d;
    --warm-wash: #302920;
    --surface: #202d25;
    --field: #19241e;
    --ink: #eff6ee;
    --muted: #beccc2;
    --accent: #bce2bd;
    --on-accent: #153426;
    --accent-hover: #d3edd0;
    --tint: #314e3d;
    --tint-hover: #3e5e4b;
    --line: #3c5144;
    --edge: #63796a;
    --glass: rgb(32 47 38 / 78%);
    --glass-edge: rgb(213 244 224 / 17%);
    --shadow: 0 12px 32px rgb(0 0 0 / 23%), 0 2px 8px rgb(0 0 0 / 12%);
    --glass-shadow: 0 8px 28px rgb(0 0 0 / 24%), inset 0 1px 1px rgb(255 255 255 / 11%);
    --focus: #f0bf91;
    --error: #f5ada4;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 87% 2%, var(--warm-wash), transparent 42rem),
    radial-gradient(ellipse at 8% 17rem, var(--wash), transparent 46rem), var(--paper);
  font: 1rem/1.55 var(--body);
}
main { min-height: calc(100vh - 170px); }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; color: var(--muted); }
h1, h2, h3 { margin: 0; font: 500 1.45rem/1.13 var(--heading); letter-spacing: -.034em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.45rem, 5.2vw, 4.65rem); }
h2 { font-size: clamp(1.85rem, 3.8vw, 2.8rem); }
img { max-width: 100%; display: block; }
svg { width: 1.15em; height: 1.15em; flex: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.container { width: min(calc(100% - 5rem), 1216px); margin-inline: auto; }
.reading { max-width: 780px; }
.skip { position: fixed; top: .5rem; left: .5rem; transform: translateY(-200%); z-index: 8; background: var(--surface); padding: .75rem 1rem; }
.skip:focus { transform: none; }

.masthead { position: sticky; top: 0; z-index: 5; padding: .85rem 0 .45rem; }
.masthead-inner, .footer-inner, .section-head, .directory-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
}
.masthead-inner {
  min-height: 68px; padding: .44rem .56rem .44rem .85rem;
  border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--surface); box-shadow: var(--glass-shadow);
}
.brand, .footer-brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand { font: 700 1.03rem/1.12 var(--body); letter-spacing: -.025em; min-width: 0; }
.brand-mark, .empty-mark {
  display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; flex: none;
  color: var(--accent); background: var(--tint);
}
.brand-mark svg, .empty-mark svg { width: 25px; height: 25px; }
.brand small { display: block; margin-top: .27rem; color: var(--muted); font-size: .69rem; font-weight: 600; letter-spacing: .015em; }
nav, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.nav-directory, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .46rem; min-height: 44px; padding: .56rem 1rem;
  border: 1px solid transparent; border-radius: 999px;
  font: 650 .94rem/1.2 var(--body); text-align: center;
}
.nav-directory:hover { background: var(--field); }
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.outline { background: var(--field); color: var(--ink); border-color: var(--edge); }
.button.outline:hover { background: var(--surface); border-color: var(--accent); }
.button.nav-button { color: var(--ink); background: var(--tint); border-color: transparent; }
.button.nav-button:hover, .share-button:hover { background: var(--tint-hover); }
.share-button { background: var(--tint); color: var(--ink); border-color: transparent; }
.button:disabled { opacity: .55; cursor: default; }
.text-link { display: inline-block; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: .22em; }
.page-section > .text-link { display: inline-flex; align-items: center; min-height: 44px; }

.intro { padding-block: .85rem 0; }
.hero {
  position: relative; isolation: isolate; display: grid; align-items: center; min-height: clamp(385px, 35vw, 466px);
  border-radius: var(--radius-lg); overflow: hidden; background: var(--hero); box-shadow: var(--shadow);
}
.hero-image { position: absolute; inset: 0; z-index: -1; margin: 0; }
.hero-image img {
  position: absolute; inset: 0 0 0 auto; width: 80%; height: 100%; object-fit: cover; object-position: 61% 50%;
}
.hero-image::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(91deg, var(--hero) 20%, rgb(24 54 44 / 97%) 30%, rgb(24 54 44 / 83%) 40%,
    rgb(24 54 44 / 31%) 57%, rgb(24 54 44 / 0%) 76%);
}
.intro-copy { color: var(--hero-ink); padding: clamp(2.4rem, 5.4vw, 4.5rem); max-width: 570px; pointer-events: none; }
.intro-copy > * { pointer-events: auto; }
.intro h1 { font-size: clamp(3.9rem, 6.6vw, 6rem); line-height: .97; letter-spacing: -.062em; }
.intro h1 em { display: block; color: var(--hero-accent); }
.intro p { max-width: 24rem; margin-block: 1.25rem 1.35rem; color: var(--hero-muted); font-size: clamp(1rem, 1.5vw, 1.15rem); }
.hero-action { background: var(--hero-accent); color: var(--hero); padding-inline: 1.18rem; }
.hero-action:hover { background: var(--hero-ink); }
.hero :focus-visible { outline-color: var(--hero-ink); }
.hero-image figcaption { position: absolute; right: 1.2rem; bottom: 1.2rem; z-index: 1; }
.hero-location {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem .83rem;
  border: 1px solid rgb(255 255 255 / 55%); border-radius: 999px;
  color: var(--hero); background: var(--hero-ink); font-size: .9rem; font-weight: 650;
}
.hero-location:hover { background: var(--hero-accent); }

.directory { padding-block: 2.25rem 4.5rem; }
.directory-head { align-items: center; margin-bottom: 1.15rem; }
.directory-count { margin: .35rem 0 0; font-size: .93rem; }
.filters {
  display: flex; align-items: center; gap: .35rem; padding: .33rem;
  background: var(--surface); border: 1px solid var(--glass-edge); border-radius: 999px; box-shadow: var(--glass-shadow);
}
.search-box { position: relative; display: block; width: clamp(15rem, 23vw, 19rem); }
.search-box svg { position: absolute; left: .73rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters input, .filters select { border-radius: 999px; }
.search-box input { padding-left: 2.28rem; }
.ashram-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ashram-card, .wishlist, .panel, .empty, .auth-card, .ashram-banner {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ashram-card { border-radius: var(--radius-md); }
.ashram-card > a { display: flex; flex-direction: column; min-height: 100%; padding: .56rem; border-radius: inherit; }
.ashram-card > a:focus-visible { outline-offset: 2px; }
.card-photo-wrap { overflow: hidden; border-radius: var(--radius-sm); }
.card-photo { width: 100%; aspect-ratio: 1.95; object-fit: cover; background: var(--tint); }
.card-copy { display: flex; flex: 1; flex-direction: column; padding: .82rem .65rem .18rem; }
.card-copy h3 { margin-bottom: .18rem; }
.location { display: inline-flex; align-items: center; gap: .32rem; font-size: .92rem; color: var(--muted); }
.card-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-block: .55rem .28rem;
  margin-top: .68rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
.card-link { color: var(--accent); font-weight: 700; }
.ashram-card a:hover .card-link { text-decoration: underline; text-underline-offset: .2em; }
.photo-missing { display: grid; place-items: center; background: linear-gradient(145deg, var(--wash), var(--warm-wash)); color: var(--accent); }
.photo-missing svg { width: 3rem; height: 3rem; opacity: .72; }

.page-section { padding-block: 1.65rem 4rem; }
.page-section > h1 { margin: .35rem 0 1rem; }
.ashram-banner {
  display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: 1.4rem;
  padding: .65rem; border-radius: var(--radius-lg); margin-block: .48rem 1.4rem;
}
.ashram-banner-copy { padding: clamp(1rem, 3.4vw, 2.8rem); }
.ashram-banner h1 { margin-block: .45rem 1rem; }
.banner-image { width: 100%; height: 100%; min-height: 244px; max-height: 346px; aspect-ratio: 1.75; object-fit: cover; border-radius: var(--radius-md); }
.space-lists { display: grid; gap: 1rem; max-width: 940px; }
.wishlist, .panel, .empty, .auth-card { border-radius: var(--radius-md); padding: clamp(1.1rem, 3vw, 2.05rem); }
.reading > .wishlist { margin-top: .52rem; }
.wishlist h1 { font-size: clamp(2rem, 4.6vw, 3.8rem); }
.wishlist-head, .item-head, .item-tools { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.wishlist-head { margin-bottom: .78rem; }
.wishlist-head > div, .item-copy { min-width: 0; }
.wishlist-head .button { flex: none; }
.wishlist-head h2 a:hover { text-decoration: underline; text-underline-offset: .17em; }
.list-progress { display: grid; gap: .32rem; color: var(--muted); font-size: .9rem; font-weight: 650; margin-block: .7rem 1rem; }
progress { appearance: none; width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); border-radius: inherit; }
progress::-webkit-progress-value { background: var(--accent); border-radius: inherit; }
progress::-moz-progress-bar { background: var(--accent); border-radius: inherit; }
.status {
  display: inline-flex; align-items: center; gap: .32rem; background: var(--tint); color: var(--ink);
  border-radius: 999px; padding: .25rem .6rem; font-size: .88rem; font-weight: 650; white-space: nowrap;
}
.user-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.wishlist-items { margin: 0 0 .65rem; padding: 0; list-style: none; }
.wishlist-items li { display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); gap: .65rem; padding-block: .9rem; border-top: 1px solid var(--line); }
.item-number { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--accent); background: var(--tint); border-radius: 50%; font-weight: 700; font-size: .9rem; }
.item-meta { margin-block: .27rem .45rem; font-size: .93rem; }
.item-meta span { margin-inline: .25rem; }
.empty p { margin: .4rem 0 0; }
.ashram-empty { display: flex; align-items: center; gap: 1rem; }
.ashram-empty h2 { font-size: clamp(1.4rem, 3vw, 2rem); }

.auth-card { max-width: 465px; margin: 1rem auto 0; }
.auth-card h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: .85rem 0 .55rem; }
.auth-card .button { width: 100%; }
.passkey-button, .forgot { margin-top: .75rem; }
.forgot { min-height: 44px; display: inline-flex; align-items: center; }
.section-head { margin-block: .25rem 1.3rem; }
.section-head h1 { margin-block: .35rem; }
.section-head p { margin: 0; overflow-wrap: anywhere; }
.panel { margin-bottom: 1rem; }
.panel h2 { margin-bottom: .7rem; }
.panel > p:last-child { margin-bottom: 0; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .12rem 1rem; align-items: center; justify-content: space-between; padding: .42rem 0; overflow-wrap: anywhere; }
.simple-list li a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; text-decoration: underline; text-underline-offset: .15em; }
.simple-list li span { color: var(--muted); }
form { display: grid; gap: .95rem; }
form label { display: grid; gap: .28rem; font-size: .96rem; font-weight: 650; }
form > .button { justify-self: start; }
input, select, textarea {
  min-width: 0; max-width: 100%; width: 100%; min-height: 44px; padding: .55rem .75rem;
  border: 1px solid var(--edge); border-radius: 12px; color: var(--ink); background: var(--field); font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select { padding-right: 1.3rem; }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
.checkbox input { accent-color: var(--accent); width: 1.1rem; min-height: auto; height: 1.1rem; }
.publish { padding-block: .35rem; }
.item-editor { display: grid; gap: .85rem; margin: 0 0 .85rem; padding: .85rem; border-radius: var(--radius-sm); border: 1px solid var(--line); min-width: 0; }
.item-editor legend { padding-inline: .35rem; color: var(--accent); font-weight: 700; }
.item-tools { align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.feedback { margin: .35rem 0 0; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--tint); }
.feedback.error { border-color: var(--error); color: var(--error); background: var(--surface); }
.toast { position: fixed; z-index: 6; right: 1rem; bottom: 1rem; padding: .65rem 1rem; border-radius: 999px; color: var(--on-accent); background: var(--accent); box-shadow: var(--shadow); }
footer { border-top: 1px solid var(--line); padding-block: 1.25rem; }
.footer-inner { color: var(--muted); font-size: .9rem; }
.footer-inner a:hover { text-decoration: underline; text-underline-offset: .2em; }
.footer-brand { font-weight: 650; }

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .masthead-inner, .filters, .hero-location {
    -webkit-backdrop-filter: blur(20px) saturate(145%);
    backdrop-filter: blur(20px) saturate(145%);
    background: var(--glass);
  }
  .hero-location { background: rgb(247 251 244 / 86%); }
  .hero-location:hover { background: var(--hero-ink); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .masthead-inner, .filters, .hero-location { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .masthead-inner, .filters { background: var(--surface); border-color: var(--edge); }
  .hero-location { background: var(--hero-ink); }
}
@media (forced-colors: active) {
  .button, .hero-location, .masthead-inner, .filters { border: 1px solid ButtonText; }
  progress { appearance: auto; }
}
@media (max-width: 920px) {
  .container { width: min(calc(100% - 3rem), 1216px); }
  .hero { min-height: 387px; }
  .intro-copy { max-width: 62%; }
  .ashram-grid { gap: .85rem; }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 87px; }
  .container { width: calc(100% - 1.5rem); }
  .masthead { padding-top: .55rem; }
  .masthead-inner { min-height: 58px; gap: .28rem; padding: .32rem .32rem .32rem .48rem; }
  .brand { font-size: .95rem; gap: .42rem; }
  .brand small { font-size: .59rem; margin-top: .16rem; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-mark svg { width: 22px; height: 22px; }
  nav { gap: 0; flex: none; }
  nav .button { font-size: .86rem; padding-inline: .67rem; }
  .nav-directory { display: none; }
  .intro { padding-top: .45rem; }
  .hero { min-height: 0; border-radius: var(--radius-md); grid-template-rows: auto auto; }
  .intro-copy { grid-row: 1; max-width: none; padding: 1.85rem 1.25rem .85rem; }
  .intro h1 { font-size: clamp(2.95rem, 12.5vw, 4.7rem); }
  .intro h1 em { display: inline; }
  .intro p { margin-block: .83rem 1rem; }
  .hero-image { position: relative; grid-row: 2; aspect-ratio: 2 / 1; }
  .hero-image img { width: 100%; object-position: center 47%; }
  .hero-image::after { background: linear-gradient(180deg, var(--hero), rgb(24 54 44 / 0%) 39%); }
  .hero-image figcaption { right: .7rem; bottom: .7rem; }
  .hero-location { font-size: .84rem; }
  .directory { padding-block: 1.65rem 2.7rem; }
  .directory-head { flex-direction: column; align-items: stretch; gap: .7rem; margin-bottom: .85rem; }
  .filters { max-width: 100%; }
  .search-box { flex: 1; width: auto; min-width: 0; }
  .filters select { max-width: 8.2rem; }
  .ashram-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .68rem; }
  .ashram-card > a { padding: .38rem; }
  .card-photo { aspect-ratio: 1.5; }
  .card-copy { padding: .55rem .32rem .1rem; }
  .card-copy h3 { font-size: clamp(1.13rem, 4.7vw, 1.36rem); }
  .card-bottom, .section-head, .footer-inner { align-items: flex-start; flex-direction: column; }
  .card-bottom { gap: .19rem; }
  .ashram-card .location { font-size: .85rem; }
  .ashram-banner { grid-template-columns: 1fr; gap: .6rem; border-radius: var(--radius-md); }
  .ashram-banner-copy { padding: .7rem .55rem; }
  .banner-image { height: auto; min-height: 0; max-height: 280px; border-radius: var(--radius-sm); }
  .wishlist-head { flex-wrap: wrap; }
  .item-head { flex-wrap: wrap; gap: .45rem; }
  .page-section { padding-block: .9rem 2.6rem; }
}
@media (max-width: 355px) {
  .ashram-grid, .form-grid { grid-template-columns: 1fr; }
  .filters { flex-wrap: wrap; border-radius: var(--radius-md); }
  .search-box { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
