/*
Theme Name:        360 Diabetes Child
Theme URI:         https://360graddiabetes.de
Description:       Child Theme für die Veranstaltungs-Site 360° Diabetes 2026. Basiert auf Kadence.
Author:            Niklas Körner (localutions)
Author URI:        https://localutions.de
Template:          kadence
Version:           0.6.1
Requires at least: 6.5
Requires PHP:      8.1
License:           GPL v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       360-child
*/

/* ------------------------------------------------------------------ *
 * Die Hauptkonfiguration liegt in theme.json (Farben, Typo, Spacing).
 * Hier nur Overrides, die sich nicht über theme.json abbilden lassen.
 * ------------------------------------------------------------------ */

/* CI-Hilfsvariablen (Fallback, falls theme.json-Tokens fehlen) */
:root {
    --color-primary: #822584;
    --color-primary-dark: #6a1d6c;
    --color-secondary: #e8604b;
    --color-accent-green: #8da926;
    --color-accent-cyan: #59c0ca;
    --color-black: #1d1d1b;
}

/* ============================================================ *
 * TYPO — Inter forcen (Kadence überschreibt sonst mit System-Stack)
 * ============================================================ */

body,
.wp-site-blocks,
.entry-content,
.kadence-page-builder,
.wp-block-button__link,
.wp-block-heading,
.wp-block-paragraph,
h1, h2, h3, h4, h5, h6, p, li, a, button, input, textarea, select {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================ *
 * GLOBALE SEKTION-PADDINGS — kompakter (statt 96px global 64–72px)
 * ============================================================ */

/* Cap zu großer Paddings (96/64 inline → 56/40), schont aber absichtlich kleine */
section.wp-block-group.alignfull[style*="padding-top: 96px"],
section.wp-block-group.alignfull[style*="padding-top:96px"] {
    padding-top: clamp(40px, 4vw, 56px) !important;
}
section.wp-block-group.alignfull[style*="padding-bottom: 96px"],
section.wp-block-group.alignfull[style*="padding-bottom:96px"] {
    padding-bottom: clamp(40px, 4vw, 56px) !important;
}
section.wp-block-group.alignfull[style*="padding-top: 64px"],
section.wp-block-group.alignfull[style*="padding-top:64px"] {
    padding-top: clamp(32px, 3vw, 44px) !important;
}
section.wp-block-group.alignfull[style*="padding-bottom: 64px"],
section.wp-block-group.alignfull[style*="padding-bottom:64px"] {
    padding-bottom: clamp(32px, 3vw, 44px) !important;
}
section.wp-block-group.alignfull[style*="padding-top: 48px"],
section.wp-block-group.alignfull[style*="padding-top:48px"] {
    padding-top: clamp(24px, 2.5vw, 32px) !important;
}
section.wp-block-group.alignfull[style*="padding-bottom: 48px"],
section.wp-block-group.alignfull[style*="padding-bottom:48px"] {
    padding-bottom: clamp(24px, 2.5vw, 32px) !important;
}
section.wp-block-group.alignfull[style*="padding-top: 32px"],
section.wp-block-group.alignfull[style*="padding-top:32px"] {
    padding-top: clamp(16px, 2vw, 24px) !important;
}
section.wp-block-group.alignfull[style*="padding-bottom: 32px"],
section.wp-block-group.alignfull[style*="padding-bottom:32px"] {
    padding-bottom: clamp(16px, 2vw, 24px) !important;
}

/* Programm-Teaser: lange Symposium-Bezeichnungen besser umbrechen */
.wp-block-columns .wp-block-column .wp-block-list li {
    text-wrap: pretty;
    margin-bottom: 12px;
}
.wp-block-columns .wp-block-column .wp-block-list li:last-child {
    margin-bottom: 0;
}

/* ============================================================ *
 * TEXT-LINKS — CI-Lila statt Kadence-Default-Blau
 * ============================================================ */

.entry-content a:not(.wp-block-button__link):not(.wp-element-button),
.wp-block-paragraph a:not(.wp-block-button__link),
.wp-block-list a:not(.wp-block-button__link) {
    color: #822584 !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color .15s;
}

.entry-content a:not(.wp-block-button__link):hover,
.wp-block-paragraph a:not(.wp-block-button__link):hover,
.wp-block-list a:not(.wp-block-button__link):hover {
    color: #6a1d6c !important;
}

/* Skip-Link sichtbar bei Fokus (A11y) */
.skip-link:focus {
    background: var(--color-primary);
    color: #fff;
    left: 8px;
    top: 8px;
    padding: 8px 16px;
    z-index: 100000;
}

/* Frühbucher-Badge (wird im Block-Editor als Klasse vergeben) */
.fruehbucher-badge {
    display: inline-block;
    background: var(--color-secondary);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

/* WooCommerce: Sale-Preis-Anzeige etwas zurückhaltender */
.woocommerce ul.products li.product .price del,
.woocommerce div.product p.price del {
    opacity: 0.55;
    margin-right: 0.5em;
}

.woocommerce ul.products li.product .price ins,
.woocommerce div.product p.price ins {
    background: transparent;
    text-decoration: none;
    font-weight: 700;
    color: var(--color-primary);
}

/* ------------------------------------------------------------------ *
 * Ticket-Karten auf der Anmeldung-Seite (Pattern: anmeldung-seite)
 * ------------------------------------------------------------------ */

/* Add-to-Cart-Button im Pattern: Vollbreite, CI-Primärfarbe.
   WICHTIG: Der [add_to_cart]-Shortcode setzt class="ticket-add-button" auf den
   <p>-WRAPPER, nicht auf den <a>-Button. Daher Descendant-Selektor auf a.button,
   plus !important gegen Kadence/Woo-Default (.woocommerce a.button = höhere Spez.). */
.ticket-add-button {
    display: block;
    width: 100%;
    margin: 0;
    text-align: center;
}
/* :link/:visited heben die Spezifität (0,3,1) auf Hover-Niveau — sonst gewinnt
   im Ruhezustand Kadences eigene !important-Link-Farbe und der Text wird unsichtbar. */
.ticket-add-button a.button,
.ticket-add-button a.button:link,
.ticket-add-button a.button:visited,
.ticket-add-button a.add_to_cart_button,
.ticket-add-button a.add_to_cart_button:link,
.ticket-add-button a.add_to_cart_button:visited,
.wp-block-shortcode .ticket-add-button a.button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--color-primary) !important;
    color: #fff !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none !important;
    transition: background-color .15s, border-color .15s;
}
.ticket-add-button a.button:hover,
.ticket-add-button a.add_to_cart_button:hover,
.wp-block-shortcode .ticket-add-button a.button:hover {
    background: #6a1d6c !important;
    border-color: #6a1d6c !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* "Im Warenkorb"-Link nach Add-to-Cart wird oft als zweiter <a> ausgegeben */
.wp-block-shortcode a.added_to_cart {
    display: inline-block;
    margin-top: 8px;
    font-size: .875rem;
    color: var(--color-primary);
}

/* WooCommerce blendet manchmal "Wurde hinzugefügt"-Mitteilungen ein —
   die mitten in der Ticketkarte stehen würden. Wir verschieben sie an die Site-Spitze. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    position: relative;
    z-index: 2;
}

/* ============================================================ *
 * KADENCE-OVERRIDES
 * ============================================================ */

/* Kadence Page-Title-Bar ausblenden (wir nutzen unsere Pattern-H1) — nuclear option */
body .entry-hero,
body section.entry-hero,
body .entry-hero-section,
body .entry-hero-layout-standard,
body .entry-hero-layout-section,
body .entry-hero-container,
body .entry-hero-container-inner,
body .entry-banner-section,
body .entry-banner-area,
body .entry-banner-wrap,
body .above-entry-hero,
body .above-entry-banner,
body .above-content-banner,
body .above-page-title-section,
body .above-content-wrap,
body .above-content-area,
body .above-content-area-padding-area,
body .page-hero-section,
body .page-title-area,
body .page-title-section,
body .kadence-page-title-area,
body .kadence-page-header,
body .standard-banner-section,
body div[class*="entry-hero"]:not(.brand-footer),
body div[class*="above-content"]:not(.brand-footer),
body section[class*="entry-banner"],
body div[class*="page-title-area"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: none !important;
    visibility: hidden !important;
}

/* Forciertes Weiß auf alle Top-Level-Container — falls "Grau" durch
   einen Container-Hintergrund kommt (nicht durch versteckte Sub-Sektion) */
body,
body main,
body main#inner-wrap,
body .site-content,
body .site-main,
body .wp-site-blocks,
body .content-bg,
body .entry-content-wrap,
body .entry-content,
body .kt-clear {
    background-color: #ffffff !important;
}

/* Falls Kadence zusätzliches Top-Padding auf main rendert → killen */
body main,
body main#inner-wrap,
body .site-main,
body .entry-content-wrap,
body .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Kadence-Default-Footer ausblenden — wir liefern eigenes footer.php */
body .site-footer,
body footer.site-footer,
body #colophon {
    display: none !important;
}

/* Sample Page aus Auto-Menü (Kadence zeigt alle Seiten an, wenn kein Menü zugewiesen) — ausgeblendet bis Hauptmenü aktiv */
body .header-menu-container .menu-item a[href*="/sample-page"] {
    display: none !important;
}

/* ============================================================ *
 * BUTTONS — explizite CI-Farben (Kadence-Specificity überschreiben)
 * ============================================================ */

/* Einheitliche Button-Dimensionen — gleiche Höhe trotz unterschiedlicher Border-Stärke */
.wp-block-button .wp-block-button__link {
    box-sizing: border-box !important;
    min-height: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
}

/* Primary-Button: solides Lila */
.wp-block-button .wp-block-button__link.has-primary-background-color,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
    background-color: #822584 !important;
    color: #ffffff !important;
    border: 2px solid #822584 !important;
    border-radius: 4px !important;
    padding: 12px 26px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    transition: background-color .15s, border-color .15s !important;
}

.wp-block-button .wp-block-button__link.has-primary-background-color:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover {
    background-color: #6a1d6c !important;
    border-color: #6a1d6c !important;
    color: #ffffff !important;
}

/* Outline-Button: Lila Border, Lila Text, transparent */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button .wp-block-button__link.has-primary-color.has-text-color {
    background-color: transparent !important;
    color: #822584 !important;
    border: 2px solid #822584 !important;
    border-radius: 4px !important;
    padding: 12px 26px !important;
    font-weight: 600 !important;
    transition: background-color .15s, color .15s !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: #822584 !important;
    color: #ffffff !important;
}

/* Frühbucher-Banner: weißer Button auf orangem Banner */
.has-secondary-background-color .wp-block-button .wp-block-button__link,
.has-secondary-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background-color: #ffffff !important;
    color: #c93b1e !important;
    border-color: #ffffff !important;
}

.has-secondary-background-color .wp-block-button .wp-block-button__link:hover {
    background-color: #fef0ed !important;
    color: #c93b1e !important;
    border-color: #fef0ed !important;
}

/* ============================================================ *
 * USP-Karten (Pattern: usp-grid)
 * ============================================================ */

.usp-card-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #ffffff;
}

.usp-card-icon svg {
    width: 24px;
    height: 24px;
}

.usp-card-icon.icon-primary { background-color: #822584; }
.usp-card-icon.icon-green   { background-color: #8da926; }
.usp-card-icon.icon-cyan    { background-color: #59c0ca; }
.usp-card-icon.icon-orange  { background-color: #e8604b; }

/* USP-Karte: Watermark-Nummer top-right + Hover-Lift */
.wp-block-column.usp-card {
    position: relative !important;
    overflow: hidden !important;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}

.wp-block-column.usp-card::before {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 3rem;
    font-weight: 800;
    color: #822584;
    opacity: 0.08;
    line-height: 1;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

.wp-block-columns .wp-block-column.usp-card:nth-of-type(1)::before { content: "01"; }
.wp-block-columns .wp-block-column.usp-card:nth-of-type(2)::before { content: "02"; }
.wp-block-columns .wp-block-column.usp-card:nth-of-type(3)::before { content: "03"; }

.wp-block-column.usp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08) !important;
    border-color: #d0d0d0 !important;
}

/* ============================================================ *
 * STICKY FRÜHBUCHER-BAR (über Header)
 * ============================================================ */

.fruehbucher-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(90deg, #822584 0%, #e8604b 100%);
    color: #ffffff;
    padding: 10px 24px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    line-height: 1.4;
}

/* Body-Padding-Top, damit Content nicht von der fixed Bar überlagert wird */
body {
    padding-top: 44px;
}

/* WP-Admin-Bar (32px Desktop / 46px Mobile) → Sticky-Bar nach unten verschieben */
body.admin-bar .fruehbucher-sticky {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .fruehbucher-sticky {
        top: 46px;
    }
}

.fruehbucher-sticky .fb-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fruehbucher-sticky .fb-text svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.fruehbucher-sticky .fb-cta {
    background: #ffffff;
    color: #822584 !important;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color .15s, color .15s;
    white-space: nowrap;
}

.fruehbucher-sticky .fb-cta:hover {
    background: #fef0ed;
    color: #6a1d6c !important;
}

.fruehbucher-sticky .fb-hide-mobile { display: inline; }
.fruehbucher-sticky .fb-mobile-only { display: none; }

@media (max-width: 640px) {
    .fruehbucher-sticky {
        font-size: 0.78rem;
        padding: 6px 12px;
        gap: 8px;
        flex-wrap: nowrap; /* einzeilig erzwingen */
        white-space: nowrap;
    }
    .fruehbucher-sticky .fb-text { gap: 6px; }
    .fruehbucher-sticky .fb-text svg { width: 14px; height: 14px; }
    .fruehbucher-sticky .fb-cta { padding: 3px 8px; font-size: 0.72rem; }
    .fruehbucher-sticky .fb-hide-mobile { display: none; }
    .fruehbucher-sticky .fb-mobile-only { display: inline; }
    /* Body-Padding auf Mobile angepasst (Bar ist jetzt schmaler) */
    body { padding-top: 36px; }
}

@media (max-width: 380px) {
    .fruehbucher-sticky { font-size: 0.7rem; padding: 5px 10px; gap: 6px; }
    .fruehbucher-sticky .fb-cta { padding: 3px 7px; font-size: 0.68rem; }
    body { padding-top: 32px; }
}

/* ============================================================ *
 * HEADER-LOGO — feste max-Höhen damit es nie wieder abgeschnitten wird
 * ============================================================ */

.site-branding img.custom-logo,
.site-logo img,
.custom-logo-link img,
.header-logo img {
    max-height: 52px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

@media (max-width: 768px) {
    .site-branding img.custom-logo,
    .site-logo img,
    .custom-logo-link img,
    .header-logo img {
        max-height: 36px !important;
    }
}

/* ============================================================ *
 * HERO-META-ICONS
 * ============================================================ */

.hero-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.hero-meta-item .hero-meta-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(130, 37, 132, 0.08);
    color: #822584;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.hero-meta-item .hero-meta-icon svg { width: 18px; height: 18px; }
.hero-meta-item .hero-meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}
.hero-meta-item .hero-meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1b;
}
.hero-meta-item.is-accent .hero-meta-value { color: #e8604b; }
.hero-meta-item.is-accent .hero-meta-icon {
    background-color: rgba(232, 96, 75, 0.10);
    color: #e8604b;
}

.hero-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
}

@media (max-width: 560px) {
    .hero-meta-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================ *
 * BRAND-FOOTER (footer.php-Override)
 * ============================================================ */

.brand-footer {
    background-color: #1d1d1b;
    color: #ffffff;
    padding: 64px 24px 24px;
}

.brand-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.brand-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

@media (max-width: 768px) {
    .brand-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

.brand-footer h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-footer p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin: 0 0 16px;
    line-height: 1.6;
    max-width: 360px;
}

.brand-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-footer li {
    margin-bottom: 8px;
}

.brand-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color .15s;
}

.brand-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.brand-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ============================================================ *
 * MwSt-Hinweis auf Ticket-Karten
 * ============================================================ */

.mwst-hint {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-top: -8px;
    margin-bottom: 16px;
}

/* ============================================================ *
 * Map-Placeholder etwas freundlicher
 * ============================================================ */

.map-placeholder {
    aspect-ratio: 4 / 3;
    background:
        linear-gradient(135deg, rgba(89, 192, 202, 0.08), rgba(141, 169, 38, 0.08)),
        repeating-linear-gradient(45deg, #f7f7f7 0, #f7f7f7 16px, #efefef 16px, #efefef 17px);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #666;
    font-size: 0.875rem;
    padding: 24px;
    text-align: center;
}

.map-placeholder svg {
    width: 40px;
    height: 40px;
    color: #822584;
}

/* ============================================================ *
 * Programm-Vollseite Aufwertung
 * ============================================================ */

.programm-day-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.programm-day-card.day-1 { border-top: 6px solid #822584; }
.programm-day-card.day-2 { border-top: 6px solid #8da926; }

.programm-slot {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.programm-slot:last-child { border-bottom: none; }

.programm-slot .time {
    color: #1d1d1b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.programm-slot.symposium-1 { border-left: 4px solid #822584; padding-left: 16px; }
.programm-slot.symposium-2 { border-left: 4px solid #e8604b; padding-left: 16px; }
.programm-slot.symposium-3 { border-left: 4px solid #8da926; padding-left: 16px; }
.programm-slot.symposium-4 { border-left: 4px solid #59c0ca; padding-left: 16px; }
.programm-slot.break { background: #fafafa; color: #666; padding-left: 16px; padding-right: 16px; border-radius: 6px; }

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
