/* Global Styles */
:root {
    --primary-color: #333333;
    --secondary-color: #666666;
    --accent-color: #C5A059;
    /* Muted Gold */
    --bg-color: #F9F9F9;
    --card-bg: #FFFFFF;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --spacing-unit: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 400;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header / Hero */
/* Header / Hero */
/* Hero Header */
.hero-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 80px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Visual Column */
.hero-visual {
    width: 100%;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    aspect-ratio: 1/1;
    /* or adjust based on image */
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content Column */
.hero-content {
    text-align: left;
    padding-right: 20px;
}

.intro-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #8C6A3E;
    /* Gold/Bronze accent */
    margin-bottom: 20px;
    display: block;
    font-weight: 600;
}

h1.name {
    font-size: 4rem;
    margin-bottom: 25px;
    color: var(--primary-color);
    line-height: 1.1;
}

.dates {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-weight: 600;
    font-style: normal;
}

.tribute {
    color: var(--primary-color);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 100%;
    margin: 0;
}

/* Life Story */
.story-section {
    padding: 70px 0 10px;
}

.story-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.story-content .card-subtitle {
    text-align: center;
}

.story-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.story-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-color);
    margin-bottom: 22px;
    text-align: left;
}

.story-content p:last-child {
    margin-bottom: 0;
}

/* Pull quote — emotional centerpiece that breaks up the story */
.pull-quote {
    max-width: 820px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.4;
    font-style: italic;
    color: var(--primary-color);
}

.pull-quote::before {
    content: "\201C";
    display: block;
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 0.2;
    margin-top: 30px;
    margin-bottom: 28px;
    color: var(--accent-color);
}

.pull-quote .quote-attr {
    display: block;
    margin-top: 22px;
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--secondary-color);
}

/* Gallery Grid */
.gallery-section {
    padding: 60px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background-color: #eee;
    padding-top: 100%;
    /* 1:1 Aspect Ratio Square */
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-height: 96vh;
    max-width: 97vw;
    object-fit: contain;
    border-radius: 2px;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 1002;
    transition: color 0.2s;
    font-family: var(--font-heading);
    line-height: 0.5;
}

.close-btn:hover {
    color: var(--accent-color);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    padding: 20px;
    transition: color 0.2s;
    background: none;
    border: none;
}

.nav-btn:hover {
    color: var(--accent-color);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Service Details & Memorials */
.details-section {
    padding: 50px 0 70px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.details-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

.card-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8C6A3E;
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
}

.details-card h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--primary-color);
}

/* Racing Legacy card */
.racing-logo {
    margin-bottom: 28px;
}

.racing-logo img {
    display: block;
    width: 140px;
    max-width: 45%;
    height: auto;
    border-radius: 8px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 20px;
    margin: 14px 0 26px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: #8C6A3E;
}

.racing-note {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 28px;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
}

.detail-item p {
    font-size: 1rem;
    color: var(--primary-color);
}

.memorial-text {
    margin-bottom: 25px;
    color: var(--secondary-color);
}

/* Memorial race logo */
.memorial-logo {
    margin-top: 18px;
}

.memorial-logo img {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 6px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.memorial-logo a:hover img {
    opacity: 0.85;
    transform: translateY(-2px);
}

.memorial-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-memorial {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 50px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-memorial:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(197, 160, 89, 0.05);
}

/* Actions row: obituary (left) + slideshow (right) */
.actions-section {
    padding: 10px 0 40px;
}

.actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.slideshow-action {
    text-align: right;
}

.btn-obituary {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-obituary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* Slideshow */
.btn-slideshow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35);
}

.btn-slideshow:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.btn-slideshow .play-icon {
    font-size: 0.85rem;
    line-height: 1;
}

/* Slideshow mode: clean, distraction-free full-screen display */
.lightbox.slideshow-mode .nav-btn {
    display: none;
}

.lightbox.slideshow-mode .lightbox-img {
    transition: opacity 0.6s ease;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    h1.name {
        font-size: 2.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        text-align: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .details-card {
        padding: 30px 20px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }

    .actions-row {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .slideshow-action {
        text-align: center;
    }

    .pull-quote {
        font-size: 1.45rem;
        margin: 35px auto;
    }

    .pull-quote::before {
        font-size: 3.5rem;
    }
}
/* ============================================================
   Guest book: in-slideshow message card, guest book page, control page
   ============================================================ */

/* Message slide shown between photos during the slideshow */
.message-slide {
    display: none;
    max-width: 900px;
    padding: 0 8vw;
    text-align: center;
}

.message-slide.active {
    display: block;
}

.message-slide-mark {
    display: block;
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 0.4;
    color: var(--accent-color);
    margin-bottom: 34px;
}

.message-slide-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.6rem, 3.8vw, 3rem);
    line-height: 1.42;
    color: #f6f2ea;
    margin-bottom: 30px;
}

.message-slide-name {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1rem;
    font-weight: 600;
    color: #c9b182;
}

/* Guest book section on the main page */
.guestbook-section {
    padding: 70px 0 30px;
}

.gb-inner {
    max-width: 940px;
    margin: 0 auto;
    text-align: center;
}

.gb-inner h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 18px;
}

.gb-section-sub {
    max-width: 640px;
    margin: 0 auto 36px;
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
}

/* Keep the form a comfortable single-column width, centered */
.gb-inner .gb-form {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* Memories wall: two masonry-style columns when there's room */
.guestbook-section .gb-list {
    display: block;
    column-count: 2;
    column-gap: 16px;
    text-align: left;
}

.guestbook-section .gb-card {
    margin-bottom: 16px;
    break-inside: avoid;
}

@media (max-width: 700px) {
    .guestbook-section .gb-list {
        column-count: 1;
    }
}

/* Guest book page */
.guestbook-page {
    background-color: var(--bg-color);
}

.gb-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 50px 22px 70px;
}

.gb-header {
    text-align: center;
    margin-bottom: 36px;
}

.gb-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 400;
    color: var(--primary-color);
    margin: 8px 0 16px;
    line-height: 1.15;
}

.gb-sub {
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
}

.gb-form {
    background-color: var(--card-bg);
    padding: 28px 24px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 46px;
}

.gb-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: #8C6A3E;
    margin: 0 0 8px;
}

.gb-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--primary-color);
    background: #fff;
    border: 1px solid #E2E2E2;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.gb-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.gb-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

/* Honeypot — visually hidden, but present for bots to trip on */
.gb-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.gb-submit {
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.gb-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.gb-status {
    min-height: 1.2em;
    margin-top: 14px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.gb-status.error {
    color: #b3261e;
}

.gb-status.success {
    color: #2e7d32;
}

.gb-wall-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 24px;
}

.gb-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gb-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 22px 22px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.gb-card-message {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--primary-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 14px;
}

.gb-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.gb-card-name {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--primary-color);
}

.gb-card-time {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
}

.gb-empty {
    text-align: center;
    color: var(--secondary-color);
    font-style: italic;
}

.gb-foot {
    text-align: center;
    margin-top: 44px;
}

.gb-home-link {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.gb-home-link:hover {
    color: var(--accent-color);
}

/* Control page */
.control-page {
    background-color: var(--bg-color);
}

.ctl-wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 36px 20px 70px;
}

.ctl-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.ctl-note {
    color: var(--secondary-color);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 22px;
}

.ctl-toggles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.ctl-toggle {
    flex: 1 1 200px;
    padding: 14px 18px;
    border: 1px solid #DADADA;
    background: #fff;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctl-toggle.active {
    background: #b3261e;
    border-color: #b3261e;
    color: #fff;
}

.ctl-subtitle {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 18px;
}

.ctl-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ctl-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.ctl-del {
    margin-top: 12px;
    padding: 8px 18px;
    border: 1px solid #e0b4b0;
    background: #fff;
    color: #b3261e;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctl-del:hover {
    background: #b3261e;
    color: #fff;
    border-color: #b3261e;
}

.ctl-del:disabled {
    opacity: 0.5;
    cursor: default;
}
