/* Visual language 1.1: shared tokens and components, loaded after legacy styles. */
:root {
    --sh-navy: #1d254e; --sh-coral: #ed625f; --sh-text: #414654;
    --sh-muted: #626878; --sh-surface: #f5f6f8; --sh-line: #dfe3eb;
    --sh-radius: 10px; --sh-control-radius: 6px;
    --sh-space-1: 8px; --sh-space-2: 16px; --sh-space-3: 24px;
    --sh-space-4: 32px; --sh-space-6: 48px;
    --sonnhalde-text: 16px;
}
body { color: var(--sh-text); }
body #wrapper :is(h1, .sonnhalde-section-heading h1, #page-title h1) {
    font-size: 32px !important; line-height: 1.25 !important; text-transform: none;
}
body #wrapper h2 { font-size: 24px !important; line-height: 1.35 !important; }
body #wrapper :is(.sonnhalde-card, .sonnhalde-offer-card, .sonnhalde-date-row) h3 {
    font-size: 18px !important; line-height: 1.45 !important; text-transform: none;
}
body #wrapper :is(p, li, td, th) { line-height: 1.6; }
body #wrapper .sonnhalde-offer-card h3 { height: 2.9em; }
body #wrapper .sonnhalde-card-body { padding: 24px; }
body #wrapper :is(.sonnhalde-section-heading, #page-title) { margin-bottom: 24px; padding-bottom: 16px; }
body #wrapper .sonnhalde-offers-toolbar { margin-bottom: 24px; }
body #wrapper .sonnhalde-richtext :is(p, ul, ol) { max-width: 72ch; }
body #wrapper .sonnhalde-richtext p { margin-bottom: 16px; }
body #wrapper :is(.sonnhalde-content-columns, .sonnhalde-offer-dates, .sonnhalde-related-offers) { margin-bottom: 32px; }
body #wrapper :is(.sonnhalde-content-side-image img, .sonnhalde-offer-content-image img, .sonnhalde-embedded-offer-image) { border-radius: var(--sh-radius); }
body #wrapper .sonnhalde-related-offers { margin-top: 48px; padding: 24px; border-radius: var(--sh-radius); background: var(--sh-surface); }
body #wrapper .sonnhalde-related-offers h2 { margin-bottom: 24px; }
body #wrapper .sonnhalde-offer-dates { margin-top: 32px; }
body #wrapper .sonnhalde-date-details { padding: 24px; margin-bottom: 24px; border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: var(--sh-surface); }

/* Text links stay readable on white. Coral marks selection and decoration. */
body #wrapper :is(.sonnhalde-richtext, .entry-content, .post-content, .hentry, #contact-details, .w3eden, .sonnhalde-section-link, .sonnhalde-calendar-action, .sonnhalde-date-title-label) a:not(:is(.button, .btn, .sonnhalde-button, .sonnhalde-card-link, .wpdm-download-link, .shd-download-button, .sonnhalde-hero-programme)),
body #wrapper .sonnhalde-date-title-label,
body #wrapper .sonnhalde-calendar-link {
    color: var(--sh-navy) !important; text-decoration: underline; text-underline-offset: 3px;
}
body #wrapper .sonnhalde-date-title-label { text-decoration: none; }
body #contact-details a { color: var(--sh-navy) !important; }
body #wrapper .sonnhalde :is(.sonnhalde-offer-card, .sonnhalde-card, .sonnhalde-date-row) a { text-decoration: none; }
body #wrapper :is(a, button, input, select, textarea):focus-visible { outline: 3px solid var(--sh-navy); outline-offset: 3px; }

/* A single family of 44px controls across filters, pagination and downloads. */
body #wrapper :is(.sonnhalde-filters button, .sonnhalde-views a, .sonnhalde-month-nav > a, .sonnhalde-pagination a, .sonnhalde-pagination span, .sonnhalde-button, .w3eden .btn, .sonnhalde-hero-programme) {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; height: auto; padding: 10px 16px; border: 1px solid var(--sh-line);
    border-radius: var(--sh-control-radius) !important; background: #fff !important; color: var(--sh-navy) !important;
    font-size: 16px !important; font-weight: 400; line-height: 1.4; text-decoration: none !important;
    box-shadow: none;
}
body #wrapper :is(.sonnhalde-button, .w3eden .btn, .sonnhalde-hero-programme) {
    background: var(--sh-navy) !important; border-color: var(--sh-navy) !important; color: #fff !important;
}
body #wrapper :is(.sonnhalde-filters button[aria-pressed="true"], .sonnhalde-views a[aria-current], .sonnhalde-views a.active, .sonnhalde-pagination .current) {
    background: var(--sh-navy) !important; border-color: var(--sh-navy) !important; color: #fff !important;
    box-shadow: inset 0 -3px 0 var(--sh-coral) !important;
}
body #wrapper :is(.sonnhalde-filters button, .sonnhalde-views a, .sonnhalde-pagination a):hover { background: #edf0f5 !important; color: var(--sh-navy) !important; border-color: #a9b0c1; }
body #wrapper :is(.sonnhalde-button, .w3eden .btn, .sonnhalde-hero-programme):hover { background: #303b70 !important; color: #fff !important; }
body #wrapper :is(.sonnhalde-filters, .sonnhalde-views, .sonnhalde-agenda-toolbar) { gap: 8px; }
body #wrapper .sonnhalde-special { background: #f8e7e6; color: var(--sh-navy); font-size: 14px !important; }
body #wrapper .sonnhalde-day-heading { padding: 16px; margin-top: 32px; background: var(--sh-surface); border-radius: var(--sh-control-radius); }
body #wrapper .sonnhalde-agenda-list .sonnhalde-date-row { padding: 16px; }
body #wrapper .sonnhalde-offer-dates .sonnhalde-date-row { border-radius: var(--sh-radius); }
body #wrapper .sonnhalde-date-thumb img { border-radius: var(--sh-control-radius); }
body #wrapper :is(.notification.notice, .notification.success) {
    box-sizing: border-box; background: var(--sh-surface) !important; color: var(--sh-navy) !important;
    border: 1px solid var(--sh-line) !important; border-left: 3px solid var(--sh-coral) !important;
    border-radius: var(--sh-control-radius); padding: 16px 24px !important;
}
body #wrapper .w3eden .link-template-default { border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: #fff; margin: 16px 0 24px; }
body #wrapper .w3eden .package-title a { color: var(--sh-navy) !important; }
body #wrapper .w3eden .link-template-default:hover { background: var(--sh-surface); }

/* Smaller, calmer footer with the same palette as the navigation. */
body #footer { background: var(--sh-navy); border-top: 3px solid var(--sh-coral); padding: 0 var(--sonnhalde-page-gutter); margin-top: 48px !important; }
body #footer-bottom { background: transparent; padding: 40px 0; }
body #footer .footer-info-grid { gap: 32px; margin: 0; align-items: start; }
body #footer .logo-footer { width: 100%; max-width: 280px; margin: 0; }
body #footer h4 { color: #fff; text-transform: none; letter-spacing: normal; border-color: rgba(255,255,255,.2); margin: 0 0 16px; }
body #footer :is(p, a, span, strong) { color: #fff !important; }
body #footer p { margin: 0 0 12px; }
body #footer a { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
body #footer a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
body #footer .hours-box { padding: 16px; background: rgba(255,255,255,.06); border-color: var(--sh-coral); border-radius: var(--sh-control-radius); }
body #footer .footer-copyright:empty { display: none; }
body #footer .footer-copyright { margin-top: 0; padding-top: 0; border: 0; }

/* Keep the primary menu reachable without covering page content. */
@media (max-width: 1023px) {
    body .sh-mobile-header { position: sticky; top: 0; z-index: 9990; min-height: 80px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(29,37,78,.06); }
    body.admin-bar .sh-mobile-header { top: 32px; }
    .sh-mobile-ready body .sh-menu-floating-button { display: none; }
    body #footer { padding-bottom: env(safe-area-inset-bottom); }
    body #wrapper [id] { scroll-margin-top: 96px; }
}
@media (min-width: 601px) and (max-width: 782px) { body.admin-bar .sh-mobile-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .sh-mobile-header { top: 0; } }
@media (max-width: 640px) {
    body #wrapper .sonnhalde-card-body { padding: 20px; }
    body #wrapper .sonnhalde-related-offers { padding: 16px; }
    body #footer-bottom { padding: 32px 0; }
    body #footer .footer-info-grid { gap: 24px; }
    body #footer .logo-footer { max-width: 220px; }
}

/* Fixed wordmark scale matches the municipal identity rather than viewport width. */
body #header #logo img { width: 360px; max-width: 100%; height: auto; }
body #footer .footer-logo-col > a { display: inline-block; max-width: 100%; }
/* Legacy fixed body height/overflow must not create a second scroll container. */
html, body { height: auto; min-height: 0; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: clip; overflow-y: visible; }
body.admin-bar { min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); }
@media (max-width: 782px) {
    body.admin-bar { min-height: calc(100vh - 46px); min-height: calc(100dvh - 46px); }
}

/* Explicit selectors supersede the old theme's important utility colours. */
body #footer a:is([href^="mailto:"], [href^="tel:"]):is(:link, :visited, :hover, :focus-visible) { color: #fff !important; }
body #wrapper .w3eden .link-template-default.card {
    border: 1px solid var(--sh-line) !important; border-radius: var(--sh-radius) !important;
}
body #wrapper .w3eden .link-template-default.card:is(:hover, :focus-within) .wpdm-download-link {
    background: #303b70 !important; border-color: #303b70 !important;
}
body #footer .footer-info-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1fr); }
body #footer .footer-info-grid > div { min-width: 0; }
body #footer .footer-logo-col { text-align: left; }
@media (max-width: 767px) { body #footer .footer-info-grid { grid-template-columns: minmax(0, 1fr); } }

body #wrapper .sonnhalde-home-hero a.sonnhalde-hero-programme {
    background: #fff !important; color: var(--sh-navy) !important; border-color: #fff !important;
}
body #wrapper .sonnhalde-home-hero a.sonnhalde-hero-programme:hover { background: #edf0f5 !important; }
body .sonnhalde { --sh-surface: #f5f6f8; --sh-line: #dfe3eb; color: var(--sh-text); }
@media print {
    body #footer { background: #fff !important; }
    body #footer :is(p, a, span, strong, h4) { color: #1d254e !important; }
    body .sh-mobile-header { position: static; }
}
