/* ---------------- GENERALE ---------------- */

body {
    margin: 0;
    font-family: serif;
    background-color: #fff8fb;
    color: #4b3b47;
    transition: background-color 0.5s;
}

/* ---------------- PALETTE ---------------- */
/*
Rosa chiaro: #f8dce7
Rosa medio: #e8b7c8
Rosa scuro: #c97f9b

Verde salvia: #7f9277
Verde salvia chiaro: #a8b8a0

Crema: #fff8fb
Testo: #4b3b47
*/

/* ---------------- HEADER ---------------- */

#site-header {
    position: sticky;
    top: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8dce7, #e8b7c8);
    border-bottom: 3px solid #d9a5b7;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* ---------------- TITOLO ---------------- */

#titolo {
    text-align: center;
    font-size: 50px;
    color: white;
    padding: 20px;
    margin: 0;
}

/* ---------------- HAMBURGER ---------------- */

#hamburger {
    position: absolute;
    left: 20px;
    z-index: 3000;
    cursor: pointer;
}

.latBar {
    width: 35px;
    height: 5px;
    background-color: #7f9277;
    margin: 6px 0;
    border-radius: 20px;
    transition: 0.3s;
}

#hamburger:hover .latBar {
    background-color: #c97f9b;
}

/* ---------------- SIDENAV ---------------- */

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 2500;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #a8b8a0 0%, #96a88f 45%, #7f9277 100%);
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: 5px 0 25px rgba(0,0,0,0.18);
}

/* ---------------- OVERLAY ---------------- */

#overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.45);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---------------- CLOSE SIDENAV ---------------- */

.closebtn {
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 40px;
    text-decoration: none;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.closebtn:hover {
    color: #ffeef5;
}

/* ---------------- MENU ---------------- */

.sidenav ul {
    list-style-type: none;
    margin-top: 2vh;
    padding: 0;
}

.side-btn {
    width: 100%;
    border: none;
    padding: 18px;
    text-align: left;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    color: white;
    font-weight: 500;
    background-color: transparent;
}

.active {
    background-color: rgba(255,255,255,0.18);
    border-left: 4px solid #f8dce7;
}

.inactive {
    background-color: transparent;
}

.side-btn:hover {
    background-color: rgba(255,255,255,0.12);
    padding-left: 26px;
}

/* ---------------- SEARCH BAR ---------------- */

.topnav {
    margin: 20px;
    margin-left: 80px;
    background-color: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f0d6df;
}

.topnav input {
    width: 100%;
    padding: 12px;
    border: none;
    outline: none;
    border-radius: 10px;
    font-size: 17px;
    background-color: transparent;
    color: #4b3b47;
}

/* ---------------- GRID ---------------- */

#grid-div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px;
}

/* ---------------- SCHEDE ---------------- */

.scheda {
    text-align: center;
}

.ricettaBtn {
    background-color: transparent;
    border: none;
}

.img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 18px;
    transition: 0.3s;
    box-shadow: 0 5px 18px rgba(0,0,0,0.12);
}

.img:hover {
    transform: scale(1.05);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.descrizione {
    font-size: 18px;
    margin-top: 10px;
    color: #4b3b47;
    font-weight: 500;
}

/* ---------------- BOTTONI GRID ---------------- */

#div-btn {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 8px;
}

#storia-btn,
#ricetta-btn {
    min-width: 160px;
    padding: 16px 28px;
    border: none;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#storia-btn {
    background-color: #7f9277;
}

#storia-btn:hover {
    background-color: #6c8064;
}

#ricetta-btn {
    background-color: #f3c8d8;
}

#ricetta-btn:hover {
    background-color: #e5adc2;
}

/* ---------------- POPUP ---------------- */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.popup {
    background: #fff8fb;
    padding: 25px;
    border-radius: 22px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 35px rgba(0,0,0,0.18);
    animation: popIn 0.25s ease;
}

/* immagine popup */
.popup img {
    width: 90%;
    border-radius: 15px;
    margin-top: 10px;
    margin-bottom: 18px;
}

/* titolo popup */
.popup h2 {
    margin-top: 10px;
    margin-bottom: 15px;
    color: #4b3b47;
}

/* ---------------- BOTTONI POPUP ---------------- */

.grid-btn {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

/* BOTTONI PIÙ GRANDI E PIÙ PRESENTI */
.grid-btn button {
    padding: 22px 44px;
    border: none;
    border-radius: 16px;

    font-size: 23px;
    font-weight: 700;

    cursor: pointer;
    color: white;

    transition: 0.25s;

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);

    min-width: 220px;
}

.grid-btn button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* ---------------- CLOSE POPUP ---------------- */

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background-color: #f8dce7;
    color: #4b3b47;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.close-btn:hover {
    background-color: #e8b7c8;
    color: white;
    transform: scale(1.1);
}

/* ---------------- ANIMAZIONE ---------------- */

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}