/**
 * Shared styling for invitation template sections (countdown, RSVP,
 * congratulations, memory game). Templates set their palette through
 * CSS custom properties; the markup lives in resources/views/partials/*.
 *
 * Required variables (define on :root or a wrapper in each template):
 *   --wi-accent        main accent (buttons, headings)
 *   --wi-accent-2      secondary accent / gradient end
 *   --wi-on-accent     text colour placed on top of the accent
 *   --wi-ink           primary text colour
 *   --wi-muted         muted/secondary text colour
 *   --wi-card          card background
 *   --wi-card-border   card border colour
 *   --wi-field-bg      form field background
 *   --wi-radius        card corner radius (e.g. 1.5rem)
 */

/* never let a stray wide element create horizontal scroll / shift the layout */
html, body { overflow-x: hidden; max-width: 100%; }

.wi-card {
    background: var(--wi-card);
    border: 1px solid var(--wi-card-border);
    border-radius: var(--wi-radius, 1.5rem);
}

.wi-title {
    color: var(--wi-accent);
}

.wi-muted {
    color: var(--wi-muted);
}

/* ----- countdown ----- */
.wi-count {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.wi-count-box {
    background: var(--wi-card);
    border: 1px solid var(--wi-card-border);
    border-radius: 1rem;
    padding: 1rem 0;
    text-align: center;
}

.wi-count-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wi-accent);
}

.wi-count-label {
    font-size: 0.7rem;
    margin-top: 0.4rem;
    color: var(--wi-muted);
}

/* ----- forms ----- */
.wi-input {
    width: 100%;
    background: var(--wi-field-bg);
    border: 1px solid var(--wi-card-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--wi-ink);
    outline: none;
    transition: border-color 0.2s ease;
}

.wi-input::placeholder { color: var(--wi-muted); opacity: 0.8; }
.wi-input:focus { border-color: var(--wi-accent); }

textarea.wi-input { min-height: 7rem; resize: vertical; }

.wi-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    color: var(--wi-on-accent);
    background: linear-gradient(to right, var(--wi-accent), var(--wi-accent-2, var(--wi-accent)));
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.wi-btn:hover { transform: translateY(-2px); opacity: 0.95; }
.wi-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.wi-toggle {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--wi-card-border);
    background: var(--wi-field-bg);
    color: var(--wi-muted);
    transition: all 0.2s ease;
    cursor: pointer;
}

.wi-toggle.is-yes { background: var(--wi-accent); color: var(--wi-on-accent); border-color: transparent; }
.wi-toggle.is-no  { background: #7f1d1d; color: #fff; border-color: transparent; }

/* success overlay inside a relative card */
.wi-overlay {
    position: absolute;
    inset: 0;
    background: var(--wi-card);
    border-radius: var(--wi-radius, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    z-index: 30;
}

/* ----- memory game ----- */
.wi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.wi-tile { height: 5.5rem; position: relative; cursor: pointer; perspective: 800px; }

.wi-tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.wi-tile.is-up .wi-tile-inner { transform: rotateY(180deg); }

.wi-face {
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
}

.wi-face-back {
    background: var(--wi-field-bg);
    border: 1px solid var(--wi-card-border);
    color: var(--wi-accent);
    font-size: 1.5rem;
    opacity: 0.85;
}

.wi-face-front {
    background: #fff;
    transform: rotateY(180deg);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

.wi-face-front .wi-emoji { font-size: 1.75rem; }
.wi-face-front .wi-name { color: #92400e; font-weight: 700; font-size: 0.8rem; }

.wi-win {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--wi-accent);
    background: color-mix(in srgb, var(--wi-accent) 8%, transparent);
    text-align: center;
}

/* ----- cinematic hero overlay (full-screen photo heroes) ----- */
.wi-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.wi-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    animation: wiSlowZoom 18s ease-in-out infinite alternate;
}

@keyframes wiSlowZoom { from { transform: scale(1.05); } to { transform: scale(1.18); } }

.wi-hero-content { position: relative; z-index: 2; padding: 5rem 1.5rem; width: 100%; max-width: min(34rem, calc(100vw - 1.5rem)); margin: 0 auto; }

/* ----- "our story" ornament ----- */
.wi-ornament {
    width: 120px;
    height: 1px;
    margin: 1.25rem auto;
    background: linear-gradient(to right, transparent, var(--wi-accent), transparent);
    position: relative;
}
.wi-ornament::after {
    content: "❦";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--wi-accent);
    font-size: 1.25rem;
    background: var(--wi-card, #fff);
    padding: 0 0.6rem;
}

/* ----- event timeline / programme ----- */
.wi-timeline { max-width: 34rem; margin: 0 auto; position: relative; }
.wi-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 27px;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--wi-accent), transparent);
}

.wi-tl-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; position: relative; }

.wi-tl-dot {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wi-card);
    border: 2px solid var(--wi-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1;
}

.wi-tl-time { color: var(--wi-accent); font-weight: 700; }
.wi-tl-title { color: var(--wi-ink); }

/* ----- floating music button ----- */
.wi-music-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--wi-accent);
    color: var(--wi-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    border: none;
}

.wi-eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.wi-eq span { width: 3px; background: currentColor; animation: wiEq 0.9s ease-in-out infinite; }
.wi-eq span:nth-child(2) { animation-delay: 0.2s; }
.wi-eq span:nth-child(3) { animation-delay: 0.4s; }
@keyframes wiEq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
