:root {
    --light: #dad7cd;
    --medium: #a3b18a;
    --dark: #588157;
    --deep-dark: #3a5a40;
    --sidebar-width: 240px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Playfair Display", serif;
    font-optical-sizing: auto;
    font-style: normal;
    background-color: var(--light);
    color: var(--deep-dark);
    margin: 0;
}

/* ── INTRO SPLASH ── */
.intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    height: 100%;
    width: 100%;
    background-color: var(--dark);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
}

.intro img {
    display: block;
    border: none;
    outline: none;
    height: 25%;
    width: auto;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.88);
    animation: splashLogoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

/* Barra di caricamento sotto il logo */
.intro-bar {
    width: 25%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: splashBarFadeIn 0.4s ease 0.5s forwards;
}

.intro-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--medium);
    border-radius: 2px;
    animation: splashBarFill 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}

@keyframes splashLogoIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splashBarFadeIn {
    to {
        opacity: 1;
    }
}

@keyframes splashBarFill {
    to {
        width: 100%;
    }
}

.intro.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── LAYOUT PRINCIPALE ── */
.main {
    opacity: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: opacity 1.5s ease-in-out;
}

.main.show {
    opacity: 1;
}

/* ── SIDEBAR NAV ── */
.nv-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    background-color: var(--dark);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    width: 25%;
    overflow-y: auto;
    justify-content: flex-start;
}

.img-cl {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.logo {
    width: 50%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.06);
    opacity: 0.9;
}

.licence {
    display: flex;
    width: 80%;
    justify-content: center;
    align-items: center;
    color: var(--light);
}

.licence a {
    text-decoration: none;
    color: var(--medium);
    transition: filter 0.3s ease;
}

.licence a:hover {
    filter: brightness(25%);
}

.licence-icon {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

/* ── NOME + TAGLINE TYPEWRITER ── */
.sidebar-bio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0 12px 4px;
    text-align: center;
    /* separatore sottile sopra */
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 18px;
    width: 80%;
}

.sidebar-name {
    font-family: "Playfair Display", serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    /* fade-in dal basso insieme al main */
    opacity: 0;
    transform: translateY(8px);
    animation: bioFadeIn 0.7s ease forwards 2.1s;
}

.sidebar-tagline {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 0.78rem;
    color: var(--medium);
    letter-spacing: 1.2px;
    margin: 0;
    min-height: 1.2em;
    /* evita salti di layout mentre il testo appare */
}

/* cursore lampeggiante */
.tw-cursor {
    display: inline-block;
    color: var(--medium);
    font-weight: 300;
    animation: blink 0.85s step-start infinite;
    margin-left: 1px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes bioFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#home {
    display: flex;
    padding: 50px 50px;
    justify-content: flex-end;
    width: 75%;
}

/* ── GRID GALLERIA ── */
.grlg-princi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.grid-select {
    display: contents;
}

/* ── CARD IMMAGINE BASE ── */
.item,
.item2 {
    position: relative;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.item a,
.item2 a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.size-img,
.size-img-2 {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
}

/* Hover generico per .item */
.item:hover .size-img,
.item:hover .size-img-2 {
    transform: scale(1.07);
    filter: brightness(55%);
}

/* ── PULSANTI MENU ── */
.bt-menu {
    background: transparent;
    border: none;
    font-family: "Playfair Display", serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 0;
    width: auto;
    text-align: center;
    position: relative;
}

.bt-menu a {
    color: var(--light);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
    font-size: 1.5rem;
}

.bt-menu:hover a {
    color: #fff;
}

.bt-menu::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--light);
    transition: width 0.3s ease;
}

.bt-menu:hover::after {
    width: 80%;
}

/* ── DROPDOWN SHOWCASE ── */
.dropmenu {
    background: transparent;
    border: none;
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--light);
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 0;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.dropmenu:hover {
    color: #fff;
}

.dropmenu .bi {
    color: inherit;
    transition: transform 0.3s ease;
}

.dropmenu.open .bi {
    transform: rotate(180deg);

}

.element {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
}

.element.visible {
    max-height: 50%;
    width: 80%;
}

.element ul {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.element ul li {
    width: auto;
    text-align: center;
}

.element ul li a {
    display: block;
    padding: 7px 12px;
    color: var(--light);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.element ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
}

/* ── SOCIAL ICONS SIDEBAR ── */
.icon-social-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.flex-icon {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.flex-icon .bi {
    font-size: 1.2rem;
    color: var(--light);
    transition: color 0.3s ease, transform 0.3s ease;
}

.flex-icon .bi:hover {
    color: #fff;
    transform: translateY(-3px);
}

/* ── STRUTTURA HEADER ── */
header {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

header a {
    text-decoration: none;
    color: inherit;
}

/* ── SEZIONE PRINCIPALE ── */
.grid-home {
    flex-direction: column;
    display: flex;
    justify-content: flex-end;
    width: 75%;
}

/* ── INDICE / BARRA NAVIGAZIONE SEZIONI ── */
.indice {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px 24px;
    background-color: var(--medium);
    position: sticky;
    top: 0;
    z-index: 50;
}

.btn-indice {
    background: var(--dark);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: var(--light);
    font-family: "Playfair Display", serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    line-height: 1.3;
}

.btn-indice a {
    color: var(--light);
    text-decoration: none;
    display: block;
}

.btn-indice:hover {
    background: var(--deep-dark);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.titolo-grid {
    display: flex;
    justify-content: center;
}

/* ── TITOLI SEZIONE ── */
.tt-luogo {
    width: auto;
    display: flex;
    background: var(--dark);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: var(--light);
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    line-height: 1.3;
    text-align: center;
    justify-content: center;

}

.tt-luogo a {
    color: var(--light);
    text-decoration: none;
    display: block;
}

.tt-luogo:hover {
    background: var(--deep-dark);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ── PHOTO GRID ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 24px 40px;
}

.photo-card {
    border-radius: 8px;
    overflow: hidden;
    background: var(--deep-dark);
    position: relative;
}

/* Figure wrapper */
.photo-card figure,
.photo-card .photo-figure {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.photo-card figure a,
.photo-card .photo-figure a {
    display: block;
    width: 100%;
    height: 100%;
}

.photo-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    transition: transform 0.45s ease, filter 0.45s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

.photo-card:hover img {
    transform: scale(1.04);
    filter: brightness(75%);
}

/* Rimuove margin di default da figure */
figure {
    margin: 0;
}

/* ── SCROLL TO TOP ── */
.scroll-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: auto;
    height: auto;
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid var(--medium);
    background-color: var(--dark);
    color: #fff;
    font-family: "Playfair Display", serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease;
    z-index: 200;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: var(--deep-dark);
    transform: translateY(-3px);
}

/* ── FOOTER ── */
footer {
    background-color: var(--dark);
    margin-left: var(--sidebar-width);
    padding: 18px 0;
}

.ft-grd {
    display: flex;
    justify-content: center;
    gap: 36px;
}

.ft-grd .bi {
    font-size: 1.3rem;
    color: var(--light);
    transition: color 0.3s ease, transform 0.3s ease;
}

.ft-grd .bi:hover {
    color: #fff;
    transform: translateY(-3px);
}

/* Icone sidebar */
.bi {
    color: var(--light);
}

/* ── HAMBURGER / MENU MOBILE ── */
.toggle,
#drop,
.ham-menu {
    display: none;
}

/* ── RESPONSIVE ── */

@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .tt-luogo {
        font-size: 2.2rem;
    }

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

@media screen and (max-width: 768px) {

    /* Sidebar → navbar top */
    .nv-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 12px 16px;
        gap: 0;
        overflow: visible;
        z-index: 200;
    }

    .img-cl {
        width: auto;
        padding: 0;
    }

    .logo {
        width: 42px;
        height: 42px;
        object-fit: cover;
    }

    /* Nascondi voci desktop */
    .bt-menu,
    .dropmenu,
    .element,
    .icon-social-menu,
    .sidebar-bio {
        display: none;
    }

    /* Hamburger visibile */
    .toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        z-index: 201;
    }

    .toggle div {
        width: 24px;
        height: 2px;
        background-color: var(--light);
        border-radius: 2px;
        transition: var(--transition);
    }

    #drop:checked~.toggle div:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    #drop:checked~.toggle div:nth-child(2) {
        opacity: 0;
    }

    #drop:checked~.toggle div:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #drop:checked~.ham-menu {
        display: flex;
    }

    .ham-menu {
        position: absolute;
        top: 66px;
        left: 0;
        width: 100%;
        background-color: var(--dark);
        flex-direction: column;
        align-items: center;
        padding: 16px 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .ham-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .ham-menu ul li a {
        display: block;
        padding: 10px 20px;
        color: var(--light);
        text-decoration: none;
        font-size: 0.9rem;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        transition: background 0.2s ease;
    }

    .ham-menu ul li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    /* Contenuto sotto navbar top */
    .grid-home {
        margin-left: 0;
        padding-top: 66px;
        width: 100%;
    }

    .indice {
        position: sticky;
        top: 66px;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }

    .btn-indice {
        font-size: 0.65rem;
        padding: 5px 8px;
        letter-spacing: 1px;
    }

    .tt-luogo {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Griglia a 1 colonna su mobile */
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px 16px 24px;
    }

    .photo-card img {
        aspect-ratio: 16 / 10;
    }

    footer {
        margin-left: 0;
    }

    .scroll-to-top {
        right: 12px;
        bottom: 12px;
        font-size: 0.7rem;
        padding: 8px 16px;
    }
}

@media screen and (max-width: 480px) {

    .indice {
        gap: 4px;
        padding: 8px 8px;
    }

    .btn-indice {
        font-size: 0.6rem;
        padding: 4px 6px;
    }

    .tt-luogo {
        font-size: 1.3rem;
    }
}

@media screen and (min-width: 2500px) {}