/*
 * Template CSS per blog post su animazione.ilmagomax.com
 * Light theme, WCAG AAA readable, alta specificità per battere animazione-theme.css
 *
 * Personalizzazioni da fare:
 *   --brand-primary       → colore tema brand (AAA su white: contrasto ≥ 7:1)
 *   --brand-primary-hover → variante 10% scura per :hover
 *   --brand-primary-soft  → tinta soft per highlight-box/border (HSL +35% lightness)
 *   --brand-primary-bg    → background soft per featured card (HSL +45% lightness)
 *
 * Colori brand AAA-safe da scegliere:
 *   Verde scuola  #0f766e / hover #115e59 / soft #ccfbf1 / bg #f0fdfa
 *   Rosso natale  #b91c1c / hover #991b1b / soft #fee2e2 / bg #fef2f2
 *   Blu inverno   #1d4ed8 / hover #1e40af / soft #dbeafe / bg #eff6ff
 *   Viola         #9d174d / hover #831843 / soft #fce7f3 / bg #fdf2f8
 *   Orange autunno #c2410c / hover #9a3412 / soft #fed7aa / bg #fff7ed
 *   Teal estate   #0f766e / hover #115e59 / soft #ccfbf1 / bg #f0fdfa
 */

:root {
    --brand-primary: #0f766e;          /* ← PERSONALIZZA */
    --brand-primary-hover: #115e59;     /* ← PERSONALIZZA */
    --brand-primary-soft: #ccfbf1;      /* ← PERSONALIZZA */
    --brand-primary-bg: #f0fdfa;        /* ← PERSONALIZZA */

    /* NON cambiare: WCAG AAA su bianco */
    --text-body: #1f2937;       /* contrasto 13.6:1 — AAA */
    --text-muted: #4b5563;      /* contrasto 7.5:1 — AAA */
    --text-heading: #0f172a;    /* contrasto 17.7:1 — AAA */
    --bg-page: #ffffff;
    --bg-soft: #f8fafc;
    --bg-card: #ffffff;
    --border-soft: #e5e7eb;
}

/* Reset base + typography body */
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;     /* ~70ch ottimale leggibilità */
    margin: 0 auto;
    padding: 0 24px;
}

article {
    padding: 2rem 0 4rem;
}

/* H1 — alta specificità per battere animazione-theme.css gradient */
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 text — AAA contrast OBBLIGATORIO */
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;
}

/* Links: brand color con underline accessibile */
body .container article a,
article a {
    color: var(--brand-primary) !important;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.2);   /* sostituibile con rgba del brand */
    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 — call-out con bordo 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 p {
    color: var(--text-heading) !important;
    margin-bottom: 0 !important;
    font-size: 1rem;
}

.highlight-box p a {
    color: var(--brand-primary-hover) !important;
    font-weight: 700;
}

/* Package cards grid */
.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 più richiesto";
    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 .price {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--brand-primary) !important;
    margin: 0.25rem 0 1rem;
    line-height: 1;
}

.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 — alto contrasto */
.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;
}

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

/* 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;
}

.whatsapp-float:hover { transform: scale(1.08); }

/* 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; }

/* Skip link a11y */
.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; }

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