/* ============================================================
   Base — Reset, Typography, Shared Components
   Uses CSS variables from theme files
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.18s ease;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    color: var(--text-inverse);
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ============================================================
   Section Headers (landing)
   ============================================================ */
.section { padding: 64px 0; }

.section-header {
    text-align: center;
    margin-bottom: 44px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
}
.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--text-strong);
}
.section-title-left {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 18px;
    color: var(--text-strong);
    text-align: left;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* ============================================================
   Reveal Animation
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    transition: opacity 0.3s;
}
.lightbox[hidden] { display: none; }
.lightbox.show { opacity: 1; }
.lightbox-img {
    max-width: 90vw;
    max-height: 78vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    animation: lbZoom 0.35s ease-out;
}
@keyframes lbZoom {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.lightbox-caption {
    color: #fff;
    margin-top: 20px;
    font-size: 1rem;
    text-align: center;
    max-width: 700px;
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   Toast Notifications — top-right (desktop), top (mobile)
   ============================================================ */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    width: auto;
    max-width: 420px;
    min-width: 280px;
    height: auto;

    padding: 14px 20px;
    border-radius: 14px;

    background: var(--text-strong);
    color: var(--text-inverse);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);

    display: flex;
    align-items: flex-start;
    gap: 12px;

    opacity: 0;
    transform: translateX(calc(100% + 40px));
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity   0.3s ease-out;
    pointer-events: none;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-info {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
}

.toast-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #ffffff;
}

.toast-error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #ffffff;
}

@media (max-width: 640px) {
    .toast {
        top: 12px;
        left: 50%;
        right: auto;
        width: 75vw;
        max-width: 75vw;
        min-width: 0;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 0.85rem;
        transform: translateX(-50%) translateY(calc(-100% - 40px));
    }

    .toast.show {
        transform: translateX(-50%) translateY(0);
    }

    .toast-icon {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
}
/* Force hidden attribute to always hide */
[hidden] {
    display: none !important;
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@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;
    }
    .reveal { opacity: 1; transform: none; }
    .toast { transition: none; }
}