/* === COLOR PALETTE === */
:root {
    --primary: #E7C24F;
    --secondary: #DC4618;
    --accent1: #511414;
    --accent2: #6B8E23;
    --bg: #381D2A;
    --text: #E7C24F;
}

/* === GLOBAL ==== */
html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: url(images/final-background-dark.jpg) center top no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-color: var(--bg);
    color: var(--text);
    font-family: "Lora", serif;
}

/* === HEADERS === */
h1, h2, h3, h4, h5, h6 {
    text-align: center;
    width: 100%;
    color: var(--secondary);
    border-bottom: 2px solid var(--accent1);
    padding-bottom: 0.25rem;
}

/* === PARAGRAPHS === */
p {
    color: var(--accent1);
}

/* === INTRO === */
.intro {
    max-width: 700px;
    margin: 3rem auto 2rem auto;
    text-align: center;
    padding: 1rem;
}

.intro h1 {
    margin-bottom: 0.5rem;
}

.intro p {
    color: #fff3b0;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* === HEADER === */
header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    background: #00000040;
    border-bottom: 2px solid var(--primary);
}

/* === LOGO === */
.logo {
    width: 100%;
    text-align: center;
    position: relative;
    font-family: "Cinzel", serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo span {
    display: inline-block;
}

.logo img {
    padding-top: 20px;
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 100;
    height: 100px;
    object-fit: contain;
}

/* === NAV === */
nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-family: "Cinzel", serif;
}

nav a.active,
nav a:hover {
    color: var(--primary);
}

/* === MAIN CONTAINER === */
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 0.5rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* === CONTROLS === */
.controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.5rem;
}

.filters {
    width: 100%;
    display: flex;
    justify-content: center;
}

#origin-select {
    display: block;
    margin: 0 auto;
}

/* === INPUT === */
input[type="text"],
select {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 2px solid var(--secondary);
    background-color: #2a1220;
    color: var(--text);
    width: 260px;
    max-width: 100%;
    box-sizing: border-box;
}

input[type="text"]::placeholder {
    color: #c9c9c9;
}

/* === CARD GRID === */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* === CARDS === */
.card {
    background-color: #511414;
    border: 3px solid var(--accent2);
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--secondary);
}

.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.card h3 {
    margin: 0.25rem 0;
    font-size: 1.1rem;
    font-family: "Cinzel", serif;
    border-bottom: 1px solid var(--accent1);
    color: var(--secondary);
}

.card p {
    margin: 0.15rem 0;
    font-size: 0.9rem;
    color: var(--primary);
}

/* === DETAIL PANEL === */
.detail-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem;
    background-color: #511414;
    border-radius: 6px;
    border: 3px solid var(--accent2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    z-index: 1001;
    box-sizing: border-box;
}

.detail-panel::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(81, 20, 20, 0.8);
    z-index: -1;
}

.detail-panel img {
    width: 100%;
    max-width: 100%;
    border-radius: 4px;
    margin: 0.75rem 0;
}

.detail-panel h2,
.detail-panel h3 {
    color: var(--secondary);
}

.detail-panel p,
.detail-origin {
    color: var(--primary);
}

/* === CLOSE BUTTON === */
.close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
    font-family: "Cinzel", serif;
}

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

.hidden {
    display: none;
}

/* === FOOTER === */
footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--accent1);
    margin-top: 3rem;
    font-size: 0.9rem;
}

footer img {
    height: 60px;
    width: auto;
    border: 5px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 0 20px #ffffff;
}

/* ==== Tablet ==== */
@media screen and (min-width: 700px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }

    nav {
        flex-direction: row;
        gap: 2rem;
    }

    .filters {
        justify-content: flex-end;
    }

    .container {
        padding: 0 1rem;
    }

    .detail-panel {
        width: 80%;
        padding: 1.5rem;
    }
}

/* ==== Desktop ==== */
@media screen and (min-width: 1000px) {
    .card-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    nav {
        justify-content: center;
        gap: 3rem;
    }

    .container {
        max-width: 1200px;
    }

    .detail-panel {
        width: 700px;
    }
}