/**
 * Milchhof WEG — theme stylesheet
 *
 * Adjustable design tokens live in :root below. Everything else in this
 * file consumes those tokens instead of hardcoding values, so most visual
 * tweaks (card radius, accent color, spacing) only need to change in one
 * place.
 */

:root {
    --milchhof-content-width: var(--wp--style--global--content-size, 880px);
    --milchhof-wide-width: var(--wp--style--global--wide-size, 1100px);

    --milchhof-color-text: var(--wp--preset--color--text, #201d1a);
    --milchhof-color-surface: var(--wp--preset--color--cream, #faf6f0);
    --milchhof-color-border: var(--wp--preset--color--neutral, #ece7e0);
    --milchhof-color-accent: var(--wp--preset--color--accent-terracotta, #c1502e);
    --milchhof-color-accent-hover: var(--wp--preset--color--accent-green, #3f5b45);
    --milchhof-color-on-accent: #fff;

    --milchhof-font-heading: var(--wp--preset--font-family--heading, serif);
    --milchhof-font-body: var(--wp--preset--font-family--body, sans-serif);

    --milchhof-radius-card: 8px;
    --milchhof-radius-pill: 999px;
    --milchhof-gap-card: 2rem;
    --milchhof-transition-fast: transform .15s ease, opacity .4s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* ---------- Typography (Bootstrap/Lux reconciliation) ---------- */
/* theme.json's heading font-family (Cardo) already wins the cascade, but
   Bootstrap/Lux's plain `h1,h2,h3,h4,h5,h6` selector has the same
   specificity as WP's :where()-based global-styles rule and loads after
   it, so it wins on font-weight. Restore the intended weight here rather
   than patch every heading context individually. Lux's uppercase +
   letter-spacing treatment on headings is kept -- it reads elegant on
   short section titles; long dynamic titles get a scoped exception where
   they're introduced (card components, Phase 2). */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

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

.milchhof-header-row {
    max-width: var(--milchhof-wide-width);
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 2rem;
}

.milchhof-header-row > .wp-block-group {
    min-width: 0;
}

.milchhof-header-nav-row {
    padding-top: .5rem;
}

.milchhof-logo-mark {
    display: flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}

.milchhof-logo-mark img {
    height: 40px;
    width: auto;
    display: block;
}

.milchhof-header-row .wp-block-site-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .milchhof-header-row {
        padding: 0 1rem;
        row-gap: .5rem;
    }
    .milchhof-header-row.is-nowrap {
        flex-wrap: wrap;
    }
    .milchhof-logo-mark img {
        height: 30px;
    }
    .milchhof-header-row .wp-block-site-title {
        font-size: 1.05rem !important;
    }
}

.milchhof-search .wp-block-search__inside-wrapper {
    border: none;
    gap: .4rem;
}

.milchhof-search .wp-block-search__input {
    border: 1px solid var(--milchhof-color-border);
    border-radius: var(--milchhof-radius-pill);
    background: var(--milchhof-color-surface);
    padding: .5rem 1.1rem;
    font-family: var(--milchhof-font-body);
    font-size: .95rem;
    transition: var(--milchhof-transition-fast);
}

.milchhof-search .wp-block-search__input:focus {
    outline: none;
    border-color: var(--milchhof-color-accent);
}

.milchhof-search .wp-block-search__button {
    background: var(--milchhof-color-accent);
    border: none;
    border-radius: var(--milchhof-radius-pill);
    color: var(--milchhof-color-on-accent);
    width: 2.4rem;
    height: 2.4rem;
    min-width: 2.4rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--milchhof-transition-fast);
}

.milchhof-search .wp-block-search__button:hover {
    background: var(--milchhof-color-accent-hover);
}

.milchhof-search .wp-block-search__button svg {
    fill: currentColor;
    width: 1.1rem;
    height: 1.1rem;
}

/* ---------- Mobile navigation overlay (core/navigation, CSS-only restyle) ---------- */
/* Kept as WordPress's native overlayMenu so board members keep editing the
   menu in the block editor -- only the visual chrome is restyled here. */

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--milchhof-radius-pill);
    color: var(--milchhof-color-text);
    transition: var(--milchhof-transition-fast);
}

.wp-block-navigation__responsive-container-open:hover,
.wp-block-navigation__responsive-container-close:hover {
    background: var(--milchhof-color-surface);
    color: var(--milchhof-color-accent);
}

.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
    width: 20px;
    height: 20px;
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
    background-color: var(--milchhof-color-surface);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: 1.15rem;
    padding: .6rem 0;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
    color: var(--milchhof-color-accent-hover);
}

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

.milchhof-footer-row {
    max-width: var(--milchhof-content-width);
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 2rem var(--wp--preset--spacing--x-large);
}

/* ---------- Page hero (patterns/page-header.php) ---------- */

.milchhof-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 220px;
    max-height: 500px;
    display: flex;
    align-items: flex-end;
    background-color: var(--milchhof-color-text);
    overflow: hidden;
}

.milchhof-hero--plain {
    aspect-ratio: auto;
    min-height: clamp(220px, 30vw, 320px);
}

.milchhof-hero__img,
.milchhof-hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.milchhof-hero__canvas {
    opacity: 0;
    transition: opacity .4s ease;
}

.milchhof-hero__canvas.is-ready {
    opacity: 1;
}

.milchhof-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 18, 16, 0.05) 0%, rgba(20, 18, 16, 0.6) 100%);
}

.milchhof-hero__inner {
    position: relative;
    width: 100%;
    max-width: var(--milchhof-wide-width);
    margin: 0 auto;
    padding: 0 2rem 2.5rem;
    box-sizing: border-box;
}

.milchhof-hero__title {
    font-family: var(--milchhof-font-heading);
    font-size: var(--wp--preset--font-size--hero);
    line-height: 1.1;
    color: #fff;
    margin: 0;
}

/* ---------- Card components (news, teasers, history links, beirat, marktplatz) ---------- */
/* Structure/grid now comes from Bootstrap's .card + .row/.row-cols; only
   genuinely Milchhof-specific bits stay custom: the decorative accent bar,
   color modifiers, and a couple of typography tweaks Bootstrap/Lux doesn't
   cover the way this brand wants (see notes inline). */

.milchhof-teasers,
.milchhof-news {
    max-width: var(--milchhof-wide-width);
    margin: 0 auto;
    padding: 0 2rem var(--wp--preset--spacing--x-large);
    box-sizing: border-box;
}

.milchhof-teasers {
    padding-top: var(--wp--preset--spacing--x-large);
}

.milchhof-news__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.milchhof-news__title {
    font-family: var(--milchhof-font-heading);
    font-size: 1.75rem;
    margin: 0;
}

.milchhof-news__all {
    font-weight: 600;
    color: var(--milchhof-color-accent);
    text-decoration: none;
    white-space: nowrap;
}

.milchhof-news__all:hover {
    color: var(--milchhof-color-accent-hover);
}

/* Lux disables Bootstrap's rounded corners globally (its own elegant/flat
   signature) -- this brand keeps its established cream surface, soft
   card radius and hover lift on top of .card. */
.card {
    background: var(--milchhof-color-surface);
    border-color: var(--milchhof-color-surface);
    border-radius: var(--milchhof-radius-card);
}

a.card {
    color: var(--milchhof-color-text);
    text-decoration: none;
    transition: var(--milchhof-transition-fast);
}

a.card:hover {
    color: var(--milchhof-color-text);
    transform: translateY(-2px);
}

.card-img-top {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Card titles are real, variable-length content (post titles, listing
   titles) -- Lux's uppercase+letter-spacing heading treatment reads
   elegant on short static labels (h2/h3 section titles) but dense/heavy
   on longer sentences, so card titles opt back out of it. */
.card-title {
    font-family: var(--milchhof-font-heading);
    text-transform: none;
    letter-spacing: normal;
}

/* Decorative accent bar (teasers, history links) -- no Bootstrap equivalent. */
.milchhof-accent-bar {
    display: block;
    width: 2.5rem;
    height: 3px;
    background: var(--milchhof-color-accent);
    margin-bottom: 1.25rem;
}

.milchhof-news-card__date {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--milchhof-color-accent);
}

.milchhof-card-cta {
    font-weight: 600;
    color: var(--milchhof-color-accent);
}

a.card:hover .milchhof-card-cta {
    color: var(--milchhof-color-accent-hover);
}

/* Category/art/status pill badges -- Bootstrap's .badge supplies
   padding/font-size; brand keeps its own pill radius (Lux disables
   rounded corners, including the .rounded-pill utility) and colors. */
.milchhof-category-badge,
.milchhof-category-badge a,
.mp-art-badge,
.mp-status-badge,
.milchhof-antrag-status {
    border-radius: var(--milchhof-radius-pill);
}

.milchhof-category-badge,
.milchhof-category-badge a {
    background: var(--milchhof-color-border);
    color: var(--milchhof-color-text) !important;
    text-decoration: none !important;
}

/* Neutral fallback background when no status color modifier matches. */
.milchhof-antrag-status {
    background: var(--milchhof-color-border);
}

/* No fill color modifier matched (e.g. "aktiv") -- outline only, like before. */
.mp-status-badge {
    border: 1px solid var(--milchhof-color-border);
}

.mp-art-badge--verkaufen,
.milchhof-antrag-status--geprueft,
.milchhof-antrag-status--publish {
    background: var(--milchhof-color-accent);
    color: var(--milchhof-color-on-accent);
}

.mp-art-badge--verschenken,
.milchhof-antrag-status--beschlossen {
    background: var(--milchhof-color-accent-hover);
    color: var(--milchhof-color-on-accent);
}

.mp-art-badge--tauschen,
.milchhof-antrag-status--beim_verwalter {
    background: #5b5b52;
    color: var(--milchhof-color-on-accent);
}

/* Marktplatz filter bar -- same pill-radius reasoning as badges above. */
.nav-pills .nav-link {
    border-radius: var(--milchhof-radius-pill);
    color: var(--milchhof-color-text);
    font-weight: 600;
}

/* Beirat member cards */

.milchhof-beirat-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-family: var(--milchhof-font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--milchhof-color-on-accent);
}

.milchhof-beirat-card__avatar--terracotta {
    background: var(--milchhof-color-accent);
}

.milchhof-beirat-card__avatar--green {
    background: var(--milchhof-color-accent-hover);
}

.milchhof-beirat-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.milchhof-beirat-card__name {
    font-family: var(--milchhof-font-heading);
    font-size: 1.15rem;
    margin: 0 0 .25rem;
}

.milchhof-beirat-card__role {
    margin: 0 0 .5rem;
    font-weight: 600;
    color: var(--milchhof-color-accent);
}

.milchhof-beirat-card__since {
    margin: 0;
    font-size: .875rem;
    color: var(--milchhof-color-text);
    opacity: .7;
}

/* ---------- Anträge table ---------- */
/* .table-responsive / .table / .table-hover come from Bootstrap; only the
   heading font and the status-pill color modifiers above are brand-specific. */

.table th {
    font-family: var(--milchhof-font-heading);
}

.milchhof-antraege-table__link {
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Buttons (native WP button block, theme.json-driven) ---------- */
/* CF7's submit button now carries class:btn class:btn-primary directly
   (Phase 3) and gets its look from the Bootstrap recolor -- no longer
   duplicated here. */

.wp-element-button {
    border-radius: 6px;
    font-weight: 600;
    transition: var(--milchhof-transition-fast);
}

/* ---------- Contact Form 7 (Antrag stellen / Anzeige einstellen) ---------- */
/* Fields carry Bootstrap's form-control/form-check-input/btn classes
   directly (added as CF7 mail-tag `class:` options); this is just the
   bridge CSS CF7's own wrapper markup needs to lay out correctly with
   them -- CF7 doesn't let a class be added to the <span>/<label> it
   wraps each field in. */

.wpcf7-form {
    max-width: 40rem;
}

.wpcf7-form label {
    display: block;
    margin: 0 0 1.25rem;
}

.wpcf7-form p br,
.wpcf7-form label br {display: none}

.wpcf7-form .wpcf7-form-control-wrap {
    display: block;
    margin-top: .4rem;
}

.wpcf7-form textarea.form-control {
    min-height: 7rem;
}

.wpcf7-form .wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-weight: 400;
}

/* CF7's checkbox/radio module puts a `class:` option on the *wrapper*
   span, not the actual <input> -- Bootstrap's .form-check-input can't be
   targeted this way (it needs the class on the input itself), so these
   two field types keep their own simple styling instead of fighting
   Bootstrap's float/margin assumptions for a class that isn't even on
   the right element. */
.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--milchhof-color-accent);
}

.wpcf7-form .wpcf7-not-valid-tip {
    display: block;
    color: #b3261e;
    font-size: .85rem;
    font-weight: 400;
    margin-top: .3rem;
}

.wpcf7-form .wpcf7-response-output {
    border-radius: 6px;
    padding: .85rem 1.1rem;
    margin: 1.5rem 0 0;
    font-weight: 600;
}

.wpcf7-form.sent .wpcf7-response-output,
.wpcf7-mail-sent-ok {
    background: color-mix(in srgb, var(--milchhof-color-accent-hover) 15%, transparent);
    border: 1px solid var(--milchhof-color-accent-hover);
    color: var(--milchhof-color-accent-hover);
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.spam .wpcf7-response-output,
.wpcf7-validation-errors,
.wpcf7-mail-sent-ng,
.wpcf7-spam-blocked,
.wpcf7-aborted {
    background: rgba(179, 38, 30, .08);
    border: 1px solid #b3261e;
    color: #b3261e;
}

/** bootstrap overwrite */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    text-transform: none;
    letter-spacing: inherit;
}

/* Drag & drop file upload widget (CF7 file fields) renders its own
   instructional heading with no class -- picks up the site's Cardo
   display heading style by default, which is far too heavy for a small
   upload hint. */
.codedropz-upload-inner h3 {
    font-family: var(--milchhof-font-body);
    font-size: 1rem;
    font-weight: 600;
}