/* Home a catalogo (card di mappe e dataset). Palette coerente con la mappa (site.css). */

.cat-shell {
    min-height: 100vh; display: flex; flex-direction: column; background: #f4f6f9;
    font-family: "Titillium Web", "Segoe UI", system-ui, sans-serif;
}

/* ---------- fascia istituzionale + intestazione ---------- */
.cat-strip {
    background: #06263f; color: #cbd5e1; font-size: .78rem;
    padding: 6px 22px; letter-spacing: .3px;
}
.cat-strip-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cat-strip a { color: #e2e8f0; text-decoration: none; }
.cat-strip a:hover { text-decoration: underline; }

.cat-hero {
    background: linear-gradient(120deg, #0b3d78 0%, #06263f 100%);
    color: #fff;
    padding: 34px 22px 46px;
    border-bottom: 4px solid #0b3d78;
}
.cat-hero-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.cat-brand { display: flex; align-items: center; gap: 20px; }
.cat-logo { height: 70px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px 10px; }
.cat-hero h1 { margin: 0 0 8px; font-size: 1.6rem; font-weight: 600; letter-spacing: .2px; }
.cat-hero .cat-sotto { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1.4px; color: #93c5fd; font-weight: 600; }
.cat-hero p { margin: 0; opacity: .85; max-width: 46rem; font-size: .95rem; line-height: 1.5; }
.cat-admin {
    color: #fff; text-decoration: none; font-size: .9rem; white-space: nowrap;
    border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 8px 14px;
    transition: background .15s;
}
.cat-admin:hover { background: rgba(255,255,255,.12); }

/* ---------- sezioni / tab / ricerca ---------- */
.cat-main { max-width: 1180px; margin: -22px auto 40px; padding: 0 22px; width: 100%; box-sizing: border-box; }
.cat-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 8px 10px; margin-bottom: 22px; box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.cat-tabs { display: flex; gap: 4px; }
.cat-tab {
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; background: transparent; color: #475569; cursor: pointer;
    font-size: .95rem; font-weight: 600; padding: 9px 16px; border-radius: 10px;
}
.cat-tab:hover { background: #f1f5f9; }
.cat-tab.active { background: #0b3d78; color: #fff; }
.cat-tab.active .cat-count { background: rgba(255,255,255,.18); color: #fff; }
.cat-cerca {
    flex: 1 1 240px; max-width: 26rem; padding: 9px 14px; font-size: .9rem;
    border: 1px solid #cbd5e1; border-radius: 10px;
}
.cat-count {
    background: #e2e8f0; color: #475569; font-size: .78rem; font-weight: 600;
    border-radius: 999px; padding: 2px 9px;
}
.cat-vuoto { color: #64748b; margin: 8px 4px; }

/* ---------- card ---------- */
.cat-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.cat-card {
    background: #fff; border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit;
    border: 1px solid #e2e8f0; display: flex; flex-direction: column; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transition: transform .16s ease, box-shadow .16s ease;
}
.cat-card:hover, .cat-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .13);
}
.cat-card-img { position: relative; aspect-ratio: 16 / 10; background: #e2e8f0; overflow: hidden; }
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.cat-card:hover .cat-card-img img { transform: scale(1.04); }
.cat-card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 2.6rem; background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
}
.cat-badge {
    position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 700;
    padding: 3px 9px; border-radius: 999px; color: #fff; background: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.25); letter-spacing: .3px;
}
.cat-badge-cdu { background: #16a34a; }
.cat-badge-civici { background: #d97706; }
.cat-badge-editing { background: #9333ea; }
.cat-badge-privato { left: auto; right: 10px; background: #475569; }
.cat-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-card-body h3 { margin: 0; font-size: 1.02rem; color: #0f172a; line-height: 1.3; }
.cat-card-body p {
    margin: 0; color: #64748b; font-size: .86rem; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-apri { margin-top: auto; padding-top: 8px; color: #2563eb; font-size: .85rem; font-weight: 600; }
.cat-azioni { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-azioni .cat-apri { margin-top: 0; padding-top: 0; }
.cat-dettagli {
    border: 1px solid #cbd5e1; background: #fff; color: #475569; border-radius: 8px;
    padding: 4px 10px; font-size: .78rem; cursor: pointer;
}
.cat-dettagli:hover { background: #f1f5f9; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cat-tag { background: #f1f5f9; color: #475569; border-radius: 999px; font-size: .72rem; padding: 2px 8px; }

/* ---------- dialog dettagli dataset ---------- */
.cat-dialog { border: none; border-radius: 14px; padding: 22px 24px; max-width: 34rem; width: 92vw; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.cat-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.cat-dialog h3 { margin: 0 0 8px; }
.cat-meta { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 10px 0 14px; }
.cat-meta th { text-align: left; color: #64748b; font-weight: 600; padding: 4px 10px 4px 0; vertical-align: top; white-space: nowrap; }
.cat-meta td { padding: 4px 0; color: #0f172a; }
.cat-chiudi { border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 8px; padding: 6px 16px; cursor: pointer; }

/* ---------- footer istituzionale ---------- */
.cat-foot {
    background: #06263f; color: #94a3b8; font-size: .82rem;
    padding: 22px 22px 26px; margin-top: auto;
}
.cat-foot-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cat-foot a { color: #cbd5e1; text-decoration: none; }
.cat-foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .cat-hero-inner { flex-direction: column; }
    .cat-hero h1 { font-size: 1.25rem; }
}
