/**
 * Homepage-only refinements.
 * Kept separate so small front-page adjustments cannot affect other sections.
 */

/* Restore the shared heading scale and generous section rhythm. */
body.home {
    --wp--preset--font-size--2xl: clamp(1.75rem, 3.5vw, 2.75rem);
    --wp--preset--font-size--3xl: clamp(2rem, 5vw, 3.5rem);
    --wp--preset--spacing--2xl: clamp(2.5rem, 5vw, 4rem);
}

body.home .hero-block .wp-block-cover__inner-container > .wp-block-group {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    text-align: start;
}

body.home .ls-hero-eyebrow,
body.home .hero-block .ls-hero-eyebrow {
    display: block;
    max-width: 1200px;
    margin-inline: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem) !important;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

body.home .hero-block h1 {
    max-width: 1200px;
    margin-inline: auto;
    max-width: 22ch;
    margin-left: 0;
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    line-height: 1.12;
    text-align: start;
}

body.home .hero-block p:not(.ls-hero-eyebrow) {
    max-width: 1200px;
    margin-inline: auto;
}

body.home .hero-block .wp-block-buttons {
    justify-content: flex-start;
}

body.home main .ls-section h2 {
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.25;
    letter-spacing: normal;
}

body.home .ls-neuigkeiten-section,
body.home .ls-termine-section,
body.home .ls-schnellzugriff {
    padding-block: clamp(2rem, 4vw, 3.5rem) !important;
}

body.home .ls-info-box {
    padding-block: clamp(2.5rem, 5vw, 5rem) !important;
}

body.home .contact-teaser {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
    background: #fff !important;
    color: #1a1a2e !important;
}

body.home .contact-teaser h2,
body.home .contact-teaser p,
body.home .contact-teaser a:not(.wp-element-button) {
    color: #1a1a2e !important;
}

body.home .ls-sz-grid {
    gap: 1rem;
}

body.home .ls-sz-card {
    min-height: auto;
    padding: 1.75rem;
    border: 0;
    border-top: 4px solid #b2202d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 20px rgba(0, 0, 0, 0.09);
}

body.home .ls-sz-card::before {
    display: none;
}

body.home .ls-info-box .wp-block-image img {
    aspect-ratio: auto;
    border-radius: 8px;
    box-shadow: none;
    object-fit: fill;
}

/* Give the section heading and its "Alle Beiträge" action a gentle pause from
   the section boundary without changing the shared homepage section rhythm. */
.ls-neuigkeiten-section > .wp-block-group:first-child {
    padding-top: clamp(0.75rem, 1.4vw, 1.25rem);
}

/* Protect card shadows from touching the following section. The maximum is the
   requested 20px, with slightly tighter spacing on small screens. */
.ls-news-grid {
    padding-bottom: clamp(1rem, 1.4vw, 1.25rem);
}

/* Mirror the same rhythm in the homepage Termine section. */
.ls-termine-section > .wp-block-group:first-child {
    padding-top: clamp(0.75rem, 1.4vw, 1.25rem);
}

.ls-termine-section > .ls-termine-list,
.ls-termine-section > .ls-no-events {
    padding-bottom: clamp(1rem, 1.4vw, 1.25rem);
}

@media (max-width: 600px) {
    .ls-neuigkeiten-section > .wp-block-group:first-child {
        padding-top: 0.75rem;
    }

    .ls-news-grid {
        padding-bottom: 1rem;
    }

    .ls-termine-section > .wp-block-group:first-child {
        padding-top: 0.75rem;
    }

    .ls-termine-section > .ls-termine-list,
    .ls-termine-section > .ls-no-events {
        padding-bottom: 1rem;
    }
}

/* Native page blocks share the same grid and can be edited individually. */
body.home .wp-block-post-content { margin-block-start: 0; }
body.home .hero-block { padding-block: clamp(3rem,8vw,6rem); }
body.home .hero-block h1, body.home .hero-block p { margin-left: 0; }
body.home .hero-block .wp-block-cover__inner-container { max-width: 1200px; width: 100%; margin-inline: auto; }
body.home .hero-block .wp-block-cover__inner-container > .wp-block-group { max-width: none; }
body.home .ls-sz-card.wp-block-group { display: flex; flex-direction: column; gap: .8rem; margin: 0; }
body.home .ls-sz-card h3 { font-size: 1.2rem; line-height: 1.3; margin: 0; }
body.home .ls-sz-card p { font-size: 1rem; line-height: 1.65; margin: 0; color: #596473; }
body.home .ls-sz-card h3 a { color: #801722; text-decoration: none; }
body.home .ls-sz-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
body.home .ls-sz-card:focus-within { outline: 3px solid #801722; outline-offset: 4px; }
body.home .ls-sz-card h3 a:focus-visible { outline: 0; box-shadow: none; }
body.home .ls-info-box { background: #f4f0e8; }
body.home .contact-teaser .wp-element-button { background: #a51f2d !important; color: #fff !important; border-color: #a51f2d !important; }
body.home .contact-teaser .wp-element-button:hover { background: #801722 !important; }
body.home .hero-block > .wp-block-cover__background {
    opacity: 1;
    background: linear-gradient(90deg, rgba(15,20,28,.88) 0%, rgba(15,20,28,.74) 45%, rgba(15,20,28,.3) 100%) !important;
}
@media (max-width: 600px) {
    body.home .hero-block > .wp-block-cover__background { background: rgba(15,20,28,.76) !important; }
    body.home .hero-block { min-height: 540px !important; }
    body.home .hero-block .wp-block-cover__inner-container > .wp-block-group { padding-inline: 0; }
}
body.home .wp-block-post-content > .ls-section,
body.home .wp-block-post-content > .hero-block {
    margin-block: 0;
}

/* Core constrained layouts auto-center narrow blocks; hero copy stays aligned. */
body.home .hero-block .wp-block-cover__inner-container h1 {
    margin-inline: 0 !important;
    max-width: min(100%, 52rem);
}
body.home .hero-block .wp-block-cover__inner-container p,
body.home .hero-block .wp-block-cover__inner-container .wp-block-buttons {
    margin-inline: 0 !important;
}
body.home .ls-no-events {
    padding: 1.4rem 1.6rem;
    border: 1px solid #e5ded3;
    border-left: 4px solid #a51f2d;
    border-radius: 10px;
    background: #f8f6f2;
    color: #344050;
    max-width: 48rem;
    line-height: 1.7;
}
body.home .ls-no-events a {
    color: #801722;
    text-underline-offset: 0.2em;
}

/* One content edge for every homepage section. Narrow prose remains readable
   within the shared frame instead of being independently centered by Core. */
body.home .wp-block-post-content > .ls-section,
body.home .wp-block-post-content > .hero-block {
    padding-inline: max(clamp(1rem, 4vw, 2rem), calc((100% - 1200px) / 2)) !important;
}
body.home .wp-block-post-content > .ls-section > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    margin-inline: 0 !important;
}
body.home .hero-block .wp-block-cover__inner-container > .wp-block-group {
    padding-inline: 0;
}

/* Keep long German task labels intact on smaller desktop/tablet screens. */
@media (min-width: 601px) and (max-width: 899px) {
    body.home .ls-sz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) and (max-width: 1279px) {
    body.home .ls-sz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    body.home .ls-sz-card h3 { min-height: 2.6em; }
}
/* An empty list already gives a useful next step; omit the redundant archive link. */
body.home .ls-termine-section > .ls-no-events ~ .ls-termine-all-link {
    display: none;
}
