/* ==========================================================================
   Škola na Kole – Design System
   Matching 2026.skolanakole.cz aesthetic
   ========================================================================== */

:root {
    --color-primary: #FF6B35;
    --color-primary-dark: #E85D2A;
    --color-primary-light: rgba(255, 107, 53, 0.1);
    --color-secondary: #0D9488;
    --color-secondary-dark: #0B7E74;
    --color-secondary-light: rgba(13, 148, 136, 0.1);
    --color-accent: #FBBF24;
    --color-accent-dark: #D97706;
    --color-midnight: #1E1B4B;
    --color-midnight-800: #252262;
    --color-dark: #1E1B4B;
    --color-text: #374151;
    --color-text-light: #6B7280;
    --color-bg: #FAFAFA;
    --color-border: #E5E7EB;
    --color-white: #FFFFFF;
    --color-success: #10B981;

    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    --container-max: 1200px;
    --container-padding: 1.5rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;

    --shadow-sm: 0 1px 3px rgba(30, 27, 75, 0.04);
    --shadow-md: 0 4px 16px rgba(30, 27, 75, 0.08);
    --shadow-lg: 0 12px 32px rgba(30, 27, 75, 0.12);
    --shadow-glow: 0 0 40px rgba(255, 107, 53, 0.15);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-midnight);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
}

.btn--secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn--secondary:hover {
    background-color: var(--color-secondary-dark);
    color: var(--color-white);
}

.btn--white {
    background-color: var(--color-white);
    color: var(--color-midnight);
    box-shadow: var(--shadow-md);
}

.btn--white:hover {
    background-color: var(--color-bg);
    color: var(--color-midnight);
}

.btn--outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Header – Frosted Glass
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: box-shadow 0.3s, background-color 0.3s;
}

.site-header.is-scrolled {
    box-shadow: 0 1px 12px rgba(30, 27, 75, 0.06);
    background: rgba(255, 255, 255, 0.95);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 64px;
}

.site-header .main-nav {
    margin-left: auto;
}

.site-header .header-cta {
    flex-shrink: 0;
}

.site-header .menu-toggle {
    flex-shrink: 0;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-midnight);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.2s;
}

.site-logo:hover {
    color: var(--color-primary);
}

.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
    color: #fff;
}

.header-cta svg {
    flex-shrink: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-list li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-light);
    border-radius: var(--radius-md);
    transition: color 0.2s, background-color 0.2s;
}

.nav-list li a:hover,
.nav-list li.current-menu-item a {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.mobile-cta {
    display: none;
}

/* Dropdown submenu */
.nav-list li {
    position: relative;
}

.nav-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(30, 27, 75, 0.1);
    padding: 0.5rem;
    list-style: none;
    z-index: 100;
}

.nav-list li:hover > .sub-menu {
    display: block;
}

.nav-list .sub-menu li a {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* Mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: var(--color-primary-light);
}

.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-midnight);
    position: relative;
    transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--color-midnight);
    left: 0;
    transition: transform 0.3s;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .header-cta {
        display: none;
    }

    .main-nav {
        position: absolute;
        top: 100%; /* directly below the header */
        left: 0;
        right: 0;
        height: calc(100vh - 64px);
        background: #fff;
        padding: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        border-top: 1px solid var(--color-border);
        overflow-y: auto;
        z-index: 999;
    }

    .admin-bar .main-nav {
        height: calc(100vh - 64px - 46px);
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    .main-nav .mobile-cta {
        display: block;
        margin-top: 1.5rem;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
        color: #fff;
        background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
        border-radius: var(--radius-md);
        text-decoration: none;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-list li a {
        font-size: 1.125rem;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
        border-radius: 0;
    }

    .nav-list .sub-menu {
        display: block;
        position: static;
        background: none;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0;
        min-width: 0;
    }

    .nav-list .sub-menu li a {
        font-size: 1rem;
        padding-left: 2rem;
        color: var(--color-text-light);
    }
}

/* Admin bar offset – desktop (wider than mobile breakpoint) */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.site-main {
    padding-top: 64px;
}

.page-container {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.entry-content--fullwidth {
    font-size: 1rem;
}

.entry-content--fullwidth > * {
    /* ACF blocks handle their own container/padding */
}

.page-article--fullwidth {
    /* No extra padding – blocks are edge-to-edge */
}

.entry-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content img {
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

/* ==========================================================================
   Ročník Archive & Detail
   ========================================================================== */

.rocnik-archive__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.rocnik-card {
    display: block;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--color-border);
}

.rocnik-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.rocnik-card--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
}

.rocnik-card__image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.rocnik-card__content {
    padding: 1.5rem;
}

.rocnik-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rocnik-card__badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.rocnik-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--color-midnight);
}

.rocnik-card__dates {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.rocnik-card__excerpt {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.5;
}

.rocnik-dates {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

.rocnik-gallery {
    margin-top: 3rem;
}

.rocnik-gallery h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.rocnik-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.rocnik-gallery__item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: opacity 0.2s, transform 0.3s;
}

.rocnik-gallery__item:hover img {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ==========================================================================
   Footer – Midnight
   ========================================================================== */

.site-footer {
    background-color: var(--color-midnight);
    color: rgba(255, 255, 255, 0.6);
    padding: 4rem 0 0;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-secondary), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-grid h3 {
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-grid p {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-nav {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--color-white);
}

.footer-col a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* ==========================================================================
   Gutenberg alignment overrides
   ========================================================================== */

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.alignwide {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}

.wp-block-image {
    margin-bottom: 1.5rem;
}

.wp-block-image img {
    border-radius: var(--radius-md);
}

.wp-block-gallery {
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes trail-flow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

@keyframes speed-move {
    0% { transform: translateX(0); }
    100% { transform: translateX(200px); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-up {
    animation: fade-up 0.6s ease-out both;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 27, 75, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lightbox__content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s;
}

.lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }

.lightbox__prev:hover,
.lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox__prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox__next:hover { transform: translateY(-50%) translateX(2px); }

.lightbox__counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(30, 27, 75, 0.6);
    padding: 0.375rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .lightbox__prev,
    .lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox__prev { left: 0.5rem; }
    .lightbox__next { right: 0.5rem; }
}
