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

:root {
    --cream: #faf6f0;
    --warm-white: #fff9f2;
    --tan: #d4a574;
    --brown: #8b6f47;
    --dark-brown: #5c4a2e;
    --light-tan: #efe3d4;
    --text: #3e3225;
    --text-light: #7a6b5a;
    --shadow: rgba(92, 74, 46, 0.1);
    --radius: 8px;
}

html {
    font-size: 16px;
}

body {
    font-family: Georgia, "Times New Roman", serif;
    background-color: var(--cream);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    background: var(--warm-white);
    border-bottom: 2px solid var(--light-tan);
}

header h1 {
    font-size: 2.2rem;
    color: var(--dark-brown);
    font-weight: normal;
    letter-spacing: 0.02em;
}

.subtitle {
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.3rem;
    font-size: 1.05rem;
}

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    margin-bottom: 2.5rem;
}

h2 {
    font-size: 1.4rem;
    color: var(--dark-brown);
    font-weight: normal;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--light-tan);
}

/* Tab bar */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1.2rem;
    background: var(--warm-white);
    border: 1px solid var(--light-tan);
    border-radius: var(--radius) var(--radius) 0 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: background 0.2s, color 0.2s;
}

.tab:hover {
    background: var(--light-tan);
    color: var(--text);
}

.tab.active {
    background: var(--tan);
    color: #fff;
    border-color: var(--tan);
}

/* Mobile dropdown */
.gallery-select {
    display: none;
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--light-tan);
    border-radius: var(--radius);
    background: var(--warm-white);
    color: var(--text);
    margin-bottom: 1rem;
    cursor: pointer;
}

/* Gallery frame */
.frame-container {
    background: var(--warm-white);
    border: 1px solid var(--light-tan);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.gallery-frame {
    display: none;
    width: 100%;
    height: 75vh;
    border: none;
}

.gallery-frame.visible {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.empty-state .hint {
    font-style: italic;
    font-size: 0.9rem;
}

/* Link cards */
.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem;
    background: var(--warm-white);
    border: 1px solid var(--light-tan);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 1px 4px var(--shadow);
}

.link-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2.5rem;
}

.card-title {
    font-size: 1.1rem;
    color: var(--dark-brown);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--light-tan);
}

/* Responsive: switch tabs to dropdown on small screens */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.7rem;
    }

    .tabs {
        display: none;
    }

    .gallery-select {
        display: block;
    }

    .gallery-frame {
        height: 60vh;
    }

    main {
        padding: 1.2rem 0.75rem;
    }
}
