/* A.S.D. Tennis Roma: foglio di stile unico del sito */

:root {
    --green-900: #102e27;
    --green-800: #173f35;
    --green-600: #24614f;
    --clay: #c4552d;
    --clay-dark: #a3431f;
    --cream: #f7f4ee;
    --sand: #ece5d8;
    --ink: #1d2321;
    --muted: #5d6661;
    --line: #ddd5c6;
    --white: #ffffff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 46, 39, .06), 0 8px 24px rgba(16, 46, 39, .08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--cream);
    overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-600); text-underline-offset: 3px; }
a:hover { color: var(--clay); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--green-900); margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 8px 12px; border-radius: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--clay); margin-bottom: .75em; }
.lead { font-size: 1.2rem; color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }

/* Bottoni */
.btn {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .8em 1.4em; border-radius: 999px;
    background: var(--clay); color: var(--white); font-weight: 600; text-decoration: none;
    border: 2px solid var(--clay); transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--clay-dark); border-color: var(--clay-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .7); }
.btn-ghost:hover { background: var(--white); color: var(--green-900); border-color: var(--white); }
.prose .btn-ghost, .page-head ~ .container .btn-ghost { color: var(--green-800); border-color: var(--green-800); }
.more { font-weight: 600; text-decoration: none; color: var(--clay); }
.more:hover { color: var(--clay-dark); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(16, 46, 39, .96); backdrop-filter: saturate(1.4) blur(8px); color: var(--white); }
.topbar { font-size: .82rem; background: var(--green-900); color: rgba(255, 255, 255, .75); }
.topbar-inner { display: flex; justify-content: flex-end; gap: 24px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: var(--white); text-decoration: none; }
.nav-bar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand img { width: 44px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.brand-text small { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a, .sub-toggle {
    display: block; padding: 10px 14px; border-radius: 8px;
    color: rgba(255, 255, 255, .9); text-decoration: none; font: inherit; font-size: .95rem; font-weight: 500;
    background: none; border: 0; cursor: pointer;
}
.main-nav a:hover, .sub-toggle:hover, .main-nav a.active, .sub-toggle.active { color: var(--white); background: rgba(255, 255, 255, .1); }
.main-nav a.active, .sub-toggle.active { box-shadow: inset 0 -2px 0 var(--clay); }
.sub-toggle::after { content: ""; display: inline-block; margin-left: 6px; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.has-sub { position: relative; }
.has-sub > ul {
    list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 250px;
    background: var(--white); border-radius: 12px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.has-sub > ul a { color: var(--ink); }
.has-sub > ul a:hover { background: var(--cream); color: var(--clay); }
.has-sub:hover > ul, .has-sub:focus-within > ul, .has-sub.open > ul { opacity: 1; visibility: visible; transform: none; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--white); margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1020px) {
    .site-header { backdrop-filter: none; background: var(--green-900); }
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed; inset: 0 0 0 auto; top: 0; width: min(340px, 88vw); padding: 96px 20px 24px;
        background: var(--green-900); overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s;
    }
    .nav-open .main-nav { transform: none; visibility: visible; box-shadow: -20px 0 40px rgba(0, 0, 0, .3); }
    .main-nav > ul { flex-direction: column; align-items: stretch; }
    .main-nav a, .sub-toggle { width: 100%; text-align: left; padding: 12px 14px; font-size: 1.05rem; }
    .has-sub > ul { position: static; opacity: 1; visibility: visible; transform: none; display: none; background: transparent; box-shadow: none; padding: 0 0 0 12px; }
    .has-sub.open > ul { display: block; }
    .has-sub > ul a { color: rgba(255, 255, 255, .85); }
    .has-sub > ul a:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
    .has-sub:hover > ul { display: none; }
    .has-sub.open:hover > ul { display: block; }
    .nav-bar { position: relative; z-index: 2; }
    .nav-toggle { position: relative; z-index: 3; }
    .topbar-inner { justify-content: space-between; }
}

/* Home: hero */
.hero { position: relative; min-height: min(78vh, 720px); display: flex; align-items: flex-end; color: var(--white); overflow: hidden; background: var(--green-900); }
.hero-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: slide 18s infinite; }
.hero-slides img:nth-child(1) { animation-delay: 0s; }
.hero-slides img:nth-child(2) { animation-delay: 6s; }
.hero-slides img:nth-child(3) { animation-delay: 12s; }
@keyframes slide { 0% { opacity: 0; transform: scale(1.04); } 6% { opacity: 1; } 33% { opacity: 1; } 40% { opacity: 0; transform: scale(1); } 100% { opacity: 0; } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 46, 39, .15) 0%, rgba(16, 46, 39, .35) 45%, rgba(16, 46, 39, .88) 100%); }
.hero-content { position: relative; z-index: 1; padding-top: 120px; padding-bottom: 72px; }
.hero h1 { color: var(--white); font-size: clamp(2.4rem, 6vw, 4.25rem); margin-bottom: .25em; }
.hero .eyebrow { color: #f0b49c; }
.hero-sub { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 40ch; color: rgba(255, 255, 255, .9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (prefers-reduced-motion: reduce) {
    .hero-slides img { animation: none; }
    .hero-slides img:first-child { opacity: 1; }
}

.stats { background: var(--white); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 32px; padding-bottom: 32px; }
.stats strong { display: block; font-family: var(--serif); font-size: 2.2rem; color: var(--green-800); line-height: 1.1; }
.stats span { color: var(--muted); font-size: .92rem; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* Sezioni */
.section { padding: 72px 0; }
.section-alt { background: var(--sand); }
.section-dark { background: var(--green-900); color: rgba(255, 255, 255, .88); }
.section-dark h2 { color: var(--white); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }

/* Card notizie */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 46, 39, .08), 0 16px 36px rgba(16, 46, 39, .14); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.2rem; margin: .4em 0 .5em; }
.card-body h3 a { color: var(--green-900); text-decoration: none; }
.card-body h3 a:hover { color: var(--clay); }
.card-body .excerpt { color: var(--muted); font-size: .97rem; margin-bottom: 1em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-body .excerpt p { margin: 0 0 .5em; }
.draft-banner { margin: 0; padding: 10px 20px; background: #fff3cd; color: #6b4e00; text-align: center; font-weight: 600; }
.card-body .more { margin-top: auto; }
.tag { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green-600); background: #e3efe9; padding: 3px 10px; border-radius: 999px; }

/* Attivita' */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.feature img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.feature div { padding: 22px; }
.feature p { color: var(--muted); }
.feature:hover { color: var(--ink); }
.feature:hover h3 { color: var(--clay); }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.split-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; filter: sepia(.15); }
.facts { display: grid; grid-template-columns: 9rem 1fr; gap: 12px 20px; margin: 24px 0 32px; }
.facts dt { font-weight: 700; color: var(--green-800); }
.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; gap: 32px; }
    .facts { grid-template-columns: 1fr; gap: 2px; }
    .facts dd { margin-bottom: 12px; }
}

.quotes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 420px); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.quote { margin: 0; scroll-snap-align: start; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.quote blockquote { margin: 0 0 20px; max-height: 22em; overflow-y: auto; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; }
.quote blockquote p::before { content: "“"; font-size: 3rem; line-height: 0; vertical-align: -.45em; margin-right: 4px; color: var(--clay); }
.quote figcaption { margin-top: auto; display: flex; flex-direction: column; }
.quote figcaption strong { color: var(--white); }
.quote figcaption span { font-size: .88rem; color: rgba(255, 255, 255, .65); }

.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: stretch; }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); }
.map { min-height: 360px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--sand); }
.map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } .contact-list li { flex-direction: column; gap: 0; } }

/* Pagine interne */
.page-head { background: var(--green-800); color: var(--white); padding: 56px 0 48px; background-image: radial-gradient(circle at 85% 20%, rgba(196, 85, 45, .35), transparent 45%); }
.page-head h1 { color: var(--white); margin: 0; }
.page-head .eyebrow { color: #f0b49c; }

.article-hero { position: relative; min-height: 420px; display: flex; align-items: flex-end; background: var(--green-800) center / cover no-repeat; color: var(--white); }
.article-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-hero::before { z-index: 1;  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 46, 39, .1), rgba(16, 46, 39, .85)); }
.article-hero .container { position: relative; z-index: 2; padding-top: 80px; padding-bottom: 40px; }
.article-hero h1 { color: var(--white); max-width: 26ch; margin: 0; }
.article-hero.no-image { min-height: 0; }
.back { display: inline-block; margin-bottom: 16px; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .92rem; }
.back:hover { color: var(--white); }

.prose { max-width: 760px; margin: 0 auto; padding: 48px 0 72px; }
.prose.wide { max-width: none; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose > :first-child { margin-top: 0; }
.prose figure { margin: 32px 0; }
.prose figure img { border-radius: var(--radius); width: 100%; box-shadow: var(--shadow); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose p .btn { margin: 4px 8px 4px 0; }

.table-wrap { overflow-x: auto; margin: 24px 0 32px; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--green-800); color: var(--white); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td, tr:nth-child(even) td { background: #faf8f4; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 32px 0; }
.gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--sand); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery a:hover img { transform: scale(1.05); }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin: 20px 0 48px; }
.person { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.avatar { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; margin-bottom: 12px; background: var(--sand); display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.initials { font-family: var(--serif); font-size: 2rem; color: var(--green-600); }
.person span { color: var(--muted); font-size: .92rem; }

/* Lightbox */
.lightbox-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8, 20, 17, .94); display: grid; place-items: center; padding: 24px; }
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img { max-width: min(1200px, 100%); max-height: 86vh; border-radius: 8px; }
.lightbox-overlay button { position: absolute; background: rgba(255, 255, 255, .12); color: var(--white); border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lightbox-overlay button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Footer */
.site-footer { background: var(--green-900); color: rgba(255, 255, 255, .75); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.site-footer h2 { font-family: var(--font); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--white); margin-bottom: 1em; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: #f0b49c; }
.site-footer li { margin-bottom: .5em; }
.brand-footer { margin-bottom: 16px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

@media (max-width: 600px) {
    .section { padding: 52px 0; }
    .prose { padding: 32px 0 52px; }
    .article-hero { min-height: 320px; }
    .container { padding: 0 16px; }
}
