/* ---------- existing styles (unchanged) ---------- */
.infos-header {
    text-align: center;
    padding: 36px 18px 16px;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.infos-main {
    max-width: 1000px;
    margin: 26px auto;
    padding: 0 18px 80px;
    /* bottom padding so last section not covered by footer */
    display: grid;
    gap: 22px;
    grid-template-columns: 1fr;
}

.section {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.06);
}

.section h2 {
    margin: 0 0 10px;
    font-family: var(--mono);
}

.section p,
.section ul,
.section li {
    font-family: var(--grotesk);
    color: var(--muted);
    line-height: 1.5;
    font-size: 20px;
}

.section ul {
    margin: 6px 0 0 18px;
}

.map-frame {
    width: 100%;
    height: 360px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
    background: #e6e6e6;
}

.map-link {
    margin-top: 8px;
}

.map-link a {
    color: var(--text);
    font-family: var(--mono);
    text-decoration: underline;
}

:root {
    --bg: #fbf6ec;
    --pink: #F0C5BD;
    --accent: #f6d77a;
    --shadow: rgba(0, 0, 0, 0.25);
    --text: #231f20;
    --muted: #6a5f55;
    --drop: #9c8e5d;
    --card-bg: #fff7e6;
    --button-bg-hover: #fff6e6;
    --button-bg: #FFF4D4;
    --rounded: 12px;
    --mono: "Space Mono", monospace;
    --grotesk: "Space Grotesk", sans-serif;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--grotesk);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ensure content isn't hidden behind fixed footer */
body {
    padding-bottom: calc(var(--footer-height) + 20px);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 42px;
    padding: 15px 28px 0;
}

/* Header */
.masthead {
    text-align: center;
}

.title {
    font-family: var(--mono);
    font-size: 42px;
    letter-spacing: 1px;
    margin: 0;
}

.subtitle {
    font-family: var(--mono);
    font-size: 30px;
    margin: 0;
}

.subsubtitle {
    font-family: var(--mono);
    font-size: 20px;
    margin: 0;
    margin-bottom: 15px;
}

/* Hero: flowers + photo band */
.hero {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    position: relative;
    margin-top: 8px;
    min-height: 170px;
}

/* Photo strip: much wider, thin vertical padding, polaroids overlap */
.photo-strip {
    background: var(--pink);
    padding: 8px 80px;
    /* thin vertical padding; wide horizontal padding */
    border-radius: 18px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 1200px;
    width: 86%;
    min-width: 480px;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* flower images positioned absolutely relative to hero */
.flower {
    position: absolute;
    width: 78px;
    height: auto;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}

.flower-left {
    margin-top: 10px;
    width: 220px;
    height: auto;
    left: calc((100% - 88%)/2 - 56px);
    /* align outside left of strip */
    transform: scaleX(-1) rotate(10deg) translateY(40px);
}

.flower-right {
    width: 220px;
    height: auto;
    right: calc((100% - 88%)/2 - 56px);
    /* align outside right of strip */
    transform: rotate(10deg) translateY(40px);
}

/* Polaroids should be larger than the strip and overlap visually */
.polaroid {
    width: 240px;
    background: #fff;
    padding: 10px 10px 16px;
    border-radius: 6px;
    transform-origin: center bottom;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.20);
    position: relative;
    margin-top: -36px;
    /* lift polaroids so they overlap top of strip */
}

.polaroid img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 4px;
}

.polaroid-caption {
    margin-top: 8px;
    height: 15px;
    font-size: 12px;
    text-align: center;
    font-family: var(--mono);
}

/* rotation for vintage look */
.polaroid-1 {
    transform: rotate(-9deg);
    z-index: 2;
}

.polaroid-2 {
    transform: rotate(7deg);
    margin-left: -32px;
    z-index: 1;
}

/* Countdown card */
.countdown-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.countdown-card {
    margin-top: 30px;
    background: var(--accent);
    width: 360px;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.countdown-title {
    font-family: var(--mono);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 20px;
}

.countdown-display {
    background: #fff;
    border-radius: 8px;
    padding: 14px 20px;
    font-family: var(--mono);
    font-size: 18px;
    color: var(--text);
    box-shadow: 6px 6px 0 var(--drop);
}

/* Controls */
.controls {
    width: 100%;
    margin-top: 30px;
    max-width: 920px;
    background: var(--pink);
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.btn {
    min-width: 150px;
    padding: 8px 8px;
    border-radius: 10px;
    border: none;
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 1px;
    font-weight: bold;
    background: var(--button-bg);
    box-shadow: 8px 8px 0 var(--drop);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 6px 6px 0 var(--drop);
}

.btn:hover {
    background: var(--button-bg-hover);
}

/* Footer fixed to bottom and full width */
.page-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: left;
    background: var(--accent);
    z-index: 40;
    padding: 12px 18px;
}

.footer-inner {
    max-width: 1200px;
    width: 86%;
    border-radius: 8px;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 12px;
}

/* Modal / Backdrop: use class .open to show */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 90%;
    max-width: 560px;
    background: #fff;
    border-radius: 12px;
    font-size: 20px;
    padding: 18px 22px;
    position: relative;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    max-height: 80vh;
    overflow: auto;
    transform: translateY(6px);
    transition: transform .18s ease;
}

.modal-backdrop.open .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    z-index: 130;
}

#modalTitle {
    font-family: var(--mono);
    margin: 0 0 12px 0;
}

/* simple form styling inside modal */
.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.form-row label {
    font-family: var(--mono);
    font-size: 18px;
    min-width: 100px;
}

.form-row input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    background-color: #fbf6ec;
    border: 0px solid var(--muted);
    font-family: inherit;
    font-size: 18px;
}

/* gift list */
.gift-list {
    display: grid;
    gap: 8px;
}

.gift-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 8px;
    background: #fbf6ec;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.04);
    font-family: var(--mono);
}

/* responsive small screens adjustments */
@media (max-width:920px) {
    .photo-strip {
        width: 92%;
        padding: 8px 36px;
    }

    .flower-left,
    .flower-right {
        display: none;
    }

    .polaroid {
        width: 150px;
        margin-top: -28px;
    }

    .polaroid img {
        height: 140px;
    }

    .polaroid-caption {
        height: 5px;
    }

    .countdown-card {
        margin-top: 10px;
    }

    .controls {
        margin-top: 10px;
        flex-direction: column;
        align-items: center;
        padding: 14px;
    }

    .btn {
        min-width: 220px;
        font-size: 15px;
    }

    .modal {
        font-size: 18px;
    }

    .form-row label {
        font-size: 14px;
    }

    .form-row input[type="text"] {
        font-size: 14px;
    }

    .footer-inner {
        width: 80%;
    }
}

@media (max-width:520px) {
    .photo-strip {
        padding: 6px 18px;
        min-width: 0;
        width: 96%;
    }

    .polaroid {
        width: 132px;
        margin-top: -20px;
    }

    .polaroid img {
        height: 120px;
    }

    .flower-left,
    .flower-right {
        display: none;
    }

    .title {
        font-size: 37px;
    }

    .modal {
        font-size: 18px;
    }

    .form-row label {
        font-size: 14px;
        min-width: 100px;
    }

    .form-row input[type="text"] {
        font-size: 14px;
    }

    .subtitle {
        font-size: 25px;
    }

    .subsubtitle {
        font-size: 18px;
    }
    
}

@media (min-width:880px) {
    .infos-main {
        grid-template-columns: 1fr 520px;
        grid-auto-rows: min-content;
    }

    .map {
        grid-column: 1 / 3;
    }
}

@media (max-width:520px) {
    .map-frame {
        height: 220px;
    }

    .title {
        font-size: 26px;
    }

    .subtitle {
        font-size: 14px;
    }
}

.infos-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.infos-container.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-main-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 100px); /* always visible near the top */
    right: 380px;
    left: auto;
    z-index: 9999; /* above maps/iframes/modals */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 36px;
    background: var(--button-bg);
    box-shadow: 6px 6px 0 var(--drop);
    cursor: pointer;
    transition: transform .14s ease, opacity .12s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(.98);
    -webkit-text-fill-color: var(--text);
    color:var(--test);
    -webkit-text-size-adjust: 100%; 
}

/* visible state toggled by JS: .visible */
.back-to-main-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.back-to-main-btn.visible:hover {
}
 
/* slightly smaller on very small screens */
@media (max-width:420px) {
    .back-to-main-btn {
        width: 58px;
        height: 58px;
        font-size: 25px;
        right: 25px;
    }
    .back-to-main-btn.visible {
        opacity: 1;
    }
}

@media (max-width:1800px) {
    .back-to-main-btn {
      right:25px;
    }
}

.back-to-main-btn:active {
    transform: translateY(2px);
    box-shadow: 4px 4px 0 var(--drop);
}
