/* === helligdager.no === */
:root {
    --brand: #DC2626;
    --brand-hover: #B91C1C;
    --brand-light: #FEF2F2;
    --brand-muted: #F87171;
    --brand-deep: #991B1B;
    --color-bg: #FAFAFA;
    --color-surface: #FFFFFF;
    --color-bg-hover: #F9FAFB;
    --color-border: #E5E7EB;
    --color-text: #1F2937;
    --color-text-secondary: #4B5563;
    --color-text-muted: #6B7280;
    --radius: 12px;
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* --- Header --- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}
.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo:hover { text-decoration: none; }
.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--brand);
    border-radius: 50%;
    display: inline-block;
}
.dark-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: border-color 150ms;
}
.dark-toggle:hover { border-color: var(--brand-muted); }

/* --- Hero --- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 1.5rem 4rem;
    border-radius: 16px;
    margin: 1rem 0 2rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 60%, #4B1113 100%);
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center 30%, rgba(0,0,0,0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.hero.theme-nyttaar { background: linear-gradient(160deg, #1E293B 0%, #312E81 50%, #78350F 100%); }
.hero.theme-paske { background: linear-gradient(160deg, #166534 0%, #15803D 40%, #A16207 100%); }
.hero.theme-1mai { background: linear-gradient(160deg, #DC2626 0%, #991B1B 50%, #7F1D1D 100%); }
.hero.theme-kristi { background: linear-gradient(160deg, #1D4ED8 0%, #3B82F6 50%, #7DD3FC 100%); }
.hero.theme-17mai { background: linear-gradient(160deg, #DC2626 0%, #B91C1C 35%, #1E3A8A 100%); }
.hero.theme-pinse { background: linear-gradient(160deg, #15803D 0%, #16A34A 40%, #CA8A04 100%); }
.hero.theme-jul { background: linear-gradient(160deg, #7F1D1D 0%, #991B1B 40%, #92400E 100%); }
.hero.theme-default { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 60%, #4B1113 100%); }

.hero-festive {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 1;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}
.hero-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}
.hero-holiday {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0 0 0.25rem;
}
.hero-date {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}
.countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.countdown-unit {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    min-width: 72px;
}
.countdown-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}
.countdown-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* --- Intro --- */
.intro {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}
.intro strong { color: var(--color-text); }

/* --- Section headings --- */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

/* --- Calendar --- */
.calendar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.cal-tab {
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.16,1,0.3,1);
    color: var(--color-text);
}
.cal-tab.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.cal-tab:hover:not(.active) {
    border-color: var(--brand-muted);
    color: var(--brand);
}
.year-calendar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.cal-month {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem;
}
.cal-month-title {
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.75rem;
}
.cal-day-hdr {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.65rem;
    padding: 2px 0;
}
.cal-cell {
    padding: 4px 2px;
    border-radius: 6px;
    line-height: 1.4;
    transition: background 150ms;
    position: relative;
}
.cal-cell.holiday {
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}
.cal-cell.school { background: #DCFCE7; }
.cal-cell.today {
    outline: 2px solid var(--color-text);
    outline-offset: -1px;
    font-weight: 700;
    border-radius: 50%;
}
.cal-cell.sunday { color: var(--brand); }
.cal-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}
.calendar-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.legend-holiday { background: var(--brand); }
.legend-school { background: #DCFCE7; }
.legend-today { outline: 2px solid var(--color-text); }

/* --- Tables --- */
.events-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}
.events-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--color-border);
}
.events-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}
.events-table tr:hover td { background: var(--color-bg-hover); }
.desc-col { color: var(--color-text-muted); }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
    padding: 1rem 0;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
}
.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: transform 250ms cubic-bezier(0.16,1,0.3,1);
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms cubic-bezier(0.16,1,0.3,1);
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}
.faq-item.open .faq-answer {
    max-height: 200px;
    padding-bottom: 1rem;
}

/* --- beep.me CTA --- */
.beep-cta {
    display: block;
    background: linear-gradient(135deg, var(--brand-light) 0%, #FEF2F2 100%);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
    margin: 2rem 0;
    transition: transform 150ms cubic-bezier(0.16,1,0.3,1), box-shadow 150ms cubic-bezier(0.16,1,0.3,1);
}
.beep-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(220,38,38,0.12);
    text-decoration: none;
}
.beep-cta strong { color: var(--brand-deep); }

/* --- Footer --- */
footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.footer-eco { font-weight: 600; margin-bottom: 0.5rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.footer-links a { color: var(--color-text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }
.source {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2rem;
    text-align: center;
}

/* --- Mobile --- */
@media (max-width: 700px) {
    .year-calendar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .hero-title { font-size: 2rem; }
    .hero-holiday { font-size: 1.5rem; }
    .countdown-unit { min-width: 60px; padding: 0.6rem 0.8rem; }
    .countdown-number { font-size: 1.5rem; }
    .hero-festive { opacity: 0.7; }
    .desc-col { display: none; }
}
@media (max-width: 480px) {
    .year-calendar { grid-template-columns: 1fr; }
    .hero { padding: 2rem 1rem 3rem; }
    .hero-festive { display: none; }
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0F0F13;
        --color-surface: #1A1A24;
        --color-bg-hover: #22222E;
        --color-border: #2A2A35;
        --color-text: #E8E8ED;
        --color-text-secondary: #B0B0BA;
        --color-text-muted: #9CA3AF;
        --brand-light: #2A1215;
    }
    header { background: #0F0F13; }
    .cal-cell.school { background: #14291A; }
    .beep-cta {
        background: linear-gradient(135deg, #2A1215 0%, #1A1A24 100%);
        border-color: rgba(220,38,38,0.25);
    }
}
[data-theme="dark"] {
    --color-bg: #0F0F13;
    --color-surface: #1A1A24;
    --color-bg-hover: #22222E;
    --color-border: #2A2A35;
    --color-text: #E8E8ED;
    --color-text-secondary: #B0B0BA;
    --color-text-muted: #9CA3AF;
    --brand-light: #2A1215;
}
[data-theme="dark"] header { background: #0F0F13; }
[data-theme="dark"] .cal-cell.school { background: #14291A; }
[data-theme="dark"] .beep-cta {
    background: linear-gradient(135deg, #2A1215 0%, #1A1A24 100%);
    border-color: rgba(220,38,38,0.25);
}
