body { background-color: #f9f7f0; font-family: 'Inter', sans-serif; }

/* Navbar */
.navbar { background-color: #0a2a6e !important; border-bottom: 3px solid #ffd700; }
.navbar-brand { color: #fff !important; font-family: 'Dancing Script', cursive; font-size: 1.4rem; }
.navbar-brand:hover { color: #ffd700 !important; }

/* Bootstrap overrides */
.btn-primary { background-color: #ffd700; border-color: #ffd700; color: #0a2a6e; font-weight: 600; }
.btn-primary:hover, .btn-primary:focus { background-color: #e6c200; border-color: #e6c200; color: #0a2a6e; }

/* CTA pill button */
.btn-cta {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background-color: #ffd700; border: none; color: #0a2a6e;
    font-weight: 700; font-size: 1.05rem;
    padding: 0.7rem 2rem; border-radius: 50px;
    box-shadow: 0 4px 14px rgba(255,215,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
    text-decoration: none;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,215,0,0.55); background-color: #e6c200; color: #0a2a6e; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 3.5rem 1rem 2.5rem; text-align: center; background: #fafaf7; }
.hero-congrats { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 700; color: #0a2a6e; margin-bottom: 0; line-height: 1.1; }
.hero-names { font-family: 'Dancing Script', cursive; font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 700; color: #ffd700; line-height: 1.2; margin-bottom: 0.75rem; text-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.hero-subtitle { color: #777; font-size: 1.05rem; margin-bottom: 1.75rem; }

/* Balloons */
.balloon-wrap { position: absolute; pointer-events: none; z-index: 1; }
.balloon-wrap.b-left { left: 4%; top: 4%; }
.balloon-wrap.b-right { right: 4%; top: 6%; }
.balloon-svg { width: 96px; height: auto; display: block; filter: drop-shadow(2px 4px 5px rgba(0,0,0,0.18)); }
@media (max-width: 700px) { .balloon-wrap { display: none; } }

/* Confetti dashes */
.dash { position: absolute; border-radius: 2px; opacity: 0.4; }

/* Section header */
.section-header { text-align: center; padding: 2rem 0 1.5rem; }
.section-rule { display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: #0a2a6e; margin-bottom: 0.4rem; font-size: 0.85rem; }
.section-rule::before, .section-rule::after { content: ''; flex: 0 0 50px; height: 1px; background: #ccc; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.7rem; color: #0a2a6e; margin-bottom: 0.2rem; }
.section-subtitle { color: #999; font-size: 0.93rem; }

/* Polaroid grid */
.polaroid-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.5rem; padding: 0.5rem 0 2rem; }
@media (max-width: 991px) { .polaroid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .polaroid-grid { grid-template-columns: minmax(0, 1fr); } }

/* Polaroid card */
.polaroid { background: #fff; padding: 10px 10px 34px; box-shadow: 2px 4px 16px rgba(0,0,0,0.1); position: relative; transition: transform 0.2s, box-shadow 0.2s; transform: rotate(var(--tilt, -2deg)); }
.polaroid:hover { transform: rotate(0deg) scale(1.03) !important; z-index: 10; box-shadow: 4px 8px 28px rgba(0,0,0,0.15); }
/* Tape strip */
.polaroid::before { content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 44px; height: 16px; background: rgba(255,215,0,0.5); border-radius: 2px; }

.polaroid-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; margin-bottom: 10px; }
.polaroid-message { font-family: 'Caveat', cursive; font-size: 1.05rem; color: #333; line-height: 1.4; overflow-wrap: break-word; margin-bottom: 6px; }
.polaroid-message > *:last-child { margin-bottom: 0; }
.polaroid-message p { margin-bottom: 3px; }
.polaroid-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.polaroid-sender { font-family: 'Caveat', cursive; color: #666; font-size: 0.95rem; }
.polaroid-icon-heart { color: #e74c6c; }
.polaroid-icon-star { color: #ffd700; }

/* Tagline */
.page-tagline { text-align: center; padding: 1rem 0 2.5rem; }
.tagline-text { font-family: 'Dancing Script', cursive; font-size: 1.6rem; color: #0a2a6e; display: inline-block; }
.tagline-text::after { content: ''; display: block; height: 2px; background: #ffd700; margin-top: 4px; border-radius: 2px; }

/* Footer */
footer { background-color: #0a2a6e !important; border-top: none !important; }
footer small { color: rgba(255,255,255,0.55) !important; }

/* Watercolor spots */
.watercolor {
    position: absolute;
    border-radius: 50%;
    filter: blur(28px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

/* On mobile, two of the four splotches overlap badly — hide the diagonal pair that crowds the hero */
@media (max-width: 700px) {
    .splotch-tr, .splotch-bl { display: none; }
}

/* Admin / shared utils */
.message-body > *:last-child { margin-bottom: 0; }
.text-pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* Nav wall link */
.nav-wall-link {
    color: rgba(255,255,255,0.78); text-decoration: none;
    font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.25); padding: 0.3rem 0.85rem;
    border-radius: 999px; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.nav-wall-link:hover { color: #0a2a6e; background-color: #ffd700; border-color: #ffd700; }

/* Tribute layout */
.tribute-row { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; padding: 2rem 0; }
.tribute-row-reverse { grid-template-columns: 1fr 280px; }
.tribute-row-reverse .polaroid-tribute { grid-column: 2; grid-row: 1; }
.tribute-row-reverse .sticky-stack { grid-column: 1; grid-row: 1; }
@media (max-width: 700px) {
    .tribute-row, .tribute-row-reverse { grid-template-columns: 1fr; gap: 1.5rem; }
    .tribute-row-reverse .polaroid-tribute, .tribute-row-reverse .sticky-stack { grid-column: 1; grid-row: auto; }
}

.tribute-section-header { text-align: center; padding: 2.5rem 0 0.5rem; }
.tribute-name { font-family: 'Playfair Display', serif; font-size: 2rem; color: #0a2a6e; margin-bottom: 0.15rem; }
.tribute-years { font-family: 'Dancing Script', cursive; font-size: 1.3rem; color: #c8a800; margin-bottom: 0; }

/* Polaroid for tribute (placeholder photo) */
.polaroid-tribute { background: #fff; padding: 10px 10px 38px; box-shadow: 2px 4px 16px rgba(0,0,0,0.12); transform: rotate(var(--tilt, -2deg)); position: relative; }
.polaroid-tribute::before { content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 44px; height: 16px; background: rgba(255,215,0,0.5); border-radius: 2px; }
.polaroid-photo-tribute { aspect-ratio: 4/5; width: 100%; object-fit: cover; display: block; margin-bottom: 10px; }

/* Polaroid stack — click to cycle through photos */
.polaroid-stack { position: relative; width: 100%; aspect-ratio: 1 / 1.55; min-height: 425px; cursor: pointer; user-select: none; }
.polaroid-stack .polaroid-tribute {
    position: absolute; top: 0; left: 0; right: 0; margin: 0;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.5s ease, box-shadow 0.25s ease;
}
.polaroid-stack .polaroid-tribute:nth-child(1) { z-index: 4; transform: rotate(var(--tilt, -2deg)); }
.polaroid-stack .polaroid-tribute:nth-child(2) { z-index: 3; transform: rotate(var(--tilt, 2deg)) translate(8px, 6px); }
.polaroid-stack .polaroid-tribute:nth-child(3) { z-index: 2; transform: rotate(var(--tilt, -2deg)) translate(-8px, 12px); }
.polaroid-stack .polaroid-tribute:nth-child(4) { z-index: 1; transform: rotate(var(--tilt, 2deg)) translate(6px, 18px); }
.polaroid-stack:hover .polaroid-tribute:nth-child(1) { box-shadow: 4px 8px 26px rgba(0,0,0,0.2); }
.polaroid-stack .polaroid-tribute.falling {
    transform: translate(0, 520px) rotate(-30deg) !important;
    opacity: 0;
    z-index: 5 !important;
}
.polaroid-stack .polaroid-tribute.no-transition { transition: none !important; }

/* Message stack (wall page) — same-size cards, polaroid or sticky on top, stickies behind for overflow */
.message-stack { aspect-ratio: 1 / 1.2; min-height: 280px; }
.message-stack > .message-card {
    position: absolute; top: 0; left: 0; right: 0; height: 100%; margin: 0;
    display: flex; flex-direction: column; box-sizing: border-box;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.5s ease, box-shadow 0.25s ease;
}
.message-stack > .message-card:nth-child(1) { z-index: 4; transform: rotate(var(--tilt, -2deg)); }
.message-stack > .message-card:nth-child(2) { z-index: 3; transform: rotate(var(--tilt, 2deg)) translate(8px, 6px); }
.message-stack > .message-card:nth-child(3) { z-index: 2; transform: rotate(var(--tilt, -2deg)) translate(-8px, 12px); }
.message-stack > .message-card:nth-child(4) { z-index: 1; transform: rotate(var(--tilt, 2deg)) translate(6px, 18px); }
.message-stack > .message-card:nth-child(n+5) { z-index: 0; transform: rotate(var(--tilt, -2deg)) translate(4px, 22px); }
.message-stack:hover > .message-card:nth-child(1) { box-shadow: 4px 8px 26px rgba(0,0,0,0.18); }
.message-stack > .message-card.falling {
    transform: translate(0, 520px) rotate(-30deg) !important;
    opacity: 0; z-index: 5 !important;
}
.message-stack > .message-card.no-transition { transition: none !important; }

/* Polaroid variant */
.message-polaroid {
    background: #fff; padding: 8px 8px 6px; position: relative;
    box-shadow: 2px 4px 16px rgba(0,0,0,0.12);
}
.message-polaroid::before {
    content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 16px; background: rgba(255,215,0,0.5); border-radius: 2px;
}
.message-photo-frame {
    width: 100%; aspect-ratio: 1/1; margin-bottom: 2px; flex-shrink: 0;
    background: linear-gradient(135deg, #ede8da 0%, #e3ddc8 100%);
    overflow: hidden;
}
.message-photo {
    width: 100%; height: 100%; object-fit: cover; display: block;
    opacity: 0; transition: opacity 0.35s ease;
}
.message-photo.loaded { opacity: 1; }
.message-photo-caption {
    flex: 0 0 auto;
    font-family: 'Caveat', cursive; font-size: 0.95rem; line-height: 1.05;
    color: #444; text-align: center;
    padding: 0 4px;
    overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Sticky variants on wall */
.message-sticky-front, .message-sticky-overflow {
    background: linear-gradient(180deg, #fff4a3 0%, #ffeb70 100%);
    padding: 0.9rem 0.9rem 0.85rem; position: relative;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.12);
}
.message-sticky-front::before, .message-sticky-overflow::before {
    content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 14px; background: rgba(0,0,0,0.08); border-radius: 1px;
}

/* Shared content area */
.message-card .message-content {
    flex: 1 1 auto; overflow: hidden; min-height: 0;
    font-family: 'Caveat', cursive; font-size: 1.02rem; line-height: 1.35; color: #2a2a2a;
    word-break: break-word;
}
.message-card .message-content > *:first-child { margin-top: 0; }
.message-card .message-content > *:last-child { margin-bottom: 0; }
.message-card .message-content p { margin-bottom: 0.4rem; }

/* Footer (sender + icon) only on front card */
.message-card .message-footer {
    flex-shrink: 0; display: flex; justify-content: space-between; align-items: flex-end;
    padding-top: 0;
}
.message-card .message-sender { font-family: 'Caveat', cursive; color: #666; font-size: 0.9rem; line-height: 1.1; }
.message-card .message-icon-heart { color: #e74c6c; font-size: 1.05rem; }
.message-card .message-icon-star  { color: #ffd700; font-size: 1.1rem; }

.placeholder-photo {
    width: 100%; aspect-ratio: 4/5;
    background: repeating-linear-gradient(45deg, #e8e4d8, #e8e4d8 10px, #ddd9cc 10px, #ddd9cc 20px);
    display: flex; align-items: center; justify-content: center;
    color: #888; font-family: 'Caveat', cursive; font-size: 1rem; text-align: center; padding: 1rem;
    margin-bottom: 10px;
}
.polaroid-caption { font-family: 'Caveat', cursive; font-size: 1.4rem; color: #444; text-align: center; }

/* Sliding-window image loading: stack cards beyond the front N are rendered with
   data-src only (no src), so they don't occupy decoded bitmap memory. Hide the
   empty <img> so the browser's broken-image fallback never shows. */
img[data-src]:not([src]) { visibility: hidden; }

/* Sticky notes */
.sticky-stack { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 0.5rem; }
.sticky-note {
    font-family: 'Caveat', cursive; font-size: 1.25rem; line-height: 1.45; color: #2a2a2a;
    padding: 1.5rem 1.4rem 1.4rem; box-shadow: 2px 3px 10px rgba(0,0,0,0.12);
    position: relative; transition: transform 0.2s, box-shadow 0.2s;
    transform: rotate(var(--tilt, -2deg));
}
.sticky-note:hover { transform: rotate(0deg) scale(1.015); box-shadow: 3px 6px 16px rgba(0,0,0,0.16); }
.sticky-note::before {
    content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 14px; background: rgba(0,0,0,0.08); border-radius: 1px;
}
.sticky-note p { margin-bottom: 0.5rem; }
.sticky-note p:last-child { margin-bottom: 0; }

.sticky-yellow { background: linear-gradient(180deg, #fff4a3 0%, #ffeb70 100%); }
.sticky-blue   { background: linear-gradient(180deg, #c6e4f5 0%, #a8d4ec 100%); }
.sticky-pink   { background: linear-gradient(180deg, #ffd6e0 0%, #ffbccc 100%); }
.sticky-quote  { background: linear-gradient(180deg, #f5f0e1 0%, #e8e0c8 100%); font-style: italic; }
.sticky-attribution { font-style: normal; text-align: right; font-size: 1.05rem; color: #555; margin-top: 0.4rem; }

/* Tribute CTA */
.tribute-cta { text-align: center; padding: 3rem 1rem 4rem; }
.tribute-cta-text { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: #0a2a6e; margin-bottom: 1.5rem; max-width: 540px; margin-left: auto; margin-right: auto; }
.tribute-cta-secondary { margin-top: 1rem; margin-bottom: 0; }
.link-subtle { color: #999; font-size: 0.92rem; text-decoration: none; border-bottom: 1px dotted #bbb; }
.link-subtle:hover { color: #0a2a6e; border-bottom-color: #0a2a6e; }
