:root {
    --bg-deep: #0f1a2b;
    --bg-navy: #152238;
    --bg-card: #1a2d47;
    --bg-card-hover: #213654;
    --text-primary: #f0f4f8;
    --text-secondary: #a8b9ce;
    --text-muted: #6b7f99;
    --accent-brass: #c9a227;
    --accent-warm: #e8c068;
    --accent-sea: #4a9ead;
    --border: #2a3f5f;
}

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

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    background-image:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 45 50 50 T100 50' fill='none' stroke='%231a2d47' stroke-width='0.5'/%3E%3Cpath d='M0 60 Q25 55 50 60 T100 60' fill='none' stroke='%231a2d47' stroke-width='0.5'/%3E%3Cpath d='M0 70 Q25 65 50 70 T100 70' fill='none' stroke='%231a2d47' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

/* Hero section */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px 40px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            rgba(15, 26, 43, 0.3) 0%,
            rgba(15, 26, 43, 0.6) 50%,
            rgba(15, 26, 43, 0.95) 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--accent-brass);
    margin-bottom: 24px;
    object-fit: cover;
    box-shadow: 0 0 60px rgba(201, 162, 39, 0.4);
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.callsigns {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.2rem;
    color: var(--accent-warm);
    margin-bottom: 16px;
    letter-spacing: 4px;
    font-weight: 300;
}

.years {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-style: italic;
}

.tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.8;
}

.main-content {
    padding: 0 40px 40px;
}

/* Quote section */
.quote-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-navy) 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-brass);
    border-radius: 4px;
    padding: 40px;
    margin: 40px 0;
    text-align: center;
    position: relative;
}

.quote-section::before {
    content: '"';
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 5rem;
    color: var(--accent-brass);
    opacity: 0.3;
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
}

.quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 12px;
}

.quote-source {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Timeline sections */
.timeline-section {
    margin-bottom: 80px;
    position: relative;
}

.timeline-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-brass), var(--border));
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 24px;
    padding-left: 24px;
    position: relative;
}

.timeline-header::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: var(--accent-brass);
    border-radius: 50%;
}

.timeline-year {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    color: var(--accent-warm);
    font-style: italic;
}

.timeline-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.timeline-content {
    padding-left: 24px;
}

.timeline-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 24px;
}

.timeline-story.reverse {
    direction: rtl;
}

.timeline-story.reverse > * {
    direction: ltr;
}

.timeline-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    font-weight: 300;
}

.timeline-text p {
    margin-bottom: 16px;
}

.timeline-text p:last-child {
    margin-bottom: 0;
}

.timeline-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-brass);
    padding: 16px 24px;
    margin-bottom: 20px;
}

.timeline-stat-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-warm);
}

.timeline-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-feature-photo {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.timeline-feature-photo img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.timeline-feature-photo:hover img {
    transform: scale(1.03);
}

.timeline-photo-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Profile cards */
.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-brass);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.profile-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.profile-card:hover::before {
    transform: scaleY(1);
}

.profile-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    color: var(--accent-warm);
    margin-bottom: 8px;
}

.profile-card .location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Source Sans 3', sans-serif;
    letter-spacing: 0.5px;
}

.profile-card .description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 300;
}

.profile-card .arrow {
    color: var(--accent-sea);
    margin-top: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s ease;
}

.profile-card:hover .arrow {
    gap: 12px;
}

/* Photo Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 26, 43, 0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    z-index: 1;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-caption {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
}

.lightbox-close:hover {
    color: var(--text-primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(15, 26, 43, 0.6);
    border: none;
    width: 60px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.lightbox-nav:hover {
    color: var(--text-primary);
    background: rgba(15, 26, 43, 0.9);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.lightbox-counter {
    position: absolute;
    top: 24px;
    left: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 50px 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-navy);
}

footer .ham-greeting {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: var(--accent-warm);
    margin-bottom: 20px;
    font-style: italic;
}

footer .ham-explanation {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

footer .memorial-note {
    font-size: 0.95rem;
    max-width: 550px;
    margin: 0 auto 20px;
    line-height: 1.8;
    font-weight: 300;
    color: var(--text-secondary);
}

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

footer a:hover {
    color: var(--accent-warm);
}

footer .credit {
    font-size: 0.9rem;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 8px;
    background: rgba(15, 26, 43, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.lang-switcher a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.lang-switcher a:hover {
    color: var(--text-primary);
    background: rgba(201, 162, 39, 0.2);
}

.lang-switcher a.active {
    color: var(--accent-brass);
    background: rgba(201, 162, 39, 0.15);
}

/* Kondolenzbuch / Condolence Book */
.kondolenz-section {
    background: var(--bg-navy);
    border-top: 1px solid var(--border);
    padding: 60px 40px;
}

.kondolenz-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
}

.kondolenz-intro {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    font-weight: 300;
    line-height: 1.8;
}

.kondolenz-form {
    max-width: 500px;
    margin: 0 auto;
}

.kondolenz-form label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-weight: 400;
}

.kondolenz-form input,
.kondolenz-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.kondolenz-form input:focus,
.kondolenz-form textarea:focus {
    outline: none;
    border-color: var(--accent-brass);
}

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

.kondolenz-form .verification {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-sea);
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.kondolenz-form .verification p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    font-style: italic;
}

.kondolenz-form button {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-brass);
    color: var(--bg-deep);
    border: none;
    border-radius: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kondolenz-form button:hover {
    background: var(--accent-warm);
}

.kondolenz-form .error {
    color: #e57373;
    font-size: 0.85rem;
    margin-top: -16px;
    margin-bottom: 16px;
    display: none;
}

.kondolenz-form .error.visible {
    display: block;
}

.kondolenz-form .photo-input {
    padding: 12px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 20px;
}

.kondolenz-form .photo-input::-webkit-file-upload-button {
    background: var(--accent-sea);
    color: var(--bg-deep);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
}

.kondolenz-form .form-success {
    display: none;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid #4caf50;
    color: #81c784;
    padding: 16px;
    border-radius: 4px;
    margin-top: 16px;
    text-align: center;
}

.kondolenz-form .form-success.visible {
    display: block;
}

.kondolenz-form .form-error {
    display: none;
    background: rgba(229, 115, 115, 0.15);
    border: 1px solid #e57373;
    color: #e57373;
    padding: 16px;
    border-radius: 4px;
    margin-top: 16px;
    text-align: center;
}

.kondolenz-form .form-error.visible {
    display: block;
}

.kondolenz-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Condolence entries display */
.kondolenz-entries {
    max-width: 900px;
    margin: 0 auto 60px;
}

.kondolenz-entry {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(22, 32, 50, 0.8) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kondolenz-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.kondolenz-entry::before {
    content: '"';
    position: absolute;
    top: 16px;
    left: 24px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    color: var(--accent-brass);
    opacity: 0.15;
    line-height: 1;
}

.kondolenz-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 8px;
}

.kondolenz-entry-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: var(--accent-warm);
    font-weight: 600;
}

.kondolenz-entry-relation {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-left: 8px;
}

.kondolenz-entry-date {
    color: var(--accent-sea);
    font-size: 0.85rem;
    font-weight: 500;
}

.kondolenz-entry-message {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.9;
    white-space: pre-line;
    padding-left: 8px;
}

/* Dynamic image grid for condolences */
.kondolenz-entry-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.kondolenz-entry-images .gallery-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Make first image larger when there are multiple */
.kondolenz-entry-images .gallery-item:first-child:not(:only-child) {
    grid-column: span 2;
    grid-row: span 2;
}

.kondolenz-entry-images .gallery-item img {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.kondolenz-entry-images .gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Form wrapper styles */
.kondolenz-form-wrapper {
    max-width: 550px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.kondolenz-form-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.kondolenz-form-wrapper .kondolenz-intro {
    margin-bottom: 30px;
}

.kondolenz-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

.kondolenz-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

/* Load more button for paginated condolences */
.kondolenz-load-more {
    text-align: center;
    padding: 20px;
}

.kondolenz-load-more-btn {
    padding: 12px 32px;
    background: transparent;
    color: var(--accent-brass);
    border: 1px solid var(--accent-brass);
    border-radius: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kondolenz-load-more-btn:hover {
    background: var(--accent-brass);
    color: var(--bg-deep);
}

.kondolenz-load-more-btn.htmx-request {
    opacity: 0.6;
    cursor: wait;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
        padding: 40px 24px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .callsigns {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .main-content {
        padding: 0 24px 24px;
    }

    .profile-cards {
        grid-template-columns: 1fr;
    }

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

    .gallery-item.featured {
        grid-column: span 2;
        grid-row: span 1;
    }

    .timeline-story {
        grid-template-columns: 1fr;
    }

    .timeline-story.reverse {
        direction: ltr;
    }

    .timeline-header {
        flex-direction: column;
        gap: 4px;
    }

    .timeline-title {
        font-size: 1.5rem;
    }

    .timeline-stat {
        padding: 12px 16px;
    }

    .timeline-stat-value {
        font-size: 1.6rem;
    }

    .kondolenz-section {
        padding: 40px 24px;
    }

    .kondolenz-entry {
        padding: 24px 20px;
    }

    .kondolenz-entry::before {
        font-size: 3rem;
        top: 12px;
        left: 16px;
    }

    .kondolenz-form-wrapper {
        padding: 24px;
    }

    .kondolenz-entry-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .kondolenz-entry-images .gallery-item:first-child:not(:only-child) {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-image {
        width: 120px;
        height: 120px;
    }

    .tagline {
        font-size: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item.featured {
        grid-column: span 2;
    }

    .timeline-section::before {
        display: none;
    }

    .timeline-header {
        padding-left: 0;
    }

    .timeline-header::before {
        display: none;
    }

    .timeline-content {
        padding-left: 0;
    }
}
