/* ==========================================================================
   site.css — Global base styles
   --------------------------------------------------------------------------
      This file is loaded FIRST to establish predictable defaults for the rest
      of the stylesheet stack.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Minimal design tokens (safe defaults)
   -------------------------------------------------------------------------- */

:root {
    /* Common layout padding for simple pages (e.g., 404). */
    --page-pad: clamp(16px, 3vw, 48px);

    /* Text defaults (components may override). */
    --text-color: #404040;
    --bg-color: #ffffff;
}

/* --------------------------------------------------------------------------
   Reset / box model
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    height: auto;
}

/* Smooth anchor scrolling across the site (opt-out for reduced motion below). */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    /* Base typography (many components explicitly set fonts; this is the fallback). */
    font-family: "Inter", Arial, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);

    /* Sticky footer layout:
     body (column) > header + main + footer; main expands to fill remaining space. */
    min-height: 100vh;   /* fallback */
    min-height: 100svh;  /* better on modern browsers */
    display: flex;
    flex-direction: column;

    /* Prevent sideways scrolling caused by decorative artwork/positioned elements. */
    overflow-x: hidden;
}

/* Main content should expand to keep the footer at the bottom on short pages. */
main {
    flex: 1 0 auto;
    display: block;
}

/* Footer should not participate in stretching/shrinking calculations. */
footer {
    flex: 0 0 auto;
}

/* If a template forgets to use <main>, this still keeps the footer at the bottom. */
.zl-footer {
    margin-top: auto;
}


/* ==========================================================================
   Toasts (no-JS): fixed top-center, auto-hide, click-to-dismiss
   ========================================================================== */

:root {
    --zah-toast-life: 6000ms;
}

.zah-toast-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
    /* above navbar (2000) and mobile overlay (4000) */

    width: min(420px, 94vw);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;

    pointer-events: none;
    /* container doesn't block clicks */
}

.zah-toast-item {
    position: relative;
}

/* hide the dismiss checkbox */
.zah-toast-dismiss {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* base toast */
.zah-toast {
    pointer-events: auto;
    /* toast itself is clickable */

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 14px 16px;
    border-radius: 18px;
    border: 2px solid transparent;

    background: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);

    font-family: "Fredoka", sans-serif;
    font-weight: 700;
    color: #172a2d;

    animation: zah-toast-inout var(--zah-toast-life) ease forwards;
}

/* click anywhere to dismiss (checkbox toggle) */
.zah-toast-dismiss:checked+.zah-toast {
    display: none;
}

/* variants (your palette) */
.zah-toast-success {
    background-color: #FFCC00;
    border-color: #FFCC00;
    color: #172a2d;
}

.zah-toast-error {
    background-color: rgba(255, 45, 85, 0.85);
    border-color: rgba(255, 45, 85, 0.85);
    color: #172a2d;
}

.zah-toast-body {
    display: block;
    line-height: 1.25;
    width: 100%;
    text-align: center;
}

/* auto-hide animation */
@keyframes zah-toast-inout {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        visibility: visible;
    }

    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    85% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
        visibility: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zah-toast {
        animation: none;
    }
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================================================
   Custom dropdown (no-JS) — rounded menu
   ========================================================= */

.zl-dd {
    position: relative;
    width: 100%;
    outline: none;
}

.zl-dd input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.zl-dd-trigger {
    width: 100%;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;
    border: 1px solid rgba(90, 89, 82, 0.35);
    background: #ffefe2;
    border-radius: 999px;

    box-sizing: border-box;
    cursor: pointer;
}

.zl-dd-trigger:focus {
    outline: none;
    border-color: rgba(90, 89, 82, 0.35);
}

.zl-dd-value {
    font-weight: 600;
}

.zl-dd-radio {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Selected label row (support: includes flag) */
.zl-dd-selected {
    display: none;
    align-items: center;
    gap: 10px;
}

.zl-dd-flag{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 28px;
}

/* Only show the selected label */
.zl-dd-value {
    display: none;
}

.zl-dd input#_dd_dummy:checked~.zl-dd-trigger .zl-dd-value[data-for="_dd_dummy"] {
    display: inline;
}

/* We'll override the above per-instance with ids via simple rules (see markup) */

.zl-dd-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;

    background: #ffefe2;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-radius: 18px;
    overflow: hidden;

    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);

    display: none;
    z-index: 50;
}

/* Open on focus-within (click trigger, menu appears; click outside to close) */
.zl-dd:focus-within .zl-dd-menu {
    display: block;
}

.zl-dd-option {
    display: block;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.zl-dd-option:hover {
    background: rgba(255, 204, 0, 0.55);
}

.zl-dd.is-disabled .zl-dd-trigger {
    opacity: 0.65;
    cursor: not-allowed;
}

.zl-dd.is-disabled .zl-dd-menu {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Media defaults
   -------------------------------------------------------------------------- */

/* Ensure images never overflow their containers by default. */
img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

/* Simple padded wrapper used by minimal templates (e.g., 404). */
.page {
    padding: var(--page-pad);
}

/* Centered simple pages (e.g., 404) */
.page-center {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 404 card tweaks */
.zl-404-card {
    width: min(980px, 94vw);
}

/* Big "404" label */
.zl-404-code {
    margin: 0 0 10px 0;
    font-family: "Fredoka", sans-serif;
    font-weight: 800;
    font-size: clamp(56px, 7vw, 92px);
    line-height: 1;
    color: #ff2d55;
}

.zl-404-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Secondary button (white) */
.zl-404-secondary {
    background: #ffffff;
    color: #172a2d;
    border: 2px solid rgba(0, 0, 0, 0.12);
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-family: "Fredoka", sans-serif;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* --------------------------------------------------------------------------
   Generic centered state blocks (error / empty)
   -------------------------------------------------------------------------- */

.zl-state {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.zl-state-card {
    width: min(680px, 94vw);
    background: #ffffff;
    border-radius: 25px;
    padding: clamp(18px, 3vw, 32px);
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.12);
}

.zl-state-title {
    margin: 0;
    font-family: "Fredoka", sans-serif;
    font-weight: 700;
    color: #FF2D55;
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.15;
}

.zl-state-text {
    margin: 10px 0 0;
    font-family: "Inter", sans-serif;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #404040;
    line-height: 1.35;
}


/* Respect reduced-motion preferences (anchors, transitions should be minimal). */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}