* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top, rgba(130, 70, 45, 0.35), transparent 35%),
        linear-gradient(180deg, #18110f 0%, #0f0f0f 55%, #090909 100%);
    color: #f7f1ea;
}

.site-shell {
    min-height: 100vh;
}

.page-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px;
}

.hero {
    padding: 46px 18px 30px;
    text-align: center;
}

.hero-inner {
    max-width: 780px;
    margin: 0 auto;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    color: #d8b36a;
    margin: 0 0 10px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1;
}

.subtitle {
    color: #dacfc3;
    font-size: 1.15rem;
    margin-top: 14px;
}

.filter-card,
.slideshow-card,
.empty-state {
    background: rgba(30, 27, 25, 0.92);
    border: 1px solid rgba(214, 177, 95, 0.18);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0 0 6px;
    font-size: 1.7rem;
}

.section-heading p {
    margin: 0;
    color: #c9beb2;
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.family-card {
    background: linear-gradient(180deg, #2a2724, #1c1a18);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    overflow: hidden;
}

.family-card[open] {
    border-color: rgba(216, 179, 106, 0.55);
}

.family-summary {
    list-style: none;
    cursor: pointer;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.family-summary::-webkit-details-marker {
    display: none;
}

.family-summary-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.family-check input {
    display: none;
}

.fake-check {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid #9b9187;
    display: inline-block;
    position: relative;
    background: #151515;
}

.family-check input:checked + .fake-check {
    background: #d8b36a;
    border-color: #d8b36a;
}

.family-check input:checked + .fake-check::after {
    content: "✓";
    position: absolute;
    color: #15110d;
    font-weight: bold;
    left: 5px;
    top: 0px;
}

.family-summary h3 {
    margin: 0;
    font-size: 1.25rem;
}

.family-summary p {
    margin: 4px 0 0;
    color: #aa9f94;
    font-size: 0.9rem;
}

.star {
    color: #d8b36a;
    margin-right: 4px;
}

.expand-text {
    color: #d8b36a;
    font-size: 0.9rem;
    font-weight: bold;
}

.family-card[open] .expand-text {
    color: #bfb4aa;
}

.family-card[open] .expand-text::after {
    content: "ing";
}

.person-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 18px 18px;
}

.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.12);
    color: #f7f1ea;
    border-radius: 999px;
    padding: 9px 13px;
    cursor: pointer;
    font-weight: bold;
}

.person-chip:hover {
    border-color: #d8b36a;
}

.person-chip input {
    accent-color: #d8b36a;
}

.other-card {
    margin-top: 14px;
    background: rgba(20,20,20,0.65);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 16px;
}

.other-card h3 {
    margin: 0 0 12px;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button,
.clear-button {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

button {
    background: #8b3430;
    color: #fff;
}

button:hover {
    background: #a8423d;
}

.clear-button {
    background: #3a3734;
    color: #fff;
}

.results-summary {
    text-align: center;
    color: #d7cec4;
    margin: 20px 0;
}

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

#mainPhoto {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 20px;
    object-fit: contain;
    background: #000;
}

.clickable-photo {
    cursor: pointer;
}

.photo-hint,
#photoName {
    color: #bfb4aa;
    font-size: 0.9rem;
    word-break: break-word;
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

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

.thumbnail-button {
    padding: 0;
    background: none;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
}

.thumbnail-button:hover {
    border-color: #d8b36a;
}

.thumbnail-button img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    display: block;
}

/* Modal */

body.modal-open {
    overflow: hidden;
}

.photo-modal {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.photo-modal.active {
    display: flex !important;
}

.photo-modal img {
    max-width: 92vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    background: #000;
}

.modal-close,
.modal-nav {
    position: fixed;
    background: rgba(60,60,60,0.85);
    color: #fff;
    border-radius: 50%;
    z-index: 1000000;
}

.modal-close {
    top: 14px;
    right: 18px;
    font-size: 2.2rem;
    width: 48px;
    height: 48px;
}

.modal-nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    width: 56px;
    height: 56px;
}

.modal-prev {
    left: 16px;
}

.modal-next {
    right: 16px;
}

#modalPhotoName {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 12px;
    word-break: break-word;
    text-align: center;
    max-width: 90vw;
}

@media (max-width: 700px) {
    .page-wrapper {
        padding: 12px;
    }

    .filter-card,
    .slideshow-card {
        padding: 16px;
        border-radius: 20px;
    }

    .family-grid {
        grid-template-columns: 1fr;
    }

    .family-summary {
        padding: 16px;
    }

    .person-chip {
        width: 100%;
        border-radius: 14px;
        padding: 12px;
    }

    .button-row button,
    .clear-button {
        width: 100%;
        text-align: center;
    }

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

    .thumbnail-button img {
        height: 125px;
    }

    .modal-nav {
        width: 46px;
        height: 46px;
        font-size: 2.4rem;
    }

    .modal-prev {
        left: 8px;
    }

    .modal-next {
        right: 8px;
    }
}

.page-wrapper .site-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px 0 44px;
    margin: 0 auto;
    text-align: center;
}

.page-wrapper .site-footer .footer-inner {
    text-align: center;
    color: #9e9388;
    font-size: 0.92rem;
    line-height: 1.6;
}

.page-wrapper .site-footer .footer-inner div {
    margin: 2px 0;
}