/* ============================================================
   calendarigratis.it — Stylesheet
   Minimal + Apple-like + Notion-style
   ============================================================ */

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
    --bg: #f8f7f4;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-tertiary: #9898aa;
    --border: #e8e8ee;
    --accent: #5b4cdb;
    --accent-light: rgba(91, 76, 219, 0.07);
    --accent-text: #5b4cdb;
    --hover-bg: #f0f0f5;
    --holiday-bg: rgba(91, 76, 219, 0.05);
    --holiday-text: #5b4cdb;
    --ponte-bg: rgba(243, 156, 18, 0.06);
    --ponte-text: #e67e22;
    --weekend-text: #9898b0;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --workdays-bar: #27ae60;
    --weekend-bar: #95a5a6;
    --holiday-bar: #e74c3c;
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-secondary: #12121a;
    --card-bg: #16161f;
    --text-primary: #e8e8ed;
    --text-secondary: #9898a8;
    --text-tertiary: #58586a;
    --border: #2a2a3a;
    --accent: #6c5ce7;
    --accent-light: rgba(108, 92, 231, 0.12);
    --accent-text: #a594ff;
    --hover-bg: #1e1e2e;
    --holiday-bg: rgba(108, 92, 231, 0.1);
    --holiday-text: #a594ff;
    --ponte-bg: rgba(253, 203, 110, 0.1);
    --ponte-text: #fdcb6e;
    --weekend-text: #636380;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --workdays-bar: #2ecc71;
    --weekend-bar: #7f8c8d;
    --holiday-bar: #e74c3c;
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--accent-text); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
img { max-width: 100%; display: block; }
.text-muted { color: var(--text-tertiary); font-size: 0.85rem; }
.text-accent { color: var(--accent-text); }
.accent { color: var(--accent); }

/* ─── HEADER ─────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248,247,244,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
    background: rgba(10,10,15,0.85);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #a594ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.logo-name { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; display: block; line-height: 1.1; }
.logo-tagline { font-size: 9px; color: var(--text-tertiary); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

/* Year nav */
.year-nav { display: flex; align-items: center; gap: 4px; }
.year-btn {
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.year-btn:hover { background: var(--hover-bg); opacity: 1; }
.year-btn.active {
    background: var(--accent);
    color: #fff;
}

/* View nav */
.header-actions { display: flex; align-items: center; gap: 8px; }
.view-nav {
    display: flex;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.view-btn {
    padding: 5px 14px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}
.view-btn:hover { opacity: 1; }
.view-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Dark toggle */
.dark-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.dark-toggle:hover { border-color: var(--accent); }

/* Month nav */
.month-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 10px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
}
.month-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
    transition: all 0.15s;
}
.month-btn:hover { background: var(--hover-bg); color: var(--text-primary); opacity: 1; }

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

/* Hero */
.hero { margin-bottom: 24px; }
.hero h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 8px;
}
.intro-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 720px;
}

/* ─── CALENDAR CARDS ─────────────────────────────────────── */
.year-grid, .planner-grid, .weeks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.cal-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s;
}
.cal-card:hover { border-color: var(--accent); }

.cal-card-header {
    padding: 14px 18px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.cal-month-name { font-size: 16px; font-weight: 700; margin: 0; }
.cal-month-name a { color: var(--text-primary); }
.cal-days-count { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }

.cal-grid { padding: 8px 14px 12px; }
.cal-compact { padding: 6px 10px 10px; }

/* Calendar rows */
.cal-row {
    display: grid;
    grid-template-columns: 30px repeat(7, 1fr);
    gap: 1px;
}
.cal-header-row { margin-bottom: 4px; }

.cal-week-num {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.cal-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cal-day-header.weekend { color: var(--accent-text); }

/* Calendar cells */
.cal-cell {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    margin: 0 auto;
}
.cal-cell:hover:not(.empty) { background: var(--hover-bg); }
.cal-cell.empty { cursor: default; }
.cal-cell.weekend { color: var(--weekend-text); }
.cal-cell.holiday {
    background: var(--holiday-bg);
    color: var(--holiday-text);
    font-weight: 700;
}
.cal-cell.ponte {
    background: var(--ponte-bg);
    color: var(--ponte-text);
}
.cal-cell.today {
    background: var(--accent-light);
    color: var(--accent);
    border: 2px solid var(--accent);
    font-weight: 700;
}

.day-num { position: relative; z-index: 1; }
.day-dot {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
}
.holiday-dot { background: var(--accent); }
.day-moon {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 8px;
}

/* Compact mode */
.cal-compact .cal-cell { width: 28px; height: 28px; font-size: 11px; }

/* ─── TOOLTIP ────────────────────────────────────────────── */
.cal-cell[data-tooltip] { position: relative; }
.cal-cell[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--text-primary);
    color: var(--bg);
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.15s ease;
}

/* ─── MONTH PAGE LAYOUT ──────────────────────────────────── */
.month-layout {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.month-main { flex: 1 1 500px; min-width: 0; }
.month-sidebar { flex: 0 0 300px; min-width: 280px; }

.month-pager {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}
.pager-btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}
.pager-btn:hover { border-color: var(--accent); opacity: 1; }
.pager-btn.disabled { opacity: 0.3; pointer-events: none; }

.month-seo-text {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.month-seo-text h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.02em; }
.month-seo-text h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.month-seo-text p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* Sidebar cards */
.sidebar-card {
    padding: 18px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.sidebar-row:last-child { border-bottom: none; }
.sidebar-row-label { font-weight: 600; }
.sidebar-row-value { color: var(--text-tertiary); font-size: 11px; }

/* Saints list */
.saints-list { max-height: 400px; overflow-y: auto; }
.saint-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.saint-day { font-weight: 700; color: var(--accent-text); min-width: 20px; }
.saint-name { color: var(--text-secondary); }

/* Sidebar lead CTA */
.sidebar-lead-cta {
    padding: 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), #a594ff);
    color: #fff;
    margin-top: 16px;
}
.sidebar-lead-cta .lead-icon { font-size: 22px; margin-bottom: 8px; }
.sidebar-lead-cta strong { display: block; font-size: 15px; margin-bottom: 4px; }
.sidebar-lead-cta p { font-size: 12px; opacity: 0.9; line-height: 1.5; margin-bottom: 12px; }
.btn-small {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* Related months */
.related-months { margin-top: 32px; }
.related-months h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.months-link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.month-link {
    padding: 8px 18px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.month-link:hover { border-color: var(--accent); color: var(--accent-text); opacity: 1; }

/* ─── DOWNLOADS ──────────────────────────────────────────── */
.download-section { margin-top: 32px; }
.download-section h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; }

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    color: var(--text-primary);
}
.download-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    opacity: 1;
}

.download-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.download-info strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.download-info span { font-size: 11px; color: var(--text-tertiary); }
.download-arrow { margin-left: auto; font-size: 18px; color: var(--accent); opacity: 0.6; }

/* ─── HOLIDAYS & PONTI ───────────────────────────────────── */
.holidays-summary, .holidays-full, .ponti-section, .holidays-by-month,
.planner-summary, .planner-tips, .lunar-months, .lunar-summary,
.weeks-table-section, .printable-section {
    margin-top: 32px;
}

.holidays-summary h2, .holidays-full h2, .ponti-section h2,
.holidays-by-month h2, .planner-summary h2, .planner-tips h2,
.lunar-months h2, .lunar-summary h2, .weeks-table-section h2,
.printable-section h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.holiday-row, .ponte-row, .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.holiday-row:last-child, .ponte-row:last-child, .summary-row:last-child { border-bottom: none; }

.holiday-name { font-size: 14px; font-weight: 600; }
.holiday-date { font-size: 13px; color: var(--accent-text); font-weight: 600; }
.holiday-day { font-size: 12px; color: var(--text-tertiary); }

.ponte-badge {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--ponte-bg);
    color: var(--ponte-text);
    font-size: 11px;
    font-weight: 600;
}

/* Data tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--hover-bg); }

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.badge-fixed { background: var(--accent-light); color: var(--accent-text); }
.badge-mobile { background: var(--ponte-bg); color: var(--ponte-text); }
.badge-ponte { background: var(--ponte-bg); color: var(--ponte-text); }

/* Month holidays blocks */
.month-holidays-block { margin-bottom: 16px; }
.month-holidays-block h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.inline-list { list-style: none; padding: 0; }
.inline-list li {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px 4px 3px 0;
    background: var(--hover-bg);
    border-radius: 6px;
    font-size: 13px;
}

/* Planner */
.planner-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.summary-col { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; }
.summary-col h2 { font-size: 18px; margin-bottom: 12px; }

.tip-card {
    padding: 12px 16px;
    background: var(--accent-light);
    border-radius: var(--radius-xs);
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Lunar */
.lunar-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.legend-item { font-size: 13px; }

.lunar-month-block { margin-bottom: 24px; }
.lunar-month-block h2 { font-size: 17px; }
.lunar-phases-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lunar-phase-card {
    padding: 12px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.phase-icon { font-size: 20px; }
.phase-name { font-weight: 600; }
.phase-date { color: var(--text-tertiary); font-size: 12px; }

/* ─── LEAD CTA ───────────────────────────────────────────── */
.lead-cta { margin-top: 40px; }
.lead-cta-inner {
    padding: 32px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), #a594ff);
    color: #fff;
    text-align: center;
}
.lead-cta-icon { font-size: 32px; margin-bottom: 12px; }
.lead-cta-inner h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.lead-cta-inner p { font-size: 14px; opacity: 0.9; line-height: 1.6; margin-bottom: 16px; }

.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s;
}
.btn-primary:hover { background: rgba(255,255,255,0.3); color: #fff; opacity: 1; }

.btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

/* ─── ERROR PAGE ─────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 80px 24px;
}
.error-icon { font-size: 64px; margin-bottom: 20px; }
.error-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.error-page p { color: var(--text-secondary); margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    margin-top: 48px;
    border-top: 1px solid var(--border);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.footer-col h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.footer-col a {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--accent-text);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.footer-brand { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.footer-bottom p { font-size: 11px; color: var(--text-tertiary); }

/* ─── PONTI PAGE ────────────────────────────────────────── */
.ponti-riepilogo {
    margin-top: 32px;
}
.ponti-riepilogo h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Badge variants */
.badge-weekend-lost {
    background: var(--hover-bg);
    color: var(--text-tertiary);
}
.badge-free {
    background: var(--accent-light);
    color: var(--accent-text);
}

/* Table footer */
.data-table tfoot td {
    padding: 12px 14px;
    border-top: 2px solid var(--border);
    font-size: 13px;
}

/* Active state for year/link nav */
.month-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.month-link.active:hover { color: #fff; opacity: 1; }

/* Internal links & FAQ (shared) */
.internal-links, .faq-section {
    margin-top: 32px;
}
.internal-links h2, .faq-section h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}
.internal-links p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}
.faq-section details {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.faq-section summary {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.faq-section summary::before {
    content: '+';
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.faq-section details[open] summary::before { content: '−'; }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section details p {
    padding: 0 18px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── WORKDAYS PAGE ─────────────────────────────────────── */

/* Zebra-striped table */
.workdays-table tbody tr:nth-child(even) td {
    background: var(--hover-bg);
}
.workdays-table tbody tr.active-year td {
    background: var(--accent-light);
}

/* CSS-only bar chart */
.workdays-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-label {
    width: 36px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}
.chart-bars {
    flex: 1;
    display: flex;
    gap: 2px;
    height: 28px;
    background: var(--hover-bg);
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.chart-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    border-radius: 4px;
    min-width: 20px;
}
.bar-workdays { background: var(--workdays-bar); }
.bar-weekend { background: var(--weekend-bar); }
.bar-holiday { background: var(--holiday-bar); }

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

/* ── Tablet (≤768px) ───────────────────────────────────── */
@media (max-width: 768px) {
    /* Header: stack logo + year nav + actions */
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 6px;
    }
    .logo { flex: 1; }
    .logo-tagline { display: none; }
    .year-nav { order: 2; gap: 2px; overflow-x: auto; flex-shrink: 0; }
    .year-btn { padding: 6px 10px; font-size: 12px; }
    .header-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
    .view-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
    }
    .view-btn { padding: 6px 12px; font-size: 11px; white-space: nowrap; }

    /* Main content */
    .site-main { padding: 16px 14px 40px; }

    /* Hero */
    .hero { margin-bottom: 16px; }
    .hero h1 { font-size: 21px; }
    .intro-text { font-size: 13px; }

    /* Calendar grids: single column */
    .year-grid, .planner-grid, .weeks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .cal-card-header { padding: 10px 14px 6px; }
    .cal-month-name { font-size: 15px; }

    /* Calendar cells: smaller on mobile */
    .cal-cell { width: 28px; height: 28px; font-size: 11px; }
    .cal-compact .cal-cell { width: 26px; height: 26px; font-size: 10px; }
    .cal-row { grid-template-columns: 24px repeat(7, 1fr); }
    .cal-week-num { font-size: 8px; }
    .cal-day-header { font-size: 9px; }

    /* Month page: sidebar goes full width */
    .month-layout { gap: 16px; }
    .month-sidebar { flex: 1 1 100%; }
    .month-seo-text { padding: 14px; }
    .month-seo-text h2 { font-size: 16px; }
    .month-seo-text p { font-size: 12px; }
    .pager-btn { padding: 10px 14px; font-size: 12px; }

    /* Sidebar */
    .sidebar-card { padding: 14px; }
    .saints-list { max-height: 250px; }

    /* Holiday rows: stack on mobile */
    .holiday-row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 10px 14px;
    }
    .holiday-date { text-align: left; font-size: 12px; }
    .holiday-day { text-align: left; font-size: 11px; }
    .holiday-name { font-size: 13px; }

    /* Data tables: tighter padding */
    .data-table { font-size: 12px; }
    .data-table th { padding: 8px 10px; font-size: 10px; }
    .data-table td { padding: 8px 10px; }

    /* Downloads */
    .download-grid { grid-template-columns: 1fr; gap: 8px; }
    .download-card { padding: 12px 14px; }
    .download-icon { width: 36px; height: 36px; font-size: 16px; }

    /* Lunar */
    .lunar-legend { gap: 12px; padding: 10px 14px; }
    .legend-item { font-size: 12px; }
    .lunar-phase-card { padding: 10px 14px; font-size: 12px; }

    /* Planner */
    .planner-summary { grid-template-columns: 1fr; gap: 16px; }
    .summary-col { padding: 14px; }
    .tip-card { padding: 10px 14px; font-size: 12px; }

    /* Months link grid */
    .months-link-grid { gap: 6px; }
    .month-link { padding: 8px 12px; font-size: 12px; }
    .related-months h2 { font-size: 16px; }

    /* Sections: reduce spacing */
    .holidays-summary, .holidays-full, .ponti-section, .holidays-by-month,
    .planner-summary, .planner-tips, .lunar-months, .lunar-summary,
    .weeks-table-section, .printable-section, .ponti-riepilogo,
    .internal-links, .faq-section, .related-months { margin-top: 24px; }

    .holidays-summary h2, .holidays-full h2, .ponti-section h2,
    .holidays-by-month h2, .planner-summary h2, .planner-tips h2,
    .lunar-months h2, .lunar-summary h2, .weeks-table-section h2,
    .printable-section h2, .ponti-riepilogo h2,
    .internal-links h2, .faq-section h2 { font-size: 18px; margin-bottom: 12px; }

    /* Lead CTA */
    .lead-cta { margin-top: 28px; }
    .lead-cta-inner { padding: 20px; }
    .lead-cta-inner h3 { font-size: 17px; }
    .lead-cta-inner p { font-size: 13px; }

    /* FAQ: bigger touch targets */
    .faq-section summary { padding: 12px 14px; font-size: 13px; min-height: 44px; }
    .faq-section details p { padding: 0 14px 12px; font-size: 12px; }

    /* Internal links */
    .internal-links p { font-size: 13px; }

    /* Footer */
    .footer-inner { padding: 24px 16px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
    .footer-col a { font-size: 12px; padding: 2px 0; }

    /* Error page */
    .error-page { padding: 48px 16px; }
    .error-icon { font-size: 48px; }
    .error-page h1 { font-size: 22px; }

    /* Homepage */
    .home-card-grid { grid-template-columns: 1fr; }
    .home-months-grid { grid-template-columns: repeat(3, 1fr); }
    .home-card { padding: 12px 14px; gap: 10px; }
    .home-card-icon { width: 40px; height: 40px; font-size: 22px; }
    .home-card-body strong { font-size: 14px; }
    .home-card-body span { font-size: 11px; }

    /* Workdays chart */
    .chart-bars { height: 24px; }
    .chart-bar { font-size: 10px; }
    .chart-label { font-size: 11px; }
}

/* ── Small phones (≤480px) ─────────────────────────────── */
@media (max-width: 480px) {
    /* Header: even more compact */
    .header-inner { padding: 8px 12px; }
    .logo-icon { width: 28px; height: 28px; font-size: 14px; }
    .logo-name { font-size: 14px; }
    .year-nav .year-btn { padding: 4px 8px; font-size: 11px; }
    .view-nav .view-btn { padding: 5px 8px; font-size: 10px; }
    .dark-toggle { width: 32px; height: 32px; font-size: 14px; }

    /* Main content */
    .site-main { padding: 12px 10px 32px; }

    /* Hero */
    .hero h1 { font-size: 19px; }
    .intro-text { font-size: 12px; }

    /* Calendar cells: even smaller */
    .cal-cell { width: 24px; height: 24px; font-size: 10px; }
    .cal-compact .cal-cell { width: 22px; height: 22px; font-size: 9px; }
    .cal-row { grid-template-columns: 20px repeat(7, 1fr); }
    .cal-grid { padding: 4px 8px 8px; }
    .cal-compact { padding: 4px 6px 8px; }

    /* Month pager: full width buttons */
    .pager-btn { padding: 10px 10px; font-size: 11px; flex: 1; text-align: center; }

    /* Tables: minimum viable */
    .data-table { font-size: 11px; }
    .data-table th { padding: 6px 6px; font-size: 9px; letter-spacing: 0.03em; }
    .data-table td { padding: 6px 6px; }
    .badge { font-size: 9px; padding: 2px 6px; }

    /* Lunar */
    .lunar-phases-row { gap: 6px; }
    .lunar-phase-card { padding: 8px 10px; font-size: 11px; gap: 6px; }
    .phase-icon { font-size: 16px; }

    /* Footer: single column */
    .footer-grid { grid-template-columns: 1fr; }

    /* Months link grid */
    .months-link-grid { gap: 4px; }
    .month-link { padding: 6px 10px; font-size: 11px; }
    .home-months-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
    .home-month-card { padding: 8px 10px; gap: 6px; }
    .home-month-name { font-size: 12px; }

    /* Sidebar lead CTA */
    .sidebar-lead-cta { padding: 16px; }

    /* Lead CTA */
    .lead-cta-inner { padding: 16px; }
    .lead-cta-icon { font-size: 24px; margin-bottom: 8px; }
    .lead-cta-inner h3 { font-size: 15px; }
    .btn-primary { padding: 10px 20px; font-size: 13px; }

    /* FAQ */
    .faq-section summary { padding: 10px 12px; font-size: 12px; }
    .faq-section details p { padding: 0 12px 10px; font-size: 11px; }

    /* Workdays chart */
    .chart-bars { height: 22px; }
    .chart-bar { font-size: 9px; min-width: 16px; }
    .chart-label { width: 28px; font-size: 10px; }
    .chart-legend { font-size: 11px; gap: 10px; }
}

/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
    .site-header, .lead-cta, .sidebar-lead-cta,
    .download-section, .dark-toggle, .site-footer { display: none !important; }
    body { background: #fff; color: #000; }
    .cal-card { border: 1px solid #ccc; break-inside: avoid; }
}

/* ─── HOMEPAGE ───────────────────────────────────────────── */
.home-section {
    margin-top: 32px;
}
.home-section h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Card grid */
.home-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.home-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    color: var(--text-primary);
}
.home-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 1;
}
.home-card-accent {
    border-color: var(--accent);
    background: var(--accent-light);
}
.home-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-bg);
    border-radius: 12px;
}
.home-card-accent .home-card-icon {
    background: var(--accent);
    filter: brightness(1.1);
}
.home-card-body {
    flex: 1;
    min-width: 0;
}
.home-card-body strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}
.home-card-body span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.home-card-arrow {
    font-size: 18px;
    color: var(--accent);
    opacity: 0.5;
    flex-shrink: 0;
}
.home-card:hover .home-card-arrow {
    opacity: 1;
}

/* Months grid */
.home-months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}
.home-month-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    color: var(--text-primary);
}
.home-month-card:hover {
    border-color: var(--accent);
    opacity: 1;
}
.home-month-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-text);
    opacity: 0.6;
}
.home-month-name {
    font-size: 14px;
    font-weight: 600;
}

/* Holidays list */
.home-holidays-list {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.home-holiday-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}
.home-holiday-row:last-child { border-bottom: none; }
.home-holiday-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}
.home-holiday-info span {
    font-size: 11px;
    color: var(--text-tertiary);
}
.home-holiday-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-text);
    white-space: nowrap;
}
/* Festività — pagina anno */
.holidays-table {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.holiday-row {
    display: grid;
    grid-template-columns: 1fr 150px 100px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.holiday-row:last-child {
    border-bottom: none;
}

.holiday-name {
    font-weight: 600;
    font-size: 14px;
}

.holiday-date {
    text-align: center;
    font-weight: 700;
    color: var(--accent-text);
    white-space: nowrap;
}

.holiday-day {
    text-align: right;
    font-size: 13px;
    color: var(--text-tertiary);
}
/* SEO text */
.home-seo-text {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.home-seo-text h2 {
    margin-bottom: 12px;
}
.home-seo-text p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}
.home-seo-text p:last-child { margin-bottom: 0; }
