/* =====================================================================
   CirdanVetrina — Tema istituzionale (slate + steel blue)
   Costruito sopra Bootstrap 5. Titoli serif, testo sans, profondità.
   ===================================================================== */

:root {
    /* Blu acciaio */
    --c-steel-900: #13344A;
    --c-steel-800: #184058;
    --c-steel-700: #1E4E6B;
    --c-steel-600: #2B5D80; /* primario */
    --c-steel-500: #3A7099;
    --c-steel-400: #5B8CB0;

    /* Grigio ardesia (slate) */
    --c-slate-900: #0F172A;
    --c-slate-800: #1E293B;
    --c-slate-700: #334155;
    --c-slate-600: #475569;
    --c-slate-500: #64748B;
    --c-slate-400: #94A3B8;
    --c-slate-300: #CBD5E1;
    --c-slate-200: #E2E8F0;
    --c-slate-100: #F1F5F9;
    --c-slate-50:  #F8FAFC;

    --c-text: #1E293B;
    --c-heading: #0F172A;
    --c-primary: var(--c-steel-600);
    --c-primary-dark: var(--c-steel-800);

    --font-serif: Georgia, "Iowan Old Style", Cambria, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: .65rem;
    --radius-sm: .4rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, .10);
    --shadow-lg: 0 14px 32px rgba(15, 23, 42, .16);

    /* Override variabili Bootstrap */
    --bs-primary: #2B5D80;
    --bs-primary-rgb: 43, 93, 128;
    --bs-link-color: #2B5D80;
    --bs-link-color-rgb: 43, 93, 128;
    --bs-link-hover-color: #184058;
    --bs-body-color: #1E293B;
    --bs-body-bg: #ffffff;
    --bs-border-color: #E2E8F0;
    --bs-secondary-color: #64748B;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: var(--font-sans);
    color: var(--c-text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
    font-family: var(--font-serif);
    color: var(--c-heading);
    letter-spacing: -.01em;
    font-weight: 700;
}

a { color: var(--c-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-primary-dark); }

:focus-visible { outline: 3px solid rgba(43, 93, 128, .45); outline-offset: 2px; }

/* ---------- Navbar ---------- */
.site-navbar {
    background: var(--c-steel-900);
    box-shadow: var(--shadow-sm);
}
.site-navbar .navbar-brand {
    font-family: var(--font-serif);
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}
.site-navbar .navbar-brand small {
    font-family: var(--font-sans);
    font-weight: 400;
    color: rgba(255, 255, 255, .65);
}
.site-navbar .brand-logo {
    height: 38px;
    width: auto;
    flex: 0 0 auto;
}
.site-navbar .nav-link {
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    padding-inline: .9rem;
    position: relative;
}
.site-navbar .nav-link:hover { color: #fff; }
.site-navbar .nav-link::after {
    content: "";
    position: absolute;
    left: .9rem; right: .9rem; bottom: .35rem;
    height: 2px;
    background: var(--c-steel-400);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}
.site-navbar .nav-link:hover::after { transform: scaleX(1); }
.site-navbar .form-control {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
}
.site-navbar .form-control::placeholder { color: rgba(255, 255, 255, .6); }
.site-navbar .form-control:focus {
    background: #fff;
    color: var(--c-text);
}

/* ---------- Bottoni ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--c-primary);
    --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary-dark);
    --bs-btn-hover-border-color: var(--c-primary-dark);
    --bs-btn-active-bg: var(--c-primary-dark);
    --bs-btn-active-border-color: var(--c-primary-dark);
    box-shadow: var(--shadow-sm);
}
.btn-outline-primary {
    --bs-btn-color: var(--c-primary);
    --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary);
    --bs-btn-hover-border-color: var(--c-primary);
    --bs-btn-active-bg: var(--c-primary-dark);
}
.btn-outline-secondary {
    --bs-btn-color: var(--c-slate-600);
    --bs-btn-border-color: var(--c-slate-300);
    --bs-btn-hover-bg: var(--c-slate-100);
    --bs-btn-hover-border-color: var(--c-slate-400);
    --bs-btn-hover-color: var(--c-slate-800);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    color: #fff;
    background: linear-gradient(135deg, var(--c-steel-800) 0%, var(--c-steel-600) 100%);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 3.25rem 2rem;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M0 48L48 0M-12 12L12 -12M36 60L60 36' stroke='%23ffffff' stroke-width='1' fill='none' opacity='0.6'/%3E%3C/svg%3E");
    opacity: .10;
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, .9); }
.hero .hero-kicker {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-steel-400);
    margin-bottom: .5rem;
}

/* ---------- Page header (pagine interne) ---------- */
.page-header {
    position: relative;
    background: linear-gradient(135deg, var(--c-steel-800) 0%, var(--c-steel-700) 100%);
    color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    padding: 2rem;
}
.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M0 48L48 0M-12 12L12 -12M36 60L60 36' stroke='%23ffffff' stroke-width='1' fill='none' opacity='0.6'/%3E%3C/svg%3E");
    opacity: .08;
}
.page-header > * { position: relative; z-index: 1; }
.page-header h1 { color: #fff; margin-bottom: .15rem; }
.page-header p { color: rgba(255, 255, 255, .82); margin-bottom: 0; }

/* ---------- Sezioni ---------- */
.section-alt { background: var(--c-slate-50); }
.section-title {
    font-family: var(--font-serif);
    position: relative;
    padding-bottom: .55rem;
    margin-bottom: 1.25rem;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 3rem; height: 3px;
    background: var(--c-primary);
    border-radius: 2px;
}

/* ---------- Card ---------- */
.card {
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--c-slate-300);
}
.card-img-top { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }

/* ---------- Badge categoria ---------- */
.badge.bg-secondary {
    background: var(--c-slate-100) !important;
    color: var(--c-slate-700) !important;
    font-weight: 600;
    border: 1px solid var(--c-slate-200);
}

/* ---------- Elenco documenti ---------- */
.doc-list .list-group-item { border-color: var(--c-slate-200); }
.doc-list .list-group-item-action:hover { background: var(--c-slate-50); }
.doc-icon {
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: rgba(43, 93, 128, .10);
    color: var(--c-primary);
    font-weight: 700;
    font-family: var(--font-sans);
    font-size: .7rem;
    letter-spacing: .02em;
}

/* ---------- Corpo articolo ---------- */
.article-body { font-size: 1.075rem; line-height: 1.75; color: var(--c-slate-800); }
.article-body h2, .article-body h3 { margin-top: 1.8rem; margin-bottom: .6rem; }
.article-body p { margin-bottom: 1.1rem; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.article-body blockquote {
    border-left: 4px solid var(--c-steel-400);
    background: var(--c-slate-50);
    margin: 1.4rem 0;
    padding: .85rem 1.2rem;
    color: var(--c-slate-700);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body a { text-decoration: underline; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .9rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--c-steel-900);
    color: rgba(255, 255, 255, .72);
}
.site-footer h2 { color: #fff; font-size: 1.05rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .footer-rule { border-color: rgba(255, 255, 255, .12); }

/* ---------- Form floating (ereditato) ---------- */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder { text-align: start; }
