/*
 * Public-page theme — Warm Editorial Design
 * Geladen auf allen öffentlichen Seiten via public_page_start().
 * Überschreibt die Standard-Dunkeltheme-Tokens mit dem warmen
 * Editorial-Design (Creme #F7F3EC, Tinte #1A1714, Terrakotta #C4784A).
 *
 * Ausgeschlossen: manage, admin, game (nutzen eigene Layout-Funktionen).
 * Die Startseite (index.php) lädt zusätzlich homepage.css für
 * homepage-spezifische Landingpage-Layouts (Hero, Sections, etc.).
 */

/* ============================================================
   1. DESIGN TOKEN OVERRIDES
   ============================================================ */
:root {
    /* Warm editorial palette */
    --color-primary:          #C4784A;
    --color-primary-hover:    #A86038;
    --color-primary-active:   #8F4E2A;
    --color-secondary:        #6B5E54;
    --color-accent:           #C4784A;

    /* Neutral / surfaces */
    --color-neutral:          #F7F3EC;
    --color-neutral-contrast: #EDE8DF;
    --color-neutral-light:    #1A1714;
    --color-surface:          #EDE8DF;
    --color-surface-alt:      #E5DFD5;
    --color-border:           rgba(26, 23, 20, 0.10);
    --color-border-strong:    rgba(26, 23, 20, 0.18);

    /* Text — dark ink on cream */
    --text-strong:    rgba(26, 23, 20, 0.97);
    --text-primary:   rgba(26, 23, 20, 0.87);
    --text-secondary: rgba(26, 23, 20, 0.68);
    --text-muted:     rgba(26, 23, 20, 0.55);
    --text-subtle:    rgba(26, 23, 20, 0.45);
    --text-dimmed:    rgba(26, 23, 20, 0.38);
    --text-on-light:  rgba(26, 23, 20, 0.87);
    --color-white:    #FFFFFF;

    /* Surface tokens — light equivalents */
    --surface-overlay:          rgba(247, 243, 236, 0.92);
    --surface-overlay-strong:   rgba(247, 243, 236, 0.97);
    --surface-panel:            rgba(237, 232, 223, 0.88);
    --surface-panel-soft:       rgba(237, 232, 223, 0.72);
    --surface-backdrop:         rgba(26, 23, 20, 0.40);
    --surface-veil:             rgba(26, 23, 20, 0.24);
    --surface-tint-xs:          rgba(26, 23, 20, 0.02);
    --surface-tint-sm:          rgba(26, 23, 20, 0.04);
    --surface-tint-md:          rgba(26, 23, 20, 0.06);
    --surface-tint-lg:          rgba(26, 23, 20, 0.09);
    --surface-tint-xl:          rgba(26, 23, 20, 0.13);
    --surface-tint-highlight:   rgba(26, 23, 20, 0.18);
    --surface-accent:           rgba(196, 120, 74, 0.10);
    --surface-accent-strong:    rgba(196, 120, 74, 0.18);
    --surface-accent-highlight: rgba(196, 120, 74, 0.28);

    /* Glass tokens — light glass */
    --glass-bg:              rgba(26, 23, 20, 0.035);
    --glass-bg-soft:         rgba(26, 23, 20, 0.028);
    --glass-bg-strong:       rgba(26, 23, 20, 0.07);
    --glass-border:          rgba(26, 23, 20, 0.12);
    --glass-border-strong:   rgba(26, 23, 20, 0.20);
    --glass-border-contrast: rgba(26, 23, 20, 0.30);
    --glass-blur:            blur(14px);
    --glass-shadow-soft:     0 4px 18px rgba(26, 23, 20, 0.07);
    --glass-shadow-strong:   0 10px 36px rgba(26, 23, 20, 0.11);

    /* Border aliases */
    --border-glass:           var(--glass-border);
    --border-glass-strong:    var(--glass-border-strong);
    --border-glass-contrast:  var(--glass-border-contrast);
    --border-accent:          rgba(196, 120, 74, 0.48);
    --border-accent-strong:   rgba(196, 120, 74, 0.68);
    --border-soft:            rgba(26, 23, 20, 0.12);
    --border-subtle:          rgba(26, 23, 20, 0.10);
    --glow-ambient:           0 0 12px rgba(196, 120, 74, 0.20);

    /* Focus rings — terracotta */
    --focus-ring:         rgba(196, 120, 74, 0.35);
    --focus-ring-outline: rgba(196, 120, 74, 0.42);
    --focus-ring-soft:    rgba(196, 120, 74, 0.24);
    --focus-ring-strong:  rgba(196, 120, 74, 0.52);

    /* Active state — terracotta */
    --state-active-primary-bg:     linear-gradient(130deg, rgba(196, 120, 74, 0.18), rgba(196, 120, 74, 0.10));
    --state-active-primary-border: rgba(196, 120, 74, 0.55);
    --state-active-primary-color:  rgba(26, 23, 20, 0.97);
    --state-active-primary-shadow: 0 4px 14px rgba(196, 120, 74, 0.22);
    --state-active-primary-focus:  0 0 0 3px rgba(196, 120, 74, 0.35);

    /* Typography */
    --font-family-base:    'DM Sans', system-ui, sans-serif;
    --font-family-display: 'Fraunces', Georgia, serif;

    /* Shadows */
    --shadow-sm: 0 4px 14px rgba(26, 23, 20, 0.08);
    --shadow-md: 0 12px 30px rgba(26, 23, 20, 0.12);

    /* Homepage token aliases for shared hp-nav / hp-footer styles */
    --hp-cream:       #F7F3EC;
    --hp-cream-dark:  #EDE8DF;
    --hp-ink:         #1A1714;
    --hp-ink-mid:     #3D3630;
    --hp-ink-muted:   #6B5E54;
    --hp-terra:       #C4784A;
    --hp-terra-dark:  #A86038;
    --hp-white:       #FFFFFF;
    --hp-line:        rgba(26, 23, 20, 0.10);
    --hp-nav-h:       68px;
    --hp-r-sm:        8px;
    --hp-r-md:        14px;
    --hp-r-lg:        22px;
    --hp-r-pill:      999px;
    --hp-shadow-sm:   0 2px 8px rgba(26, 23, 20, 0.08);
    --hp-shadow-md:   0 8px 32px rgba(26, 23, 20, 0.10);
    --hp-shadow-lg:   0 24px 64px rgba(26, 23, 20, 0.12);
    --hp-transition:  0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Alte navbar/footer-Komponenten ausblenden — public pages nutzen hp-nav / hp-footer */
.navbar      { display: none !important; }
.site-footer { display: none !important; }

/* ============================================================
   2. BASE
   ============================================================ */
html {
    color-scheme: light;
    background-color: #F7F3EC;
}

/* Freiraum für die fixed hp-nav auf allen public pages */
.page-main {
    padding-top: var(--hp-nav-h);
}

body {
    background-color: #F7F3EC;
    color: #1A1714;
    font-family: 'DM Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.bg-gradient-body {
    background: #F7F3EC !important;
}

a {
    color: #C4784A;
}

a:hover,
a:focus-visible {
    color: #A86038;
}

.beta-banner {
    display: none !important;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', Georgia, serif;
    color: #1A1714;
}

/* ============================================================
   4. NAVBAR
   ============================================================ */
.navbar {
    border-bottom: 1px solid rgba(26, 23, 20, 0.10);
}

.navbar::before {
    background: rgba(247, 243, 236, 0.90) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.navbar__brand {
    color: #1A1714 !important;
}

.navbar__toggle {
    color: #1A1714;
}

.navbar__link {
    color: #3D3630;
}

.navbar__link:hover,
.navbar__link:focus-visible {
    background: rgba(26, 23, 20, 0.07);
    color: #1A1714;
}

.navbar__panel {
    background: #F0EBE2;
    border-left-color: rgba(26, 23, 20, 0.10);
    box-shadow: -8px 0 32px rgba(26, 23, 20, 0.10);
}

.navbar__panel::before {
    background: rgba(240, 235, 226, 0.96) !important;
}

.navbar__backdrop {
    background: rgba(26, 23, 20, 0.35);
}

.navbar__close {
    color: #1A1714;
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.button {
    --button-bg:     rgba(26, 23, 20, 0.05);
    --button-border: rgba(26, 23, 20, 0.14);
    --button-color:  rgba(26, 23, 20, 0.80);
    --button-shadow: 0 2px 8px rgba(26, 23, 20, 0.06);
}

.button--primary {
    --button-bg:     linear-gradient(135deg, #C4784A, #B46438);
    --button-border: rgba(196, 120, 74, 0.40);
    --button-color:  #FFFFFF;
    --button-shadow: 0 8px 20px rgba(196, 120, 74, 0.28);
}

.button--primary:hover {
    --button-bg:    linear-gradient(135deg, #B46438, #A05430);
    --button-color: #FFFFFF;
}

.button--secondary {
    --button-bg:     transparent;
    --button-border: rgba(26, 23, 20, 0.22);
    --button-color:  rgba(26, 23, 20, 0.75);
    --button-shadow: none;
}

.button--secondary:hover {
    --button-border: rgba(26, 23, 20, 0.40);
    --button-color:  #1A1714;
}

/* ============================================================
   6. GLASS PANELS
   ============================================================ */
.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(26, 23, 20, 0.10);
    box-shadow: 0 4px 20px rgba(26, 23, 20, 0.07);
}

/* ============================================================
   7. CONTENT PAGES (AGB, Impressum, Preise, Features, …)
   ============================================================ */
.content-page__panel {
    background: rgba(255, 255, 255, 0.72) !important;
    border-color: rgba(26, 23, 20, 0.10) !important;
    box-shadow: 0 4px 20px rgba(26, 23, 20, 0.07);
}

.content-page__section {
    background: rgba(26, 23, 20, 0.03) !important;
    border-color: rgba(26, 23, 20, 0.09) !important;
    box-shadow: none;
}

.content-page__section--seo {
    background: rgba(26, 23, 20, 0.025) !important;
    border-color: rgba(26, 23, 20, 0.08) !important;
}

.content-page__title,
.content-page__section-title,
.content-page__question {
    color: #1A1714;
    font-family: 'Fraunces', Georgia, serif;
}

.content-page__lead,
.content-page__answer {
    color: rgba(26, 23, 20, 0.68);
}

.content-page__list {
    color: rgba(26, 23, 20, 0.80);
}

/* ============================================================
   8. NOTICE CARDS (created.php, confirm.php, …)
   ============================================================ */
.notice__card {
    background: rgba(255, 255, 255, 0.80) !important;
    border-color: rgba(26, 23, 20, 0.10) !important;
    box-shadow: 0 8px 32px rgba(26, 23, 20, 0.09);
}

.notice__title {
    font-family: 'Fraunces', Georgia, serif;
    color: #1A1714;
}

.notice__link-input {
    background: rgba(255, 255, 255, 0.90);
    border-color: rgba(26, 23, 20, 0.18);
    color: #1A1714;
}

.notice__link-input::placeholder {
    color: rgba(26, 23, 20, 0.40);
}

.notice__text,
.notice__note {
    color: rgba(26, 23, 20, 0.68);
}

.notice__error {
    color: #c0392b;
}

/* ============================================================
   9. FORM CONTROLS
   ============================================================ */
.form-field__label {
    color: rgba(26, 23, 20, 0.80);
    font-weight: 500;
}

.form-field__hint {
    color: rgba(26, 23, 20, 0.55);
}

.form-field__control {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(26, 23, 20, 0.16);
    color: #1A1714;
}

.form-field__control::placeholder {
    color: rgba(26, 23, 20, 0.40);
}

.form-field__control:hover {
    border-color: rgba(26, 23, 20, 0.28);
    background: rgba(255, 255, 255, 0.95);
}

.form-field__control:focus-visible {
    border-color: rgba(196, 120, 74, 0.55);
    box-shadow: 0 0 0 3px rgba(196, 120, 74, 0.22);
}

input[type="date"].form-field__control {
    color-scheme: light;
}

.form-consent {
    background: rgba(26, 23, 20, 0.03);
    color: rgba(26, 23, 20, 0.75);
}

.form-consent__input {
    border-color: rgba(26, 23, 20, 0.22);
    background: rgba(255, 255, 255, 0.80);
}

/* ============================================================
   10. SITE FOOTER — warm dark footer on light page
   ============================================================ */
.site-footer {
    background: linear-gradient(145deg, #1A1714 0%, #100E0C 100%) !important;
    border-top: 1px solid rgba(26, 23, 20, 0.20);
    box-shadow: 0 -4px 32px rgba(26, 23, 20, 0.12);
}

.site-footer__inner {
    color: rgba(247, 243, 236, 0.65);
}

.site-footer__brand {
    color: #F7F3EC !important;
    text-shadow: none;
}

.site-footer__icon-link {
    color: rgba(247, 243, 236, 0.75);
    border-color: rgba(247, 243, 236, 0.14);
}

.site-footer__icon-link:hover,
.site-footer__icon-link:focus-visible {
    border-color: rgba(196, 120, 74, 0.55);
    color: #F7F3EC;
    box-shadow: 0 4px 16px rgba(196, 120, 74, 0.22);
}

.site-footer__link {
    color: rgba(247, 243, 236, 0.68);
    border-color: transparent;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
    border-color: rgba(196, 120, 74, 0.48);
    color: #F7F3EC;
    box-shadow: 0 4px 16px rgba(196, 120, 74, 0.18);
}

/* ============================================================
   11. GLOBAL HEADER/FOOTER (HP-Layout als neuer Standard)
   ============================================================ */
/* Zentralisierte Header/Footer-Regeln aus homepage.css (CUSTOM NAV/CUSTOM FOOTER) */
.hp-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: var(--hp-nav-h);
    background: rgba(247, 243, 236, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hp-line);
}

.hp-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.5rem);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hp-nav__brand {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--hp-ink);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.hp-nav__links {
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
    display: flex;
    gap: 0.25rem;
}

.hp-nav__links a {
    display: block;
    padding: 0.4rem 0.85rem;
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--hp-ink-mid);
    text-decoration: none;
    border-radius: var(--hp-r-pill);
    transition: color var(--hp-transition), background var(--hp-transition);
}

.hp-nav__links a:hover {
    color: var(--hp-ink);
    background: rgba(26, 23, 20, 0.06);
}

.hp-nav__cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: var(--hp-ink);
    color: var(--hp-cream) !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--hp-r-pill);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--hp-transition), transform var(--hp-transition);
    flex-shrink: 0;
}

.hp-nav__cta:hover {
    background: var(--hp-ink-mid);
    transform: translateY(-1px);
}

.hp-nav__mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    color: var(--hp-ink);
}

.hp-nav__mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    margin: 4px 0;
    transition: var(--hp-transition);
}

@media (max-width: 767px) {
    .hp-nav__links              { display: none; }
    .hp-nav__cta--desktop       { display: none; }
    .hp-nav__mobile-toggle      { display: flex; flex-direction: column; justify-content: center; gap: 0; }
}

/* ---- Mobile nav panel ---- */
.hp-nav__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 9998;
    background: var(--hp-cream);
    border-left: 1px solid var(--hp-line);
    box-shadow: -8px 0 40px rgba(26, 23, 20, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
    overflow-y: auto;
}

.hp-nav__panel.is-open {
    transform: translateX(0);
    visibility: visible;
}

.hp-nav__panel-inner {
    padding: calc(var(--hp-nav-h) + 1.5rem) 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hp-nav__panel-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hp-ink-mid);
    text-decoration: none;
    border-radius: 10px;
    transition: background var(--hp-transition), color var(--hp-transition);
}

.hp-nav__panel-link:hover {
    background: rgba(26, 23, 20, 0.06);
    color: var(--hp-ink);
    text-decoration: none;
}

.hp-nav__panel-link.hp-nav__link--active {
    color: var(--hp-ink);
    font-weight: 600;
    background: rgba(26, 23, 20, 0.05);
}

.hp-nav__cta--mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    padding: 0.75rem 1.5rem;
    background: var(--hp-ink);
    color: var(--hp-cream) !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--hp-r-pill);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--hp-transition);
    width: 100%;
}

.hp-nav__cta--mobile:hover {
    background: var(--hp-ink-mid);
    text-decoration: none;
}

/* Hamburger open state — lines become X */
.hp-nav__mobile-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hp-nav__mobile-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hp-nav__mobile-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Backdrop */
.hp-nav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(26, 23, 20, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.hp-nav__backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.hp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.hp-footer {
    background: var(--hp-ink);
    color: rgba(247, 243, 236, 0.7);
    padding: clamp(3rem, 6vw, 5rem) 0 0;
}

.hp-footer__cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.hp-footer__brand-name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hp-cream);
    display: block;
    margin-bottom: 0.6rem;
}

.hp-footer__tagline {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.hp-footer__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(247, 243, 236, 0.08);
    border: 1px solid rgba(247, 243, 236, 0.12);
    color: rgba(247, 243, 236, 0.65);
    padding: 0.35rem 0.75rem;
    border-radius: var(--hp-r-pill);
}

.hp-footer__badge::before {
    content: '🇩🇪';
    font-size: 0.9em;
}

.hp-footer__col-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(247, 243, 236, 0.4);
    margin-bottom: 1rem;
}

.hp-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.hp-footer__links a {
    font-size: 0.88rem;
    color: rgba(247, 243, 236, 0.65);
    text-decoration: none;
    transition: color var(--hp-transition);
}

.hp-footer__links a:hover {
    color: var(--hp-cream);
    text-decoration: none;
}

.hp-footer__bar {
    border-top: 1px solid rgba(247, 243, 236, 0.08);
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.hp-footer__copy {
    font-size: 0.8rem;
    color: rgba(247, 243, 236, 0.35);
}

.hp-footer__social {
    display: flex;
    gap: 0.75rem;
}

.hp-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(247, 243, 236, 0.12);
    color: rgba(247, 243, 236, 0.5);
    transition: color var(--hp-transition), border-color var(--hp-transition);
    text-decoration: none;
    font-size: 0.85rem;
}

.hp-footer__social a:hover {
    color: var(--hp-cream);
    border-color: rgba(247, 243, 236, 0.3);
    text-decoration: none;
}

@media (max-width: 900px) {
    .hp-footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
    /* Brand-Spalte volle Breite; Produkt/Rechtliches/Support gleichmäßig nebeneinander */
    .hp-footer__cols {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .hp-footer__cols > div:first-child {
        grid-column: 1 / -1;
        border-bottom: 1px solid rgba(247, 243, 236, 0.08);
        padding-bottom: 1.5rem;
    }
    .hp-footer__bar  { flex-direction: column; align-items: flex-start; }
}
