/* ===== FONTS ===== */

@font-face {
    font-family: "Roboto Local";
    src: url("../fonts/Roboto-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Roboto Local";
    src: url("../fonts/Roboto-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Roboto Local";
    src: url("../fonts/Roboto-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Times New Roman Local";
    src: url("../fonts/Times New Roman Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

/* ===== VARIABLES ===== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Roboto Local";
    font-feature-settings:
        "liga" 0,
        "clig" 0,
        "kern" 0;
}

:root {
    --h1: clamp(2.25rem, 4vw, 3rem);
    --h2: clamp(1.3rem, 2.7vw, 1.8rem);
    --h5: clamp(0.875rem, 1.8vw, 0.95rem);
    --h6: clamp(0.75rem, 1.6vw, 0.85rem);
    --body: clamp(0.97rem, 2vw, 1.05rem);
    --space-xs: clamp(0.25rem, 1vw, 0.5rem);
    --space-s: clamp(0.7rem, 1.67vw, 1rem);
    --space: clamp(1rem, 4vw, 2rem);
    --space-l: clamp(1.5rem, 6vw, 3rem);
    --space-xl: clamp(3rem, 8vw, 6rem);
    --bg: #f0efed;
    --text: #303030;
    --accent: #007a3e;
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    --nav-h: calc(var(--h1) * 0.7 + var(--space-xs) * 2);
}

/* ===== BASE ===== */

::selection {
    background-color: var(--text);
    color: var(--bg);
}

html {
    scroll-behavior: smooth;
}

/* ===== LAYOUT ===== */

body {
    background: var(--bg);
    font-size: var(--body);
    line-height: 1.8;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    padding: var(--space-xs) var(--space-s);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.075);
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    flex-wrap: wrap;
}

nav a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text);
    text-decoration: none;
    font-size: var(--h5);
}

nav a:not(:has(img)) {
    opacity: 0.7;
}

nav a:hover {
    opacity: 1;
    transition: opacity 0.2s;
}

nav ul li a {
    padding: var(--space-xs);
}

nav a img {
    height: calc(var(--h1) * 0.7);
}

main {
    width: 85%;
    max-width: 1024px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    background: var(--bg);
}

/* ===== HEADER ===== */

header {
    position: relative;
    width: 100%;
    min-height: calc(100dvh - var(--nav-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space);
}

header h1 {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

header h1 img {
    height: calc(var(--h1) * 2.7);
    padding-bottom: calc(var(--h1) * 0.4);
}

header h1 div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 p {
    font-family: "Times New Roman Local";
    line-height: 1.2;
    font-size: var(--h1);
    color: var(--accent);
}

header > p {
    opacity: 0.6;
    text-align: center;
}

header .scroll-down {
    position: absolute;
    bottom: var(--space-s);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    text-decoration: none;
    color: var(--accent);
    animation: bounce-down 1.8s var(--ease) infinite;
    transition: color 0.6s var(--ease);
}

header .scroll-down::before {
    content: "";
    width: 15px;
    height: 15px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(45deg);
}

header .scroll-down:hover {
    color: var(--text);
}

@keyframes bounce-down {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

/* ===== SECTIONS ===== */

section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-s);
    scroll-margin-top: 4em;
}

section p {
    opacity: 0.9;
}

section h2 {
    display: flex;
    align-items: center;
    width: 100%;
    gap: var(--space-s);
    white-space: nowrap;
    font-size: var(--h2);
    opacity: 0.9;
}

section h2::before,
section h2::after {
    content: "";
    height: 4px;
    background-color: var(--accent);
    flex-grow: 1;
    border-radius: 10px;
}

section h2 img {
    width: 1em;
    height: 1em;
    margin-right: -0.3em;
    opacity: 0.8;
}

/* ===== FOOTER ===== */

footer {
    padding: var(--space-s) 0;
    border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    font-size: var(--h6);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-s);
    width: 100%;
    font-weight: 300;
}

/* ===== GALLERY ===== */

#galleria {
    width: 100%;
    max-width: 100%;
}

#galleria > div {
    width: 100%;
    position: relative;
    cursor: grab;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

#galleria > div:active {
    cursor: grabbing;
}

#galleria > div > div {
    display: flex;
    will-change: transform;
    transition: transform 0.6s var(--ease);
    gap: 20px;
    padding: 12px 0 20px;
}

#galleria figure {
    flex: 0 0 clamp(50%, 60%, 75%);
    opacity: 0.4;
    transform: scale(0.9);
    transition:
        opacity 0.6s var(--ease),
        transform 0.6s var(--ease),
        box-shadow 0.6s var(--ease);
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
}

#galleria figure[data-active] {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.075);
}

#galleria figure img {
    width: 100%;
    height: clamp(200px, 40px + 40vw, 400px);
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

#galleria menu {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    list-style: none;
    padding: 0;
}

#galleria button {
    cursor: pointer;
    height: 10px;
    width: 10px;
    background: color-mix(in srgb, var(--text) 20%, transparent);
    border: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
}

#galleria button[data-active] {
    background: var(--accent);
    width: 30px;
    border-radius: 10px;
}

/* ===== SERVIZI ===== */

#servizi ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 2vw, 20px);
    list-style: none;
    margin-top: 40px;
}

#servizi li {
    background: #fff;
    padding: clamp(15px, 3vw, 25px);
    border-radius: 12px;
    border: 1px solid #eee;
    font-size: clamp(0.9rem, 1vw + 0.5rem, 1.1rem);
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.045);
}

#servizi li::before {
    content: "";
    width: 10%;
    height: 3px;
    background: var(--accent);
    margin-bottom: 15px;
    border-radius: 2px;
    display: block;
    transition: width 0.3s var(--ease);
}

#servizi li:hover::before {
    width: 20%;
}

#servizi li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.075);
}

/* ===== ORARI ===== */

#orari > div {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-l);
    justify-content: center;
    justify-items: center;
    align-items: start;
}

#orari > div > article {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

#orari h3 {
    color: var(--accent);
    font-size: var(--h2);
    font-family: "Times New Roman Local";
    text-align: center;
}

table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    transition: all 0.3s var(--ease);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.045);
}

th {
    background: color-mix(in srgb, var(--bg) 95%, black);
    font-size: var(--h6);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--space-xs);
    text-align: center;
}

td {
    padding: var(--space-s);
    text-align: center;
    font-weight: 700;
    font-size: var(--body);
}

#orari article table:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.075);
}

/* ===== SEDI ===== */

#sedi > article {
    width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: var(--space);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.045);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-s);
    transition: all 0.3s var(--ease);
}

#sedi > article p {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
}

#sedi > article span {
    line-height: 1;
}

#sedi > article img {
    width: 1em;
    height: 1em;
    opacity: 0.8;
}

#sedi article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.075);
}

#sedi h3 {
    color: var(--accent);
    font-size: var(--h3);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#sedi a {
    color: inherit;
    text-decoration: none;
}

#sedi a:hover {
    text-decoration: underline;
}

#sedi iframe {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 260px;
    max-height: 420px;
    border: 0;
    border-radius: 16px;
    margin-top: var(--space-s);
    background-color: var(--bg);
}
