:root {
    --color: #0D2C3E;
    --teal-light: white;
    --blue:       #264653;
    --muted:      #6b7280;
    --border:     black;
    --bg:         #f8fafa;
    --text:       #1a1a2e;
    --accent:     #e9c46a;
}

/* ---- Header ---- */
.header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--teal-dark) 100%);
    color: #0D2C3E;
    text-align: center;
    padding: 10px 4px 4px;
    font-size: 2.8rem;
    font-weight: 900;
}
.titolo-header-ambiti{
    border-bottom: 3px solid #1DADA0;
    padding: 20px 5px 5px;
    text-align: center;
}
.titolo-header-orientati{
    border-bottom: 3px solid #1DADA0;
    padding: 20px 5px 5px;
    text-align: center;
}
.header h1 { text-align: center;font-size: 2.4rem; font-weight: 700; margin-bottom: 8px; }
.header p  { opacity: .8; font-size: 1rem; }

/* ---- Filter bar ---- */
.filter-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(42,157,143,.15);
}
.filter-input  { max-width: 220px; }
.filter-zona   { max-width: 180px; }
.filter-ambito { max-width: 260px; }

.btn-cerca {
    background: var(--teal);
    color: black;
    border: none;
    font-weight: 600;
    padding: 8px 24px;
    white-space: nowrap;
    transition: background .2s;
    font-size: .9rem;
}
.btn-cerca:hover { background: var(--teal-dark); color: #1DADA0; }
.btn-reset { color: var(--muted); font-size: .85rem; text-decoration: none; padding: 0 8px; }
.btn-reset:hover { color: var(--teal); }

/* ---- Risultati ---- */
.results-area { padding: 32px 0 64px; }
.results-count { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }
.results-count strong { color: var(--teal); }

/* ---- Card scuola ---- */
.school-card {
    background: white;
    border: 1.5px solid var(--border);
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.school-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); border-color: #1DADA0; }
.school-card.open  { box-shadow: 0 6px 24px rgba(0,0,0,.11); border-color: #1DADA0; }

.card-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    cursor: pointer;
    user-select: none;
    background: white;
}
.card-iniziale {
    width: 64px;
    height: 64px;
    background: var(--teal-light);
    color: var(--teal-dark);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.card-meta { flex: 1; min-width: 0; }
.card-meta h2 { font-size: 1rem; font-weight: 700; color: var(--teal-dark); margin-bottom: 4px; }
.card-location {
    font-size: .82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.ambiti-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ambito-tag {
    background: var(--teal-light);
    color: var(--teal-dark);
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 10px;
}
.chevron-btn {
    width: 32px;
    height: 32px;
        background: var(--teal-light);
    color: var(--teal);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .3s;
    font-size: 1rem;
}
.school-card.open .chevron-btn { transform: rotate(180deg); }

/* ---- Card body ---- */
.card-body-content {
    display: none;
    border-top: 1px solid var(--border);
    padding: 24px 22px;
    flex-wrap: wrap;
    gap: 28px;
}
.school-card.open .card-body-content { display: flex; }

.col-info { flex: 1 1 300px; }
.col-map  { flex: 1 1 300px; }

.section-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 20px;
}
.section-label:first-child { margin-top: 0; }
.section-label-spaced { margin-top: 20px; }

.desc-text { font-size: .9rem; color: #374151; line-height: 1.7; }

/* ---- Ambiti nella card body ---- */
.ambiti-desc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ambiti-desc-list li {
    font-size: .85rem;
    padding: 6px 12px;
    background: var(--teal-light);
    border-left: 3px solid var(--teal);
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ambito-num {
    font-weight: 700;
    font-size: .75rem;
    color: var(--teal-dark);
    white-space: nowrap;
}

/* ---- Link extra ---- */
.links-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.link-extra-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--teal-light);
    color: var(--teal-dark);
    border: 1px solid rgba(42,157,143,.25);
    padding: 6px 13px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.link-extra-btn:hover {
    background: var(--teal);
    color: #1DADA0;
    border-color: var(--teal);
}

/* ---- Indirizzi ---- */
.indirizzi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.indirizzi-list li {
    font-size: .85rem;
    padding: 6px 12px;
    background: var(--bg);
    border-left: 3px solid var(--teal);
    line-height: 1.4;
}

/* ---- Eventi ---- */
.eventi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.evento-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.evento-titolo { font-size: .9rem; font-weight: 700; color: var(--text); }
.evento-data {
    font-size: .78rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.evento-desc { font-size: .82rem; color: #4b5563; margin-top: 2px; }
.badge-prenotabile {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 8px;
    margin-top: 3px;
    width: fit-content;
}

/* ---- Mappa ---- */
.map-wrap {
    overflow: hidden;
    border: 1px solid var(--border);
    height: 250px;
    background: var(--teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; }
.map-address { font-size: .8rem; color: var(--muted); margin-top: 7px; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 72px 0; color: var(--muted); }
.empty-state i { font-size: 3rem; opacity: .3; display: block; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .card-header-row { padding: 14px 16px; gap: 10px; }
    .card-body-content { padding: 18px 16px; }
    .card-iniziale { width: 48px; height: 48px; font-size: 1.2rem; }
    .filter-input, .filter-zona, .filter-ambito { max-width: 100%; }
}