/* --- Base & Mobile First Setup --- */
:root {
    --royal-blue: #0B1B3D;
    --royal-blue-deep: #061024;
    --panel-bg: rgba(255, 255, 255, 0.045);
    --panel-border: rgba(212, 175, 55, 0.28);
    --text-main: #F5EFE0;
    --text-light: rgba(245, 239, 224, 0.72);
    --gold-solid: #D4AF37;
    --gold-grad: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    /* gap between the viewport edge and the 480px column, for fixed controls */
    --side: max(0px, calc((100vw - 480px) / 2));
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--royal-blue);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--royal-blue);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

/* Islamic girih pattern watermark — tiled, very low opacity, sits under all content */
.app-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/sunnat_1/wallpaper.png');
    background-repeat: repeat;
    background-size: 200px;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 480px) {
    .app-container::before {
        background-size: 130px;
    }
}

.app-container > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
h3,
.serif {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    color: var(--text-main);
}

/* ===== Language Switcher ===== */
.lang-switcher {
    position: fixed;
    top: 12px;
    left: calc(var(--side) + 12px);
    z-index: 1000;
    display: flex;
    background: rgba(11, 27, 61, 0.85);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

.lang-btn.active {
    background: var(--gold-grad);
    color: var(--royal-blue-deep);
}

/* ===== Preloader ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--royal-blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-icon {
    width: 72px;
    height: 72px;
    opacity: 0.9;
    animation: preloaderPulse 1.6s ease-in-out infinite;
}

.preloader-hint {
    margin-top: 18px;
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-light);
}

@keyframes preloaderPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
}

/* --- Hero Section --- */
.hero {
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 70px 24px 20px;
    overflow: hidden;
    text-align: center;
}

.hero-watermark-horse {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    max-width: 130%;
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
}

.hero-greeting {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.doppi-icon {
    position: relative;
    z-index: 2;
    width: 84px;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 10px rgba(212, 175, 55, 0.35));
}

#child-name {
    position: relative;
    z-index: 2;
    font-size: 3rem;
    margin: 0 0 26px;
    letter-spacing: 1px;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 30px rgba(212, 175, 55, 0.25);
}

/* --- Golden Arch Photo Frame --- */
.arch-photo-frame {
    position: relative;
    z-index: 2;
    width: 240px;
    height: 288px;
    margin: 0 auto 20px;
}

.arch-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    clip-path: path('M2.4,285.6 L2.4,96 A117.6,117.6 0 0 1 237.6,96 L237.6,285.6 Z');
    background: var(--royal-blue-deep);
}

.arch-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 4px 10px rgba(212, 175, 55, 0.3));
}

.scroll-hint {
    position: relative;
    z-index: 2;
    color: var(--text-light);
    font-size: 0.68rem;
    letter-spacing: 3px;
    margin-top: 10px;
    text-transform: uppercase;
}

.scroll-hint::after {
    content: '';
    display: block;
    width: 1px;
    height: 26px;
    background: var(--gold-solid);
    opacity: 0.6;
    margin: 10px auto 0;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.25; transform: scaleY(0.8); }
    50% { opacity: 0.8; transform: scaleY(1); }
}

/* --- Bow & Arrow Divider --- */
.bow-divider {
    display: block;
    width: 68%;
    max-width: 260px;
    margin: 12px auto 28px;
    opacity: 0.9;
}

/* --- Global Section Styling --- */
.section {
    padding: 50px 28px;
    text-align: center;
}

.section h2 {
    font-size: 1.9rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

/* :where() keeps this default at element-level specificity, so classed text
   (table badge, performer cards, programma, menu) keeps its own size and colour */
:where(.section) p {
    font-size: 0.85rem;
    line-height: 1.85;
    color: var(--text-light);
}

.section-photo {
    width: 100%;
    display: block;
    border-radius: 6px;
    margin: 22px 0;
    object-fit: contain;
    max-height: 520px;
    background: var(--royal-blue-deep);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--panel-border);
}

.signature {
    margin-top: 26px;
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.signature .cursive {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.7rem;
    color: var(--gold-solid);
    display: block;
    margin-top: 8px;
}

.photo-caption {
    margin: 22px 0 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
}

/* --- Countdown Timer --- */
.countdown {
    display: flex;
    justify-content: space-between;
    margin: 26px 0;
    padding: 22px 0;
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
}

.time-box {
    text-align: center;
    width: 22%;
}

.time-box span {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    color: var(--gold-solid);
}

.time-box p {
    font-size: 0.58rem;
    margin: 5px 0 0;
    letter-spacing: 1.5px;
    color: var(--text-light);
}

/* initCountdown swaps the boxes for a single <h3> once the date has passed */
.countdown h3 {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 1.5rem;
    color: var(--gold-solid);
}

.countdown-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-light);
    margin: 0 0 4px;
}

.wedding-date {
    font-size: 2.2rem;
    margin: 0 0 8px;
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
    color: var(--gold-solid);
}

/* --- Event Sections --- */
[data-event] { display: none; }

.event-eyebrow {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-light);
    margin: 0.2rem 0 1rem;
}

.event-meta {
    margin: 1.1rem auto 0;
    max-width: 300px;
    text-align: left;
}

.event-meta-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    font-size: 0.88rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--panel-border);
}

.event-meta-row:last-child { border-bottom: none; }

/* --- Venue --- */
.venue-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--gold-solid);
    font-style: italic;
}

.start-time {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--panel-border);
}

.start-time p {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.start-time .time-display {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    color: var(--gold-solid);
    margin: 8px 0;
    display: block;
}

/* --- Buttons --- */
/* Stacked at equal width: the pair never fits side by side on a phone */
.btn {
    display: block;
    box-sizing: border-box;
    width: min(100%, 270px);
    margin: 18px auto 0;
    text-align: center;
    padding: 13px 26px;
    border: none;
    border-radius: 999px;
    background: var(--gold-grad);
    color: var(--royal-blue-deep);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn + .btn { margin-top: 12px; }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold-solid);
    color: var(--gold-solid);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* --- Programma / Timeline --- */
.schedule-list {
    list-style: none;
    padding: 0;
    margin: 26px auto 0;
    max-width: 320px;
    text-align: left;
}

.schedule-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 14px;
    align-items: start;
    padding: 0 0 24px;
    position: relative;
}

.schedule-item:last-child { padding-bottom: 0; }

.tl-icon {
    width: 34px;
    height: 34px;
    grid-row: span 2;
}

.schedule-time {
    grid-column: 2;
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-solid);
    margin-bottom: 2px;
}

.schedule-title {
    grid-column: 2;
    font-family: 'Playfair Display', serif;
    font-size: 1.02rem;
    margin: 0 0 4px;
    color: var(--text-main);
}

.schedule-desc {
    grid-column: 2;
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.55;
}

/* --- Gallery / Carousel --- */
.carousel {
    width: 100%;
    overflow: hidden;
    padding: 24px 0 10px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 6%, black 94%, transparent 100%);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.carousel-track {
    display: flex;
    gap: 14px;
    width: max-content;
    animation: marquee 36s linear infinite;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.carousel:hover .carousel-track {
    animation-play-state: paused;
}

.carousel-track img {
    height: 220px;
    width: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--panel-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --- Performers Section --- */
.performer-list {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.performer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel-bg);
}

.performer-photo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid var(--gold-solid);
    margin-bottom: 10px;
}

.performer-time {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--gold-solid);
    margin-bottom: 6px;
}

.performer-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0 0 6px;
    color: var(--text-main);
}

.performer-role {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin: 0;
}

/* --- Menu Section --- */
.menu-list {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.menu-card {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-bg);
}

.menu-card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.menu-card-body {
    padding: 12px 14px;
    border-top: 2px solid var(--gold-solid);
}

.menu-card-name {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--text-main);
}

/* --- Table Badge --- */
.table-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 auto 30px;
    max-width: 240px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1rem 1.6rem;
}

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

.table-badge-label {
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--text-light);
    margin: 0;
}

.table-badge-number {
    font-size: 1.6rem;
    font-family: 'Playfair Display', serif;
    color: var(--gold-solid);
    margin: 2px 0 0;
    line-height: 1.2;
}

/* --- RSVP Form --- */
#rsvp-form {
    text-align: left;
    margin-top: 26px;
}

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin-bottom: 10px;
}

#rsvp-form input[type="text"],
#rsvp-form textarea,
#rsvp-form select {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    background: var(--panel-bg);
    color: var(--text-main);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}

#rsvp-form input::placeholder,
#rsvp-form textarea::placeholder {
    color: var(--text-light);
}

#rsvp-form input[type="text"]:focus,
#rsvp-form textarea:focus,
#rsvp-form select:focus {
    outline: none;
    border-color: var(--gold-solid);
}

#rsvp-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Attending yes/no as two large gold pill buttons */
.radio-group {
    display: flex;
    gap: 12px;
}

.radio-option {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
    color: var(--text-light);
    background: var(--panel-bg);
}

.radio-option:has(input:checked) {
    border-color: transparent;
    background: var(--gold-grad);
    color: var(--royal-blue-deep);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

/* Visually hidden but still focusable, so the choice works from a keyboard */
.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.radio-option:has(input:focus-visible) {
    outline: 2px solid var(--gold-solid);
    outline-offset: 2px;
}

#companions-group { display: none; }

.btn-submit {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--gold-grad);
    border: none;
    border-radius: 999px;
    color: var(--royal-blue-deep);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.btn-submit:hover { transform: translateY(-1px); }

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#rsvp-success { text-align: center; }

/* --- Footer --- */
.footer-logo {
    text-align: center;
    margin-bottom: 16px;
}

/* the shared logo is dark grey; turn it ivory so it reads on royal blue */
.footer-logo img {
    filter: brightness(0) invert(0.95) sepia(0.2);
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0;
}

.icon-circle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold-solid);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.icon-circle:hover {
    background: var(--gold-grad);
    color: var(--royal-blue-deep);
    border-color: transparent;
}

/* --- Music Player --- */
.music-player {
    position: fixed;
    bottom: 22px;
    right: calc(var(--side) + 22px);
    z-index: 9999;
    width: 48px;
    height: 48px;
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    background: rgba(11, 27, 61, 0.9);
    color: var(--gold-solid);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.music-player:hover {
    background: var(--gold-grad);
    color: var(--royal-blue-deep);
    transform: scale(1.05);
}

/* --- AOS Overrides --- */
[data-aos] {
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

[data-aos="fade-up"] {
    transform: translate3d(0, 30px, 0) !important;
}

[data-aos="fade-up"].aos-animate {
    transform: translate3d(0, 0, 0) !important;
}
