/* ==========================================================================
   03 - COMPONENTI GUIDA (TOC, STATS, CARD, ITINERARI)
   ========================================================================== */

/* --- 1. TABLE OF CONTENTS (TOC) --- */
.tf-toc { background-color: var(--tf-green-light); border: 1px solid var(--tf-green-border); border-radius: var(--tf-radius); padding: 24px 30px; margin: 40px auto; max-width: 800px; box-shadow: var(--tf-shadow); }
.tf-toc h3 { font-family: var(--tf-font-h); font-size: 1.4rem; color: var(--tf-green-dark); margin-top: 0; margin-bottom: 16px; border-bottom: 2px solid var(--tf-green-border2); padding-bottom: 10px; }
.tf-toc ul { list-style-type: none; padding: 0; margin: 0; }
.tf-toc ul li { margin-bottom: 12px; }
.tf-toc ul li:last-child { margin-bottom: 0; }
.tf-toc ul li a { color: var(--tf-dark); font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: var(--tf-transition); text-decoration: none; }
.tf-toc ul li a:before { content: "↓"; color: var(--tf-green); font-weight: bold; transition: transform 0.2s ease; }
.tf-toc ul li a:hover { color: var(--tf-green); padding-left: 5px; }
.tf-toc ul li a:hover:before { transform: translateY(2px); }

/* --- 2. PUNTI SALIENTI & HIGHLIGHT BAR --- */
.quick-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media(max-width: 800px) { .quick-stats { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 480px) { .quick-stats { grid-template-columns: 1fr 1fr; } }
.stat-card { background: var(--tf-white); border: 1px solid var(--tf-green-border); border-radius: var(--tf-radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--tf-shadow); transition: var(--tf-transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--tf-shadow-md); }
.stat-card .sc-icon { font-size: 1.6rem; margin-bottom: 4px; line-height: 1; }
.stat-card .sc-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--tf-muted); }
.stat-card .sc-value { font-size: 1rem; font-weight: 800; color: var(--tf-dark); line-height: 1.3; }
.stat-card .sc-sub { font-size: 0.78rem; color: var(--tf-muted); margin-top: 2px; }

.highlight-bar { background: var(--tf-green); color: #fff; border-radius: var(--tf-radius); padding: 22px 28px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 16px; text-align: center; }
@media(max-width: 600px) { .highlight-bar { grid-template-columns: 1fr; gap: 14px; } }
.hb-item .hb-val { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.hb-item .hb-label { font-size: 0.78rem; opacity: 0.8; margin-top: 4px; }

/* --- 3. AREE GEOGRAFICHE (CON BOTTONE) --- */
.dest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media(max-width: 860px) { .dest-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }
.dest-card { display: flex; flex-direction: column; border-radius: var(--tf-radius); overflow: hidden; box-shadow: var(--tf-shadow-md); background: var(--tf-white); border: 1px solid var(--tf-green-border2); transition: var(--tf-transition); }
.dest-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(46,139,87,0.14); }
.dest-img { position: relative; height: 200px; overflow: hidden; }
.dest-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.dest-card:hover .dest-img img { transform: scale(1.07); }
.dest-img .dest-tag { position: absolute; bottom: 14px; left: 14px; background: var(--tf-green); color: #fff; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; padding: 4px 10px; border-radius: 4px; z-index: 2; }
.dest-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex-grow: 1; }
.dest-body h3 { font-family: var(--tf-font-h); font-size: 1.15rem; color: var(--tf-dark); margin: 0 0 8px 0; line-height: 1.3; }
.dest-body p { font-size: 0.88rem; color: #555; margin: 0 0 14px 0; line-height: 1.55; flex-grow: 1; }
.dest-ideal { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--tf-green-dark); font-weight: 700; background: var(--tf-green-light); padding: 7px 12px; border-radius: 6px; margin-bottom: 16px; }
.dest-btn { display: block; text-align: center; background: var(--tf-green); color: #fff !important; padding: 10px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 800; text-decoration: none; transition: var(--tf-transition); }
.dest-btn:hover { background: var(--tf-green-dark); transform: translateY(-2px); }

/* --- 4. CLIMA (STAGIONI) --- */
.stagioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media(max-width: 720px) { .stagioni { grid-template-columns: 1fr; } }
.stagione-card { border-radius: var(--tf-radius); overflow: hidden; box-shadow: var(--tf-shadow); display: flex; flex-direction: column; }
.stagione-card .sc-head { padding: 14px 18px; display: flex; align-items: center; gap: 10px; color: #fff; }
.stagione-card .sc-head .big-icon { font-size: 1.5rem; line-height: 1; }
.stagione-card .sc-head .sc-title { font-weight: 800; font-size: 0.88rem; line-height: 1.2; margin: 0; }
.stagione-card .sc-head .sc-months { font-size: 0.75rem; opacity: 0.85; margin-top: 2px; }
.stagione-card.fresca .sc-head { background: var(--tf-green); }
.stagione-card.calda  .sc-head { background: #d97706; }
.stagione-card.piogge .sc-head { background: #3b82f6; }
.stagione-card .sc-body { background: var(--tf-white); border: 1px solid var(--tf-green-border2); border-top: none; padding: 14px 18px; font-size: 0.88rem; color: #444; border-radius: 0 0 var(--tf-radius) var(--tf-radius); flex-grow: 1; }
.stagione-card.calda  .sc-body { border-color: #fde68a; }
.stagione-card.piogge .sc-body { border-color: #bfdbfe; }
.temp-badge { display: inline-block; font-weight: 800; color: var(--tf-green-dark); background: var(--tf-green-light); padding: 2px 8px; border-radius: 4px; font-size: 0.82rem; margin-bottom: 8px; }

/* --- 5. ITINERARI --- */
.itin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media(max-width: 860px) { .itin-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; } }
.itin-card { background: var(--tf-white); border-radius: var(--tf-radius); border: 1px solid var(--tf-green-border); overflow: hidden; box-shadow: var(--tf-shadow); transition: var(--tf-transition); }
.itin-card:hover { box-shadow: var(--tf-shadow-md); transform: translateY(-3px); }
.itin-head { background: var(--tf-green-light); border-bottom: 1px solid var(--tf-green-border); padding: 16px 20px; }
.itin-head .itin-days { font-size: 2rem; font-weight: 800; color: var(--tf-green); line-height: 1; }
.itin-head .itin-days span { font-size: 0.8rem; font-weight: 700; color: var(--tf-muted); display: block; margin-top: 2px; }
.itin-head h3 { font-family: var(--tf-font-h); font-size: 1.1rem; color: var(--tf-dark); margin: 8px 0 0 0; line-height: 1.3; }
.itin-body { padding: 16px 20px; }
.itin-stops { list-style: none; margin: 0 0 14px 0; padding: 0; }
.itin-stops li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--tf-green-border2); font-size: 0.88rem; margin: 0; }
.itin-stops li:last-child { border-bottom: none; }
.stop-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tf-green); flex-shrink: 0; margin-top: 6px; }
.itin-tag { display: inline-block; background: var(--tf-green-light); color: var(--tf-green-dark); border: 1px solid var(--tf-green-border); font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 4px; }

/* --- 6. BUDGET (Tutte le card con intestazione verde) --- */
.budget-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media(max-width: 780px) { .budget-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; } }

.budget-card { background: var(--tf-white); border-radius: var(--tf-radius); border: 1px solid var(--tf-green-border); overflow: hidden; box-shadow: var(--tf-shadow); transition: var(--tf-transition); }
.budget-card.featured { transform: scale(1.02); box-shadow: 0 6px 28px rgba(46,139,87,0.15); border: 2px solid var(--tf-green-dark); }
.budget-card:hover { transform: translateY(-3px); }
.budget-card.featured:hover { transform: scale(1.02) translateY(-3px); }

/* Intestazione unificata: sfondo verde per tutte */
.budget-head { padding: 20px 22px 16px; background: var(--tf-green); border-bottom: transparent; }
.budget-card.featured .budget-head { background: var(--tf-green-dark); } /* Quella centrale leggermente più scura per farla spiccare */

/* Testi dell'intestazione (bianchi su fondo verde) */
.budget-type { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.85); margin-bottom: 4px; }
.budget-price { font-size: 1.9rem; font-weight: 800; color: #fff; line-height: 1; }
.budget-price .per { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.75); }

/* Corpo della card */
.budget-body { padding: 16px 22px 20px; }
.budget-items { list-style: none; margin: 0; padding: 0; }
.budget-items li { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dotted var(--tf-green-border2); font-size: 0.86rem; margin: 0; }
.budget-items li:last-child { border-bottom: none; }
.budget-items .item-label { color: var(--tf-muted); }
.budget-items .item-val { font-weight: 700; color: var(--tf-dark); }
/* --- 7. ERRORI (VERSIONE A RIQUADRI/GRID) --- */
.tf-grid-errors {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Due riquadri per riga */
    gap: 20px;
    margin: 30px 0;
}

/* Se lo schermo è piccolo, un solo riquadro per riga */
@media (max-width: 768px) {
    .tf-grid-errors {
        grid-template-columns: 1fr;
    }
}

.tf-error-card {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: var(--tf-radius);
    padding: 20px;
    display: grid;
    grid-template-columns: 30px 1fr; /* Icona a sinistra, testo a destra */
    gap: 15px;
    box-shadow: var(--tf-shadow);
    transition: transform 0.2s ease;
}

.tf-error-card:hover {
    transform: translateY(-3px);
}

.tf-err-triangle {
    width: 28px;
    height: 25px;
    background-color: #d97706;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.tf-err-triangle::after {
    content: "!";
    color: white;
    font-weight: 900;
    font-size: 15px;
    font-family: sans-serif;
}

.tf-error-card h3 {
    margin: 0 0 8px 0 !important;
    color: var(--tf-dark);
    font-size: 1.05rem !important;
    font-weight: 800;
}

.tf-error-card p {
    margin: 0 !important;
    color: #555;
    font-size: 0.88rem;
    line-height: 1.5;
}