/* Notizie pubbliche — proiezione read-only di Redazione SAM. */
.news-home-empty {
    min-height: 396px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 28px;
    color: var(--sam-muted);
    text-align: center;
}

.news-home-empty > span { color: var(--sam-secondary); }
.news-home-empty svg { width: 36px; height: 36px; }
.news-home-empty p { max-width: 310px; margin: 0; font-size: 13px; }

.news-archive-section,
.news-detail-section {
    min-height: 520px;
    padding: 34px 0 76px;
    background:
        radial-gradient(circle at 92% 7%, rgba(11, 61, 133, .08), transparent 30%),
        linear-gradient(180deg, #f2f6fc 0, #fff 390px);
}

.news-page-container,
.news-detail-container { display: grid; gap: 28px; }

.news-detail-container { width: min(calc(100% - 48px), 1120px); }

.news-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--sam-muted);
    font-size: 12px;
    font-weight: 700;
}

.news-breadcrumb a { color: var(--sam-secondary); }
.news-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.news-breadcrumb span[aria-current="page"] { color: var(--sam-ink); }

.news-page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--sam-line);
}

.news-page-heading > div { max-width: 850px; }
.news-page-heading h1 {
    margin: 6px 0 10px;
    color: var(--sam-primary);
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1;
    letter-spacing: -.045em;
}

.news-page-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--sam-muted);
    font-size: 16px;
}

.news-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #cbd8ec;
    border-radius: 999px;
    color: var(--sam-secondary);
    background: #fff;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.news-archive-empty,
.news-detail-empty {
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    padding: 36px;
    border: 1px dashed #bbc7da;
    border-radius: 13px;
    color: var(--sam-muted);
    background: rgba(255, 255, 255, .82);
    text-align: center;
}

.news-archive-empty > span,
.news-detail-empty > span { color: var(--sam-secondary); }
.news-archive-empty svg,
.news-detail-empty svg { width: 44px; height: 44px; }
.news-archive-empty strong { color: var(--sam-primary); font-size: 20px; }
.news-archive-empty p,
.news-detail-empty p { max-width: 620px; margin: 0; font-size: 14px; }
.news-detail-empty h1 { margin: 4px 0 0; color: var(--sam-primary); font-size: clamp(32px, 5vw, 50px); }
.news-detail-empty .button { margin-top: 12px; }

.news-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.news-archive-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sam-line);
    border-top: 4px solid var(--sam-secondary);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(6, 39, 95, .08);
}

.news-archive-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    color: var(--sam-secondary);
    background: #e9eff8;
}

.news-archive-card-media img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.news-archive-card-media:hover img { transform: scale(1.015); }
.news-archive-card-fallback { position: absolute; }
.news-archive-card-fallback svg { width: 42px; height: 42px; }

.news-archive-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
}

.news-archive-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 28px;
}

.news-category {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 5px;
    color: #4f4100;
    background: var(--sam-accent);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
}

/*
 * Badge della fonte ufficiale (colori inline dalla mappa NewsSourceBadge:
 * solo enti ufficiali, le testate depurate non hanno identità sul sito).
 */
.news-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.news-row .news-source-badge { min-height: 20px; margin-left: 8px; padding: 3px 7px; }
.news-primary-source .news-source-badge { margin-right: 10px; vertical-align: middle; }

.news-archive-card-meta time { color: var(--sam-muted); font-size: 11px; font-weight: 700; }
.news-archive-card h2 {
    margin: 15px 0 10px;
    color: var(--sam-primary);
    font-size: clamp(20px, 2.1vw, 26px);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.news-archive-card h2 a:hover { color: var(--sam-secondary); }
.news-archive-card-content > p { margin: 0; color: var(--sam-muted); font-size: 13px; }
.news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    margin-top: auto;
    padding-top: 17px;
    color: var(--sam-secondary);
    font-size: 12px;
    font-weight: 850;
}

.news-card-link svg { width: 15px; height: 15px; }

.news-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 18px;
    padding-top: 8px;
    color: var(--sam-muted);
    font-size: 12px;
    font-weight: 750;
}

.news-pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid #cbd8ec;
    border-radius: 7px;
    color: var(--sam-secondary);
    background: #fff;
}

.news-pagination a:hover { border-color: var(--sam-secondary); }

/* Dettaglio articolo */
.news-detail-header { max-width: 920px; margin-inline: auto; text-align: center; }
.news-detail-header .news-category { margin-bottom: 17px; }
.news-detail-header h1 {
    margin: 0;
    color: var(--sam-primary);
    font-size: clamp(36px, 5.6vw, 64px);
    line-height: 1.03;
    letter-spacing: -.05em;
}

.news-detail-lead {
    max-width: 850px;
    margin: 21px auto 0;
    color: var(--sam-muted);
    font-size: clamp(17px, 1.8vw, 21px);
    line-height: 1.55;
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 18px;
    margin-top: 19px;
    color: var(--sam-muted);
    font-size: 12px;
    font-weight: 700;
}

.news-detail-meta span + span { position: relative; }
.news-detail-meta span + span::before {
    content: "";
    position: absolute;
    top: .65em;
    left: -10px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #a4adbd;
}

.news-detail-hero {
    overflow: hidden;
    margin: 4px 0 8px;
    border: 1px solid var(--sam-line);
    border-radius: 15px;
    background: #edf2fa;
    box-shadow: 0 16px 42px rgba(6, 39, 95, .12);
}

.news-detail-hero img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.news-detail-hero figcaption {
    padding: 9px 15px;
    border-top: 1px solid var(--sam-line);
    color: var(--sam-muted);
    background: #fff;
    font-size: 10px;
}

.news-detail-body {
    width: min(100%, 820px);
    margin-inline: auto;
    color: #182943;
    font-size: clamp(17px, 1.4vw, 19px);
    line-height: 1.72;
}

.news-detail-body h2 {
    margin: 48px 0 17px;
    color: var(--sam-primary);
    font-size: clamp(27px, 3.2vw, 36px);
    line-height: 1.16;
    letter-spacing: -.035em;
}

.news-detail-body h3 {
    margin: 36px 0 14px;
    color: var(--sam-primary);
    font-size: clamp(22px, 2.5vw, 28px);
    line-height: 1.2;
}

.news-rich-paragraph { margin: 0 0 22px; }
.news-rich-paragraph p { margin: 0 0 22px; }
.news-rich-paragraph a,
.news-rich-list a {
    color: var(--sam-secondary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.news-rich-list { margin: 0 0 24px; padding-left: 25px; }
.news-rich-list li { margin-bottom: 8px; padding-left: 4px; }

.news-notice {
    margin: 28px 0;
    padding: 20px 22px;
    border: 1px solid #e8d470;
    border-left: 5px solid var(--sam-accent);
    border-radius: 9px;
    color: #4b3e02;
    background: #fffbea;
    font-size: 16px;
    line-height: 1.58;
}

.news-notice p { margin: 0; }
.news-notice a { color: var(--sam-secondary); text-decoration: underline; text-underline-offset: 3px; }

.news-table-region {
    overflow-x: auto;
    margin: 22px 0 30px;
    border: 1px solid var(--sam-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(6, 39, 95, .06);
}

.news-table-region:focus-visible { outline: 3px solid var(--sam-accent); outline-offset: 3px; }
.news-table-region table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.news-table-region th,
.news-table-region td { padding: 13px 14px; border-bottom: 1px solid var(--sam-line); text-align: left; vertical-align: top; }
.news-table-region th { color: #fff; background: var(--sam-primary); font-size: 11px; letter-spacing: .02em; }
.news-table-region tbody tr:last-child td { border-bottom: 0; }
.news-table-region tbody tr:nth-child(even) { background: #f8faff; }

/* Allegati: miniatura integrale della prima pagina/copertina. */
.news-documents {
    display: grid;
    gap: 21px;
    margin-top: 24px;
    padding-top: 32px;
    border-top: 1px solid var(--sam-line);
}

.news-documents-heading { max-width: 820px; }
.news-documents-heading h2 {
    margin: 5px 0 8px;
    color: var(--sam-primary);
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.news-documents-heading p { margin: 0; color: var(--sam-muted); font-size: 13px; }
.news-documents-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.news-document-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--sam-line);
    border-top: 4px solid var(--sam-secondary);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(6, 39, 95, .08);
}

.news-document-card-body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.news-document-cover {
    position: relative;
    overflow: hidden;
    width: 112px;
    aspect-ratio: 420 / 594;
    display: grid;
    place-items: center;
    border: 1px solid #cbd6e7;
    border-radius: 7px;
    color: var(--sam-secondary);
    background: #f5f7fb;
    box-shadow: 0 7px 16px rgba(6, 39, 95, .11);
}

.news-document-cover img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.news-document-cover-fallback { position: absolute; }
.news-document-cover-fallback svg { width: 34px; height: 34px; }
.news-document-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; height: 100%; }
.news-document-type {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 5px 8px;
    border-radius: 5px;
    color: #fff;
    background: var(--sam-primary);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .055em;
}

.news-document-content h3 {
    margin: 12px 0 8px;
    color: var(--sam-primary);
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.news-document-content > p { margin: 0; color: var(--sam-muted); font-size: 12px; }
.news-document-source { margin-top: 10px; color: var(--sam-ink); font-size: 10px; font-weight: 750; }
.news-document-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
    margin-top: auto;
    padding-top: 15px;
}

.news-document-download,
.news-document-official {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: var(--sam-secondary);
    font-size: 11px;
    font-weight: 850;
}

.news-document-download { gap: 6px; }
.news-document-download svg { width: 14px; height: 14px; }
.news-document-official { text-decoration: underline; text-underline-offset: 3px; }

.news-primary-source {
    width: min(100%, 820px);
    margin: 0 auto;
    padding-top: 8px;
    border-top: 1px solid var(--sam-line);
}

.news-primary-source a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    color: var(--sam-secondary);
    font-size: 12px;
    font-weight: 850;
}

.news-primary-source svg { width: 15px; height: 15px; }

@media (max-width: 1080px) {
    .news-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-documents-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .news-archive-section,
    .news-detail-section { padding: 26px 0 54px; }
    .news-detail-container { width: min(calc(100% - 24px), 1120px); }
    .news-page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
    .news-archive-grid { grid-template-columns: 1fr; }
    .news-detail-header { text-align: left; }
    .news-detail-meta { justify-content: flex-start; }
    .news-detail-hero { border-radius: 10px; }
    .news-detail-body { font-size: 17px; line-height: 1.66; }
    .news-detail-body h2 { margin-top: 38px; }
    .news-notice { padding: 17px 18px; }
    .news-documents { padding-top: 26px; }
}

@media (max-width: 520px) {
    .news-page-heading h1 { font-size: 36px; }
    .news-archive-card-content { padding: 19px; }
    .news-document-card { padding: 18px; }
    .news-document-card-body { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; }
    .news-document-cover { width: 82px; }
    .news-document-content h3 { font-size: 18px; }
    .news-document-actions { align-items: flex-start; flex-direction: column; gap: 0; }
    .news-detail-meta span + span::before { display: none; }
}

@media (max-width: 380px) {
    .news-document-card-body { grid-template-columns: 1fr; }
    .news-document-cover { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .news-archive-card-media img { transition: none; }
}

@media print {
    .news-breadcrumb,
    .news-pagination,
    .news-document-actions,
    .news-primary-source { display: none; }
    .news-detail-section { padding: 0; background: #fff; }
    .news-detail-hero { box-shadow: none; }
    .news-document-card { break-inside: avoid; box-shadow: none; }
}
