/* MARIAPAOLA PINTO - DESIGN GIORNALISTICO PROFESSIONALE (Versione Definitiva) */
/* Creato da SoSiteWeb - Professional Web Agency */

/* Fonts caricati via <link> in header.php per performance migliore */

:root {
    --font-headlines: 'Playfair Display', serif;
    --font-body: 'Crimson Text', serif;
    --font-ui: 'Inter', sans-serif;
    --ink-black: #181a20;
    --paper-white: #fafdff;
    --news-gray: #3a4252;
    --accent-gold: #b08d55; /* Scurito per accessibilità (WCAG AA su bianco) */
    --accent-gold-light: #e2b86b; /* Colore originale per sfondi/bordi */
    /* Primary accent now follows the site brand burgundy */
    --accent-primary: var(--brand-burgundy);
    --accent-blue: var(--accent-primary); /* legacy alias kept for compatibility */
    --light-gray: #f3f6fa;
    --border-gray: #e0e6ed;
    --soft-gray: #f5f7fb;
    --light-border: #dce3ee;
    --muted-text: #5f6b7a;
    --red-breaking: #ef4444;
    --shadow-subtle: 0 2px 8px rgba(44,82,130,0.08);
    --shadow-medium: 0 8px 24px rgba(44,82,130,0.12);
    --shadow-deep: 0 16px 40px rgba(44,82,130,0.18);
    --shadow-glass: 0 4px 32px rgba(124,58,237,0.12);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-elegant: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);

    /* Site brand variables (burgundy / gold / black) - used by admin and CTA buttons */
    --brand-burgundy: #9B2335;
    --brand-gold: #e2b86b;
    --brand-black: #181a20;
    --brand-burgundy-rgb: 155,35,53;
    --brand-gold-rgb: 226,184,107;
}

/* === RESET E BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; } /* Base font size migliorata */
body {
    font-family: var(--font-body);
    color: var(--ink-black);
    background-color: var(--paper-white);
    line-height: 1.75; /* Aumentata per leggibilità */
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; /* Migliora la resa del testo */
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* === TIPOGRAFIA GIORNALISTICA === */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-headlines); font-weight: 600; line-height: 1.3; color: var(--ink-black); margin-bottom: 0.75em; text-rendering: optimizeLegibility; }
h1 { font-size: clamp(2.8rem, 5vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; margin-bottom: 1rem; }
p { margin-bottom: 1.5em; line-height: 1.8; color: var(--news-gray); font-size: 1.1rem; letter-spacing: 0.005em; }
.lead { font-size: 1.35rem; font-weight: 400; color: var(--ink-black); line-height: 1.65; margin-bottom: 1.5rem; max-width: 750px; margin-left: auto; margin-right: auto; text-align: center; }
blockquote {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--ink-black);
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--accent-gold-light);
    position: relative;
    background: var(--light-gray);
    border-radius: 8px;
}
blockquote::before {
    display: none; /* Rimosso il grande " */
}
hr { border: 0; border-top: 1px solid var(--border-gray); margin: 4rem auto; max-width: 200px; }
strong { font-weight: 600; color: var(--accent-primary); }

/* === SKIP LINK === */
.skip-link { position: absolute; top: -50px; left: 6px; background: var(--ink-black); color: var(--paper-white); padding: 0.5rem 1rem; text-decoration: none; z-index: 10000; border-radius: 4px; font-family: var(--font-ui); font-weight: 500; transition: top 0.2s ease-in-out; }
.skip-link:focus { top: 6px; }

/* === HEADER MODERNO === */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-gray);
    position: sticky; top: 0; z-index: 1000;
    backdrop-filter: blur(16px) saturate(150%);
    box-shadow: none;
    transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.main-header.scrolled {
    box-shadow: var(--shadow-subtle);
    border-bottom-color: transparent;
}
.main-header .container {
    display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2.5rem;
}
.logo {
    font-family: var(--font-headlines); font-size: 2.1rem; font-weight: 700; text-decoration: none; color: var(--ink-black); letter-spacing: -0.02em; position: relative; transition: var(--transition-smooth);
}
.logo::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 3px; background: var(--accent-primary); transition: var(--transition-smooth);
}
.logo:hover::after { width: 100%; }
.main-nav ul { list-style: none; display: flex; gap: 2.8rem; font-family: var(--font-ui); }
.main-nav a {
    text-decoration: none; color: var(--news-gray); font-weight: 600; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; position: relative; padding: 0.7rem 0; transition: color 0.2s, background-color 0.2s;
    border-radius: 6px;
}
.main-nav a::before {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--accent-primary); transform: translateX(-50%); transition: width 0.25s ease-in-out;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--accent-primary);
    background: transparent;
    transform: none;
    box-shadow: none;
}
.main-nav a:hover::before, .main-nav a.active::before { width: 100%; }
.hamburger { display: none; flex-direction: column; cursor: pointer; background: none; border: none; padding: 0.5rem; gap: 0.35rem; }
.hamburger .bar { width: 28px; height: 3px; background-color: var(--ink-black); transition: var(--transition-fast); border-radius: 2px; }

/* === HERO MODERNO === */
.hero {
    padding: 8rem 0;
    text-align: center;
    color: var(--paper-white);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    border-bottom: 1px solid var(--border-gray);
}
.hero h1, .hero h2, .hero p {
    color: var(--paper-white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    filter: none;
}
.hero h1 { font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; }
.hero h2 { font-family: var(--font-ui); font-size: 1.2rem; font-weight: 600; color: var(--paper-white); opacity: 0.9; margin-bottom: 2.5rem; letter-spacing: 0.1em; text-transform: uppercase; }
.hero blockquote {
    color: var(--paper-white);
    border-left-color: var(--accent-gold-light);
    font-size: 1.5rem;
    max-width: 750px;
    margin: 2.5rem auto;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: none;
    text-align: center;
    text-shadow: none;
}

/* HERO BACKGROUND MODERNO */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(10, 15, 25, 0.7) 0%, rgba(30, 40, 55, 0.4) 100%);
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 3;
}

/* === BOTTONI MODERNI === */
.cta-button, .secondary-button {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.9rem 2rem;
    text-decoration: none; font-family: var(--font-ui); font-weight: 600;
    font-size: 1rem; letter-spacing: 0.04em; border-radius: 8px;
    position: relative; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
    z-index: 2;
    border: 1px solid var(--border-gray);
    background: var(--paper-white);
    color: var(--ink-black);
    box-shadow: var(--shadow-subtle);
    outline: none;
}
.cta-button:focus, .secondary-button:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
.cta-button:hover, .cta-button:focus {
    background: var(--accent-primary);
    color: var(--paper-white);
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}
.secondary-button {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-gray);
    font-weight: 500;
}
.secondary-button:hover {
    background: var(--light-gray);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-subtle);
    border-color: var(--border-gray);
}

/* === PAGE HEADERS (PAGINE INTERNE) === */
.page-header { background: var(--light-gray); padding: 5rem 0 4rem; text-align: center; position: relative; margin-bottom: 4rem; border-bottom: 1px solid var(--border-gray); }
.page-header::after { content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 80px; height: 2px; background: var(--accent-primary); }
.page-header h1 { margin-bottom: 0; }
.page-content { padding: 4rem 0; }

/* === BIO SECTION (CHI SONO) === */
.bio-content { display: grid; grid-template-columns: 280px 1fr; gap: 4rem; align-items: start; margin-bottom: 4rem; }
.bio-image img { width: 100%; border-radius: 12px; box-shadow: var(--shadow-medium); }
.bio-details { background: transparent; padding: 0; border-radius: 0; margin-top: 0; border-left: none; }
.bio-details h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.bio-details p { margin-bottom: 1rem; font-size: 1.1rem; }

/* === SEZIONE VALORI (CHI SONO) === */
.values-section {
    padding: 4rem 0;
}
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    text-align: center;
}
.value-card {
    background: var(--light-gray);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    transition: var(--transition-smooth);
}
.value-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-primary);
}
.value-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem auto;
    color: var(--accent-primary);
}
.value-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--ink-black);
}
.value-card p {
    font-size: 1rem;
    color: var(--news-gray);
    margin-bottom: 0;
}

/* === TIMELINE MIGLIORATA (CHI SONO) === */
.timeline-section {
    padding: 4rem 0;
}
.timeline-wrapper {
    max-width: 800px;
    margin: 0 auto;
}
.timeline {
    position: relative;
    padding-left: 4rem;
    border-left: 3px solid var(--border-gray);
}
.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-icon {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 50px;
    height: 50px;
    background: var(--paper-white);
    border: 3px solid var(--border-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    transition: var(--transition-smooth);
}
.timeline-item:hover .timeline-icon {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}
.timeline-icon svg {
    width: 24px;
    height: 24px;
}
.timeline-date {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    display: block;
}
.timeline-content {
    margin-left: 1.5rem; /* Spazio per l'icona */
}
.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.timeline-content p {
    margin-bottom: 0;
    font-size: 1rem;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border-gray);
    margin: 4rem auto;
    max-width: 800px;
}

.bio-content-enhanced {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}
.bio-content-enhanced .bio-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-deep);
}
.bio-content-enhanced .bio-text h2 {
    text-align: left;
}

/* === CARD MODERNE === */
.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 3.2rem;
}
.card {
    flex: 0 1 350px;
    display: flex;
    flex-direction: column;
    background: var(--paper-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-subtle);
    position: relative;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-gold);
}
.card-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
}
.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-bottom: none;
}
.card:hover .card-image-container img {
    transform: scale(1.05);
}
.card-content {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card h2 {
    font-family: var(--font-headlines);
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: var(--ink-black);
}
.card h2 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.card h2 a:hover {
    color: var(--brand-burgundy);
}
.card .meta {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--news-gray);
    flex-grow: 1;
}
.card .read-more {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-burgundy);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition-fast);
    margin-top: auto;
}
.card .read-more::after {
    content: '→';
    transition: transform 0.2s;
    margin-left: 0;
}
.card .read-more:hover {
    color: var(--brand-gold);
}
.card .read-more:hover::after {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .card {
        flex-basis: 100%;
    }
}

/* Bottone specifico per aprire galleria */
.open-gallery-btn {
    font-family: var(--font-ui);
    /* Use brand gradient for consistency: burgundy -> gold */
    background: linear-gradient(135deg, var(--brand-burgundy), var(--brand-gold));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(var(--brand-burgundy-rgb), 0.28);
}

.open-gallery-btn:hover {
    background: linear-gradient(135deg, var(--brand-burgundy), rgba(var(--brand-gold-rgb), 1));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--brand-burgundy-rgb), 0.36);
}
.card-image-container {
    position: relative;
    overflow: hidden;
}
.card-image-container img {
    transition: transform 0.3s ease-in-out;
}
.card:hover .card-image-container img {
    transform: scale(1.05);
}
.card-category-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(24, 26, 32, 0.8);
    color: var(--paper-white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.gallery-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}
.gallery-indicator-clickable {
    cursor: pointer;
}
.gallery-indicator-clickable:hover {
    background: rgba(155, 35, 53, 0.9); /* Brand Burgundy */
}

/* === SEZIONI GENERICHE === */
.section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    text-align: center;
    margin-bottom: 1rem;
    color: var(--ink-black);
}
.section-title-left {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    text-align: left;
    margin-bottom: 1.5rem;
}
.section-subtitle {
    font-size: 1.2rem;
    text-align: center;
    max-width: 650px;
    margin: 0 auto 3.5rem auto;
    color: var(--news-gray);
    font-family: var(--font-ui);
}
.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* === SEZIONE COLLABORAZIONI (HOME) === */
.collaborations-section {
    padding: 6rem 0;
    background: var(--paper-white);
}
.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 3rem;
    align-items: center;
}
.logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
}
.logo-item img {
    height: auto;
    max-height: 40px;
    width: auto;
    max-width: 100%;
    filter: grayscale(100%) contrast(0%) brightness(1.5);
    opacity: 0.6;
    transition: var(--transition-smooth);
}
.logo-item img:hover {
    filter: none;
    opacity: 1;
}

/* === TESTIMONIALS SECTION (HOME) === */
.testimonials { 
    padding: 6rem 0; 
    background: var(--light-gray); 
    position: relative; 
    border-top: 1px solid var(--border-gray); 
    border-bottom: 1px solid var(--border-gray); 
}
#testimonials-title {
    margin-bottom: 3.5rem;
}
.testimonials-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2.5rem; 
}
.testimonial { 
    background: var(--paper-white);
    padding: 2rem; 
    border-radius: 12px; 
    box-shadow: var(--shadow-subtle); 
    position: relative; 
    border: 1px solid var(--border-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.testimonial-author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-subtle);
    border: 4px solid var(--paper-white);
}
.testimonial-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.testimonial blockquote { 
    font-size: 1.15rem; 
    color: var(--news-gray); 
    border: none; 
    padding: 0; 
    margin-bottom: 1rem; 
    background: transparent; 
    border-radius: 0; 
    font-style: italic;
}
.testimonial blockquote::before { display: none; }
.testimonial cite { 
    font-family: var(--font-ui); 
    font-weight: 600; 
    color: var(--ink-black); 
    font-style: normal; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

/* Styled LinkedIn link used in testimonials */
.testimonial-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    background: #0077B5; /* LinkedIn blue */
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 140ms ease, opacity 120ms ease;
}
.testimonial-link svg { width: 16px; height: 16px; display: block; fill: #fff; }
.testimonial-link:hover { background: #00669c; transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.16); }
.testimonial-link:focus { outline: none; box-shadow: 0 0 0 4px rgba(var(--brand-burgundy-rgb),0.14); }
.testimonial-link[aria-hidden="true"] { display: none; }

/* Layout helpers: keep testimonial content vertically stacked and provide space for the LinkedIn pill */
.testimonial-content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.testimonial-link {
    margin-top: 0.6rem; /* push the pill a bit lower */
    align-self: flex-start;
}

/* === ABOUT ME SECTION (HOME) === */
.about-me-section {
    padding: 6rem 0;
    background: var(--light-gray);
    border-top: 1px solid var(--border-gray);
    border-bottom: 1px solid var(--border-gray);
}
.about-me-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}
.about-me-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-deep);
}
.about-me-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 650px;
}
.about-me-content .cta-button {
    margin-top: 1.5rem;
}

/* === CONTACT PAGE REVAMPED === */
.contact-info {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-info p {
    margin: 0.5rem 0;
}

.contact-info a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-gray);
    margin: 2rem auto;
    width: 50%;
}

.text-center {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--ink-black);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--paper-white);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form .honeypot {
    display: none !important;
}

.form-group-privacy {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.form-group-privacy label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-weight: 400;
}

.form-group-privacy input[type="checkbox"] {
    width: auto;
    height: 1.2em;
    width: 1.2em;
    accent-color: var(--accent-primary);
}

.form-group-privacy a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.contact-form .cta-button {
    align-self: center;
    width: auto;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
}

#status-message {
    margin-top: 2rem;
    text-align: center;
}

.success-message {
    background-color: #e6f9f0;
    color: #0d6a43;
    border: 1px solid #b6e9d1;
    padding: 1.5rem;
    border-radius: 8px;
}

.error-message {
    margin-top: 1.5rem;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 1.25rem;
    border-radius: 8px;
}

.info-box-response {
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: var(--light-gray);
    border-left: 4px solid var(--accent-primary);
    border-radius: 4px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.info-box-response h3 {
    margin-top: 0;
    color: var(--accent-primary);
}

/* Responsive adjustments for contact form */
@media (min-width: 768px) {
    .contact-form .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* === PROCESS SECTION (BRAND JOURNALISM) === */
.process-section {
    padding: 6rem 0;
    background: var(--light-gray);
    border-top: 1px solid var(--border-gray);
    border-bottom: 1px solid var(--border-gray);
    margin: 4rem 0;
}
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
}
.process-step {
    background: var(--paper-white);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    text-align: center;
    position: relative;
    transition: var(--transition-smooth);
}
.process-step:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}
.process-number {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    color: var(--paper-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headlines);
    font-size: 1.5rem;
    font-weight: 700;
    border: 4px solid var(--light-gray);
}
.process-step h3 {
    margin-top: 1.5rem;
    font-size: 1.3rem;
    color: var(--accent-primary);
}
.process-step p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* === CASE STUDY SECTION (BRAND JOURNALISM) === */
.case-study-section {
    padding: 4rem 0;
}
.case-study {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    background: var(--paper-white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-gray);
    box-shadow: var(--shadow-subtle);
}
.case-study-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.case-study-content {
    padding: 3rem;
}
.case-study-content h3 {
    font-size: 2rem;
    color: var(--accent-primary);
}
.case-study-meta {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--news-gray);
    margin-bottom: 2rem;
}
.case-study-content h4 {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-black);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.case-study-content .results-list {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}
.case-study-content .results-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}
.case-study-content .results-list li::before {
    content: '✓';
    color: var(--accent-gold);
    position: absolute;
    left: 0;
    font-weight: 700;
}
.case-study-content .secondary-button {
    margin-top: 2rem;
}

/* === COMPETENCE SECTION (BRAND JOURNALISM) === */
.competence-section {
    padding: 4rem 0;
}
.competence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}
.competence-card {
    background: var(--paper-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-subtle);
}
.competence-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-primary);
}
.competence-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1.5rem auto;
    color: var(--accent-primary);
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.competence-card:hover .competence-icon {
    background: var(--accent-primary);
    color: var(--paper-white);
    transform: scale(1.1);
}
.competence-icon img {
    width: 24px;
    height: 24px;
    stroke: var(--accent-primary);
}
.competence-card:hover .competence-icon img {
    stroke: var(--paper-white);
}
.competence-card h3 {
    font-size: 1.4rem;
    color: var(--ink-black);
    margin-bottom: 0.75rem;
}
.competence-card p {
    font-size: 1rem;
    color: var(--news-gray);
    margin-bottom: 0;
}

/* === FINAL CTA SECTION === */
.final-cta {
    padding: 5rem 0;
    margin-top: 4rem;
    background: var(--light-gray);
    text-align: center;
    border-top: 1px solid var(--border-gray);
    border-bottom: 1px solid var(--border-gray);
}
.final-cta .container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}
.final-cta .lead {
    margin-bottom: 2.5rem;
}
.final-cta .cta-button {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}
.final-cta .cta-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-deep);
}

/* === ERROR PAGE (404) === */
.error-page { padding: 6rem 0; text-align: center; min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.error-content h1 { font-size: 8rem; color: var(--accent-gold); font-weight: 700; margin-bottom: 1rem; }
.error-content h2 { color: var(--ink-black); margin-bottom: 2rem; }
.error-content p { max-width: 600px; margin-left: auto; margin-right: auto; }
.error-actions { margin-top: 2rem; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.suggested-pages { margin-top: 4rem; }
.suggested-pages ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2rem; }
.suggested-pages a { text-decoration: none; font-weight: 600; color: var(--accent-primary); }

/* === FOOTER MODERNO === */
.main-footer {
    background: var(--ink-black);
    color: var(--paper-white);
    padding: 5rem 0 2.5rem; position: relative; margin-top: 5rem;
    box-shadow: none;
}
.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--brand-burgundy));
}
.footer-collaborations { text-align: center; margin-bottom: 3.2rem; }
.footer-collaborations h3 { font-family: var(--font-ui); font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent-gold); margin-bottom: 2.5rem; }
.footer-logos { display: flex; justify-content: center; align-items: center; gap: 3rem; flex-wrap: wrap; margin: 2.5rem 0; }
.footer-logos img {
    height: 32px;
    width: auto;
    max-width: 140px;
    opacity: 0.7;
    transition: opacity 0.25s ease-in-out;
    filter: invert(1) grayscale(100%) brightness(2);
}
.footer-logos img:hover {
    opacity: 1;
    filter: none;
}
.footer-social {
    text-align: center;
    padding: 2.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}
.footer-social h3 {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.social-links a {
    color: var(--paper-white);
    opacity: 0.8;
    transition: var(--transition-smooth);
}
.social-links a:hover {
    opacity: 1;
    color: var(--accent-gold);
    transform: translateY(-3px);
}
.social-icon {
    width: 28px;
    height: 28px;
}
.footer-info { text-align: center; padding: 2.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); font-family: var(--font-ui); }
.footer-info p { margin-bottom: 0.7rem; font-size: 1rem; opacity: 0.8; color: var(--paper-white); }
.footer-credits { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); font-family: var(--font-ui); font-size: 0.9rem; opacity: 0.6; }
.footer-credits a { color: var(--accent-gold); text-decoration: none; font-weight: 600; transition: var(--transition-fast); }
.footer-credits a:hover { color: var(--paper-white); text-decoration: underline; }

/* === FILTRI ARTICOLI === */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}
.filter-btn {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-gray);
    background: transparent;
    color: var(--news-gray);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-btn:hover {
    background: var(--light-gray);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.filter-btn.active {
    background: var(--accent-primary);
    color: var(--paper-white);
    border-color: var(--accent-primary);
}
.card.hide {
    display: none;
}

/* === ANIMAZIONI ON-SCROLL === */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* === RESPONSIVE DESIGN === */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 768px) {
    html { font-size: 16px; }
    body { line-height: 1.7; }
    .container { padding: 0 1.5rem; }
    .hamburger { display: flex; z-index: 10000; }
    .main-nav { position: fixed; left: -100%; top: 0; background: var(--paper-white); backdrop-filter: blur(24px); width: 100%; height: 100vh; text-align: center; transition: left 0.35s ease-in-out; box-shadow: var(--shadow-deep); padding: 7rem 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
    .main-nav.active { left: 0; }
    .main-nav ul { flex-direction: column; gap: 2.5rem; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(10px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }
    .hero { padding: 6rem 0 5rem; }
    .bio-content { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .bio-image { margin: 0 auto; max-width: 250px; }
    .bio-details { text-align: left; }
    .card-grid { grid-template-columns: 1fr; }
    
    /* Correzione Timeline su Mobile */
    .timeline {
        padding-left: 2.5rem; /* Aumenta lo spazio a sinistra per il contenuto */
    }
    .timeline-icon {
        width: 40px;
        height: 40px;
        left: -21.5px; /* Centra l'icona (40px / 2 + 1.5px di bordo) */
    }
    .timeline-content {
        margin-left: 1.5rem; /* Aumenta il margine per allontanare il testo dalla linea */
    }

    .about-me-grid, .case-study, .contact-layout, .bio-content-enhanced { grid-template-columns: 1fr; }
    .case-study-image { display: none; }
    .contact-layout { gap: 2.5rem; }
    .cta-button, .secondary-button { padding: 1rem 1.8rem; }
}
@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .main-header .container { padding: 1rem; }
    .hero { padding: 4rem 0 3rem; }
    .page-header { padding: 3rem 0 2rem; }
    .page-content { padding: 2rem 0; }
    .error-content h1 { font-size: 4rem; }
    .form-group input, .form-group textarea, .form-group select { padding: 0.8rem; font-size: 1rem; }
    .testimonial-author-avatar { width: 72px; height: 72px; margin-bottom: 1rem; border-width: 3px; }
}

/* Scroll-to-Top Button Styles */
#back-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-primary);
    color: var(--paper-white);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.3s;
    z-index: 9998;
    box-shadow: var(--shadow-medium);
}
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-to-top-btn:hover {
    background-color: var(--accent-gold);
    transform: translateY(-5px);
}

/* === GALLERIA ARTICOLI === */
.article-gallery {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--soft-gray);
    border-radius: 12px;
    border: 1px solid var(--light-border);
}

.article-gallery h3 {
    margin: 0 0 1rem 0;
    color: var(--ink-black);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-count {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--muted-text);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.gallery-thumb {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--light-border);
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.gallery-thumb:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-thumb:hover img {
    transform: scale(1.05);
}

/* Modal carosello */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column; /* keep carousel above thumbnails by default */
    align-items: center;
    justify-content: center;
}

.gallery-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-carousel {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.gallery-main {
    position: relative;
    flex: 1 1 auto; /* let the main area take available space */
    min-width: 0; /* allow flex item to shrink cleanly */
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: calc(80vh - 80px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: opacity 280ms ease, transform 340ms ease;
    opacity: 0;
    transform: translateY(6px) scale(0.995);
    display: block;
    margin: 0 auto;
}

.gallery-nav {
    background: rgba(0,0,0,0.45);
    border: none;
    color: white;
    font-size: 28px;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, background-color 180ms ease, opacity 200ms ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    flex: 0 0 56px;
    opacity: 0.28; /* low opacity by default to reduce intrusiveness */
}

/* show arrows at full opacity when modal hovered or element focused */
.gallery-modal:hover .gallery-nav,
.gallery-nav:hover,
.gallery-nav:focus {
    opacity: 1;
    background: rgba(0,0,0,0.6);
    transform: translateY(-3px) scale(1.02);
    outline: none;
}

/* micro-bounce animation on the svg icon inside the nav when hovering */
@keyframes nav-bounce {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-6px) scale(1.03); }
    100% { transform: translateY(0) scale(1); }
}
.gallery-nav:hover svg { animation: nav-bounce 480ms cubic-bezier(.22,.9,.31,1); }

.gallery-nav:focus { box-shadow: 0 0 0 4px rgba(var(--brand-burgundy-rgb),0.12); }

/* SVG inside nav buttons should scale and remain centered */
.gallery-nav svg { width: 28px; height: 28px; display: block; fill: white; }

@media (min-width: 769px) {
    .gallery-nav svg { width: 34px; height: 34px; }
}

.gallery-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

/* Nav buttons default placement (may be overridden per breakpoint) */
.gallery-prev { position: relative; }
.gallery-next { position: relative; }

/* Close button default (desktop) - mobile override exists in media queries */
.gallery-close { position: absolute; top: -50px; right: 0; z-index: 10001; }

/* Responsive galleria */
@media (max-width: 768px) {
    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .gallery-title {
        position: relative; /* keep above carousel but not overlapping */
        top: 0; left: 0; right: 0;
        font-size: 0.95rem;
        padding: 0.45rem 0.8rem;
        margin-bottom: 0.5rem;
    }
}

/* Desktop: center carousel content and keep nav buttons visually outside the image without shifting the whole layout right */
@media (min-width: 769px) {
    .gallery-carousel {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    /* let main image area be the central block, capped for very large screens */
    .gallery-main {
        flex: 0 1 75%;
        max-width: 1100px;
    }

    /* nav buttons sit beside the image but keep the whole carousel centered */
    .gallery-prev, .gallery-next {
        flex: 0 0 72px;
        margin: 0;
    }

    .gallery-nav {
        width: 72px;
        height: 72px;
        font-size: 32px;
        background: linear-gradient(180deg, rgba(var(--brand-burgundy-rgb),0.14), rgba(0,0,0,0.45));
        box-shadow: 0 10px 30px rgba(0,0,0,0.28);
        transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    }

    /* give small negative margins so the arrows visually sit outside the image without shifting center */
    .gallery-prev { margin-right: -36px; }
    .gallery-next { margin-left: -36px; }

    .gallery-nav:hover, .gallery-nav:focus {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 0 18px 48px rgba(0,0,0,0.32);
    }

    /* allow the main image to take more vertical space on large screens */
    .gallery-main img {
        max-height: calc(100vh - 260px);
    }
}

/* Mobile-first improvements for gallery: full-width main image, horizontal thumbnail scroller, larger touch targets */
@media (max-width: 768px) {
    .gallery-modal {
        align-items: flex-start; /* pin modal to top for easier reach */
        padding-top: 1.25rem;
    }

    .gallery-modal-content {
        width: 100vw;
        height: calc(100vh - 32px);
        padding: 0 12px;
        max-width: 100vw;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .gallery-main {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 170px);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-main img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 200px);
    object-fit: contain; /* avoid cropping on narrow screens */
        border-radius: 8px;
    }

    /* Bigger nav buttons for touch */
    .gallery-nav {
        width: 64px;
        height: 64px;
        font-size: 28px;
        padding: 0.3rem;
        opacity: 0.98;
    }

    .gallery-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 28px;
        background: rgba(255,255,255,0.06);
        color: white;
        z-index: 10002;
    }

    /* Make thumbnails horizontally scrollable and less intrusive on mobile */
    .gallery-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.5rem 0 0.75rem 0;
        -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    }

    .gallery-thumb {
        min-width: 84px;
        flex: 0 0 auto;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
        border-width: 2px;
    scroll-snap-align: center;
    }

    /* Reposition counter and title inside the modal on mobile so they stay visible */
    .gallery-counter {
        position: absolute;
        bottom: 12px;
        left: 12px;
        transform: none;
        font-size: 0.9rem;
        padding: 0.4rem 0.7rem;
    }

    .gallery-title {
        /* Keep the title outside the image on mobile (not overlapping) */
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.95rem;
        padding: 0.45rem 0.8rem;
        margin-bottom: 0.5rem;
    }

    /* Improve hit area for gallery indicators on cards */
    .gallery-indicator, .open-gallery-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

/* thumbnail strip inside modal */
.gallery-thumbnails-modal {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.gallery-thumbnails-modal .gallery-thumb {
    min-width: 64px;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    overflow: hidden;
    cursor: pointer;
}
.gallery-thumbnails-modal .gallery-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-thumbnails-modal .gallery-thumb.active { outline: 3px solid var(--brand-gold); transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 30px rgba(var(--brand-burgundy-rgb),0.12); }

/* Hide the thumbnail strip on wider desktops to avoid right-side preview column */
@media (min-width: 769px) {
    .gallery-thumbnails-modal { display: none; }
}

/* When image is loaded, will add .is-visible to animate in */
.gallery-main img.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* === PROGETTI SPECIALI (Refactoring) === */
.sp-section {
    margin: 2.5rem 0 3.5rem;
    position: relative;
}
.sp-section::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    opacity: 0.3;
}
.sp-header {
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.sp-heading {
    font-family: var(--font-headlines);
    font-size: 2.5rem;
    color: var(--brand-burgundy);
    margin-bottom: 0.5rem;
}
.sp-sub {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--news-gray);
}

/* Grid Layout con Flexbox per evitare orfani */
.sp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centra le card nell'ultima riga */
    gap: 1.5rem;
}

.sp-card {
    flex: 0 1 320px; /* Base width ridotta per compattezza */
    display: flex;
    flex-direction: column;
    background: var(--paper-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-subtle);
    position: relative;
}

.sp-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-gold);
}

.sp-card-img {
    position: relative;
    height: 200px; /* Altezza ridotta */
    overflow: hidden;
}

.sp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.sp-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sp-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.sp-testata {
    background: var(--light-gray);
    color: var(--brand-burgundy);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sp-date {
    color: var(--muted-text);
}

.sp-title {
    font-family: var(--font-headlines);
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: var(--ink-black);
}

.sp-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.sp-title a:hover {
    color: var(--brand-burgundy);
}

.sp-desc {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--news-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.sp-read {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-burgundy);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition-fast);
}

.sp-read::after {
    content: '→';
    transition: transform 0.2s;
}

.sp-read:hover {
    color: var(--brand-gold);
}

.sp-read:hover::after {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .sp-card {
        flex-basis: 100%; /* Full width su mobile */
    }
    .sp-heading {
        font-size: 2rem;
    }
}