/* Inter (SIL Open Font License), the typeface Glide uses; bundled so it works offline. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}

:root {
  --brown: #432105;
  --brown-2: #5a2f0c;
  --accent: #b85a0c;
  --accent-ink: #9a4a08;
  --accent-soft: #fbe7d7;
  --ink: #1d1b19;
  --muted: #6a645e;
  --line: #e9e4df;
  --bg: #ffffff;
  --bg-2: #f6f3f0;
  --radius: 12px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
body.sheet-open { overflow: hidden; }
a { color: var(--accent-ink); }
img { max-width: 100%; }
h2 { font-size: 1.4rem; margin: 0; line-height: 1.2; }
h3 { margin: 0; }
.ic { flex: none; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 10px 0; }
.empty { color: var(--muted); padding: 8px 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--brown); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 7px; }
.topnav { display: none; margin-left: auto; gap: 4px; }
#appTitle { display: none; }
.status-top {
  margin-left: auto; display: flex; align-items: center; gap: 2px;
  font-size: 0.78rem; color: rgba(255,255,255,0.85); white-space: nowrap;
}
.status-top .pill { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; padding: 0 8px; margin-right: 4px; }
.status-top .icon-btn { color: #fff; }

@media (max-width: 899px) {
  .topbar { padding: 2px 6px 2px 12px; padding-top: calc(2px + env(safe-area-inset-top, 0px)); gap: 8px; min-height: 40px; }
  .brand img { width: 24px; height: 24px; border-radius: 6px; }
  .brand { min-width: 0; font-size: 1rem; gap: 8px; }
  .status-top .icon-btn.small { width: 32px; height: 32px; }
  #pageTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .status.has-extras { display: flex; }
  .status:not(.has-extras) { display: none; }
  .status .st-compact { display: none; }
}
.title-short { display: none; }
@media (max-width: 599px) { .title-long { display: none; } .title-short { display: inline; } }
@media (min-width: 900px) {
  #appTitle { display: inline; }
  #pageTitle, .status-top { display: none; }
}

.nav-item {
  display: flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; opacity: 0.85;
}
.nav-item.active { background: rgba(255,255,255,0.14); opacity: 1; }

/* bottom nav (phones) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
}
.bottomnav .nav-item {
  flex-direction: column; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 0.7rem; padding: 6px 0; border-radius: 0; opacity: 1;
  min-width: 0;
}
.bottomnav .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottomnav .nav-item.active { color: var(--accent); background: none; }

@media (min-width: 900px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 24px; }
}

/* ---------- banner + status ---------- */
.banner {
  background: var(--brown-2) center / cover no-repeat;
  color: #fff;
  padding: 18px 16px 16px;
  min-height: 84px;
  display: flex; align-items: flex-end;
}
.banner-text { font-size: 1.05rem; line-height: 1.3; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.banner-text font[size="+1"] { font-size: 1.35em; }
/* Desktop: "Schedule updated" sits at the right of the banner instead of its own row */
.banner-status { display: none; }
@media (min-width: 900px) {
  .banner { gap: 16px; }
  .banner-status {
    display: flex; align-items: center; gap: 6px 10px; margin-left: auto; flex: none;
    font-size: 0.9rem; color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  }
  .banner-status .icon-btn { color: #fff; }
  .banner-status .pill { background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.5); color: #fff; }
  .status:not(.has-extras) { display: none; }
  .status .st-compact { display: none; }
}
@media (max-width: 899px) {
  .banner { padding: 14px 16px; min-height: 80px; }
  .banner-text { font-size: 1rem; line-height: 1.3; }
  .banner-text font[size="+1"] { font-size: 1.4em; }
}

.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 6px 16px; min-height: 36px;
  font-size: 0.85rem; color: var(--muted);
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.status:empty { display: none; }
.st-compact { display: inline-flex; align-items: center; gap: 6px 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; color: var(--ink); }
.pill.warn { background: #fff4d6; border-color: #f0d48a; }

/* ---------- layout ---------- */
main { display: block; max-width: 1100px; margin: 0 auto; padding: 16px; outline: none; }
.section { margin: 8px 0 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { min-width: 0; }
.section-head .btn, .btn.compact { white-space: nowrap; flex: none; min-height: 38px; padding: 6px 15px; border-radius: 10px; font-size: 0.9rem; }
.button-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.btn-arrow { font-size: 1.05em; line-height: 1; }
@media (max-width: 420px) { h2 { font-size: 1.25rem; } .section-head .btn { padding: 4px 12px; } }
/* Full-size desktop screens: smaller type, closer to Glide */
@media (min-width: 900px) {
  html { font-size: 14px; }
  body { font-size: 15px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 10px; font: inherit; font-weight: 650; font-size: 0.95rem;
  text-decoration: none; cursor: pointer;
}
.btn.outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 0.8rem; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer; text-decoration: none;
}
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.spinning .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.card-plain { margin-bottom: 8px; }

/* ---------- search + toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .btn { flex: none; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border-radius: 10px; padding: 0 12px; min-height: 44px; color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 10px 0; outline: none; }

/* ---------- sessions ---------- */
.day-group { margin-bottom: 22px; }
.day-title { font-size: 1.2rem; margin: 8px 0 6px; }
.session-grid { display: grid; grid-template-columns: 1fr; column-gap: 24px; }
@media (min-width: 760px) { .session-grid { grid-template-columns: 1fr 1fr; } }
.sheet .session-grid { grid-template-columns: 1fr; }
/* Home on desktop: Spotlight and Category share a column about 2/3 of the page wide */
@media (min-width: 900px) {
  .home-section, .install { max-width: 67%; }
  .home-section .tiles { grid-template-columns: repeat(3, 1fr); }
}
.session {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.session:active { background: var(--bg-2); }
.session-main { flex: 1; min-width: 0; }
.when { color: var(--accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.title { font-weight: 650; margin-top: 2px; }
.details { color: var(--muted); font-size: 0.95rem; white-space: pre-line; margin-top: 2px; }
.chev { color: #b3aca5; display: flex; }
.session.compact { padding: 10px 4px; }
.session.compact .title { font-weight: 450; color: #4a4542; }

/* ---------- category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
/* Category tiles: 2 across on phones and tablets, 3 across on desktop */
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.after-tiles { margin-top: 20px; }
.rich p { margin: 0 0 1em; }
.rich .rich-gap { border: 0; height: 0; margin: 0 0 1em; }
.tile { display: block; text-decoration: none; color: inherit; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.tile-img { aspect-ratio: 3 / 2; background: #eee; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-label { padding: 8px 10px 10px; font-size: 0.8rem; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- maps ---------- */
.maps { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .maps { grid-template-columns: 1fr 1fr; } }
.map-fig { margin: 0; }
.map-fig img { width: 100%; display: block; border-radius: 8px; }
.zoom { overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; background: #fff; cursor: zoom-in; }
.zoom img { display: block; width: 100%; }
.zoom.zoomed { cursor: zoom-out; }
.zoom.zoomed img { width: 250%; max-width: none; }

/* ---------- info ---------- */
.rich { line-height: 1.6; }
.rich a { font-weight: 500; color: var(--accent); text-decoration: none; }
.address { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #f3dfcb; border: 0; border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; }
.address-text { flex: 1; white-space: pre-line; min-width: 180px; line-height: 1.4; }
.btn.directions { background: #fff; color: var(--ink); border-color: #e2d3c4; border-radius: 12px; }
.btn.directions .ic { color: #8c8c8c; }
.area-map { display: block; width: 100%; height: 320px; border: 0; border-radius: 16px; background: var(--bg-2); margin-bottom: 18px; }
.area-map.offline { height: auto; padding: 18px; display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* ---------- volunteers ---------- */
.jump-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 14px; }
.jump {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-width: 0; min-height: 58px; padding: 8px 4px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-ink); font-weight: 500; font-size: 0.75rem; text-decoration: none;
}
/* One line, as in Glide (the arrow never drops to its own line). */
.jump span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rooms on a level / room panel */
.sheet-map { margin-bottom: 14px; border: 1px solid var(--line); }
.room-list { display: flex; flex-direction: column; }
.room-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.room-thumb { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--bg-2); flex: none; }
.room-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-name { font-weight: 650; }
.room-notes { color: var(--muted); font-size: 0.9rem; }
.room-notes-head { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; margin: -4px 0 12px; }
/* Desktop: Info and Volunteer Schedule use the same 2/3-width column as Home;
   volunteer time slots sit two across. */
@media (min-width: 900px) {
  .page-col { max-width: 67%; }
  .page-col .vol-slots { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
}

/* English / Español switch */
.lang-toggle {
  font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  color: #fff; background: transparent; border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px; padding: 4px 12px; margin-left: 6px; white-space: nowrap;
}
.lang-toggle:hover { background: rgba(255,255,255,0.14); }
.lang-toggle.small { font-size: 0.75rem; padding: 2px 8px; margin: 0 6px 0 0; }
.lang-toggle.inline { color: var(--accent-ink); border-color: var(--line); background: #fff; margin-left: 8px; }
.topnav { align-items: center; }

/* Desktop "More" drop-down */
.nav-more { position: relative; }
.nav-more > .nav-item { background: none; border: 0; font: inherit; cursor: pointer; }
.nav-more > .nav-item.active { background: rgba(255,255,255,0.14); }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.22); padding: 6px;
}
.more-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.more-item:hover, .more-item.active { background: var(--bg-2); }
.more-item .ic { color: var(--muted); }

.vol-head { display: flex; align-items: center; gap: 10px; }
.vol-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; flex: none; }
.filter-empty { color: var(--muted); font-size: 0.9rem; margin: 4px 2px 8px; }
.filter-group > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 8px 0 4px; }
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary .ic { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.filter-group[open] > summary .ic { transform: rotate(180deg); }
.filter-group > summary + .check { border-top: 1px solid var(--line); }
.panel-filter { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 14px; margin-bottom: 14px; }
.vol-section { border-top: 1px solid var(--line); padding-top: 16px; scroll-margin-top: 80px; }
.vol-section h2 { margin-bottom: 8px; }
.vol-slot { padding: 8px 0; }
.vol-time { font-weight: 650; }
.vol-names { margin: 4px 0 0; padding: 0; list-style: none; }
.vol-names li { color: var(--accent-ink); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; padding: 2px 0; }

/* ---------- about / more ---------- */
.about { display: flex; gap: 16px; align-items: flex-start; }
.about img { border-radius: 14px; flex: none; }
.about p { margin: 6px 0 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }
.menu-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 560px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 16px; color: inherit; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item span { flex: 1; }
.menu-item .ic:first-child { color: var(--accent); }
.empty-state { text-align: center; max-width: 520px; margin: 24px auto; }
.empty-state p { color: var(--muted); }
.install { background: var(--accent-soft); border-color: #f2cfb2; }
.install { padding: 10px 14px; font-size: 0.9rem; line-height: 1.35; margin-bottom: 14px; }
.install p { margin: 0 0 4px; }
.install .install-note { color: var(--muted); margin-bottom: 4px; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.install-actions .btn { min-height: 38px; padding: 6px 14px; }
.install-actions .link-btn { min-height: 38px; }

/* ---------- sheet (detail panel) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,0.35); }
.sheet {
  position: fixed; z-index: 31; left: 0; right: 0; bottom: 0;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
  animation: up 0.18s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 1.15rem; min-width: 0; }
.sheet-head h2 span { overflow-wrap: anywhere; }
.sheet-head .back { margin-left: -10px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; padding-bottom: calc(24px + var(--safe-b)); }
@media (min-width: 900px) {
  .sheet { left: auto; top: 12px; right: 12px; bottom: 12px; width: min(400px, 60vw); max-height: none; border-radius: 16px; animation: none; }
}
.sheet-hero { width: 100%; max-width: 560px; border-radius: var(--radius); display: block; margin-bottom: 14px; }
.chips { display: grid; gap: 10px; }
.chip { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); white-space: pre-line; }
.chip.accent { background: var(--accent-soft); }
.chip .ic { margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { font-size: 0.85rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--accent-ink); font-weight: 600; }
.room-img { display: block; width: 100%; margin-top: 16px; border-radius: 8px; border: 1px solid var(--line); }
.detail-tiles { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-map { display: block; }
.detail-map .room-img { border: 0; margin-top: 20px; }
/* Room picture in event details: full width on phones, about half the panel on wider screens */
.room-tile { display: block; margin-top: 16px; max-width: 560px; color: inherit; text-decoration: none; }
.room-tile img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.room-tile-name { display: block; font-weight: 650; font-size: 1.05rem; margin: 8px 12px 0; }
.room-tile-level { display: block; color: var(--muted); margin: 0 12px; }
/* Beyond phone width the room picture is the same width as a category tile;
   the map always uses the full panel width so its labels stay readable. */
@media (min-width: 560px) {
  .room-tile { width: calc(50% - 6px); }
}
.detail-actions { margin: 6px 0 0; display: flex; flex-direction: column; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 2px; color: var(--accent); font-weight: 650; text-decoration: none; }
.filter-head { font-size: 1rem; margin: 6px 0 4px; }
.check { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.filter-head + .check { border-top: 1px solid var(--line); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
