/* Bäckerei Dammer: the whole site's styles. No framework, no JavaScript. */

:root {
    --magenta: #e5097f;
    --magenta-dark: #b0065f;
    --text: #333;
    --muted: #666;
    --line: #ececec;
    --paper: #fff;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --content-width: 60rem;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text);
    background: #f9f9f9 url("/assets/img/HG3.png") repeat;
}

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

a {
    color: var(--magenta);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--magenta-dark);
}

:focus-visible {
    outline: 3px solid var(--magenta);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -100vw;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--paper);
}

/* Header ------------------------------------------------------------------ */

.site-header {
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
    background: var(--paper);
}

.site-header .logo img {
    display: block;
    width: 18rem;
    margin: 0 auto;
}

.tagline {
    margin: 1.25rem auto 0;
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text);
}

.tagline::before,
.tagline::after {
    content: "";
    display: block;
    width: 5rem;
    margin: 0.75rem auto;
    border-top: 1px solid var(--line);
}

/* Navigation -------------------------------------------------------------- */

.site-nav {
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: block;
    padding: 0.85rem 0.9rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.site-nav a:hover {
    color: var(--magenta);
}

.site-nav a[aria-current="page"] {
    color: var(--magenta);
    border-bottom-color: var(--magenta);
}

/* The mobile menu opens with a visually hidden checkbox and its label. */
.menu-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-button {
    display: none;
}

@media (max-width: 40rem) {
    .menu-button {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
        padding: 0.85rem;
        cursor: pointer;
        font-weight: 600;
    }

    .menu-toggle:focus-visible + .menu-button {
        outline: 3px solid var(--magenta);
        outline-offset: -3px;
    }

    .site-nav ul {
        display: none;
        flex-direction: column;
        border-top: 1px solid var(--line);
    }

    .menu-toggle:checked ~ ul {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 1rem;
        text-align: center;
        border-bottom: 1px solid var(--line);
    }

    .site-nav a[aria-current="page"] {
        border-bottom-color: var(--line);
        background: #fdf0f7;
    }
}

/* Content ----------------------------------------------------------------- */

main {
    width: calc(100% - 2rem);
    max-width: var(--content-width);
    margin: 2.5rem auto;
    padding: 1rem 2.5rem 2.5rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgb(0 0 0 / 8%);
}

@media (max-width: 40rem) {
    main {
        width: calc(100% - 1rem);
        margin: 1rem auto;
        padding: 0.5rem 1.25rem 1.5rem;
    }
}

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

h1 {
    margin: 1.5rem 0 2rem;
    font-size: clamp(1.75rem, 5vw, 2.4rem);
    text-align: center;
}

h1::after {
    content: "";
    display: block;
    width: 4rem;
    margin: 1rem auto 0;
    border-top: 3px solid var(--magenta);
}

h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--magenta);
}

h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.center {
    text-align: center;
}

.lead {
    font-size: 1.15rem;
    text-align: center;
}

.emphasis {
    font-weight: 600;
    color: var(--magenta);
}

.statement {
    margin: 2rem 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    color: var(--magenta);
}

.photo {
    display: block;
    margin: 2rem auto 0;
    border-radius: 4px;
}

/* Cards: product groups (Spezialitäten), shops (Standorte, Kontakt) ------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.card {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--magenta);
    border-radius: 4px;
}

.card img {
    display: block;
    height: 4.5rem;
    width: auto;
    margin: 0 auto 0.5rem;
}

.card h2 {
    margin-top: 0;
    text-align: center;
}

/* An odd last group spans the full row instead of leaving a gap. */
.card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.card ul {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.card ul ul {
    margin-top: 0.25rem;
    list-style: circle;
}

.card li {
    margin-bottom: 0.35rem;
}

.card li li {
    margin-bottom: 0;
}

.shops .card {
    text-align: center;
}

/* A single card (Kontakt) stays card-sized instead of filling the row. */
.card:only-child {
    width: 100%;
    max-width: 26rem;
    justify-self: center;
}

.shops .card p {
    margin: 0;
}

/* Legal pages: long generated text, kept verbatim. */
.legal {
    overflow-wrap: anywhere;
}

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

.site-footer {
    margin-top: auto;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.site-footer p {
    margin: 0.25rem 0;
}
