/*
 * Mobile civic pages: a short introduction, the real content, then clear next steps.
 * Existing forest/paper palette and local typefaces; 20px edges, 4px rhythm.
 * All changes are contained below 901px. The desktop stylesheet remains authoritative.
 */
@media (max-width: 900px) {
  :root {
    --shell: min(calc(100% - 40px), 820px);
    --header-height: 68px;
    --radius-small: 12px;
    --radius: 18px;
    --radius-large: 22px;
  }

  html { scroll-padding-top: calc(var(--header-height) + 20px); }
  .site-header { height: var(--header-height); }
  .site-header__inner { gap: 16px; }
  .brand { gap: 10px; }
  .brand__crest { width: 30px; height: 38px; }
  .brand__name span { display: none; }
  .brand__name strong { margin-top: 0; font-size: 21px; letter-spacing: -.025em; }
  .menu-toggle { min-height: 44px; gap: 10px; padding: 0; }
  .menu-toggle__label { font-size: 14px; }
  .menu-toggle__lines { width: 25px; }
  .primary-nav {
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
  .primary-nav__link { min-height: 56px; font-size: 16px; }
  .mega-menu { padding: 12px 0 16px; }
  .mega-menu__links, .mega-menu__links--columns { grid-template-columns: 1fr; gap: 0; }
  .mega-menu__links a { display: flex; min-height: 44px; align-items: center; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
  body.admin-bar .primary-nav { top: calc(var(--header-height) + 32px); height: calc(100dvh - var(--header-height) - 32px); }
  body.hv-editor-active .primary-nav { top: calc(var(--header-height) + 96px); height: calc(100dvh - var(--header-height) - 96px); }

  body:not(.home-page) #main > .section { padding-block: 56px; }
  body:not(.home-page) #main > .section--compact { padding-block: 40px; }
  body:not(.home-page) .section-heading { margin-bottom: 28px; }
  body:not(.home-page) #main h2 { font-size: clamp(28px, 4.8vw, 38px); line-height: 1.12; letter-spacing: -.03em; }
  body:not(.home-page) #main h3 { font-size: clamp(23px, 3.6vw, 30px); line-height: 1.16; }
  body:not(.home-page) #main .eyebrow { margin-bottom: 12px; font-size: 11px; line-height: 1.5; letter-spacing: .12em; }
  body:not(.home-page) #main .lede, body:not(.home-page) #main .prose { font-size: 16px; line-height: 1.65; }
  body:not(.home-page) #main .button { min-height: 48px; padding: 13px 20px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.35; }
  body:not(.home-page) #main .text-link { min-height: 44px; font-size: 14px; line-height: 1.4; }

  .page-hero { padding: 32px 0 36px; }
  .page-hero::after { display: none; }
  .page-hero__inner { grid-template-columns: 1fr; gap: 18px; }
  .breadcrumbs { margin-bottom: 22px; gap: 8px; font-size: 12px; line-height: 1.4; }
  .breadcrumbs a { min-height: 24px; display: inline-flex; align-items: center; }
  .page-hero h1, body[data-page="termine"] .page-hero h1 {
    max-width: 720px;
    font-size: clamp(34px, 6.2vw, 52px);
    line-height: 1.07;
    letter-spacing: -.04em;
    text-wrap: balance;
  }
  .page-hero__aside { max-width: 60ch; margin: 0; padding: 0; border: 0; font-size: 15px; line-height: 1.65; }
  .page-hero__aside p { margin: 0; }

  .media-banner { display: block; width: var(--shell); height: auto; min-height: 0; margin: 0 auto 28px; overflow: visible; background: transparent; }
  .media-banner img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 18px; object-fit: cover; transform: none !important; }
  .media-banner__caption { position: static; max-width: none; margin: 0; padding: 16px 0 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; color: var(--muted); font-size: 14px; line-height: 1.65; }

  .fact-rail { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact-rail__item { padding: 24px 20px; border-top: 0; border-left: 1px solid var(--line); }
  .fact-rail__item:nth-child(3), .fact-rail__item:nth-child(4) { border-top: 0; border-left: 1px solid var(--line); }
  .fact-rail__item strong { font-size: 30px; line-height: 1.05; }
  .fact-rail__item span { font-size: 12px; line-height: 1.5; }
  .story-grid { gap: 32px; }
  .story-grid__aside { position: static; max-width: 600px; }
  .story-grid__body { gap: 32px; }
  .story-block { padding-top: 24px; scroll-margin-top: calc(var(--header-height) + 24px); }
  .story-block p { font-size: 16px; line-height: 1.7; }
  .place-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 20px; }
  .place-list span { display: flex; min-height: 48px; align-items: center; padding: 10px 0; font-size: 14px; line-height: 1.4; }

  .directory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .directory-card, .directory-card.directory-card--club { min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-radius: 18px; box-shadow: none; }
  .directory-card__media, .directory-card--club .directory-card__media { min-height: 0; aspect-ratio: 16 / 10; }
  .directory-card__media img { width: 100%; height: 100%; object-fit: cover; }
  .directory-card__media--logo { min-height: 180px; padding: 28px; }
  .directory-card__media--logo img { height: 150px; object-fit: contain; }
  .directory-card--club .directory-card__club-crest { width: 48px; height: 60px; padding: 6px; right: 14px; bottom: 14px; object-fit: contain; }
  .directory-card__copy, .directory-card--club .directory-card__copy { padding: 24px; gap: 18px; }
  .directory-card__copy p { font-size: 15px; line-height: 1.65; }
  .directory-card--text { min-height: 0; }
  .directory-card--text .directory-card__copy { justify-content: flex-start; }
  .directory-card__link { min-height: 44px; font-size: 14px; }

  .detail-intro { gap: 28px; }
  .detail-intro__media { aspect-ratio: 16 / 10; border-radius: 18px; }
  .detail-intro__media--kita { aspect-ratio: 554 / 300; }
  .detail-intro__copy .lede { margin-bottom: 24px; }
  .detail-intro__copy > p { font-size: 16px; line-height: 1.7; }
  .mini-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
  .mini-fact { padding: 18px; border-radius: 12px; }
  .mini-fact strong { font-size: 22px; line-height: 1.2; }
  .mini-fact span { font-size: 12px; line-height: 1.5; }

  .letter { width: var(--shell); padding: 32px; border-radius: 18px; box-shadow: none; }
  .letter::before { position: static; display: block; width: 36px; height: 44px; margin: 0 0 24px; }
  .letter p { font-size: 16px; line-height: 1.75; }
  .letter__signoff { margin-top: 28px; padding-top: 20px; }
  body[data-page="rat"] #main { display: flex; flex-direction: column; }
  body[data-page="rat"] #main > .page-hero { order: 0; }
  body[data-page="rat"] #mitglieder { order: 1; }
  body[data-page="rat"] #sitzungen { order: 2; }
  body[data-page="rat"] #buergermeister { order: 3; scroll-margin-top: calc(var(--header-height) + 20px); }
  .council-showcase { gap: 24px; }
  .council-mayor { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); border-radius: 18px; box-shadow: none; }
  .council-mayor__portrait { min-height: 0; aspect-ratio: 3 / 4; }
  .council-mayor__body { padding: 24px; align-self: end; }
  body:not(.home-page) #main .council-mayor h3 { font-size: 28px; line-height: 1.08; }
  .council-mayor__role { margin-bottom: 10px; }
  .council-mayor a { min-height: 44px; font-size: 13px; }
  .council-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .council-person { grid-template-columns: 90px minmax(0, 1fr); min-height: 130px; border-radius: 12px; }
  .council-person__portrait { min-height: 130px; }
  .council-person__photo { object-position: 50% 12%; transform: scale(1.12); transform-origin: 50% 12%; }
  .council-person:hover .council-person__photo { transform: scale(1.12); }
  .council-person__body { padding: 16px; }
  body:not(.home-page) #main .council-person h3 { font-size: 18px; line-height: 1.15; letter-spacing: -.025em; }
  .council-person p { font-size: 12px; line-height: 1.45; }
  .council-person__role { margin-bottom: 8px; }
  .meeting-callout { gap: 18px; padding: 26px; border-radius: 18px; }
  .meeting-callout__date { font-size: 28px; }
  .meeting-callout p { font-size: 15px; line-height: 1.65; }
  .meeting-callout .button { justify-self: start; }

  .event-toolbar { align-items: flex-start; gap: 24px; margin-bottom: 24px; }
  .filter-group { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .filter-button { min-height: 44px; padding-inline: 14px; font-size: 12px; }
  .event-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 8px 20px; padding-block: 22px; }
  .event-row__date, .event-row__place { grid-column: 1; font-size: 13px; line-height: 1.5; }
  .event-row > div { grid-column: 1; }
  body:not(.home-page) #main .event-row h3 { font-size: 23px; }
  .event-row__action { grid-column: 2; grid-row: 1 / 4; min-width: 44px; min-height: 44px; align-self: center; }
  .event-empty { margin-top: 20px; padding: 20px; font-size: 15px; line-height: 1.65; }
  body:not(.home-page) .news-empty { margin-top: 28px; padding: 24px; border-radius: 16px; }

  .download-gates { gap: 20px; }
  .download-gate { min-height: 0; gap: 22px; padding: 28px; border-radius: 18px; }
  body:not(.home-page) #main .download-gate h2 { font-size: 34px; margin-bottom: 14px; }
  .download-gate p { font-size: 15px; line-height: 1.65; }
  .download-gate__arrow { font-size: 24px; }
  .document-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .document-item { padding: 24px; border-radius: 14px; }
  body:not(.home-page) #main .document-item h3 { font-size: 23px; }
  .document-item p { font-size: 14px; line-height: 1.65; }

  .contact-grid { gap: 32px; }
  .contact-details { gap: 20px; }
  .contact-block { padding-top: 16px; }
  body:not(.home-page) #main .contact-block h3 { font: 700 14px/1.4 "Manrope", sans-serif; letter-spacing: 0; margin-bottom: 8px; }
  .contact-block p, .contact-block address { font-size: 15px; line-height: 1.65; }
  .contact-block a { display: flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
  .contact-form { padding: 28px; border-radius: 18px; box-shadow: none; }
  .contact-form__grid { gap: 20px; }
  .field input, .field select { min-height: 52px; }
  .field input, .field select, .field textarea { font-size: 16px; border-radius: 10px; }
  .field__help { font-size: 12px; line-height: 1.6; }
  .form-actions { margin-top: 24px; }
  .location-heading { margin-bottom: 28px; gap: 18px; }
  .location-heading .lede { margin-bottom: 0; }
  .map-card { border-radius: 18px; box-shadow: none; }
  .osm-map { min-height: 0; height: 450px; }
  .map-placeholder { gap: 24px; padding: 24px; }
  .map-placeholder__coordinates { font-size: 40px; line-height: 1; }
  .map-placeholder > div { padding: 22px; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: none; }
  body:not(.home-page) #main .map-placeholder h3 { font-size: 26px; }
  .map-placeholder > div > p:not(.eyebrow) { font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
  .map-card__footer { padding: 20px; gap: 12px; }
  .map-card__footer address { gap: 4px; font-size: 13px; }
  .map-card__footer .text-link { min-height: 44px; font-size: 14px; }

  .privacy-layout { gap: 32px; }
  .privacy-nav { padding: 20px; border-radius: 12px; }
  .privacy-nav a, .privacy-nav button { display: flex; align-items: center; min-height: 44px; padding-block: 10px; font-size: 13px; line-height: 1.4; }
  .privacy-updated { margin-bottom: 20px; }
  .privacy-prose section, .privacy-prose section + section { padding-block: 28px; }
  body:not(.home-page) #main .privacy-prose h2 { margin-bottom: 20px; font-size: clamp(24px, 3.8vw, 30px); line-height: 1.2; letter-spacing: -.025em; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
  body:not(.home-page) #main .privacy-prose h3 { margin-top: 28px; font-size: 21px; line-height: 1.25; }
  .privacy-prose p, .privacy-prose address { font-size: 15px; line-height: 1.75; }
  .privacy-prose address { padding: 20px; border-left-width: 2px; }
  .source-list { gap: 8px; }
  .source-item { gap: 8px; padding-block: 20px; font-size: 15px; line-height: 1.65; }
  .source-item strong { font-size: 19px; }
  .simple-page { min-height: calc(100dvh - var(--header-height)); padding-block: 56px; }
  .simple-page__inner h1 { font-size: clamp(34px, 6vw, 48px); }
  .simple-page__inner p:not(.eyebrow) { font-size: 16px; line-height: 1.65; }

  .site-footer { padding-top: 44px; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; padding-bottom: 32px; }
  .site-footer__lead { grid-column: 1 / -1; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; column-gap: 14px; }
  .site-footer__lead img { grid-column: 1; grid-row: 1 / 3; width: 34px; height: 42px; margin: 3px 0 0; }
  .site-footer__title { grid-column: 2; margin: 0 0 6px; font-size: 23px; line-height: 1.1; }
  .site-footer__lead p:not(.site-footer__title) { grid-column: 2; margin: 0; max-width: 44ch; font-size: 13px; line-height: 1.65; }
  .footer-heading { margin-bottom: 10px; font-size: 10px; line-height: 1.5; letter-spacing: .12em; }
  .site-footer__grid > div:not(.site-footer__lead) a { display: flex; align-items: center; min-height: 44px; margin: 0; font-size: 13px; line-height: 1.4; gap: 7px; }
  .site-footer address { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); }
  .site-footer address span { margin: 0; font-size: 14px; line-height: 1.65; }
  .site-footer address a { display: inline-flex; align-items: center; min-height: 44px; margin: 0; font-size: 14px; }
  .site-footer__bottom { align-items: stretch; flex-direction: column; gap: 16px; padding-block: 24px calc(20px + env(safe-area-inset-bottom)); }
  .site-footer__credits { justify-content: space-between; gap: 20px; font-size: 11px; }
  .site-footer__agency { min-height: 44px; }
  .site-footer__agency img { height: 16px; }
  .site-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
  .site-footer__links a, .site-footer__links button { display: flex; align-items: center; min-height: 44px; padding: 0; font-size: 12px; line-height: 1.4; text-align: left; }
}

@media (max-width: 782px) {
  body.admin-bar .primary-nav { top: calc(var(--header-height) + 46px); height: calc(100dvh - var(--header-height) - 46px); }
  body.hv-editor-active .primary-nav { top: calc(var(--header-height) + 150px); height: calc(100dvh - var(--header-height) - 150px); }
}

@media (max-width: 640px) {
  body:not(.home-page) #main > .section { padding-block: 44px; }
  body:not(.home-page) #main > .section--compact { padding-block: 32px; }
  .page-hero { padding-block: 28px 32px; }
  .page-hero__inner { gap: 16px; }
  .page-hero h1, body[data-page="termine"] .page-hero h1 { font-size: clamp(34px, 9.2vw, 42px); }
  .breadcrumbs { margin-bottom: 20px; }
  .media-banner img { aspect-ratio: 4 / 3; }
  .media-banner__caption { font-size: 13px; }
  .fact-rail { grid-template-columns: 1fr; }
  .fact-rail__item, .fact-rail__item:nth-child(2), .fact-rail__item:nth-child(3), .fact-rail__item:nth-child(4) { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 20px; padding: 20px 0; border-left: 0; border-top: 1px solid var(--line); }
  .fact-rail__item:first-child { border-top: 0; }
  .fact-rail__item strong { margin: 0; font-size: 30px; }
  .fact-rail__item span { font-size: 13px; }
  .directory { grid-template-columns: 1fr; gap: 20px; }
  .directory-card__copy, .directory-card--club .directory-card__copy { padding: 24px; }
  .detail-intro { gap: 24px; }
  .detail-intro__media { aspect-ratio: 4 / 3; }
  .detail-intro__media--kita { aspect-ratio: 554 / 300; }
  .mini-fact { padding: 16px; }
  .mini-fact strong { font-size: 20px; }
  .letter { padding: 24px; }
  body:not(.home-page) #main .letter h2 { font-size: 27px; }
  .council-mayor { grid-template-columns: minmax(100px, .85fr) minmax(0, 1.15fr); }
  .council-mayor__portrait { min-height: 260px; aspect-ratio: auto; }
  .council-mayor__portrait img { height: 100%; object-position: center top; }
  .council-mayor__body { padding: 22px 18px; }
  body:not(.home-page) #main .council-mayor h3 { font-size: 25px; }
  .council-mayor__body > p:last-of-type { margin-bottom: 14px; font-size: 12px; }
  .council-mayor__role { font-size: 10px; line-height: 1.4; }
  .council-mayor a { font-size: 12px; line-height: 1.5; }
  .council-roster { grid-template-columns: 1fr; }
  .council-person { grid-template-columns: 96px minmax(0, 1fr); min-height: 132px; }
  .council-person__portrait { min-height: 132px; }
  .council-person__body { padding: 18px; }
  .council-person p { font-size: 12px; }
  .meeting-callout { padding: 24px; }
  .meeting-callout .button { width: 100%; justify-self: stretch; }
  .event-toolbar { flex-direction: column; }
  .filter-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-button { padding-inline: 12px; }
  .event-row { gap: 8px 16px; }
  body:not(.home-page) #main .event-row h3 { font-size: 22px; }
  .download-gate { padding: 24px; }
  body:not(.home-page) #main .download-gate h2 { font-size: 32px; }
  .download-gate__type { font-size: 11px; }
  .document-list { grid-template-columns: 1fr; }
  .document-item { padding: 22px; }
  .contact-form { padding: 24px 20px; }
  .contact-form__grid { grid-template-columns: 1fr; }
  .contact-details { gap: 16px; }
  .form-actions .button { width: 100%; }
  .osm-map { height: 420px; }
  .map-placeholder { gap: 20px; padding: 20px; }
  .map-placeholder__coordinates { font-size: 32px; }
  .map-placeholder > div { padding: 20px; }
  body:not(.home-page) #main .map-placeholder h3 { font-size: 24px; }
  .map-card__footer { grid-template-columns: 1fr; }
  .map-card__footer address { flex-direction: column; }
  .privacy-prose p, .privacy-prose address { font-size: 15px; }
  .source-item { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .page-hero h1, body[data-page="termine"] .page-hero h1 { font-size: 32px; }
  body:not(.home-page) #main h2 { font-size: 27px; }
  .directory-card__copy, .directory-card--club .directory-card__copy { padding: 20px; }
  .council-mayor { grid-template-columns: 1fr; }
  .council-mayor__portrait { aspect-ratio: 4 / 3.8; min-height: 0; }
  .council-mayor__body { padding: 22px; }
  .site-footer__grid { gap: 24px 20px; }
  .site-footer__grid > div:not(.site-footer__lead) a { font-size: 12px; }
}
