/* ==========================================================================
   1. DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
    --bg-cream: #f4f1ea;
    --ink-blue: #0f2c45;
    --accent-gold: #c5a059;
    --text-color: #2b2b2b;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Open Sans', sans-serif;
}

/* ==========================================================================
   2. GLOBAL STYLES & RESETS
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Critical Scroll Mechanics */
html,
body {
    min-height: 100vh;
    width: 100%;
    /* Barva a obraz jsou umístěny do body::before kvůli z-index layering */
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
}

/* Stabilní řešení fixního pozadí nezpůsobující přeskoky při rolování na mobilech */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-cream); /* Sloučeno s barvou */
    background-image: url('pozadi.png');
    background-repeat: repeat;
    background-position: center;
    background-size: auto;
    z-index: -3; /* Bezpečně vzadu za vším */
    pointer-events: none; /* Propouští klikání dále na web */
    will-change: transform; /* Vynutí akceleraci GPU a zabrání trhání obrazce na mobilech */
}

/* The true scroll container */
.main-scroll-container {
    /* Nyní necháme scrollovat tělo jako u běžného webu */
    width: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

/* Typography Basics */
h1,
h2,
h3,
h4,
.logo {
    font-family: var(--font-heading);
    color: var(--ink-blue);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.intro-text {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.4rem;
    /* Zvětšeno */
    line-height: 1.8;
}

/* Utilities */
.section {
    min-height: 100vh;
    /* Roztáhnout na celou výšku okna */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Nezakusovat dlouhý obsah přes horní konec obrazovky (issue Novény) */
    padding: 100px 0 60px;
    /* Horní padding pro vyhnutí se fixní hlavičce */
}

.section > .container {
    margin: auto; /* Vycentruje zbytek volného vertikálního flex místa */
}

h2 {
    font-size: 3.5rem;
    /* Výrazně zvětšeno */
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent-gold);
    margin: 1.5rem auto 0;
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
    padding: 1.5rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--accent-gold);
}

/* Scrolled State */
header.scrolled {
    background-color: var(--bg-cream);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding: 0.5rem 0;
    /* Zúženo menu po zascrollování */
}

header.scrolled .logo,
header.scrolled .nav-links a {
    color: var(--ink-blue);
    text-shadow: none;
}

header.scrolled .nav-links a:hover {
    color: var(--accent-gold);
}

header.scrolled .hamburger .bar {
    background-color: var(--ink-blue);
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
    /* Above menu */
}

.hamburger .bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px auto;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    /* keep visible on hero */
}

header.scrolled .hamburger .bar {
    box-shadow: none;
}

/* ==========================================================================
   4. SECTIONS
   ========================================================================== */

/* A. Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image:
        linear-gradient(to bottom, rgba(15, 44, 69, 0.2) 20%, rgba(15, 44, 69, 0.95) 100%),
        url('primiciant-hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* No Parallax on mobile/desktop as per request */
    text-align: center;
    color: #fff;
    padding: 2rem;
}

.hero-content {
    max-width: 800px;
    margin-top: 45vh;
    /* Níž - text bude víc posunutý ke spodnímu okraji fotky */
}

.motto {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero h1 {
    font-size: 5.5rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent-gold);
    font-weight: 600;
}

.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* B. About Me */
.grid-2col {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.text-content {
    flex: 1;
}

.text-content p {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    /* Zvětšeno */
    line-height: 1.8;
}

.image-content {
    flex: 1;
    display: flex;
    justify-content: center;
}

.about-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /* Optional slight rounding */
    filter: drop-shadow(0 10px 20px rgba(15, 44, 69, 0.15));
}

/* C. Program slavnosti - Vertical Timeline */
.timeline {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-item {
    display: flex;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1; /* Kontext pro překrývání teček a čar */
}

/* The vertical line */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 139px; /* Střed 60px mezery */
    top: 15px; /* Čára začíná přesně ve středu tečky */
    bottom: calc(-2.5rem - 15px); /* Končí přesně ve středu tečky další položky */
    width: 2px;
    background-color: var(--accent-gold);
    z-index: -1; /* Čára je za tečkou */
}

.timeline-item:last-child::before {
    display: none;
}

/* The blue dot */
.timeline-item::after {
    content: '';
    position: absolute;
    left: 132px; /* Těžiště tečky dokonale zarovnané se svislou čarou na ose 140px */
    top: 7px; /* Optický střed prvního řádku nadpisu události / času */
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--ink-blue);
    border: 3px solid var(--bg-cream);
    z-index: 2; /* Tečka leží jasně nad čarou */
}

.time {
    width: 140px; /* Pevný blokový box */
    box-sizing: border-box; /* Nutné pro správné zarovnání mezer */
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--accent-gold);
    padding-top: 0;
    padding-right: 30px; /* Mezera před svislici */
    text-align: right;
    white-space: nowrap;
}

.event {
    flex: 1;
    padding-left: 30px; /* Mezera za svislici */
}

.event h3 {
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
    /* Zvětšeno */
}

.event p {
    font-size: 1.1rem;
    /* Zvětšeno */
}

/* D. Příprava modlitbou - PDF View */
.pdf-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.pdf-wrapper h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.pdf-preview {
    background-color: #fff;
    border: 1px solid var(--ink-blue);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 65vh;
    /* Dinamická výška vzhledem k obrazovce */
    min-height: 500px;
    /* Jistota, že se extrémně nestáhne */
    flex-shrink: 0;
    /* Zákaz smrskávání flexboxem v celostránkovém slajdu */
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.btn-container {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink-blue);
    background-color: rgba(15, 44, 69, 0.05);
    /* very light blue hint */
    border: 2px solid var(--ink-blue);
    border-radius: 3px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: var(--ink-blue);
    color: #fff;
}

/* E. Dar na primici */
.gift-box {
    max-width: 500px;
    margin: 0 auto;
    padding: 3rem;
    border: 2px dashed var(--ink-blue);
    background-color: rgba(255, 255, 255, 0.5);
    /* slightly opaque over bg */
    border-radius: 8px;
    text-align: center;
}

.gift-box h3 {
    font-size: 1.8rem;
    /* Zvětšeno */
    margin-bottom: 1rem;
}

.account-number {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    /* Zvětšeno */
    font-weight: 700;
    color: var(--ink-blue);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.gift-box .note {
    font-style: italic;
    color: #666;
    font-size: 1.2rem;
}

/* F. Ke stažení */
.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* G. Footer */
footer {
    width: 100%;
    background-color: var(--ink-blue);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 1.5rem 0;
    /* Sníženo z 3rem pro tenčí patičku */
    font-size: 1rem;
    letter-spacing: 1px;
}

/* ==========================================================================
   5. RESPONSIVE DESIGN & SCROLL SNAP
   ========================================================================== */

/* Desktop Scroll Snap mechanics */
@media (min-width: 769px) {
    .main-scroll-container {
        overscroll-behavior-y: none;
        /* Scroll-snap z CSS je zcela vypnut, používáme čistě vlastní luxusně plynulou animaci. */
        scroll-snap-type: none;
    }

    .hero {
        scroll-snap-align: none;
    }

    .content-wrapper {
        scroll-snap-align: none;
    }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {

    /* Critical: disable scroll snap on mobile entirely */
    .main-scroll-container {
        scroll-snap-type: none;
        scroll-snap-align: none;
        overscroll-behavior-y: auto;
    }

    /* Typo adjustments */
    .hero h1 {
        font-size: 3.5rem;
    }

    .motto {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 2rem;
    }

    /* Navigation / Hamburger */
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-cream);
        background-image: url('pozadi.png');
        /* Add texture to menu too */
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding-top: 6rem;
        z-index: 1000;
        justify-content: flex-start;
    }

    .nav-links a {
        display: block;
        padding: 1.5rem;
        color: var(--ink-blue);
        text-shadow: none;
        /* override hero shadow */
        font-size: 1.5rem;
        border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    }

    .nav-links a:hover {
        background-color: rgba(197, 160, 89, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    /* Hamburger Animation to X */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--ink-blue);
        box-shadow: none;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--ink-blue);
        box-shadow: none;
    }

    /* Layout tweaks */
    .grid-2col {
        flex-direction: column-reverse;
        /* image top, text bottom */
        gap: 2rem;
    }

    /* PDF */
    .pdf-preview {
        height: 500px;
        /* Zvýšeno i na mobilu */
    }

    /* Timeline */
    .timeline-item {
        flex-direction: column;
    }

    .timeline-item::before {
        left: 17px; /* Linie široká 2px zarovnaná se středem tečky (10px + 8px = 18px střed) */
        top: 18px; /* Střed modré tečky v mobilním zobrazení (10px + poloměr 8) */
        bottom: calc(-2.5rem - 18px); /* Spojuje se přesně se středem tečky na dalším řádku */
        z-index: -1;
    }

    .timeline-item::after {
        left: 10px; /* Odsazení tečky zleva */
        top: 10px; /* Zarovnáno s prvním řádkem, kterým je zde čas */
        z-index: 2;
    }

    .time {
        width: 100%;
        text-align: left;
        padding-left: 50px; /* 10 tečka + 22 tělo + 18 mezera */
        padding-bottom: 0.5rem;
        padding-right: 0;
    }

    .event {
        padding-left: 50px;
    }

    .btn {
        width: 100%;
        margin-bottom: 1rem;
    }

    .account-number {
        font-size: 1.6rem;
    }
}