/* ==========================================================================
   Les St. Clair Memorial - Stylesheet
   A dignified, warm tribute design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&family=Lato:wght@300;400;700&display=swap');

:root {
    --color-midnight: #1a1a2e;
    --color-navy: #16213e;
    --color-slate: #2c3e50;
    --color-steel: #4a6274;
    --color-stone: #7f8c8d;
    --color-warm-gray: #b0a999;
    --color-sand: #d4c5a9;
    --color-cream: #f5f0e8;
    --color-ivory: #faf8f4;
    --color-white: #ffffff;
    --color-gold: #c9a84c;
    --color-gold-light: #e8d48b;
    --color-gold-dark: #a07e2e;
    --color-badge-blue: #2b4c7e;
    --color-badge-light: #3d6098;
    --color-success: #2d6a4f;
    --color-error: #9b2226;

    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'Lato', 'Segoe UI', Tahoma, sans-serif;

    --max-width: 960px;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--color-slate);
    background-color: var(--color-ivory);
    line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-badge-blue); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--color-gold-dark); }

/* ---- Hero Section ---- */
.hero {
    background: linear-gradient(170deg, var(--color-midnight) 0%, var(--color-navy) 40%, var(--color-badge-blue) 100%);
    color: var(--color-white);
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero__star {
    display: inline-block;
    color: var(--color-gold);
    font-size: 1.6rem;
    letter-spacing: 0.8rem;
    margin-bottom: var(--space-sm);
    opacity: 0.8;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 4rem);
    letter-spacing: 0.06em;
    margin-bottom: 0.3em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero__dates {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--color-gold-light);
    margin-bottom: 0.5em;
    letter-spacing: 0.08em;
}

.hero__age {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: var(--space-sm);
}

.hero__subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--space-md);
}

.hero__divider {
    width: 60px;
    height: 1px;
    background: var(--color-gold);
    margin: 0 auto var(--space-sm);
    opacity: 0.6;
}

.hero__days-since {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

.hero__guestbook-link {
    display: inline-block;
    margin-top: var(--space-md);
    padding: 0.6em 1.6em;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    border-radius: 3px;
    text-decoration: none;
    background: rgba(201,168,76,0.1);
    transition: all 0.3s;
}

.hero__guestbook-link:hover {
    background: rgba(201,168,76,0.22);
    border-color: var(--color-gold-light);
    color: var(--color-gold-light);
}

/* ---- Container ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ---- Photo Rotator ---- */
.photo-rotator {
    background: var(--color-midnight);
    padding: var(--space-lg) 0;
}

.rotator {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.rotator__frame {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
    aspect-ratio: 4 / 3;
}

.rotator__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.rotator__slide--active {
    opacity: 1;
    pointer-events: auto;
}

.rotator__slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rotator__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8em 1em;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: rgba(255,255,255,0.9);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
}

.rotator__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

.rotator__btn:hover {
    background: rgba(0,0,0,0.7);
    color: #fff;
}

.rotator__btn--prev { left: -54px; }
.rotator__btn--next { right: -54px; }

.rotator__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--space-sm);
}

.rotator__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--color-gold);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s;
    padding: 0;
}

.rotator__dot--active,
.rotator__dot:hover {
    background: var(--color-gold);
}

.rotator__counter {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
}

@media (max-width: 780px) {
    .rotator__btn--prev { left: 8px; }
    .rotator__btn--next { right: 8px; }
}

/* ---- Content Sections ---- */
.content-section {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.content-section:last-of-type {
    border-bottom: none;
}

.content-section h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--color-navy);
    margin-bottom: var(--space-sm);
    position: relative;
    padding-bottom: 0.6em;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-gold);
}

.content-section .body-text {
    white-space: pre-line;
    max-width: 720px;
}

.content-section .body-text p,
.content-section .body-text {
    margin-bottom: 1em;
}

/* ---- Badge / CHP Accent ---- */
.badge-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: var(--color-badge-blue);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.35em 0.9em;
    border-radius: 2px;
    margin-bottom: var(--space-sm);
}

/* ---- Guestbook ---- */
.guestbook {
    background: var(--color-cream);
    padding: var(--space-xl) 0;
}

.guestbook h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--color-navy);
    text-align: center;
    margin-bottom: 0.3em;
}

.guestbook__summary {
    text-align: center;
    color: var(--color-stone);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

.guestbook__entries {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.gb-entry {
    background: var(--color-white);
    border-radius: 4px;
    padding: var(--space-md);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-left: 3px solid var(--color-gold);
    transition: box-shadow 0.3s;
}

.gb-entry:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.gb-entry__message {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-slate);
    margin-bottom: var(--space-sm);
    font-style: italic;
}

.gb-entry__meta {
    font-size: 0.8rem;
    color: var(--color-stone);
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}

.gb-entry__name {
    font-weight: 700;
    color: var(--color-navy);
}

/* ---- Guestbook Form ---- */
.gb-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 4px;
    padding: var(--space-md);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.gb-form-wrapper h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.4rem;
    color: var(--color-navy);
    margin-bottom: var(--space-sm);
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-sm);
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-steel);
    margin-bottom: 0.3em;
}

.form-group label .required {
    color: var(--color-error);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.6em 0.8em;
    border: 1px solid #d0cdc5;
    border-radius: 3px;
    background: var(--color-ivory);
    color: var(--color-slate);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: var(--color-stone);
    margin-top: 0.3em;
    transition: color 0.3s;
}

.char-counter--warn {
    color: #b8860b;
}

.char-counter--danger {
    color: var(--color-error);
    font-weight: 700;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    background: var(--color-ivory);
    padding: 0.8em;
    border-radius: 3px;
}

.captcha-row .captcha-question {
    font-weight: 700;
    color: var(--color-navy);
    font-size: 1.05rem;
    white-space: nowrap;
}

.captcha-row input {
    width: 80px;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.4em 0.6em;
    border: 1px solid #d0cdc5;
    border-radius: 3px;
    text-align: center;
    background: var(--color-white);
}

.btn-submit {
    display: block;
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-white);
    background: var(--color-badge-blue);
    border: none;
    padding: 0.9em;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s, transform 0.15s;
}

.btn-submit:hover {
    background: var(--color-navy);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ---- Flash Messages ---- */
.flash {
    max-width: var(--max-width);
    margin: var(--space-sm) auto;
    padding: 0.8em 1.2em;
    border-radius: 3px;
    font-size: 0.9rem;
}

.flash--success {
    background: #d4edda;
    color: var(--color-success);
    border: 1px solid #b7dfbf;
}

.flash--error {
    background: #f8d7da;
    color: var(--color-error);
    border: 1px solid #f1aeb5;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--color-midnight);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    font-size: 0.8rem;
    line-height: 1.8;
}

.site-footer .footer-star {
    color: var(--color-gold);
    font-size: 1rem;
    letter-spacing: 0.5rem;
    display: block;
    margin-bottom: var(--space-sm);
    opacity: 0.6;
}

.site-footer a {
    color: rgba(255,255,255,0.5);
}

.site-footer a:hover {
    color: var(--color-gold-light);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: var(--space-lg) var(--space-sm);
    }

    .gb-entry__meta {
        flex-direction: column;
        gap: 0.3em;
    }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section {
    animation: fadeInUp 0.6s ease both;
}

.content-section:nth-child(2) { animation-delay: 0.1s; }
.content-section:nth-child(3) { animation-delay: 0.2s; }
.content-section:nth-child(4) { animation-delay: 0.3s; }
.content-section:nth-child(5) { animation-delay: 0.4s; }

/* ---- Admin Styles (shared) ---- */
.admin-bar {
    background: var(--color-slate);
    color: var(--color-white);
    padding: 0.5em var(--space-md);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-bar a {
    color: var(--color-gold-light);
    margin-left: 1em;
}