/* Kaidolfest Frontend Styles */

/* ─── Instrument Sans Font ─── */
@font-face {
    font-family: 'Instrument Sans';
    src: url('/assets/fonts/InstrumentSans/InstrumentSans-Regular.woff2') format('woff2'),
         url('/assets/fonts/InstrumentSans/InstrumentSans-Latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Instrument Sans';
    src: url('/assets/fonts/InstrumentSans/InstrumentSans-Italic.woff2') format('woff2'),
         url('/assets/fonts/InstrumentSans/InstrumentSans-ItalicLatin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

/* ─── Custom Properties ─── */
:root {
    --color-violet: #9980F2;
    --color-cyan: #05C7F2;
    --color-gold: #F2CF66;
    --color-bg: #FAFAFC;
    --color-card: #FFFFFF;
    --color-surface: #F0F0F5;
    --color-border: #E0E0EA;
    --color-text: #1A1A2E;
    --color-text-muted: #6B6B80;
    --gradient-primary: linear-gradient(135deg, var(--color-violet), var(--color-cyan));
    --gradient-gold: linear-gradient(135deg, var(--color-gold), #E8B84A);
    --font-sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
}

/* ─── Base ─── */
* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
}

/* ─── Gradient Text ─── */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gold-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Gradient Border ─── */
.gradient-border {
    position: relative;
    border: 1px solid transparent;
    background: linear-gradient(var(--color-card), var(--color-card)) padding-box,
                var(--gradient-primary) border-box;
    border-radius: 12px;
}

/* ─── Buttons ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(153, 128, 242, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--color-text);
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-secondary:hover {
    border-color: var(--color-violet);
    color: var(--color-violet);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--gradient-gold);
    color: #1A1A25;
    font-weight: 700;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(242, 207, 102, 0.3);
}

/* ─── Cards ─── */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--color-violet);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(153, 128, 242, 0.12);
}

/* ─── Category Pills ─── */
.pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Hero Section ─── */
.hero {
    position: relative;
    min-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(153, 128, 242, 0.08), transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(5, 199, 242, 0.06), transparent 60%);
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
}

/* ─── Navigation ─── */
.nav-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-violet);
}

img.header-logo {
    padding-top: 0px;
    max-height: 100px;
    max-width: 90px;

}

/* ─── Footer ─── */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0;
}

/* ─── Section Headings ─── */
.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ─── Scroll Reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Lightbox ─── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* ─── Flash Messages ─── */
.flash {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.flash-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #059669;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #DC2626;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #D97706;
}

/* ─── Form Styles ─── */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #FFFFFF;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-violet);
    box-shadow: 0 0 0 3px rgba(153, 128, 242, 0.15);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-error {
    color: #EF4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ─── Prose / Typography ─── */
/* Overrides Tailwind preflight which resets all heading/list styles */
.prose {
    line-height: 1.75;
    color: var(--color-text-muted);
}

.prose > :first-child { margin-top: 0; }

.prose h1 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
    color: var(--color-text) !important;
}

.prose h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.35 !important;
    color: var(--color-text) !important;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border);
}

.prose h3 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
    color: var(--color-text) !important;
}

.prose h4 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.4rem !important;
    line-height: 1.4 !important;
    color: var(--color-text) !important;
}

.prose p {
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    color: var(--color-text-muted) !important;
}

.prose ul, .prose ol {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
    padding-left: 1.75rem !important;
    color: var(--color-text-muted) !important;
}

.prose ul { list-style-type: disc !important; }
.prose ol { list-style-type: decimal !important; }

.prose li {
    margin-bottom: 0.35rem !important;
    padding-left: 0.25rem;
}

.prose li::marker {
    color: var(--color-violet);
}

.prose a {
    color: var(--color-violet) !important;
    text-decoration: underline !important;
    transition: color 0.2s;
}

.prose a:hover {
    color: var(--color-cyan) !important;
}

.prose strong {
    font-weight: 700 !important;
    color: var(--color-text) !important;
}

.prose blockquote {
    border-left: 4px solid var(--color-violet);
    padding-left: 1rem;
    margin: 1.5rem 0 !important;
    color: var(--color-text-muted);
    font-style: italic;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th, .prose td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.prose th {
    background: var(--color-surface);
    font-weight: 600;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.prose-lg {
    font-size: 1.125rem;
}

/* ─── Responsive Hamburger ─── */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    padding: 5rem 2rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    font-size: 1.35rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.mobile-nav a:hover {
    color: var(--color-violet);
}

/* Archive toggle in mobile nav */
.mobile-archive-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-sans);
    padding: 0;
}

.mobile-archive-toggle svg {
    transition: transform 0.2s ease;
}

.mobile-archive-toggle.open svg {
    transform: rotate(180deg);
}

.mobile-archive-items {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mobile-archive-items.open {
    display: flex;
}

.mobile-archive-items a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ─── Lazy Load ─── */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* ─── Tier Logos ─── */
.tier-title_sponsor img { max-height: 145px; }
.tier-main_sponsor img { max-height: 120px; }
.tier-partner img { max-height: 100px; }
.tier-media_partner img { max-height: 100px; }
.tier-supporter img { max-height: 100px; }

/* ─── Schedule Grid ─── */
.schedule-entry {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.5rem;
}

/* ─── Schedule Grid View (Gesamtuebersicht) ─── */
.schedule-grid-block {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}

.schedule-grid-block:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10 !important;
}

/* ─── Partner Tier Headings ─── */
.tier-title_sponsor { padding: 1rem 0; }
.tier-main_sponsor { padding: 0.75rem 0; }
.tier-partner { padding: 0.5rem 0; }
.tier-media_partner { padding: 0.25rem 0; }
.tier-supporter { padding: 0.25rem 0; }

/* ─── Print View (Schedule) ─── */
/* Only the tab/day currently visible on screen ends up on paper: the inactive
   room panels and day blocks are already display:none via the .hidden class. */
.print-only { display: none; }

@media print {
    /* Fallback only — updatePrintContext() injects the effective rule (incl.
       orientation) into #schedule-page-style, which wins by source order. */
    @page { size: A4 portrait; margin: 16mm 12mm; }

    html, body {
        background: #fff !important;
        color: #111;
    }

    /* Chrome breaks pages unreliably inside flex items: content after a page
       break ignores the top page margin. Fall back to block flow for printing. */
    body {
        display: block !important;
        min-height: 0 !important;
    }

    /* Keep room and category colors — browsers strip backgrounds by default */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .nav-sticky,
    .footer,
    .no-print,
    .hero-bg {
        display: none !important;
    }

    main {
        display: block !important;
        flex: none !important;
        padding-top: 0 !important;
        overflow: visible !important;
    }

    #schedule-print-root {
        background: #fff !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #schedule-print-root > div {
        max-width: none !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .print-only { display: block !important; }

    #schedule-print-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #111;
    }

    #schedule-print-header h1 {
        font-size: 18pt;
        font-weight: 700;
        color: #111;
    }

    #schedule-print-context {
        margin-top: 0.25rem;
        font-size: 11pt;
        color: #444;
    }

    /* List view: never split an entry across two pages */
    #schedule-list-view .day-block > div > div {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
    }

    #schedule-list-view .day-block h3 {
        color: #111 !important;
        break-after: avoid;
    }

    /* Grid view: release the horizontal scroll container so the full grid prints */
    #schedule-grid-view .overflow-x-auto {
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #schedule-grid-view .schedule-grid {
        min-width: 0 !important;
        width: 100% !important;
        /* inline overflow:hidden would clip the grid at a page break */
        overflow: visible !important;
    }

    .schedule-grid-day {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .schedule-grid-block:hover {
        transform: none;
        box-shadow: none;
    }
}
