/*
 * CSS post-specifico: blog/sagra-finocchietto-blufi-2026/
 * Light theme WCAG AAA, brand verde Madonie #047857
 * Alta specificità per battere css/animazione-theme.css (caricato dopo)
 */

:root {
    --brand-primary: #047857;
    --brand-primary-hover: #065f46;
    --brand-primary-soft: #d1fae5;
    --brand-primary-bg: #f0fdf4;

    --text-body: #1f2937;
    --text-muted: #4b5563;
    --text-heading: #0f172a;
    --bg-page: #ffffff;
    --bg-soft: #f8fafc;
    --bg-card: #ffffff;
    --border-soft: #e5e7eb;
}

body {
    background: #ffffff !important;
    color: var(--text-body) !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

article { padding: 2rem 0 4rem; }

body .container article h1,
.container article h1,
article h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.6rem) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem !important;
    color: var(--brand-primary) !important;
    background: none !important;
    background-image: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: var(--brand-primary) !important;
}

body .container article h2,
.container article h2,
article h2 {
    font-size: clamp(1.4rem, 3vw, 1.7rem) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: var(--text-heading) !important;
    margin: 3rem 0 1rem !important;
    padding-top: 1rem;
    border-top: 2px solid var(--brand-primary-soft);
}

body .container article h3,
.container article h3,
article h3 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: var(--text-heading) !important;
    margin: 2rem 0 0.75rem !important;
    line-height: 1.35;
}

body .container article p,
body .container article li,
article p,
article li {
    color: var(--text-body) !important;
    font-size: 1.0625rem;
    line-height: 1.75;
    margin-bottom: 1.1rem;
}

body .container article strong,
article strong {
    color: var(--text-heading) !important;
    font-weight: 700;
}

article ul, article ol { margin: 1rem 0 1.5rem; padding-left: 1.5rem; }
article li { margin-bottom: 0.6rem; }

body .container article a,
article a {
    color: var(--brand-primary) !important;
    text-decoration: underline;
    text-decoration-color: rgba(4, 120, 87, 0.3);
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}

body .container article a:hover,
article a:hover {
    color: var(--brand-primary-hover) !important;
    text-decoration-color: var(--brand-primary);
}

/* Highlight box brand */
.highlight-box {
    background: var(--brand-primary-soft) !important;
    border-left: 4px solid var(--brand-primary) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 0 12px 12px 0 !important;
    margin: 2rem 0 !important;
}
.highlight-box h3 {
    color: var(--text-heading) !important;
    font-size: 1.15rem !important;
    margin: 0 0 0.5rem !important;
}
.highlight-box p {
    color: var(--text-heading) !important;
    margin-bottom: 0.75rem !important;
    font-size: 1rem;
}
.highlight-box p:last-of-type { margin-bottom: 0 !important; }
.highlight-box a {
    color: var(--brand-primary-hover) !important;
    font-weight: 700;
}

/* Cards grid (piatti, programma) */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.package-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 16px !important;
    padding: 1.5rem 1.25rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.package-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-primary);
}

.package-card.featured {
    border: 2px solid var(--brand-primary) !important;
    background: linear-gradient(180deg, var(--brand-primary-bg) 0%, #ffffff 30%) !important;
}

.package-card.featured::before {
    content: "Il momento clou";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 99px;
    white-space: nowrap;
}

.package-card h3 {
    font-size: 1.15rem !important;
    margin: 0 0 0.5rem !important;
    color: var(--text-heading) !important;
}

.package-card .time {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem;
}

.package-card p { font-size: 0.97rem; color: var(--text-muted) !important; margin-bottom: 0.5rem !important; }
.package-card ul { font-size: 0.95rem; margin: 0; padding-left: 1.2rem; }
.package-card li { color: var(--text-muted) !important; margin-bottom: 0.4rem; }

/* CTA button — alta specificità per battere `body .container article a` */
body .container article a.cta-button,
body a.cta-button,
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%) !important;
    color: #ffffff !important;
    padding: 0.95rem 1.75rem !important;
    border-radius: 999px;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    margin: 2rem 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

body .container article a.cta-button:hover,
body a.cta-button:hover,
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Video player */
article video {
    width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    margin: 24px 0;
    background: #000;
    display: block;
}

/* Image caption */
.caption {
    font-size: 0.85rem;
    color: var(--text-muted) !important;
    text-align: center;
    margin: -12px 0 24px !important;
}

/* FAQ */
.faq-container { margin: 2rem 0; }
.faq-item {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    background: var(--bg-card);
}
.faq-question {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 1.1rem 1.25rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-heading) !important;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-question:hover { background: var(--brand-primary-bg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding: 0 1.25rem;
}
.faq-answer.active { max-height: 1000px; padding: 0 1.25rem 1.1rem; }
.faq-answer p { color: var(--text-body) !important; font-size: 1rem !important; margin: 0; }

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    width: 56px;
    height: 56px;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: transform 0.2s;
    font-size: 26px;
    line-height: 1;
}
.whatsapp-float:hover { transform: scale(1.08); }

/* Credits box */
.credits-box {
    background: var(--bg-soft);
    border-left: 3px solid var(--border-soft);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 2.5rem 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted) !important;
    line-height: 1.6;
}
.credits-box strong { color: var(--text-heading) !important; }

/* Footer */
footer {
    background: var(--bg-soft) !important;
    color: var(--text-muted) !important;
    border-top: 1px solid var(--border-soft) !important;
    padding: 2.5rem 1rem !important;
    margin-top: 4rem;
    text-align: center;
}
footer a { color: var(--brand-primary) !important; }
footer p { color: var(--text-muted) !important; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
.social-footer { border-top: 1px solid var(--border-soft); margin-top: 1.5rem; padding-top: 1.5rem; }
.social-footer p { color: var(--text-heading) !important; }
.social-footer a { color: var(--text-muted) !important; }
.social-footer a:hover { color: var(--brand-primary) !important; }

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    font-size: 14px;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Top navbar — pattern legacy stilato qui perché shared.css ora gestisce solo il drawer mobile */
body > nav:not(.breadcrumb-nav) {
    background: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body > nav:not(.breadcrumb-nav) .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
body > nav:not(.breadcrumb-nav) .nav-container > a {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
body > nav:not(.breadcrumb-nav) .nav-container > a img {
    height: 36px;
    width: auto;
    /* Logo nero su sfondo bianco — invertito perché l'originale è white-on-dark */
    filter: invert(1) brightness(0.4);
}
body > nav:not(.breadcrumb-nav) ul.nav-links {
    display: flex;
    list-style: none;
    gap: 1.4rem;
    flex-wrap: wrap;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center;
}
body > nav:not(.breadcrumb-nav) ul.nav-links li {
    margin: 0 !important;
    padding: 0;
    list-style: none;
}
body > nav:not(.breadcrumb-nav) ul.nav-links li::before { content: none; }
body > nav:not(.breadcrumb-nav) ul.nav-links a {
    color: #0f172a !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.15s;
    white-space: nowrap;
}
body > nav:not(.breadcrumb-nav) ul.nav-links a:hover {
    color: var(--brand-primary) !important;
}
@media (max-width: 860px) {
    body > nav:not(.breadcrumb-nav) ul.nav-links {
        gap: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    body > nav:not(.breadcrumb-nav) ul.nav-links a {
        font-size: 0.85rem;
    }
}
@media (max-width: 560px) {
    body > nav:not(.breadcrumb-nav) ul.nav-links {
        display: none;  /* Su mobile small nascondo le voci, lascio solo il logo */
    }
}

/* Breadcrumb */
.breadcrumb-nav {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 24px 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.breadcrumb-nav a { color: var(--text-muted) !important; text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--brand-primary) !important; }
.breadcrumb-nav .sep { margin: 0 0.4rem; color: #cbd5e1; }

/* Responsive */
@media (max-width: 640px) {
    body { font-size: 16px; }
    article h1 { font-size: 1.75rem !important; }
    article h2 { font-size: 1.3rem !important; margin-top: 2.25rem !important; }
    article h3 { font-size: 1.1rem !important; }
    .container { padding: 0 18px; }
    .packages-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    body { color: #000 !important; background: #fff !important; font-size: 11pt; }
    .whatsapp-float, .skip-link, footer, video { display: none; }
    article a { color: #000 !important; text-decoration: underline; }
    article a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
