:root {
    --primary: #00625d;
    --primary-deep: #003c35;
    --primary-dark: #00211b;
    --accent: #6eb74c;
    --accent-dark: #49792f;
    --accent-forest: #2d481f;
    --tortora: #aca198;
    --tortora-dark: #6f625a;
    --white: #fafaf8;
    --off-white: #f5f3f0;
    --light-bg: #edeae6;
    --text: #1a1a1a;
    --text-light: #555;
    --shadow: 0 4px 24px rgba(0,33,27,.08);
    --shadow-lg: 0 12px 48px rgba(0,33,27,.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .3s cubic-bezier(.4,0,.2,1);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    background: rgba(250,250,248,.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,98,93,.06);
    transition: all var(--transition);
}
.navbar.scrolled {
    background: rgba(250,250,248,.98);
    box-shadow: 0 2px 20px rgba(0,33,27,.06);
}
.navbar .container {
    display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.navbar-logo { height: 44px; width: auto; }
.navbar-logo img { height: 100%; width: auto; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
    font-size: .875rem; font-weight: 500; letter-spacing: .02em;
    color: var(--primary-dark); text-transform: uppercase;
    position: relative; padding: 4px 0;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: width var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.hamburger {
    display: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.hamburger span {
    display: block; width: 24px; height: 2px; background: var(--primary-dark);
    margin: 5px 0; transition: all var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===== HERO ===== */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    justify-content: center; text-align: center;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-deep) 100%);
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    opacity: .3;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,33,27,.4) 0%, rgba(0,60,53,.6) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 40px 24px; }
.hero-logo { width: 160px; height: auto; margin: 0 auto 32px; filter: brightness(0) invert(1); }
.hero h1 {
    font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--white); font-weight: 700; line-height: 1.1; margin-bottom: 16px;
}
.hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.35rem); color: rgba(250,250,248,.8);
    font-weight: 300; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 40px;
}
.hero-scroll {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--white); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase;
    opacity: .7; transition: opacity var(--transition); cursor: pointer;
    background: none; border: none; font-family: var(--font);
}
.hero-scroll:hover { opacity: 1; }
.hero-scroll svg { animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ===== SECTIONS COMMON ===== */
.section { padding: 100px 0; }
.section-alt { background: var(--off-white); }
.section-dark { background: var(--primary-dark); color: var(--white); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header h2 {
    font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-dark); margin-bottom: 12px; font-weight: 700;
}
.section-dark .section-header h2 { color: var(--white); }
.section-header .divider {
    width: 60px; height: 3px; background: var(--accent); margin: 16px auto;
    border-radius: 2px;
}
.section-header p {
    font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto;
}
.section-dark .section-header p { color: rgba(250,250,248,.7); }

/* ===== STORIA ===== */
.storia-content {
    display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.storia-text { color: var(--text-light); line-height: 1.8; }
.storia-text p { margin-bottom: 16px; }
.storia-img {
    border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
    aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
}
.storia-img img { width: 100%; height: 100%; object-fit: cover; }
.storia-img .placeholder-icon { color: rgba(255,255,255,.3); }
.storia-img .placeholder-icon svg { width: 80px; height: 80px; }

@media (max-width: 768px) {
    .storia-content { grid-template-columns: 1fr; gap: 32px; }
    .storia-img { order: -1; }
}

/* ===== SERVICES ===== */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}
.service-card {
    background: var(--white); border-radius: var(--radius); padding: 40px 28px;
    text-align: center; box-shadow: var(--shadow); cursor: pointer;
    transition: all var(--transition); border: 1px solid transparent;
}
.service-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}
.service-icon {
    width: 56px; height: 56px; margin: 0 auto 20px;
    color: var(--primary); transition: color var(--transition);
}
.service-icon svg { width: 100%; height: 100%; }
.service-card:hover .service-icon { color: var(--accent); }
.service-card h3 {
    font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 8px;
}
.service-card p { font-size: .9rem; color: var(--text-light); line-height: 1.5; }

/* ===== MUSEUM / GALLERY ===== */
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.gallery-item {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    aspect-ratio: 4/3; cursor: pointer;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--transition);
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,33,27,.6) 0%, transparent 60%);
    display: flex; align-items: flex-end; padding: 20px;
    opacity: 0; transition: opacity var(--transition);
}
.gallery-item:hover .overlay { opacity: 1; }
.gallery-item .overlay span { color: var(--white); font-size: .9rem; font-weight: 500; }

/* ===== EVENTS ===== */
.events-slider { position: relative; overflow: hidden; }
.events-track {
    display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 8px 0 24px; -ms-overflow-style: none; scrollbar-width: none;
}
.events-track::-webkit-scrollbar { display: none; }
.event-card {
    flex: 0 0 340px; scroll-snap-align: start;
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition);
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-card-img {
    height: 200px; background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.event-card-img img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 24px; }
.event-date {
    display: inline-block; font-size: .8rem; font-weight: 600; color: var(--accent-dark);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
}
.event-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; color: var(--primary-dark); }
.event-card p { font-size: .9rem; color: var(--text-light); line-height: 1.5; }
.event-location {
    display: flex; align-items: center; gap: 6px; margin-top: 12px;
    font-size: .8rem; color: var(--tortora-dark);
}

/* ===== BIBLIOTECA ===== */
.biblioteca-content {
    display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.biblioteca-text h3 {
    font-family: var(--font-display); font-size: 1.8rem; color: var(--primary-dark);
    margin-bottom: 20px;
}
.biblioteca-text p { color: var(--text-light); margin-bottom: 16px; line-height: 1.7; }
.biblioteca-img {
    border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
}
.biblioteca-img img { width: 100%; height: 100%; object-fit: cover; }
.biblioteca-img .placeholder-icon { color: rgba(255,255,255,.3); }
.biblioteca-img .placeholder-icon svg { width: 80px; height: 80px; }

/* ===== NEWS ===== */
.news-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 32px;
}
.news-card {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition);
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card-img {
    height: 200px; background: linear-gradient(135deg, var(--tortora) 0%, var(--tortora-dark) 100%);
    overflow: hidden;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card-body { padding: 24px; }
.news-date { font-size: .8rem; color: var(--tortora-dark); margin-bottom: 8px; }
.news-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--primary-dark); }
.news-card p { font-size: .9rem; color: var(--text-light); line-height: 1.5; }

/* ===== PODCAST ===== */
.podcast-list { max-width: 800px; margin: 0 auto; }
.podcast-item {
    display: flex; align-items: center; gap: 20px;
    background: var(--white); border-radius: var(--radius); padding: 20px 24px;
    margin-bottom: 16px; box-shadow: var(--shadow);
    transition: all var(--transition);
}
.podcast-item:hover { box-shadow: var(--shadow-lg); }
.podcast-play {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
    background: var(--primary); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; transition: all var(--transition);
}
.podcast-play:hover { background: var(--accent-dark); transform: scale(1.05); }
.podcast-play.playing { background: var(--accent-dark); }
.podcast-play svg { width: 20px; height: 20px; }
.podcast-info { flex: 1; min-width: 0; }
.podcast-info h3 { font-size: 1rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 4px; }
.podcast-info p {
    font-size: .85rem; color: var(--text-light);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.podcast-progress {
    width: 100%; height: 4px; background: var(--light-bg); border-radius: 2px;
    margin-top: 8px; cursor: pointer; position: relative;
}
.podcast-progress-bar {
    height: 100%; background: var(--accent); border-radius: 2px;
    width: 0; transition: width .1s linear;
}
.podcast-duration { flex-shrink: 0; font-size: .8rem; color: var(--tortora-dark); min-width: 50px; text-align: right; }

/* ===== FOOTER ===== */
.footer {
    background: var(--primary-dark); color: rgba(250,250,248,.7); padding: 80px 0 32px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
    margin-bottom: 48px;
}
.footer-brand .footer-logo { height: 48px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-brand p { font-size: .9rem; line-height: 1.6; max-width: 300px; }
.footer h4 {
    font-size: .85rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--white); margin-bottom: 20px;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: rgba(250,250,248,.6); font-size: .9rem; transition: color var(--transition); }
.footer ul a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(250,250,248,.08); display: flex; align-items: center;
    justify-content: center; color: rgba(250,250,248,.6); transition: all var(--transition);
}
.footer-social a:hover { background: var(--accent); color: var(--white); }
.footer-social a svg { width: 18px; height: 18px; }
.footer-bottom {
    border-top: 1px solid rgba(250,250,248,.1); padding-top: 24px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: .8rem;
}
.footer-bottom a { color: var(--accent); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,33,27,.6); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all var(--transition);
    padding: 24px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--white); border-radius: var(--radius);
    width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
    transform: translateY(20px) scale(.97);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header {
    position: sticky; top: 0; background: var(--white);
    padding: 24px 28px 16px; display: flex; justify-content: space-between;
    align-items: flex-start; border-bottom: 1px solid var(--light-bg); z-index: 1;
}
.modal-header h2 {
    font-family: var(--font-display); font-size: 1.5rem; color: var(--primary-dark);
    flex: 1; padding-right: 16px;
}
.modal-close {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--light-bg); cursor: pointer; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all var(--transition);
}
.modal-close:hover { background: var(--primary); color: var(--white); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 28px; }
.modal-body img { border-radius: var(--radius-sm); margin-bottom: 20px; }
.modal-body p { margin-bottom: 16px; line-height: 1.7; color: var(--text-light); }
.modal-meta {
    display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
    font-size: .85rem; color: var(--tortora-dark);
}
.modal-meta span { display: flex; align-items: center; gap: 6px; }

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.92); display: flex; align-items: center;
    justify-content: center; opacity: 0; visibility: hidden;
    transition: all var(--transition);
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-img {
    max-width: 90vw; max-height: 85vh; object-fit: contain;
    border-radius: var(--radius-sm);
}
.lightbox-close {
    position: absolute; top: 20px; right: 20px;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.15); color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.12); color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .biblioteca-content { gap: 40px; }
}

@media (max-width: 768px) {
    :root { --nav-h: 64px; }
    .nav-links {
        position: fixed; top: var(--nav-h); left: 0; right: 0;
        background: rgba(250,250,248,.98); backdrop-filter: blur(20px);
        flex-direction: column; align-items: center; gap: 0; padding: 16px 0;
        transform: translateY(-100%); opacity: 0; visibility: hidden;
        transition: all var(--transition); border-bottom: 1px solid var(--light-bg);
    }
    .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-links a { padding: 12px 24px; display: block; width: 100%; text-align: center; }
    .hamburger { display: block; }
    .section { padding: 72px 0; }
    .biblioteca-content { grid-template-columns: 1fr; }
    .biblioteca-img { order: -1; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .news-grid { grid-template-columns: 1fr; }
    .event-card { flex: 0 0 calc(100vw - 64px); }
    .hero-logo { width: 120px; }
    .modal { max-height: 95vh; margin: 8px; }
}

@media (max-width: 480px) {
    .services-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .service-card { padding: 28px 16px; }
    .gallery-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .podcast-item { flex-wrap: wrap; }
    .podcast-duration { width: 100%; text-align: left; }
    .container { padding: 0 16px; }
}
