/* ========================================
   Portale Cittadino - Modern CSS
   Design: Architettura Mediterranea Editoriale
   ======================================== */

/* === CSS Variables === */
:root {
    /* Colori Primari - Palette Mediterranea */
    --color-stone: #D4C5B9;
    --color-terracotta: #C96A34;
    --color-sand: #E8DDD0;
    --color-olive: #7A7256;
    --color-clay: #8B5E3C;
    --color-bronze: #B87333;
    
    /* Colori Neutri */
    --color-dark: #2A2520;
    --color-mid: #5A4F47;
    --color-light: #F5F1ED;
    --color-white: #FDFCFA;
    
    /* Tipografia */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Crimson Text', 'Times New Roman', serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    
    /* Transizioni */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Ombre */
    --shadow-sm: 0 2px 8px rgba(42, 37, 32, 0.08);
    --shadow-md: 0 4px 16px rgba(42, 37, 32, 0.12);
    --shadow-lg: 0 8px 32px rgba(42, 37, 32, 0.16);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-dark);
    background: var(--color-white);
    overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }

p {
    margin-bottom: var(--space-sm);
}

a {
    color: var(--color-terracotta);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-bronze);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout Utilities === */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* === Header === */
.site-header {
    position: relative;
    background: var(--color-white);
    border-bottom: 3px solid var(--color-stone);
    z-index: 1000;
}

.header-ornament {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--color-terracotta) 0%, 
        var(--color-bronze) 50%, 
        var(--color-terracotta) 100%
    );
    animation: ornamentShine 3s ease-in-out infinite;
}

@keyframes ornamentShine {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.main-nav {
    padding: var(--space-md) 0;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand .site-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-dark);
    letter-spacing: -0.5px;
}

.nav-brand .site-title span {
    color: var(--color-terracotta);
    display: block;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-menu a {
    color: var(--color-mid);
    font-size: 1.1rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-smooth);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-terracotta);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 80%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-terracotta);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-dark);
    border-radius: 2px;
    transition: all var(--transition-smooth);
}

/* === Hero Section === */
.hero {
    position: relative;
    padding: var(--space-xl) 0;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 197, 185, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(201, 106, 52, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--color-sand) 0%, var(--color-white) 100%);
    z-index: -1;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(184, 115, 51, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -50px) scale(1.1); }
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-terracotta);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: var(--space-md);
    animation: fadeIn 1s ease-out 0.2s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    color: var(--color-dark);
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-title-accent {
    color: var(--color-terracotta);
    display: block;
    font-style: italic;
    position: relative;
}

.hero-title-accent::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 150px;
    height: 4px;
    background: var(--color-bronze);
    border-radius: 2px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-mid);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-stats {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-terracotta);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-mid);
    margin-top: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    background: var(--color-stone);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-mid);
    font-size: 0.875rem;
    animation: bounce 2s ease-in-out infinite;
}

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

/* === Buttons === */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-terracotta);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-bronze);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-terracotta);
    border-color: var(--color-terracotta);
}

.btn-outline:hover {
    background: var(--color-terracotta);
    color: var(--color-white);
}

.btn-outline-dark {
    background: transparent;
    color: var(--color-dark);
    border-color: var(--color-dark);
}

.btn-outline-dark:hover {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-light {
    background: var(--color-white);
    color: var(--color-dark);
}

.btn-light:hover {
    background: var(--color-sand);
}

/* === Section Styles === */
section {
    padding: var(--space-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-sand);
    color: var(--color-clay);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: var(--space-sm);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
}

.section-description {
    font-size: 1.25rem;
    color: var(--color-mid);
    max-width: 600px;
    margin: 0 auto;
}

.section-footer {
    text-align: center;
    margin-top: var(--space-lg);
}

/* === News Grid === */
.featured-news {
    background: var(--color-light);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.news-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    animation: fadeInUp 0.6s ease-out both;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.news-card-large {
    grid-row: span 2;
}

.news-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.news-card-large .news-image {
    aspect-ratio: 16 / 12;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(42, 37, 32, 0.7), transparent);
}

.news-content {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-terracotta);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    align-self: flex-start;
}

.news-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.news-card-large .news-title {
    font-size: 2rem;
}

.news-title a {
    color: var(--color-dark);
    transition: color var(--transition-fast);
}

.news-title a:hover {
    color: var(--color-terracotta);
}

.news-excerpt {
    color: var(--color-mid);
    margin-bottom: var(--space-sm);
    flex: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--color-mid);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-stone);
}

.news-views::before {
    content: '👁 ';
}

/* === Monuments Grid === */
.monuments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.monument-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    animation: fadeInUp 0.6s ease-out both;
}

.monument-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.monument-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.monument-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.monument-card:hover .monument-image img {
    transform: scale(1.1);
}

.monument-overlay {
    position: absolute;
    inset: 0;
    background: rgba(201, 106, 52, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.monument-card:hover .monument-overlay {
    opacity: 1;
}

.monument-link {
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--color-white);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.monument-link:hover {
    background: var(--color-white);
    color: var(--color-terracotta);
}

.monument-content {
    padding: var(--space-md);
}

.monument-period {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--color-bronze);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

.monument-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.monument-title a {
    color: var(--color-dark);
}

.monument-title a:hover {
    color: var(--color-terracotta);
}

.monument-excerpt {
    color: var(--color-mid);
    font-size: 1rem;
}

/* === People Grid === */
.people-section {
    background: var(--color-white);
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.person-card {
    animation: fadeInUp 0.6s ease-out both;
}

.person-link {
    display: block;
    background: var(--color-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.person-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: var(--color-sand);
}

.person-image {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--color-stone);
}

.person-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.person-link:hover .person-image img {
    transform: scale(1.05);
}

.person-content {
    padding: var(--space-md);
    text-align: center;
}

.person-name {
    font-size: 1.375rem;
    color: var(--color-dark);
    margin-bottom: var(--space-xs);
}

.person-title {
    display: block;
    font-size: 0.875rem;
    color: var(--color-terracotta);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.person-dates {
    font-size: 0.875rem;
    color: var(--color-mid);
    font-family: var(--font-display);
}

/* === Dictionary CTA === */
.dictionary-cta {
    background: linear-gradient(135deg, var(--color-terracotta), var(--color-bronze));
    color: var(--color-white);
    text-align: center;
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.dictionary-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.cta-icon {
    font-size: 4rem;
    margin-bottom: var(--space-sm);
}

.cta-title {
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.cta-description {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
    opacity: 0.95;
}

/* === Footer === */
.site-footer {
    background: var(--color-dark);
    color: var(--color-sand);
    padding: var(--space-xl) 0 var(--space-md);
    position: relative;
}

.footer-ornament {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--color-terracotta) 0%, 
        var(--color-bronze) 50%, 
        var(--color-terracotta) 100%
    );
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-title {
    font-size: 1.75rem;
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.footer-subtitle {
    font-size: 1.125rem;
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.footer-text {
    color: var(--color-stone);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links a {
    color: var(--color-stone);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--color-stone);
    transition: all var(--transition-smooth);
}

.social-link:hover {
    background: var(--color-terracotta);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-mid);
    font-size: 0.875rem;
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    :root {
        --space-xl: 4rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card-large {
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        min-height: auto;
        padding: var(--space-lg) 0;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .stat-divider {
        display: none;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .monuments-grid,
    .people-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
    
    section {
        padding: var(--space-lg) 0;
    }
}
