:root {
  color-scheme: light;
  --paper: #fcfaf6;
  --ink: #211f1c;
  --muted: #615951;
  --accent: #ad3428;
  --accent-dark: #86261e;
  --line: #ded7cb;
  --panel: #f4eee4;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[id] { scroll-margin-top: 1.5rem; }
.shell { width: min(75rem, calc(100% - 5rem)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 5; top: 0; left: 1rem; padding: 0.7rem 1rem; translate: 0 -140%; background: var(--ink); color: white; }
.skip-link:focus { translate: 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.56rem; font: 700 1.55rem/1 var(--serif); letter-spacing: -0.055em; white-space: nowrap; }
.brand img { flex: none; }
.brand-accent { color: var(--accent); margin-left: 0.12em; }
.navigation { display: flex; align-items: center; gap: clamp(1rem, 2.75vw, 2.5rem); }
.navigation a { font-size: 0.94rem; font-weight: 600; white-space: nowrap; }
.navigation a:hover, .navigation a:focus-visible { color: var(--accent); }
.search-trigger { display: inline-flex; align-items: center; gap: 0.48rem; padding: 0.52rem 0.83rem; border: 1px solid var(--line); border-radius: 0.35rem; background: transparent; color: var(--ink); font-size: 0.9rem; }
.search-trigger:hover { border-color: var(--accent); color: var(--accent); }

.eyebrow { color: var(--accent); font-size: 0.875rem; font-weight: 750; letter-spacing: 0.105em; line-height: 1.4; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 0.78rem 1.13rem; margin-top: 1.45rem; background: var(--accent); color: white; border-radius: 0.28rem; font-weight: 650; }
.button:hover { background: var(--accent-dark); }

.home-hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr); align-items: center; gap: clamp(1.5rem, 4.6vw, 4.1rem); padding-block: clamp(1.25rem, 3vw, 2.6rem); }
.home-hero h1 { font: 700 clamp(2.8rem, 5.2vw, 4.8rem)/0.98 var(--serif); letter-spacing: -0.06em; }
.home-hero h1 em { display: block; font-weight: 400; color: var(--accent); }
.home-hero-copy > p { max-width: 32ch; margin-top: 1rem; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.15rem); }
.home-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1.1rem; margin-top: 1.15rem; }
.home-hero-actions .button { margin-top: 0; }
.home-hero-photo { position: relative; overflow: hidden; background: var(--panel); border-radius: 0.34rem; }
.home-hero-photo img { width: 100%; height: auto; aspect-ratio: 2; object-fit: cover; object-position: center 58%; }
.home-hero-photo figcaption { position: absolute; inset: auto 0.6rem 0.6rem auto; padding: 0.25rem 0.55rem; border-radius: 0.2rem; background: var(--ink); color: white; font-size: 0.8125rem; }

.home-topics-nav { display: flex; flex-wrap: wrap; gap: 0.45rem; padding-block: 0.75rem; border-top: 1px solid var(--line); }
.home-topics-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.85rem; border: 1px solid var(--line); border-radius: 2rem; font-size: 0.9rem; font-weight: 650; }
.home-topics-nav a:hover, .home-topics-nav a:focus-visible { color: var(--accent-dark); border-color: var(--accent); background: white; }
.home-featured, .home-topic { padding-block: clamp(1.45rem, 3.5vw, 2.75rem); }
.home-featured, .home-topic { border-top: 1px solid var(--line); }
.home-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.45rem 1.2rem; margin-bottom: 1.15rem; }
.home-section-heading h2 { font: 700 clamp(1.95rem, 4.1vw, 2.8rem)/1.12 var(--serif); letter-spacing: -0.045em; }
.home-section-link { display: inline-block; padding-block: 0.45rem; color: var(--accent-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 0.18em; }
.home-section-link:hover { color: var(--ink); }
.home-cards, .home-topic-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.7rem, 2vw, 1.3rem); padding: 0; margin: 0; list-style: none; }
.home-card { display: grid; grid-template-rows: auto 1fr; height: 100%; background: #fffdf9; border: 1px solid var(--line); border-radius: 0.38rem; }
.home-card:hover { border-color: var(--accent); }
.home-card:hover h3, .home-card:focus-visible h3 { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 0.12em; }
.home-card-image { position: relative; overflow: hidden; background: var(--panel); border-radius: 0.32rem 0.32rem 0 0; }
.home-card-image img { width: 100%; height: auto; aspect-ratio: 1.9; object-fit: cover; }
.home-image-note { position: absolute; inset: auto 0.4rem 0.4rem auto; max-width: calc(100% - 0.8rem); padding: 0.21rem 0.43rem; border-radius: 0.2rem; background: var(--ink); color: white; font-size: 0.75rem; line-height: 1.2; }
.home-card-copy { padding: 0.9rem 1rem 1rem; }
.home-card-kind { color: var(--accent-dark); font-size: 0.875rem; font-weight: 650; }
.home-card h3 { margin-block: 0.13rem 0.35rem; font: 700 clamp(1.28rem, 2.05vw, 1.68rem)/1.13 var(--serif); letter-spacing: -0.025em; }
.home-card-summary { color: var(--muted); line-height: 1.42; }
.home-topic-links { gap: 0 clamp(0.7rem, 2vw, 1.3rem); margin-top: 0.8rem; }
.home-topic-links a { display: block; padding: 0.65rem 0.15rem; border-bottom: 1px solid var(--line); color: var(--accent-dark); font-weight: 650; }
.home-topic-links a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.home-review { padding-bottom: 2rem; }
.home-credits { max-width: 31rem; font-size: 0.875rem; }
.home-credits summary { padding-block: 0.35rem; cursor: pointer; font-weight: 650; }
.home-credits ul { padding-inline-start: 1.15rem; margin-block: 0.55rem 0; }
.home-credits li + li { margin-top: 0.5rem; }
.home-credits li > span { display: block; font-weight: 650; }
.home-credits a { color: var(--accent-dark); text-decoration: underline; }

@media (min-width: 941px), (max-width: 525px) {
  .home-featured li:nth-child(n + 4) .home-card { grid-template: 1fr / minmax(0, 0.62fr) minmax(0, 1fr); }
  .home-featured li:nth-child(n + 4) .home-card-image { border-radius: 0.32rem 0 0 0.32rem; min-height: 7.5rem; }
  .home-featured li:nth-child(n + 4) .home-card-image img { position: absolute; width: 100%; height: 100%; }
  .home-featured li:nth-child(n + 4) h3 { font-size: clamp(1.28rem, 1.65vw, 1.42rem); }
}

.site-footer { background: var(--panel); border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: start; justify-content: space-between; gap: 2rem; padding-block: 1.55rem; }
.footer-inner .brand { font-size: 1.4rem; }

.search-dialog { width: min(33rem, calc(100% - 2rem)); max-height: min(38rem, calc(100% - 2rem)); padding: 1.4rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--paper); color: var(--ink); }
.search-dialog::backdrop { background: #211f1c91; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.dialog-heading h2 { font: 700 1.65rem/1.1 var(--serif); }
.close-dialog { width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 0.25rem; background: none; color: var(--ink); font-size: 1.65rem; line-height: 1; }
.search-dialog input { display: block; width: 100%; margin-top: 1rem; padding: 0.62rem; border: 1px solid #a89b8e; border-radius: 0.24rem; background: white; color: var(--ink); }
.search-status { min-height: 1.4rem; margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; }
.search-results { padding: 0; margin: 0.45rem 0 0; list-style: none; }
.search-results a { display: block; padding: 0.57rem 0.45rem; border-top: 1px solid var(--line); }
.search-results a:hover { color: var(--accent); }

@media (max-width: 940px) {
  .shell { width: calc(100% - 3rem); }
  .header-inner { gap: 0.8rem; }
  .navigation { gap: 0.95rem; }
  .brand { font-size: 1.36rem; }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; min-height: 0; }
  .header-inner .brand { min-height: 3.9rem; justify-self: start; }
  .navigation { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 0.1rem 0.55rem; border-top: 1px solid var(--line); }
  .navigation a { padding: 0.51rem 0; font-size: 0.875rem; }
  .search-trigger { grid-column: 2; grid-row: 1; justify-self: end; padding: 0.4rem 0.52rem; }
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .home-hero h1 { font-size: clamp(2.65rem, 8.5vw, 4rem); }
  .home-hero h1 em { display: inline; }
  .home-hero-photo img { max-height: 14rem; }
  .home-cards, .home-topic-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .button { margin-top: 0.9rem; }
  .footer-inner { display: grid; gap: 0.7rem; }
}

@media (max-width: 525px) {
  .home-hero-photo img { aspect-ratio: 2.35; }
  .home-topics-nav { gap: 0.35rem; }
  .home-topics-nav a { padding-inline: 0.65rem; }
  .home-cards, .home-topic-links { grid-template-columns: minmax(0, 1fr); }
  .home-card { grid-template: 1fr / minmax(0, 0.62fr) minmax(0, 1fr); }
  .home-card-image { min-height: 7.5rem; border-radius: 0.32rem 0 0 0.32rem; }
  .home-card-image img { position: absolute; height: 100%; }
  .home-card-copy { padding: 0.68rem 0.72rem; }
  .home-card h3 { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.breadcrumb ol { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.875rem; color: var(--muted); }
.breadcrumb li + li::before { content: '/'; margin-right: 0.35rem; color: var(--muted); }
.breadcrumb a:hover, .footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.article-shell, .category-page { padding-block: 1.65rem 4rem; }
.article-header { margin-block: 1.95rem 1.65rem; max-width: 56rem; }
.article-header h1, .category-page > h1 { margin: 0.35rem 0 0.85rem; font: 700 clamp(2.65rem,5.1vw,4.25rem)/1.02 var(--serif); letter-spacing: -0.052em; }
.article-deck { font-size: clamp(1.08rem,2.4vw,1.25rem); color: var(--muted); max-width: 57ch; }
.byline { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.15rem; row-gap: 0.3rem; font-size: 0.875rem; margin-top: 1rem; color: var(--muted); }
.byline a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 0.13em; }
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1.2rem,4vw,2.2rem); }
.profile-portrait { width: clamp(7.5rem,20vw,12rem); height: auto; border-radius: 0.35rem; }
.article-image { margin-bottom: 1.6rem; }
.article-image img { width: 100%; aspect-ratio: 2.05; height: auto; object-fit: cover; object-position: 50% 47%; border-radius: 0.25rem; }
.article-image figcaption { margin-top: 0.25rem; color: var(--muted); font-size: 0.875rem; }
.article-image figcaption a { text-decoration: underline; }
.article-image-inline { max-width: 28rem; margin-top: 1rem; }
.article-image-inline img { aspect-ratio: auto; }
.article-layout { display: grid; grid-template-columns: minmax(0,49rem) minmax(10rem,1fr); gap: clamp(2rem,5vw,5rem); align-items: start; }
.article-body { min-width: 0; line-height: 1.7; }
.article-body a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 0.15em; overflow-wrap: break-word; }
.article-answer { margin-top: 1.1rem; padding: 1rem 1.15rem; background: var(--panel); border-inline-start: 3px solid var(--accent); font-size: 1.1rem; }
.article-body section { margin-top: 1.8rem; }
.article-body h2, .outing-options h2, .more-guides h2 { margin: 0 0 0.6rem; font: 700 clamp(1.6rem,3vw,2.3rem)/1.16 var(--serif); letter-spacing: -0.03em; }
.article-body h3 { margin: 0.9rem 0 0.45rem; font: 700 1.3rem/1.25 var(--serif); }
.article-body p + p { margin-top: 0.7rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: 0.25rem; }
.source-list { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.source-list span { display: block; color: var(--muted); }
.toc { position: sticky; top: 1rem; padding-inline-start: 1.1rem; border-inline-start: 1px solid var(--line); }
.toc h2 { font-size: 1rem; }
.toc ol { padding-left: 1rem; margin: 0.4rem 0 0; color: var(--muted); font-size: 0.93rem; }
.toc li + li { margin-top: 0.35rem; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.table-scroll { max-width: 100%; overflow-x: auto; margin-block: 0.85rem; }
.article-body table { width: 100%; border-collapse: collapse; min-width: 26rem; font-size: 0.95rem; }
.article-body td, .article-body th { padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-body th { background: var(--panel); }
.article-body caption { font-weight: 650; padding: 0.45rem 0; text-align: left; }
.table-filter, .widget label { display: grid; gap: 0.3rem; font-weight: 650; }
.table-filter input, .widget input, .widget select { padding: 0.55rem; background: white; color: var(--ink); border: 1px solid #a89b8e; border-radius: 0.25rem; font: inherit; }
.table-results { color: var(--muted); font-size: 0.875rem; }
.article-cards { list-style: none; padding-left: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0.8rem; }
.article-cards a { display: block; padding: 0.85rem 0.92rem; border: 1px solid var(--line); height: 100%; border-radius: 0.2rem; }
.article-cards a:hover { border-color: var(--accent); }
.article-cards h3 { font: 700 1.25rem/1.2 var(--serif); margin: 0 0 0.35rem; }
.article-cards p { color: var(--muted); }
.more-guides { border-top: 1px solid var(--line); padding-top: 1.4rem; margin-top: 1.8rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-block: 0.55rem; font-size: 0.9rem; }
.widget { padding: 1rem; border: 1px solid var(--line); border-radius: 0.25rem; margin-block: 1.1rem; background: var(--panel); }
.widget h2 { font-size: 1.7rem; }
.widget-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-block: 0.7rem; }
.widget label { max-width: 100%; }
.widget .button { border: 0; margin: 0; color: white; }
.widget output { font-weight: 650; }
.widget-output { background: var(--paper); padding: 0.6rem; border-radius: 0.2rem; margin-block: 0.75rem; }
.payroll-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.6rem 0.85rem; margin-block: 0.85rem; }
.payroll-controls label { display: grid; align-content: end; gap: 0.15rem; font-weight: 650; }
.payroll-controls input, .payroll-controls select { width: 100%; min-width: 0; padding: 0.45rem 0.55rem; border: 1px solid #957d6a; border-radius: 0.22rem; background: var(--paper); color: var(--ink); font: inherit; }
.payroll-controls select { appearance: none; padding-right: 1.8rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 0.9rem) 55%, calc(100% - 0.6rem) 55%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
.payroll-scheme { grid-column: 1 / -1; }
.payroll-result output { display: block; font-size: 1.75rem; color: var(--accent-dark); }
.payroll-result dl { margin-bottom: 0; }
.payroll-result dl div { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; padding-block: 0.3rem; border-top: 1px solid var(--line); }
.payroll-result dd { margin: 0; font-variant-numeric: tabular-nums; }
[data-payroll-feedback]:empty { display: none; }
@media (max-width: 30rem) { .payroll-controls { grid-template-columns: 1fr; } }
.map-controls { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0.75rem; margin-block: 0.7rem; }
.map-controls label { display: grid; gap: 0.15rem; min-width: 0; color: var(--ink); font-weight: 650; }
.map-controls input, .map-controls select { background: var(--paper); border: 1px solid #957d6a; border-radius: 0.25rem; color: var(--ink); font: inherit; min-width: 0; padding: 0.43rem 0.55rem; width: 100%; }
.map-controls select { appearance: none; padding-right: 1.8rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 0.9rem) 55%, calc(100% - 0.6rem) 55%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
.map-viewport { position: relative; border: 1px solid #93afb0; border-radius: 0.3rem; overflow: hidden; background: #dcebf0; }
.map-viewport canvas { display: block; width: 100%; height: clamp(15rem, 40vw, 26rem); }
.map-viewport canvas[data-zoomed] { cursor: grab; touch-action: none; }
.map-viewport canvas[data-zoomed]:active { cursor: grabbing; }
.map-north { position: absolute; top: 0.5rem; right: 0.7rem; font-weight: 750; color: #285058; pointer-events: none; }
.map-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.45rem; border-top: 1px solid #93afb0; background: #eef5f5; }
.map-actions button, .map-panel button { min-height: 2.4rem; padding: 0.35rem 0.55rem; border: 1px solid #93afb0; border-radius: 0.25rem; background: var(--paper); color: var(--ink); text-align: left; }
.map-actions button:disabled { color: var(--muted); cursor: default; opacity: 0.65; }
.map-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0.8rem; margin-top: 0.75rem; }
.map-panel [data-map-summary] { margin-bottom: 0.35rem; font-weight: 650; }
.article-body .map-panel ul { margin-block: 0; padding: 0.2rem 0.35rem; list-style: none; overflow: auto; max-height: 12rem; }
.map-panel button { width: 100%; background: transparent; border-color: transparent; }
.map-panel button:hover, .map-panel button[aria-pressed="true"] { background: var(--paper); border-color: var(--accent); }
.map-detail { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 0.25rem; padding: 0.65rem; }
.map-detail h3 { margin-top: 0; }
.map-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; }
.map-credit { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }
@media (max-width: 34rem) {
  .map-controls, .map-panel { grid-template-columns: 1fr; }
  .map-viewport canvas { height: 15rem; }
}
.prayer-times { display: grid; grid-template-columns: repeat(auto-fit,minmax(5rem,1fr)); gap: 0.45rem; margin-block: 0.75rem; }
.prayer-times > div { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.2rem; background: var(--paper); }
.prayer-times dd { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
[data-widget="prayerTimes"] details > summary { cursor: pointer; font-weight: 650; }
[data-widget="prayerTimes"] [data-selected] td, [data-widget="prayerTimes"] [data-selected] th { background: var(--paper); font-weight: 700; }
.article-body .gdp-bars { padding: 0; list-style: none; margin-block: 0.75rem; }
.gdp-bar { display: grid; grid-template-columns: 3.3rem minmax(0,1fr) 4.5rem; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.gdp-bar progress { width: 100%; accent-color: var(--accent); }
.gdp-bar output { text-align: end; }
.narrow-body { max-width: 48rem; }
.narrow-body h2 { margin-top: 1.4rem; }
.outing-options dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.outing-options dl div { background: var(--panel); padding: 0.8rem; }
.outing-options dt { font-weight: 700; }
.outing-options dd { margin: 0.35rem 0 0; }
.outing-options dd a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 0.15em; }

@media (max-width: 760px) {
  .article-layout { display: flex; flex-direction: column; gap: 0.75rem; }
  .article-body { width: 100%; }
  .toc { order: -1; position: static; padding-block: 0.35rem; }
  .article-cards, .outing-options dl { grid-template-columns: minmax(0,1fr); }
  .article-header { margin-top: 1.25rem; }
  .article-image img { aspect-ratio: 1.65; }
}
