/* Feuerwehr Schöllang – theme styles */

@font-face {
    font-family: 'Lato';
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/lato-latin-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/lato-latin-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/lato-latin-700.woff2') format('woff2');
}

:root {
    --red-light: #f23033;
    --red: #c61f22;
    --red-dark: #a81f22;
    --white: #fff;
    --white-soft: rgba(255, 255, 255, 0.78);
    --panel: rgba(0, 0, 0, 0.16);
    --panel-hover: rgba(0, 0, 0, 0.26);
    --line: rgba(255, 255, 255, 0.35);
    --gutter: 1.25rem;
    --crest-w: clamp(120px, 19vw, 250px);

    /* Intro timing: outline draws, then photo, crest and content settle together. */
    --intro-draw: 1s;
    --intro-settle: 1.1s;
    --intro-fade: 0.6s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--red-dark);
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(to bottom, var(--red-light) 0%, var(--red-dark) 66%, var(--red) 100%);
    color: var(--white);
    font-family: 'Lato', Calibri, Arial, sans-serif;
    font-size: 1.0625rem;
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site > main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--white);
}

h1,
h2,
h3 {
    font-weight: 300;
    line-height: 1.25;
}

h1 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin: 2.25rem 0 0.6rem;
}

h3 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 1.75rem 0 0.4rem;
}

strong {
    font-weight: 700;
}

/* ---------- Header and menu ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem var(--gutter);
    background: var(--red-dark);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 5;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 400;
}

.site-brand img {
    height: 48px;
    width: auto;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    color: var(--white);
    text-decoration: none;
    font-weight: 400;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
    background: var(--panel-hover);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--white);
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--white);
}

.nav-toggle-bars {
    position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle-bars::before {
    top: -6px;
}

.nav-toggle-bars::after {
    top: 6px;
}

@media (max-width: 760px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        width: 100%;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        padding-bottom: 0.5rem;
    }

    .site-nav a {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 440px) {
    /* Keep brand and menu button on one line; the label stays available to screen readers. */
    .nav-toggle {
        padding: 0.8rem 0.7rem;
    }

    .nav-toggle-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

/* ---------- Standard pages ---------- */

.page {
    width: 100%;
    max-width: 46rem;
    margin: 0 auto;
    padding: 2.5rem var(--gutter) 4rem;
}

.page-wide {
    max-width: 68rem;
}

.content {
    overflow-wrap: break-word;
    hyphens: auto;
}

.content a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.content p,
.content ul,
.content ol {
    margin: 0 0 1.1rem;
}

.content img {
    border-radius: 4px;
}

.content .einleitung {
    font-size: 1.25rem;
}

.content .hinweis {
    padding: 0.9rem 1.1rem;
    border-left: 3px solid var(--white);
    background: var(--panel);
}

.button,
.content a.button {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: 2px solid var(--white);
    border-radius: 5px;
    color: var(--white);
    font-weight: 400;
    text-decoration: none;
}

.button:hover,
.button:focus-visible {
    background: var(--white);
    color: var(--red-dark);
}

.page-meta {
    margin: 0 0 0.4rem;
    color: var(--white-soft);
}

.page-image {
    display: block;
    width: 100%;
    margin: 0 0 1.75rem;
    border-radius: 4px;
}

.page-back {
    margin-top: 2.5rem;
}

.list-empty {
    color: var(--white-soft);
}

/* ---------- News ---------- */

.news-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

/* Cards keep one size whether there is one post or twelve. */
.news-card {
    flex: 1 1 17rem;
    max-width: 21.8rem;
}

/* On the start page a short row sits in the middle instead of hanging left. */
.home-section .news-list {
    justify-content: center;
}

@media (max-width: 40rem) {
    .news-card {
        max-width: none;
    }
}

.news-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 6px;
    background: var(--panel);
    color: var(--white);
    text-decoration: none;
    overflow: hidden;
}

.news-card a:hover,
.news-card a:focus-visible {
    background: var(--panel-hover);
}

.news-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.1rem 1.2rem;
}

.news-card time {
    color: var(--white-soft);
    font-size: 0.9rem;
}

.news-card strong {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.3;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.pagination a,
.pagination span {
    display: block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    background: var(--panel);
    color: var(--white);
    text-decoration: none;
}

.pagination .active a,
.pagination .active span {
    background: var(--white);
    color: var(--red-dark);
}

/* ---------- Termine ---------- */

.termin-list {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

.termin-item a {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.9rem 1.1rem;
    border-radius: 6px;
    background: var(--panel);
    color: var(--white);
    text-decoration: none;
}

.termin-item a:hover,
.termin-item a:focus-visible {
    background: var(--panel-hover);
}

.termin-date {
    flex: 0 0 4.5rem;
    text-align: center;
    line-height: 1.15;
}

.termin-day {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
}

.termin-month {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.termin-body {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.termin-body strong {
    font-size: 1.15rem;
    font-weight: 400;
}

.termin-body span {
    color: var(--white-soft);
}

.termin-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    margin: 0 0 2rem;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    background: var(--panel);
}

.termin-facts dt {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--white-soft);
}

.termin-facts dd {
    margin: 0;
    font-weight: 400;
}

/* ---------- Start page ---------- */

.hero-photo {
    overflow: hidden;
    line-height: 0;
}

/* While editing, give Concrete's block controls room. */
.is-editing .hero-photo {
    overflow: visible;
    line-height: normal;
    min-height: 6rem;
}

.hero-photo img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-bottom: 3px solid var(--white);
    transition: transform var(--intro-settle) ease;
}

.crest {
    position: relative;
    z-index: 2;
    width: var(--crest-w);
    aspect-ratio: 979 / 1181;
    margin: calc(var(--crest-w) * -0.6) auto 0;
    transition: transform var(--intro-settle) ease;
    pointer-events: none;
}

.crest-logo,
.crest-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity var(--intro-fade) ease;
}

.crest-logo {
    object-fit: contain;
}

.crest-lines {
    opacity: 0;
    transform: scale(0.92);
}

/* Only the shield and emblem are drawn; the lettering arrives with the real crest. */
.crest-lines g {
    display: none;
}

.crest-lines path,
.crest-lines polygon {
    fill: none;
    stroke: var(--white);
    stroke-width: 4;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.home-body {
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem var(--gutter) 4rem;
    text-align: center;
}

.home-body h1 {
    margin-bottom: 1rem;
}

.home-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem 2rem;
    margin: 1.5rem 0 1rem;
}

.home-columns h2 {
    margin-top: 1rem;
}

.home-section {
    margin-top: 3.5rem;
}

.home-section > h2 {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.home-section .news-card-body {
    text-align: left;
}

.home-more {
    margin: 1.75rem 0 0;
}

.fade {
    transition: opacity var(--intro-settle) ease;
}

/* Intro state: only the crest outline is visible, centred on screen. */

.intro {
    overflow: hidden;
}

.intro .fade {
    opacity: 0;
}

.intro .hero-photo img {
    transform: translateY(-101%);
}

.intro .crest {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(400px, 70vw, 58vh);
    margin: 0;
    transform: translate(-50%, -50%);
    transition: none;
}

.intro .crest-logo {
    opacity: 0;
}

.intro .crest-lines {
    opacity: 1;
}

.intro .crest-lines path,
.intro .crest-lines polygon {
    animation: crest-draw var(--intro-draw) ease-in-out both;
}

@keyframes crest-draw {
    from {
        stroke-dashoffset: 1;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-photo img,
    .crest,
    .crest-logo,
    .crest-lines,
    .fade {
        transition: none;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding: 1rem var(--gutter) 1.5rem;
    border-top: 1px solid var(--line);
}

.site-footer-name {
    margin: 0;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer a {
    color: var(--white-soft);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--white);
    text-decoration: underline;
}
