:root {
    --color-bg: #fdfbf7;
    --color-text: #2c3e50;
    --color-accent: #e5b313; /* Yellow Lemon */
    --color-secondary: #eef3f7; /* Hydrangea Light Blue */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Keeps anchored sections from hiding behind the fixed navbar when scrolled to */
#story, #details, #map, #accommodation, #faq, #rsvp, #contact {
    scroll-margin-top: 90px;
}

/* Text Links Formatting */
.card a, 
.faq-answer a, 
.story-content a,
.acc-container a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 2px solid rgba(229, 179, 19, 0.4); /* var(--color-accent) with opacity */
    font-weight: 500;
    transition: var(--transition);
}

.card a:hover, 
.faq-answer a:hover, 
.story-content a:hover,
.acc-container a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(229, 179, 19, 0), rgba(44, 62, 80, 0.3), rgba(229, 179, 19, 0));
    margin: 1.5rem auto;
    width: 70%;
    max-width: 500px;
}

/* Graphic Elements */
.wreath-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 1.5rem auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wreath-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
    filter: contrast(1.2) brightness(1.05);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
}
.navbar.scrolled {
    padding: 1rem 5%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-switch a {
    background: none;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    cursor: pointer;
    color: #a0a0a0;
    text-decoration: none;
    transition: var(--transition);
}

.lang-switch a.active {
    color: var(--color-text);
    font-weight: 600;
}

/* Top nav section links (smooth-scroll to #id anchors) */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--color-accent);
}

/* Hamburger button (mobile only) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile dropdown menu (nav links + language switch), hidden on desktop.
   display stays "flex" always; opacity/transform/visibility do the show/hide so the
   reveal can transition smoothly (display can't be animated). */
.nav-mobile-menu {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 5% 1.5rem;
    background: rgba(253, 251, 247, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.nav-mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-mobile-menu a {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    text-decoration: none;
    color: var(--color-text);
    font-size: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(44, 62, 80, 0.08);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-mobile-menu.open a {
    opacity: 1;
    transform: translateY(0);
}

.nav-mobile-menu a:nth-child(1) { transition-delay: 0.05s; }
.nav-mobile-menu a:nth-child(2) { transition-delay: 0.1s; }
.nav-mobile-menu a:nth-child(3) { transition-delay: 0.15s; }
.nav-mobile-menu a:nth-child(4) { transition-delay: 0.2s; }
.nav-mobile-menu a:nth-child(5) { transition-delay: 0.25s; }
.nav-mobile-menu a:nth-child(6) { transition-delay: 0.3s; }
.nav-mobile-menu a:nth-child(7) { transition-delay: 0.35s; }

.nav-mobile-menu .lang-switch {
    margin-top: 0.75rem;
    justify-content: center;
}

@media (max-width: 920px) {
    .navbar > .nav-links,
    .navbar > .lang-switch {
        display: none;
    }
    .nav-hamburger {
        display: flex;
    }
    /* Swipe down (scrolling further into the page) hides the bar; swiping back up reveals it. */
    .navbar.nav-hidden {
        transform: translateY(-100%);
        box-shadow: none;
    }
}

.lang-switch a:hover {
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg);
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-bg img {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0.6;
    filter: brightness(1.1);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 25%;
    background: linear-gradient(to top, var(--color-bg) 10%, transparent);
    z-index: 4;
    pointer-events: none;
}

.hero-typography {
    position: relative;
    z-index: 2; /* Behind the couple */
    text-align: center;
    margin-top: 12vh;
    padding: 0 20px;
    /* .hero is a flex container with align-items:center, which by default sizes flex
       items to fit their content (shrink-to-fit) instead of the container's width —
       without this, a long title has no width limit to wrap or shrink against and
       silently overflows the viewport instead. */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    animation: fadeUp 1.2s ease-out;
}

.hero-typography .subtitle {
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 8px rgba(255,255,255,1), 0 0 15px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.8);
}

.hero-typography .title {
    font-family: var(--font-heading);
    font-size: 9rem;
    font-weight: 400;
    color: var(--color-text);
    margin: -1rem 0;
    line-height: 1;
    text-shadow: 0 5px 30px rgba(255,255,255,0.9), 0 0 80px rgba(255,255,255,1);
    /* Safety net for a single name too long to fit even at the auto-fit script's
       minimum size — break inside the word rather than overflowing the viewport. */
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Names read as one line ("Name1 & Name2") on wide screens; the forced line breaks
   only kick in on narrow screens (see the max-width:768px block below), stacking
   Name1 / & / Name2 so a long name is never wider than its own line. */
@media (min-width: 360px) {
    .hero-typography .title .hero-break {
        display: none;
    }
    /* Forces the name onto one line so a too-long combination measurably overflows
       (scrollWidth > clientWidth) instead of the browser quietly wrapping it to a
       second line — that measurable overflow is what script.js's auto-fit needs to
       detect the line is too long and shrink the font to compensate. */
    .hero-typography .title {
        white-space: nowrap;
    }
}

.title.medium {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-text);
}

.hero-typography .date {
    font-size: 1.6rem;
    letter-spacing: 8px;
    font-weight: 500;
    color: var(--color-text);
    text-shadow: 0 2px 10px rgba(255,255,255,0.8);
    margin-top: 3.5rem;
}

.hero-foreground {
    position: absolute;
    bottom: -2%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3; /* In front of typography */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hero-foreground img {

    max-height: 70vh;
    filter: drop-shadow(0 -10px 40px rgba(0,0,0,0.25));
    animation: fadeUp 1.5s ease-out 3s backwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections Common */
section {
    padding: 8rem 5%;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

/* Quote Section (Odd - #1) */
.quote-section {
    background: linear-gradient(180deg, #ffffff 0%, #f2eae0 100%);
}
.details {
    background: url('../img/wedding_hall_lemons.webp') center/cover no-repeat;
    position: relative;
    z-index: 1;
}

.details:not(.section-custom-bg)::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(253, 251, 247, 0.7);
    backdrop-filter: blur(8px);
    z-index: -1;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    font-weight: 400;
    color: var(--color-text);
}

/* Details Section */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    padding: 3.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    transition: var(--transition);
    border-top: 4px solid var(--color-accent);
    border: 1px solid rgba(255,255,255,0.6);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.12);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.card ul.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #555;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: center;
}

ul.details-list li {
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Map Section (Odd - #3) */
.location-map {
    background: linear-gradient(135deg, #f2eae0 0%, #ffffff 100%);
}

.map-container {
    max-width: 1000px;
    height: 450px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(229, 179, 19, 0.15);
    border: 4px solid var(--color-accent);
}

/* Accommodation Section */
.accommodation-section {
    background-color: #ffffff;
}

.acc-container {
    max-width: 900px;
    margin: 0 auto;
}



/* FAQ Section */
.wedding-party-section {
    padding: 5rem 5%;
    text-align: center;
    background-color: #ffffff;
}

.wedding-party-title {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.wedding-party-intro {
    max-width: 700px;
    margin: 0 auto 3rem auto;
    color: #444;
    font-size: 1.1rem;
    line-height: 1.6;
}

.wedding-party-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 3rem auto;
}

.wedding-party-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 260px;
    max-width: 300px;
}

.wedding-party-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eef3f7;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.wedding-party-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.wedding-party-desc {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .wedding-party-grid {
        gap: 2.5rem;
    }
}

.wedding-gifts-section {
    padding: 5rem 5%;
    text-align: center;
    background-color: #ffffff;
}

.wedding-gifts-title {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.wedding-gifts-intro {
    max-width: 700px;
    margin: 0 auto 3rem auto;
    color: #444;
    font-size: 1.1rem;
    line-height: 1.6;
}

.wedding-gifts-section .card h3.wedding-gifts-name {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card-icon-logo {
    max-width: 180px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.faq-section {
    padding: 5rem 5%;
    background: linear-gradient(rgba(251, 247, 240, 0.9), rgba(251, 247, 240, 0.9)), url('../img/table.webp') center / cover no-repeat;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.5rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: var(--color-accent);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-item.active .faq-question {
    color: var(--color-accent);
    padding-bottom: 0.5rem;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
}

/* RSVP Section */
/* RSVP Section (Odd - #5) */
.rsvp {
    background: linear-gradient(135deg, #f2eae0 0%, #ffffff 100%);
    text-align: left;
}

.rsvp .section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 3.5rem;
    line-height: 1.1;
}

.rsvp-content {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #e4eff8;
}

.rsvp p {
    font-size: 1.1rem;
    margin-bottom: .5rem;
    color: #555;
    font-weight: 300;
    text-align: center;
}

#rsvp-deadline-text {
    text-align: center;
}

.rsvp-subtitle {
    text-align: center;
    font-size: 0.95rem !important;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem !important;
    line-height: 1.6;
}

.rsvp-btn {
    padding: 1.2rem;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--color-accent) 0%, #d4a511 100%);
    color: #fff;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(229, 179, 19, 0.3);
    margin-top: 1rem;
}

.rsvp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(229, 179, 19, 0.4);
}

.btn-elegant {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    font-size: 1.05rem;
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #8F9779 0%, #757d5f 100%);
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
    font-weight: 500;
    box-shadow: 0 8px 15px rgba(143, 151, 121, 0.3);
}

.btn-elegant:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(143, 151, 121, 0.4);
    background: linear-gradient(135deg, #9ca683 0%, #7e8766 100%);
}

.btn-elegant:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(143, 151, 121, 0.3);
}

.btn-elegant:disabled {
    background: #cccccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}


/* Form Styles */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.form-group .form-label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
    text-align: left;
}

.form-group .form-label-small {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.form-group .form-help-text {
    font-size: 0.8rem;
    color: #888;
    text-align: left;
    margin-top: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #eef2f5;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 1rem;
    background-color: #fcfcfc;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(229, 179, 19, 0.1);
}

.form-row {
    display: flex;
    gap: 10px;
}
.form-col {
    flex: 1;
}

.allergy-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
.allergy-details.open {
    max-height: 220px;
    opacity: 1;
    margin-top: 14px;
}
.form-row input {
    flex: 1;
    margin-bottom: 0;
}

.pin-verification-group {
    background: #fffdf5;
    padding: 15px;
    border-radius: 12px;
    border: 1px dashed var(--color-accent);
}

.pin-verification-text {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #555;
    text-align: left;
}
.btn-check {
    padding: 0 1.5rem;
    background-color: var(--color-secondary);
    color: var(--color-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 600;
    transition: var(--transition);
}
.btn-check:hover {
    background-color: #dbe4ec;
}

.form-status {
    margin-top: 1rem;
    font-weight: 500;
    min-height: 24px;
}
.form-status.success { color: #2ecc71; }
.form-status.error { color: #e74c3c; }

.email-status {
    font-size: 0.9rem;
    margin-top: 0.8rem;
    text-align: left;
    display: none;
    font-weight: 500;
    padding: 12px 15px;
    border-radius: 8px;
    background: #fdfbf7;
    border-left: 4px solid var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.email-status.success {
    background: #f0fdf4;
    border-left-color: #2ecc71;
    color: #166534;
}
.email-status.warning {
    background: #fffaf0;
    border-left-color: #f39c12;
    color: #854d0e;
}
/* Footer */
footer {
    padding: 5rem 5%;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f2eae0 100%);
    position: relative;
    overflow: hidden;
}

.footer-msg {
    color: #888;
    margin-bottom: 1.5rem;
    font-weight: 300;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.footer-names {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--color-text);
    position: relative;
    z-index: 2;
    margin: 0;
}

.site-credit {
    position: relative;
    z-index: 2;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(44, 62, 80, 0.1);
}

.site-credit-invite {
    color: #999;
    font-size: 0.85rem;
    margin: 0 0 0.4rem 0;
}

.site-credit-invite a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.site-credit-invite a:hover {
    text-decoration: underline;
}

.site-credit-signature {
    color: #bbb;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #8F9779;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #78805f;
}
@media (max-width: 600px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}

/* Contact Section */
.contact-section {
    max-width: 800px;
    margin: 2rem auto 4rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: relative;
    z-index: 2;
}

.contact-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 2rem;
}

.contact-cards {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

@media (max-width: 600px) {
    .contact-card {
        min-width: 100%;
    }
}

.contact-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eef3f7;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.contact-name {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.contact-card p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #555;
}

.contact-card a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.contact-card a:hover {
    color: var(--color-accent);
}

.contact-apps {
    font-size: 0.85rem;
    color: #999;
}

/* Countdown */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}
.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.countdown-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--color-text);
    line-height: 1;
}
.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Our Story Section */
.our-story {
    width: 100%;
    padding: 6rem 5%;
    background: url('../img/school.webp') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    text-align: center;
}
.our-story:not(.section-custom-bg)::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(253, 251, 247, 0.35); /* Much more transparent to show photo */
    z-index: 0;
}
.our-story .section-title {
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}
.our-story .story-content {
    position: relative;
    z-index: 1;
}
.story-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--color-text);
    text-align: justify;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 3.5rem 4rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.story-content p {
    margin-bottom: 1.8rem;
    font-weight: 300;
}
.story-content p:last-child {
    margin-bottom: 0;
}
.story-content p:first-of-type::first-letter {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    color: var(--color-accent);
    float: left;
    margin-right: 0.8rem;
    line-height: 0.8;
    margin-top: 0.2rem;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.8);
}

.story-text-wrapper {
    max-height: 160px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
.story-text-wrapper.expanded {
    -webkit-mask-image: none;
    mask-image: none;
}
.story-read-more-container {
    text-align: center;
    margin-top: 1rem;
}
.btn-read-more {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 10px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-read-more:hover {
    background: var(--color-accent);
    color: #fff;
}

/* Details Section */
ul, ol {
    margin: 1rem 0 1rem 2rem;
    padding-left: 1rem;
    text-align: left;
}
li {
    margin-bottom: 0.5rem;
    text-align: left;
}
.card ul, .card ol,
.faq-answer ul, .faq-answer ol,
.acc-container ul, .acc-container ol {
    margin: 1rem 0 1rem 2.4rem;
    padding-left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .story-content {
        padding: 2.5rem 1.5rem;
        text-align: left;
        border-radius: 8px;
    }
    .title {
        font-size: 4rem;
        margin: 0.5rem 0;
    }
    .title.medium {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1.2rem;
    }
    .date {
        font-size: 1rem;
    }
    .hero-foreground {
        max-width: 100%;
        bottom: 0%;
    }
    .section-title {
        font-size: 2.5rem;
    }
    .cards-container {
        grid-template-columns: 1fr;
    }
    .countdown-number {
        font-size: 2.5rem;
    }
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .btn-check, #unlock-btn {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .section-title { font-size: 2.2rem; margin-bottom: 2.5rem; }
    .rsvp .section-title { font-size: 2rem; }
    .card h3 { font-size: 1.8rem; }
    .footer-names { font-size: 2rem; }
    
    .countdown-container { gap: 1.5rem; margin-bottom: 1.5rem; }
    .countdown-number { font-size: 2.5rem; }
    .countdown-label { font-size: 0.75rem; letter-spacing: 1px; }
    
    .hero-content { padding: 3rem 2rem; width: 90%; }
    .cards-container { gap: 2rem; }
    .card { width: 100%; }
    .hero-typography .title { font-size: 4rem;}
    .hero-foreground img {min-width: 100%; height: auto;}
    .hero-typography .date {font-size: 1.2rem;}
    .hero-typography .subtitle {font-size: 1.0rem;}
    .navbar { padding: 0rem 5%;}

    /* backdrop-filter on a position:fixed element forces a continuous blur
       recompute of whatever scrolls underneath it every frame — a well-known
       scroll-jank cause on weaker Android/Samsung GPUs. Desktop keeps the
       frosted look; mobile gets a plain semi-opaque bar instead. */
    .navbar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(253, 251, 247, 0.97);
    }

    /* Same backdrop-filter cost, multiplied by however many cards are on
       screen at once — drop the blur and compensate with a more opaque fill
       so the card still reads as solid instead of washed out. */
    .card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.88);
    }

    /* background-attachment: fixed is another classic mobile scroll-jank
       cause (forces the browser to repaint the background on every scroll
       frame instead of compositing it). Scroll behaves like a normal image. */
    .our-story {
        background-attachment: scroll;
    }
}
@media (min-width: 600px) and (max-width: 768px) {
  .hero-foreground img {
    min-width: 80%;
    height: auto;
  }
}

/* Short viewports (landscape phones/tablets, in any width bucket): the hero is exactly
   100vh tall, so the normal portrait-oriented spacing (15vh top margin, full-size
   title, photo capped only by width) doesn't leave enough room and everything
   overlaps. Compact it. Placed after the max-width:768px block above so it wins the
   cascade on small-and-short phones where both media queries are true at once. */
@media (max-height: 500px) {
    .hero-typography {
        /* The navbar is fixed (overlaid, not pushing content down) and ~40px tall;
           on a short viewport 5vh alone can be less than that, hiding the subtitle
           underneath it. max() guarantees the content always clears the navbar. */
        margin-top: max(64px, 5vh);
    }
    .hero-typography .subtitle {
        font-size: 0.75rem;
        letter-spacing: 3px;
        margin-bottom: 0.15rem;
    }
    .hero-typography .title {
        font-size: 2rem;
        margin: 0.15rem 0;
    }
    .hero-typography .date {
        font-size: 0.8rem;
        letter-spacing: 3px;
        margin-top: 0.6rem;
    }
    .hero-foreground img {
        max-height: 50vh;
    }
    
}

/* Narrow AND short (a small phone in landscape): the title still stacks as
   Name1 / & / Name2 here (three lines, see the min-width:769px block above), which
   takes much more vertical room than the single-line desktop case above, so it needs
   a smaller title and a shorter photo cap to still clear the date without overlapping. */
@media (max-width: 768px) {
    .hero-typography .title {
        font-size: 6.4rem;
    }
    .hero-foreground img {
        max-height: 60vh;
    }
}
@media (max-width: 359px) {
    .hero-typography .title {
        font-size: 3.4rem;
    }
    .hero-foreground img {
        max-height: 60vh;
    }
}

/* Admin-configurable section backgrounds: solid color, or an image (with adjustable opacity
   so the chosen color shows through underneath) and an optional frosted-glass blur.
   Two separate pseudo-elements are used because backdrop-filter blurs whatever is BEHIND
   the element it's applied to — it can never blur its own background-image. So the photo
   lives on ::before (z-index -2) and, when blur is on, ::after (z-index -1) sits directly
   in front of it with backdrop-filter, blurring the photo underneath. */
.section-custom-bg {
    position: relative;
    z-index: 1;
    background-color: var(--sbg-color, transparent);
    background-image: none; /* cancel out the section's own hardcoded photo/gradient */
}
.section-custom-bg > * {
    position: relative;
    z-index: 1;
}
.section-custom-bg.section-has-image::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: var(--sbg-image, none);
    background-size: cover;
    background-position: center;
    opacity: var(--sbg-opacity, 1);
    z-index: -2;
}
/* .hero-bg is absolutely positioned to fill the hero header; keep that instead of
   the relative positioning .section-custom-bg normally sets. */
.hero-bg.section-custom-bg {
    position: absolute;
}

.section-custom-bg.section-has-image.section-blur::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    backdrop-filter: blur(var(--sbg-blur, 8px));
    -webkit-backdrop-filter: blur(var(--sbg-blur, 8px));
    z-index: -1;
}

/* Renders images the admin aligned left/right/center in the rich-text editor (Story, Events,
   FAQ, Accommodation, Location descriptions, Wedding Party, Wedding Gifts). Since the
   CKEditor 5 → Tiptap migration, new content uses a plain <img data-align="left|right|center">
   (Tiptap's Image node has no figure wrapper) — these two rules are the current shape: */
.ck-content img {
    max-width: 100%;
    height: auto;
}
.ck-content img[data-align="left"] {
    float: left;
    margin: 10px 14px 10px 0;
}
.ck-content img[data-align="right"] {
    float: right;
    margin: 10px 0 10px 14px;
}
.ck-content img[data-align="center"] {
    display: block;
    margin: 0.9em auto;
}

/* Summernote (current editor, see wedding-page - v3.5b) marks a floated/centered image with
   its own "note-float-*" classes instead of data-align — same look, different attribute. */
.ck-content img.note-float-left {
    margin: 10px 14px 10px 0;
}
.ck-content img.note-float-right {
    margin: 10px 0 10px 14px;
}
.ck-content img.note-float-center {
    display: block;
    float: none;
    margin: 0.9em auto;
}

/* Backward compatibility: content saved under the old CKEditor 5 editor keeps ITS markup
   shapes (figure-wrapped, "-inline" variant, or bare img with these class names) — e.g.
   story.json currently has some. ".ck-content" was CKEditor's own documented class for
   this, kept as the shared container class for both editors' output. */
.ck-content .image {
    clear: both;
    text-align: center;
    min-width: 50px;
    margin: 0.9em auto;
    display: table;
    /* CKEditor's resize handle saves a literal inline width (e.g. style="width:400px") on
       this element. An inline style beats any external stylesheet rule regardless of
       specificity — !important is the only way to still cap it so a size picked for
       desktop can't overflow a narrower screen. */
    max-width: 100% !important;
}
.ck-content .image img {
    min-width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}
.ck-content .image.image-style-align-left {
    float: left;
    margin: 10px 14px 10px 0;
}
.ck-content .image.image-style-align-right {
    float: right;
    margin: 10px 0 10px 14px;
}
.ck-content .image.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
}
/* Fallback for images saved before the editor was locked to block-only images (some
   already-published content may still be the "inline" variant) — same float+wrap look. */
.ck-content .image-inline.image-style-align-left,
.ck-content .image-inline.image-style-align-right {
    max-width: 100%;
    height: auto;
}
.ck-content .image-inline.image-style-align-left {
    float: left;
    margin: 10px 14px 10px 0;
}
.ck-content .image-inline.image-style-align-right {
    float: right;
    margin: 10px 0 10px 14px;
}
/* Some already-saved content has the class on the bare <img> with no wrapper at all
   (older/inline downcast) — cover that shape directly too. A bare <img> never gets the
   figure wrapper's max-width/height:auto rule (that only applies to .image img), so its
   saved width="..."/height="..." attributes stay literal at any screen size unless we
   scale it here — otherwise it renders at a fixed pixel box that can overflow a narrow
   phone screen and get clipped by whatever contains it. */
.ck-content img.image-style-align-left,
.ck-content img.image-style-align-right {
    max-width: 100%;
    height: auto;
}
.ck-content img.image-style-align-left {
    float: left;
    margin: 10px 14px 10px 0;
}
.ck-content img.image-style-align-right {
    float: right;
    margin: 10px 0 10px 14px;
}
/* On narrow screens a floated, text-wrapped image usually just looks cramped —
   drop the float and let it sit full-width above/below the text instead. */
@media (max-width: 600px) {
    .ck-content img[data-align="left"],
    .ck-content img[data-align="right"],
    .ck-content .image.image-style-align-left,
    .ck-content .image.image-style-align-right,
    .ck-content .image-inline.image-style-align-left,
    .ck-content .image-inline.image-style-align-right,
    .ck-content img.image-style-align-left,
    .ck-content img.image-style-align-right {
        float: none;
        margin: 0.9em auto;
        min-width: 100%;
    }
    /* Summernote sets float as an inline style on the <img> itself (not just a class), so
       overriding it here needs !important — a plain rule can't beat an inline style. */
    .ck-content img.note-float-left,
    .ck-content img.note-float-right {
        float: none !important;
        margin: 0.9em auto;
        min-width: 100%;
    }
}