/*
 * Homepage – Layout 3 colonne
 * archivistica theme / homepage.css
 * ===========================================================
 */

/* ── Wrapper 3 colonne ─────────────────────────────────────────────────── */
.arx-home-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    grid-template-areas: "sidebar main aside";
    gap: 0;
    width: 100%;
    min-height: calc(100vh - 130px);
    align-items: start;
    background: #fff;
}

/* Griglia card risorse: 6 desktop, 3 tablet, 2 mobile. */
.arx-home-grid,
.arx-docs-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }

@media (max-width: 1199px) {
    .arx-home-grid,
    .arx-docs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 699px) {
    .arx-home-grid,
    .arx-docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ── Colonna sinistra – Filtri ─────────────────────────────────────────── */
.arx-home-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    border-right: 1px solid #ece8e2;
    padding: 24px 0;
    background: #faf9f7;
    scrollbar-width: thin;
    scrollbar-color: #d4cfc8 transparent;
}
.arx-home-sidebar::-webkit-scrollbar { width: 4px; }
.arx-home-sidebar::-webkit-scrollbar-track { background: transparent; }
.arx-home-sidebar::-webkit-scrollbar-thumb { background: #d4cfc8; border-radius: 2px; }

/* Gli archivi riutilizzano la sidebar storica dentro la colonna homepage. */
.arx-archive-layout .arx-home-sidebar {
    padding: 18px 14px;
}
.arx-archive-layout .arx-home-sidebar > .arx-sidebar {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.arx-archive-layout .arx-home-sidebar > .arx-sidebar-toggle {
    width: 100%;
}

.arx-home-sidebar__section {
    padding: 0 16px 20px;
    border-bottom: 1px solid #ece8e2;
    margin-bottom: 4px;
}
.arx-home-sidebar__section:last-child { border-bottom: none; }
.arx-home-sidebar__section--cta { padding-top: 16px; }

.arx-home-sidebar__label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #9b8f84;
    margin-bottom: 10px;
    padding-top: 4px;
}

/* Cerca nella sidebar */
.arx-home-search { margin-bottom: 0; }
.arx-home-search__wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d4cfc8;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s;
}
.arx-home-search__wrap:focus-within { border-color: var(--arx-primary); }
.arx-home-search__input {
    flex: 1;
    border: none;
    outline: none;
    padding: 7px 10px;
    font-size: .82rem;
    background: transparent;
    color: #2a2520;
    font-family: inherit;
}
.arx-home-search__wrap button {
    background: none;
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    color: #6a5e54;
    display: flex;
    align-items: center;
    transition: color .2s;
}
.arx-home-search__wrap button:hover { color: var(--arx-primary); }

/* Lista filtri */
.arx-home-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.arx-home-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #4a3f35;
    font-size: .82rem;
    transition: background .15s, color .15s;
    line-height: 1.3;
    border: 1px solid transparent;
}
.arx-home-filter-item:hover {
    background: #ece8e2;
    color: var(--arx-primary);
}
.arx-home-filter-item.is-active {
    background: #e8eef7;
    color: var(--arx-primary);
    border-color: rgba(26,58,107,.15);
    font-weight: 600;
}
.arx-home-filter-item svg { flex-shrink: 0; }
.arx-home-filter-item span { flex: 1; }
.arx-home-filter-item em {
    font-style: normal;
    font-size: .72rem;
    color: #9b8f84;
    background: #ece8e2;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}
.arx-home-filter-item.is-active em {
    background: rgba(26,58,107,.12);
    color: var(--arx-primary);
}
.arx-home-filter-item__dot,
.arx-home-sidebar .arx-home-filter-item > span:first-child:not([class]) {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9a84c;
    flex-shrink: 0;
    display: inline-block;
}

/* Filtro Comuni: solo testo, senza indicatore grafico. */
.arx-home-sidebar__section--comuni .arx-home-filter-item {
    color: #a3262a;
}
.arx-home-sidebar__section--comuni .arx-home-filter-item > span:first-child:not([class]) {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    display: inline;
}
.arx-home-sidebar__section--comuni .arx-home-filter-item:hover,
.arx-home-sidebar__section--comuni .arx-home-filter-item.is-active {
    color: #7f171c;
}

/* ── Colonna centrale – Contenuto ──────────────────────────────────────── */
.arx-home-main {
    grid-area: main;
    padding: 28px 28px 48px;
    min-width: 0; /* prevent overflow */
}

/* Intestazione risultati */
.arx-home-results-head {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ece8e2;
}
.arx-home-results-head__info {}
.arx-home-results-head__title {
    font-size: clamp(1.55rem, 2.2vw, 2.25rem);
    font-weight: 700;
    color: #1a1510;
    margin: 0 0 3px;
    line-height: 1.3;
}
.arx-home-results-head__count {
    font-size: .92rem;
    color: #8a7c70;
    margin: 0;
}
.arx-results-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font: 750 .82rem/1 var(--arx-font-sans);
    cursor: pointer;
    transition: background .18s, color .18s;
}
.arx-results-search-toggle svg { width: 20px; height: 20px; }
.arx-results-search-toggle:hover,
.arx-results-search-toggle:focus-visible { background: #333; color: #fff; }
.arx-archive-landing .arx-home-results-head {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    align-items: start;
    gap: 24px;
}
.arx-results-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 0;
}
.arx-results-tools .arx-home-active-filters { flex: 1 1 auto; }
.arx-results-inline-search {
    flex: 0 1 390px;
    display: flex;
    margin-left: auto;
    min-width: 250px;
    height: 44px;
    overflow: hidden;
    border: 1px solid #cfc9c1;
    border-radius: 999px;
    background: #fff;
}
.arx-results-inline-search input[type="search"] {
    min-width: 0;
    flex: 1;
    padding: 0 7px 0 17px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #111;
    font-size: .84rem;
}
.arx-results-inline-search button {
    display: grid;
    flex: 0 0 43px;
    width: 43px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #111;
    color: #fff;
    cursor: pointer;
}
.arx-results-inline-search button svg { width: 19px; height: 19px; }
.arx-results-inline-search:focus-within { border-color: #111; box-shadow: 0 0 0 2px rgba(0,0,0,.1); }

/* Ricerca avanzata combinata. */
.arx-advanced-search[hidden] { display: none; }
.arx-advanced-search { position: fixed; z-index: 100100; inset: 0; display: grid; place-items: center; padding: 24px; }
.arx-advanced-search__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); }
.arx-advanced-search__panel {
    position: relative;
    width: min(1420px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 28px;
    background: #050505;
    color: #fff;
    box-shadow: 0 35px 100px rgba(0,0,0,.55);
}
.arx-advanced-search__head { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 18px; background: rgba(0,0,0,.9); }
.arx-advanced-search__head img { width: min(260px, 42vw); height: 74px; object-fit: contain; object-position: left center; }
.arx-advanced-search__head-actions { display: flex; align-items: center; gap: 9px; }
.arx-advanced-search__help-toggle { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; background: transparent; color: #fff; font: 800 1.15rem/1 sans-serif; cursor: pointer; }
.arx-advanced-search__help-toggle[aria-expanded="true"] { background: #fff; color: #111; }
.arx-advanced-search__close { display: inline-flex; width: auto; height: 48px; padding: 0 7px 0 17px; align-items: center; gap: 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: #050505; color: #fff; cursor: pointer; }
.arx-advanced-search__close span { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.arx-advanced-search__close b { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #fff; color: #111; font: 400 1.65rem/1 sans-serif; }
.arx-advanced-search__body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: stretch; }
.arx-advanced-search form { min-width: 0; padding: 16px 20px 22px 28px; }
.arx-advanced-search__help { margin: 0 28px; padding: 13px 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(255,255,255,.08); }
.arx-advanced-search__help[hidden] { display: none; }
.arx-advanced-search__help strong { display: block; margin-bottom: 3px; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.arx-advanced-search__help p { margin: 0; color: rgba(255,255,255,.75); font-size: .82rem; line-height: 1.45; }
.arx-advanced-search__collage {
    display: block;
    min-height: 650px;
    margin: 20px 18px 28px 0;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    background-color: #050505;
    background-image: url("../img/menu-collage-dark-v1.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.arx-advanced-search__query { display: flex; align-items: center; gap: 12px; height: 56px; padding: 5px 18px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; background: #fff; color: #111; }
.arx-advanced-search__query > svg { flex: 0 0 25px; width: 25px; height: 25px; }
.arx-advanced-search__query input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; background: transparent; color: #111; font-size: 1rem; }
.arx-advanced-search__query button { height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: #111; color: #fff; font-weight: 800; cursor: pointer; }
.arx-advanced-search__matrix { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 18px; margin-top: 18px; }
.arx-advanced-search fieldset { min-width: 0; margin: 0; padding: 12px 10px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 16px; background: rgba(0,0,0,.92); box-shadow: 0 9px 24px rgba(0,0,0,.22); }
.arx-advanced-search fieldset.is-all-selected { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); }
.arx-advanced-search legend { max-width: calc(100% - 12px); margin: 0 auto; padding: 0; }
.arx-advanced-search__select-all { display: grid; width: 100%; min-height: 42px; padding: 5px 12px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: #080808; color: #fff; cursor: pointer; font-size: .78rem; font-weight: 850; letter-spacing: .02em; line-height: 1.15; text-align: center; }
.arx-advanced-search__select-all:hover,
.arx-advanced-search fieldset.is-all-selected .arx-advanced-search__select-all { background: #fff; color: #111; }
.arx-advanced-search__options { display: grid; gap: 5px; }
.arx-advanced-search__options--types { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; }
.arx-advanced-search__options--types label { grid-column: 1 / -1; }
.arx-advanced-search__options--types label:has(input[value="arx_immagine"]) { grid-column: 1; order: 1; }
.arx-advanced-search__options--types label:has(input[value="arx_hotspot"]) { grid-column: 2; order: 2; }
.arx-advanced-search__options--types label:has(input[value="arx_cartolina"]) { grid-column: 1; order: 3; }
.arx-advanced-search__options--types label:has(input[value="arx_pdf"]) { grid-column: 2; order: 4; }
.arx-advanced-search__options--types label:has(input[value="arx_video"]) { grid-column: 1; order: 5; }
.arx-advanced-search__options--types label:has(input[value="arx_audio"]) { grid-column: 2; order: 6; }
.arx-advanced-search__options--types label:has(input[value="arx_geografico"]) { grid-column: 1; order: 7; }
.arx-advanced-search__options label { position: relative; z-index: 1; display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(255,255,255,.04); color: rgba(255,255,255,.8); cursor: pointer; font-size: .73rem; font-weight: 720; isolation: isolate; }
.arx-advanced-search__options label > span { pointer-events: none; }
.arx-advanced-search__options label:hover { background: rgba(255,255,255,.1); }
.arx-advanced-search__options input { position: absolute; opacity: 0; pointer-events: none; }
.arx-advanced-search__options label:has(input:checked) { border-color: #fff; background: #fff; color: #111; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.arx-advanced-search__options label:has(input:focus-visible) { outline: 3px solid rgba(255,255,255,.7); outline-offset: 2px; }
.arx-advanced-search__option-icon { display: inline-flex; flex: 0 0 auto; color: currentColor; }
.arx-advanced-search__foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; }
.arx-advanced-search__foot button { min-height: 48px; padding: 10px 18px; border-radius: 999px; font-weight: 800; cursor: pointer; }
.arx-advanced-search__reset { border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; }
.arx-advanced-search__submit { border: 1px solid #fff; background: #fff; color: #111; }
.arx-advanced-search__actions-card {
    display: flex; min-width: 0; height: 100%; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 16px;
    background: rgba(255,255,255,.07); box-shadow: 0 9px 24px rgba(0,0,0,.22);
}
.arx-advanced-search__actions-card button { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: .69rem; font-weight: 850; text-transform: uppercase; cursor: pointer; }
.arx-advanced-search__actions-card button { width: min(100%, 178px); }
body.arx-advanced-search-open { overflow: hidden; }

@media (min-width: 901px) {
    .arx-advanced-search { place-items: start center; padding-top: 96px; padding-bottom: 16px; }
    .arx-advanced-search__panel { max-height: calc(100vh - 112px); }
    .arx-advanced-search__matrix { row-gap: 30px; }
    .arx-advanced-search__collage { min-height: 520px; }
    .arx-advanced-search__actions-card { grid-column: span 2; height: 104px; align-self: start; }
}

@media (max-width: 1100px) {
    .arx-archive-landing .arx-home-results-head { grid-template-columns: 1fr; }
    .arx-results-tools { margin-top: 4px; }
}

@media (max-width: 900px) {
    .arx-results-tools { flex-wrap: wrap; }
    .arx-results-tools .arx-home-active-filters { flex-basis: 100%; }
    .arx-results-inline-search { flex: 1 1 280px; }
    .arx-advanced-search__matrix { grid-template-columns: repeat(3, minmax(0,1fr)); grid-auto-rows: 1fr; gap: 9px; }
    .arx-advanced-search fieldset { height: 100%; }
    .arx-advanced-search__options label { justify-content: flex-start; text-align: left; }
    .arx-advanced-search__option-icon { align-items: center; justify-content: flex-start; }
    .arx-advanced-search__actions-card { flex-direction: column; }
    .arx-advanced-search__body { display: block; }
    .arx-advanced-search__collage { min-height: 220px; margin: 0 18px 18px; background-position: center 42%; }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .arx-advanced-search__matrix { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 600px) {
    .arx-advanced-search { padding: 8px; }
    .arx-advanced-search__panel { max-height: calc(100vh - 16px); border-radius: 20px; }
    .arx-advanced-search__head { padding: 16px 18px 12px; }
    .arx-advanced-search__head img { width: 112px; height: 48px; }
    .arx-advanced-search__head-actions { gap: 5px; }
    .arx-advanced-search__close { width: 42px; padding: 3px; }
    .arx-advanced-search__close span { display: none; }
    .arx-advanced-search__help { margin-inline: 16px; }
    .arx-advanced-search__actions-card { min-height: 100%; flex-direction: column; }
    .arx-advanced-search__actions-card button { min-height: 42px; padding-inline: 15px; }
    .arx-advanced-search form { padding: 0 16px 18px; }
    .arx-advanced-search__matrix { grid-template-columns: 1fr; }
    .arx-advanced-search__query { height: 56px; padding-left: 14px; }
    .arx-advanced-search__query button { padding-inline: 16px; }
    .arx-advanced-search__foot { flex-direction: column; }
}

/* Filtri attivi (chips) */
.arx-home-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.arx-home-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8eef7;
    color: var(--arx-primary);
    border: 1px solid rgba(26,58,107,.2);
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.arx-home-active-filter:hover { background: #d4dff0; }
.arx-home-active-filter--reset {
    background: #f0ece8;
    color: #6a5e54;
    border-color: #d4cfc8;
}
.arx-home-active-filter--reset:hover { background: #ece4dc; }

.arx-archive-landing .arx-home-active-filter,
.arx-archive-landing .arx-home-active-filter--reset {
    gap: 9px;
    min-height: 42px;
    padding: 9px 14px;
    border-color: #111;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: .82rem;
    font-weight: 750;
}
.arx-home-active-filter__funnel { width: 18px; height: 18px; flex: 0 0 auto; }
.arx-home-active-filter__remove { width: 17px; height: 17px; flex: 0 0 auto; opacity: .78; }
.arx-home-active-filter:hover .arx-home-active-filter__remove { opacity: 1; }
.arx-archive-landing .arx-home-active-filter:hover,
.arx-archive-landing .arx-home-active-filter:focus-visible {
    border-color: #333;
    background: #333;
    color: #fff;
}

/* Griglia documenti */
.arx-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* ── Doc Card ──────────────────────────────────────────────────────────── */
.arx-doc-card {
    display: flex;
    flex-direction: column;
    background: #f7f5f2;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.arx-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    border-color: rgba(26,58,107,.25);
}
.arx-doc-card__link {
    display: block;
    flex: 1 1 auto;
    text-decoration: none;
    color: inherit;
}
.arx-doc-card__media { background: #fff; }
.arx-doc-card__detail-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border-top: 1px solid #111;
    background: #111;
    color: #fff;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}
.arx-doc-card__detail-link span { font-size: 1.15rem; line-height: 1; }
.arx-doc-card__detail-link:hover { background: #fff; color: #111; }
.arx-doc-card__thumb {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #ece8e2;
}
.arx-doc-card__thumb.is-zoomable { cursor: zoom-in; }
.arx-doc-card__thumb.is-zoomable:focus-visible {
    outline: 3px solid #111;
    outline-offset: -3px;
}
.arx-doc-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .4s;
}
.arx-doc-card:hover .arx-doc-card__thumb img { transform: scale(1.04); }
.arx-doc-card__zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    width: 46px;
    height: 46px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    background: rgba(0,0,0,.78);
    color: #fff;
    cursor: zoom-in;
    box-shadow: 0 5px 18px rgba(0,0,0,.25);
    transition: transform .2s, background .2s;
}
.arx-doc-card__zoom svg { width: 23px; height: 23px; }
.arx-doc-card__zoom:hover { background: #000; transform: scale(1.08); }

/* Visore immagini a tutto schermo. */
.arx-resource-viewer[hidden] { display: none; }
.arx-resource-viewer {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: block;
    padding: 0;
    background: rgba(5,5,5,.97);
    color: #fff;
}
.arx-resource-viewer__top {
    position: absolute;
    z-index: 6;
    top: 18px;
    right: 18px;
    left: 18px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    pointer-events: none;
}
.arx-resource-viewer__info {
    max-width: min(620px, calc(100vw - 500px));
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    background: rgba(0,0,0,.88);
    box-shadow: 0 8px 30px rgba(0,0,0,.28);
    pointer-events: auto;
}
.arx-resource-viewer__type {
    display: inline-flex;
    margin-bottom: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.arx-resource-viewer__info h2 { max-width: 700px; margin: 0; color: #fff; font-size: clamp(1rem, 2vw, 1.55rem); }
.arx-resource-viewer__close {
    width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 50%;
    background: transparent; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
}
.arx-resource-viewer__tools {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 5px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(0,0,0,.9);
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    pointer-events: auto;
}
.arx-resource-viewer__tools > button {
    display: grid; width: 48px; height: 48px; padding: 0; place-items: center; border: 0;
    border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
.arx-resource-viewer__tools > button:not(.arx-resource-viewer__close) svg { width: 29px; height: 29px; }
.arx-resource-viewer__tools > button:hover,
.arx-resource-viewer__tools > button[aria-pressed="true"] { background: #fff; color: #000; }
.arx-resource-viewer__favorite[aria-pressed="true"] svg { fill: currentColor; }
.arx-resource-viewer__help-toggle span {
    display: block;
    font: 900 1.55rem/1 Arial, sans-serif;
    transform: translateY(-1px);
}
.arx-resource-viewer__help {
    position: absolute;
    z-index: 4;
    top: 94px;
    right: clamp(18px, 3vw, 48px);
    width: min(520px, calc(100vw - 36px));
    padding: 24px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 18px;
    background: #fff;
    color: #111;
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.arx-resource-viewer__help[hidden] { display: none; }
.arx-resource-viewer__help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.arx-resource-viewer__help-head span { display: block; color: #766d65; font-size: .65rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.arx-resource-viewer__help-head h3 { margin: 3px 0 0; color: #111; font-size: 1.45rem; }
.arx-resource-viewer__help-close { width: 38px; height: 38px; padding: 0; border: 1px solid #d9d3cb; border-radius: 50%; background: #fff; color: #111; font-size: 1.6rem; cursor: pointer; }
.arx-resource-viewer__help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.arx-resource-viewer__help-grid > div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; min-height: 54px; }
.arx-resource-viewer__help-grid kbd,
.arx-resource-viewer__help-symbol { display: inline-flex; justify-content: center; align-items: center; min-height: 34px; padding: 5px 8px; border: 1px solid #d8d2ca; border-bottom-width: 3px; border-radius: 7px; background: #f5f3ef; color: #111; font: 800 .72rem/1 sans-serif; text-align: center; }
.arx-resource-viewer__help-symbol { font-size: 1.45rem; }
.arx-resource-viewer__help-grid strong { display: block; margin-bottom: 2px; font-size: .78rem; }
.arx-resource-viewer__help-grid span { color: #6b625a; font-size: .7rem; line-height: 1.35; }
.arx-resource-viewer__help-wide { grid-column: 1 / -1; }
.arx-resource-viewer__stage { position: absolute; z-index: 1; inset: 0; min-height: 0; display: block; }
.arx-resource-viewer__image-wrap { position: absolute; inset: 0; width: 100%; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.arx-resource-viewer__image-wrap[hidden],
.arx-resource-viewer__video-wrap[hidden],
.arx-resource-viewer__tools > button[hidden],
.arx-resource-viewer__video-play[hidden],
.arx-resource-viewer__pdf-launch[hidden] { display: none; }
.arx-resource-viewer__image { display: block; min-width:0; min-height:0; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; box-shadow: 0 12px 50px rgba(0,0,0,.4); transform-origin: center; transition: transform .18s ease; user-select: none; }
.arx-resource-viewer__video-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 90px 90px 78px; }
.arx-resource-viewer__video {
    display: block; width: min(1280px, 100%); max-height: calc(100vh - 168px); aspect-ratio: 16 / 9;
    background: #000; box-shadow: 0 18px 70px rgba(0,0,0,.65);
}
.arx-resource-viewer__video-play {
    position: absolute; z-index: 3; top: 50%; left: 50%; display: grid; place-items: center;
    width: 108px; height: 108px; padding: 0; border: 0; border-radius: 0;
    background: transparent; color: #fff; cursor: pointer; transform: translate(-50%,-50%);
    box-shadow: none; transition: transform .2s;
}
.arx-resource-viewer__video-play:hover { background: transparent; transform: translate(-50%,-50%) scale(1.06); }
.arx-resource-viewer__video-play svg { width: 92px; height: 92px; fill: none; stroke: currentColor; stroke-width: 4; filter:drop-shadow(0 0 10px rgba(0,0,0,.72)); }
.arx-resource-viewer__video-play svg circle { fill:rgba(0,0,0,.48); stroke:#fff; stroke-width:4; }
.arx-resource-viewer__video-play svg path { fill: currentColor; stroke: none; }
.arx-resource-viewer__video-play:hover svg circle { fill:rgba(0,0,0,.6); }
.arx-resource-viewer__video-play span { position: absolute; top: calc(100% + 2px); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; text-shadow:0 2px 6px #000; }
.arx-resource-viewer__pdf-launch {
    position: absolute; z-index: 3; top: 50%; left: 50%; display: grid; place-items: center;
    width: 116px; height: 116px; padding: 0; border: 0; background: transparent; color: #fff;
    cursor: pointer; transform: translate(-50%,-50%); transition: transform .2s;
}
.arx-resource-viewer__pdf-launch:hover { background: transparent; transform: translate(-50%,-50%) scale(1.06); }
.arx-resource-viewer__pdf-launch svg { width: 100px; height: 100px; filter: drop-shadow(0 0 10px rgba(0,0,0,.72)); }
.arx-resource-viewer__pdf-launch svg circle { fill: rgba(0,0,0,.5); stroke: #fff; }
.arx-resource-viewer__pdf-launch span { position: absolute; top: calc(100% + 2px); white-space: nowrap; font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 2px 6px #000; }
.arx-guided-pdf-viewer > .arx-flipbook-open { display: none; }
.arx-resource-viewer__image-wrap.is-panning,
.arx-resource-viewer__image-wrap.is-panning .arx-resource-viewer__image { cursor: grab; }
.arx-resource-viewer__image-wrap.is-dragging { cursor: grabbing; }
.arx-resource-viewer__image-wrap.is-dragging .arx-resource-viewer__image { cursor: grabbing; }
.arx-resource-viewer__image-wrap.is-dragging .arx-resource-viewer__image { transition: none; }
.arx-resource-viewer__arrow {
    position: absolute; z-index: 5; top: 50%; display: grid; width: 58px; height: 58px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px; background: rgba(0,0,0,.9); color: #fff; cursor: pointer; transform: translateY(-50%);
}
.arx-resource-viewer__arrow--prev { left: 18px; }
.arx-resource-viewer__arrow--next { right: 18px; }
.arx-resource-viewer__arrow svg { width: 30px; height: 30px; }
.arx-resource-viewer__arrow:hover:not(:disabled) { background: #fff; color: #000; }
.arx-resource-viewer__arrow:disabled { opacity: .18; cursor: default; }
.arx-resource-viewer__detail {
    position: absolute; z-index: 6; bottom: 18px; left: 50%; padding: 12px 18px; border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px; background: rgba(0,0,0,.9); color: #fff; font-size: .83rem; font-weight: 750;
    text-decoration: none; box-shadow: 0 8px 30px rgba(0,0,0,.3); transform: translateX(-50%);
}
body.arx-viewer-open { overflow: hidden; }

/* Visualizzatore HTML5 delle card video negli archivi. */
.arx-video-card-viewer[hidden] { display: none; }
.arx-video-card-viewer {
    position: fixed; z-index: 100000; inset: 0; display: grid; place-items: center;
    padding: clamp(82px, 10vh, 120px) clamp(20px, 7vw, 100px) 76px;
    background: rgba(5,5,5,.97); color: #fff;
}
.arx-video-card-viewer__top {
    position: absolute; z-index: 2; top: 18px; right: 18px; left: 18px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.arx-video-card-viewer__info {
    max-width: min(720px, calc(100vw - 100px)); padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(0,0,0,.88);
}
.arx-video-card-viewer__info span { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.arx-video-card-viewer__info h2 { margin: 5px 0 0; color: #fff; font-size: clamp(.95rem, 2vw, 1.45rem); }
.arx-video-card-viewer__close {
    width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 50%;
    background: rgba(0,0,0,.75); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
}
.arx-video-card-viewer__stage { width: 100%; height: 100%; display: grid; place-items: center; }
.arx-video-card-viewer__player {
    display: block; width: min(1280px, 100%); max-height: calc(100vh - 180px); aspect-ratio: 16 / 9;
    background: #000; box-shadow: 0 18px 70px rgba(0,0,0,.65);
}
.arx-video-card-viewer__detail {
    position: absolute; bottom: 18px; left: 50%; padding: 12px 18px;
    border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(0,0,0,.9);
    color: #fff; font-size: .83rem; font-weight: 750; text-decoration: none; transform: translateX(-50%);
}
@media (max-width: 680px) {
    .arx-video-card-viewer { padding: 76px 10px 68px; }
    .arx-video-card-viewer__top { top: 10px; right: 10px; left: 10px; }
    .arx-video-card-viewer__player { max-height: calc(100vh - 150px); }
    .arx-video-card-viewer__detail { bottom: 10px; max-width: calc(100vw - 20px); white-space: nowrap; }
}
.arx-doc-card__type-badge {
    position: absolute;
    top:8px;
    right:auto;
    bottom:auto;
    left:8px;
    width:auto;
    height:auto;
    padding:0;
    color:#5a5045;
    background:transparent;
    border:0;
    border-radius:0;
    line-height:0;
    pointer-events:none;
}
.arx-doc-card__body {
    padding: 12px 14px;
}
.arx-doc-card__num {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: #9b8f84;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.arx-doc-card__title {
    font-size: .88rem;
    font-weight: 600;
    color: #1a1510;
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.arx-doc-card__date {
    display: block;
    font-size: .72rem;
    color: #9b8f84;
    margin-bottom: 4px;
}
.arx-doc-card__comune {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    color: #6a5e54;
    font-style: italic;
}

/* Proposta card archivio video: superficie scura e comandi allineati. */
body.post-type-archive-arx_video .arx-doc-card {
    background: #111;
    border-color: #111;
    border-top-color: #111;
}
body.post-type-archive-arx_video .arx-doc-card__thumb {
    aspect-ratio: 16 / 9;
    background: #111;
}
body.post-type-archive-arx_video .arx-doc-card__thumb img { object-fit: cover; }
body.post-type-archive-arx_video .arx-doc-card__body { background: #111; }
body.post-type-archive-arx_video .arx-doc-card__num,
body.post-type-archive-arx_video .arx-doc-card__date { color: #aaa39c; }
body.post-type-archive-arx_video .arx-doc-card__title { color: #fff; }
body.post-type-archive-arx_video .arx-doc-card__detail-link {
    border-top-color: rgba(255,255,255,.18);
    background: #111;
}
body.post-type-archive-arx_video .arx-doc-card__detail-link:hover {
    background: #fff;
    color: #111;
}
body.post-type-archive-arx_video .arx-doc-card__type-badge {
    top: 12px;
    left: 12px;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
body.post-type-archive-arx_video .arx-doc-card > .arx-favorite-toggle {
    top: 8px;
    right: 48px;
    left: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
body.post-type-archive-arx_video .arx-doc-card > .arx-favorite-toggle:hover,
body.post-type-archive-arx_video .arx-doc-card > .arx-favorite-toggle:focus-visible {
    background: transparent;
    color: #f2c46d;
}
body.post-type-archive-arx_video .arx-doc-card__zoom {
    top: 8px;
    right: 8px;
    bottom: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    box-shadow: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
body.post-type-archive-arx_video .arx-doc-card__zoom:hover,
body.post-type-archive-arx_video .arx-doc-card__zoom:focus-visible {
    background: transparent;
    color: #f2c46d;
    transform: none;
}

/* Card Video nella ricerca guidata: stessi controlli, corpo informativo chiaro. */
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__thumb {
    aspect-ratio: 16 / 9;
    background: #111;
}
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__thumb img { object-fit: cover; }
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__type-badge {
    top: 12px;
    left: 12px;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-type="Video"] > .arx-favorite-toggle,
.arx-doc-card[data-viewer-type="Video"] > .arx-card-edit-button + .arx-favorite-toggle {
    top: 8px;
    right: 48px;
    left: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-type="Video"] > .arx-favorite-toggle:hover,
.arx-doc-card[data-viewer-type="Video"] > .arx-favorite-toggle:focus-visible {
    background: transparent;
    color: #f2c46d;
}
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__zoom {
    top: 8px;
    right: 8px;
    bottom: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    box-shadow: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__zoom:hover,
.arx-doc-card[data-viewer-type="Video"] .arx-doc-card__zoom:focus-visible {
    background: transparent;
    color: #f2c46d;
    transform: none;
}

/* Controlli coerenti per tutte le card della ricerca guidata. */
.arx-doc-card[data-viewer-image] .arx-doc-card__type-badge {
    top: 12px;
    left: 12px;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle,
.arx-doc-card[data-viewer-image] > .arx-card-edit-button + .arx-favorite-toggle {
    top: 8px;
    right: 48px;
    left: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-image]:not(:has(.arx-doc-card__zoom)) > .arx-favorite-toggle,
.arx-doc-card[data-viewer-image]:not(:has(.arx-doc-card__zoom)) > .arx-card-edit-button + .arx-favorite-toggle {
    right: 8px;
}
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle:hover,
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle:focus-visible {
    background: transparent;
    color: #f2c46d;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom {
    top: 8px;
    right: 8px;
    bottom: auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    box-shadow: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.95));
}
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom:hover,
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom:focus-visible {
    background: transparent;
    color: #f2c46d;
    transform: none;
}

/* Prova velature: leggibilità dei comandi senza fasce piene. */
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::before,
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::after {
    content: "";
    position: absolute;
    z-index: 2;
    right: 0;
    left: 0;
    height: 34%;
    pointer-events: none;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 48%, transparent 100%);
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,.64) 0%, rgba(0,0,0,.2) 52%, transparent 100%);
}
.arx-doc-card[data-viewer-image] .arx-doc-card__type-badge,
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom { z-index: 3; }
.arx-doc-card[data-viewer-image] .arx-doc-card__detail-link {
    padding-top: 15px;
    border-top-color: transparent;
    background: linear-gradient(to top, #111 0%, rgba(17,17,17,.92) 58%, rgba(17,17,17,.68) 100%);
}
.arx-doc-card[data-viewer-image] .arx-doc-card__detail-link:hover {
    background: #fff;
    color: #111;
}

/* Passepartout sottile attorno alla risorsa. */
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb {
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    padding: 4px;
    background: #ede8df;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__preview-frame {
    position: absolute;
    inset: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    pointer-events: none;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__preview-frame > img {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 9px;
    object-fit: contain;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::before,
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::after {
    right: 4px;
    left: 4px;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::before { top: 4px; }
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::after { bottom: 4px; }

/* Prova estetica ispirata alle diapositive fotografiche. */
.arx-doc-card[data-viewer-image] {
    border-radius: 16px;
    border-color: #d8d3cb;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__media {
    padding: 7px 7px 0;
    background: #f5f2ec;
    border-radius: 13px 13px 0 0;
    overflow: hidden;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb {
    border-radius: 12px;
    display: grid;
    place-items: center;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb > img {
    border-radius: 9px;
    position: absolute;
    inset: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::before,
.arx-doc-card[data-viewer-image] .arx-doc-card__thumb::after {
    display: none;
}
.arx-doc-card[data-viewer-image] .arx-doc-card__detail-link {
    border-top-color: rgba(255,255,255,.12);
    background: #111;
}

/* Allineamento ottico e colore scuro dei controlli sulla cornice chiara. */
.arx-doc-card[data-viewer-image] .arx-doc-card__type-badge {
    top: 16px;
    color: #2d2925;
    filter: drop-shadow(0 1px 2px rgba(255,255,255,.95));
}
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle,
.arx-doc-card[data-viewer-image] > .arx-card-edit-button + .arx-favorite-toggle {
    top: 15px;
    color: #2d2925;
    filter: drop-shadow(0 1px 2px rgba(255,255,255,.95));
}
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom {
    color: #2d2925;
    filter: drop-shadow(0 1px 2px rgba(255,255,255,.95));
}
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle:hover,
.arx-doc-card[data-viewer-image] > .arx-favorite-toggle:focus-visible,
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom:hover,
.arx-doc-card[data-viewer-image] .arx-doc-card__zoom:focus-visible {
    color: #000;
}

/* Riconoscimento immediato del formato sull'anteprima. */
.arx-doc-card__format-cue {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.9);
    background: rgba(255,255,255,.82);
    color: #25211e;
    box-shadow: 0 5px 18px rgba(0,0,0,.24);
    pointer-events: none;
    transform: translate(-50%,-50%);
    backdrop-filter: blur(3px);
}
.arx-doc-card__format-cue--video { border-radius: 50%; }
.arx-doc-card__format-cue--video svg { width: 38px; height: 38px; }
.arx-doc-card__format-cue--video path { fill: currentColor; }
.arx-doc-card__format-cue--pdf { border-radius: 13px; }
.arx-doc-card__format-cue--pdf svg { width: 42px; height: 42px; }

/* Thumb placeholder */
.arx-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 0;
    min-height: 130px;
}
.arx-thumb-placeholder__icon { font-size: 2rem; opacity: .6; }
.arx-thumb-placeholder__label { font-size: .7rem; color: #6a5e54; font-weight: 500; }

/* Paginazione */
.arx-home-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-top: 8px;
}
.arx-home-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    width: auto;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d0d0d0;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 750;
    color: #111;
    text-decoration: none;
    transition: all .15s;
    background: #e7e7e7;
}
.arx-home-pagination__btn:hover {
    background: #555;
    border-color: #555;
    color: #fff;
}
.arx-home-pagination__btn.is-current {
    background: #111;
    border-color: #111;
    color: #fff;
    font-weight: 700;
}

/* Empty state */
.arx-empty-state {
    text-align: center;
    padding: 64px 24px;
    color: #6a5e54;
}
.arx-empty-state__icon { margin-bottom: 16px; opacity: .3; }
.arx-empty-state h2 { font-size: 1.1rem; font-weight: 600; color: #2a2520; margin-bottom: 8px; }
.arx-empty-state p { font-size: .9rem; margin-bottom: 20px; }

/* ── Colonna destra – Aside ────────────────────────────────────────────── */
.arx-home-aside {
    grid-area: aside;
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    border-left: 1px solid #ece8e2;
    background: #faf9f7;
    scrollbar-width: thin;
    scrollbar-color: #d4cfc8 transparent;
}
.arx-home-aside::-webkit-scrollbar { width: 4px; }
.arx-home-aside::-webkit-scrollbar-thumb { background: #d4cfc8; border-radius: 2px; }

/* La ricerca mantiene due colonne libere, pronte per contenuti futuri. */
.arx-archive-landing .arx-home-sidebar > *,
.arx-archive-landing .arx-home-aside > * {
    display: none;
}
.arx-archive-landing .arx-home-sidebar,
.arx-archive-landing .arx-home-aside {
    min-height: calc(100vh - 130px);
}
.arx-archive-landing .arx-home-layout {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}
.arx-archive-landing .arx-home-sidebar,
.arx-archive-landing .arx-home-aside {
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
}

/* Pagine autonome ricavate dalle due colonne informative. */
.arx-content-index-page .arx-home-layout,
.arx-archive-numbers-page .arx-home-layout {
    display: block;
    min-height: 70vh;
    padding: 54px clamp(24px, 5vw, 80px) 80px;
    background: #f5f3ef;
}
.arx-content-index-page .arx-home-main,
.arx-content-index-page .arx-home-aside,
.arx-archive-numbers-page .arx-home-main,
.arx-archive-numbers-page .arx-home-sidebar {
    display: none;
}
.arx-content-index-page .arx-home-sidebar,
.arx-archive-numbers-page .arx-home-aside {
    position: static;
    width: min(100%, 1040px);
    max-height: none;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    border: 1px solid #e3ded6;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(28, 24, 20, .08);
}
.arx-content-index-page .arx-home-sidebar {
    padding: 0 0 28px;
}
.arx-archive-numbers-page .arx-home-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.arx-standalone-panel-head {
    grid-column: 1 / -1;
    padding: 42px 40px 34px;
    border-bottom: 1px solid #ece8e2;
}
.arx-standalone-panel-head span {
    display: block;
    margin-bottom: 10px;
    color: #756b62;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.arx-standalone-panel-head h1 {
    margin: 0 0 10px;
    color: #111;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}
.arx-standalone-panel-head p {
    max-width: 650px;
    margin: 0;
    color: #625950;
    font-size: 1rem;
    line-height: 1.65;
}
.arx-content-index-page .arx-home-sidebar__section {
    padding-right: 40px;
    padding-left: 40px;
}
.arx-archive-numbers-page .arx-aside-widget {
    padding: 30px 40px;
}

/* Widget base */
.arx-aside-widget {
    padding: 18px 16px;
    border-bottom: 1px solid #ece8e2;
}
.arx-aside-widget:last-child { border-bottom: none; }
.arx-aside-widget__title {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #9b8f84;
    margin: 0 0 12px;
}
.arx-aside-widget__more {
    display: block;
    font-size: .72rem;
    color: var(--arx-primary);
    text-decoration: none;
    margin-top: 10px;
    opacity: .8;
    transition: opacity .15s;
}
.arx-aside-widget__more:hover { opacity: 1; }

/* Stats widget */
.arx-aside-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.arx-aside-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ece8e2;
}
.arx-aside-stats .arx-aside-stat:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e8eef7, #f0f4fa);
    border-color: rgba(26,58,107,.15);
}
.arx-aside-stat strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--arx-primary);
    line-height: 1;
}
.arx-aside-stat span {
    font-size: .65rem;
    color: #8a7c70;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.arx-aside-stat svg { margin-bottom: 2px; }

/* Quick add (operatori) */
.arx-aside-quick-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.arx-aside-quick-add__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: #fff;
    border: 1px solid #d4cfc8;
    border-radius: 6px;
    font-size: .65rem;
    font-weight: 600;
    color: #4a3f35;
    text-decoration: none;
    text-align: center;
    transition: all .15s;
}
.arx-aside-quick-add__link:hover {
    border-color: var(--arx-accent);
    color: var(--arx-primary);
    background: #fff9f0;
}

/* Comuni list */
.arx-aside-comuni {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.arx-aside-comune-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    text-decoration: none;
    color: #4a3f35;
    font-size: .8rem;
    transition: background .15s;
}
.arx-aside-comune-link:hover { background: #ece8e2; color: var(--arx-primary); }
.arx-aside-comune-link__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--arx-accent);
    flex-shrink: 0;
}
.arx-aside-comune-link__name { flex: 1; }
.arx-aside-comune-link em {
    font-style: normal;
    font-size: .65rem;
    color: #9b8f84;
    background: #ece8e2;
    padding: 1px 5px;
    border-radius: 8px;
}

/* News list */
.arx-aside-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.arx-aside-news-item a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 6px;
    text-decoration: none;
    color: #2a2520;
    border-radius: 5px;
    transition: background .15s;
}
.arx-aside-news-item a:hover { background: #ece8e2; }
.arx-aside-news-item__icon { flex-shrink: 0; margin-top: 1px; }
.arx-aside-news-item__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .78rem;
    line-height: 1.3;
    font-weight: 500;
}
.arx-aside-news-item__text time {
    font-size: .66rem;
    color: #9b8f84;
    font-weight: 400;
}

/* Sponsors */
.arx-aside-sponsors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.arx-aside-sponsor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    text-align: center;
}
.arx-aside-sponsor__logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a6b, #2a5298);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .05em;
}
.arx-aside-sponsor span {
    font-size: .6rem;
    color: #6a5e54;
    line-height: 1.2;
    text-align: center;
}

/* Link utili */
.arx-aside-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.arx-aside-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    text-decoration: none;
    color: #4a3f35;
    font-size: .8rem;
    border-radius: 5px;
    transition: background .15s, color .15s;
}
.arx-aside-links a:hover {
    background: #ece8e2;
    color: var(--arx-primary);
}

/* ── Layout full-width (body livello) ──────────────────────────────────── */
/* Rimuove il box al 100% per homepage */
.home .arx-site-wrap,
.front-page .arx-site-wrap {
    max-width: 100%;
    padding: 0;
    margin: 0;
}
.home .arx-site-wrap > main,
.front-page .arx-site-wrap > main {
    padding: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .arx-home-layout {
        grid-template-columns: 220px 1fr;
        grid-template-areas:
            "sidebar main"
            "aside   aside";
    }
    .arx-home-aside {
        position: static;
        max-height: none;
        border-left: none;
        border-top: 1px solid #ece8e2;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0;
    }
}

@media (max-width: 768px) {
    .arx-home-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "sidebar"
            "aside";
    }
    .arx-home-sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-top: 1px solid #ece8e2;
        border-bottom: 1px solid #ece8e2;
    }
    .arx-archive-landing .arx-home-sidebar,
    .arx-archive-landing .arx-home-aside {
        display: none;
    }
    .arx-archive-landing .arx-home-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "main";
    }
    .arx-content-index-page .arx-home-layout,
    .arx-archive-numbers-page .arx-home-layout {
        padding: 24px 14px 48px;
    }
    .arx-archive-numbers-page .arx-home-aside {
        grid-template-columns: 1fr;
    }
    .arx-standalone-panel-head,
    .arx-content-index-page .arx-home-sidebar__section,
    .arx-archive-numbers-page .arx-aside-widget {
        padding-right: 22px;
        padding-left: 22px;
    }
    .arx-home-main {
        padding: 20px 16px 32px;
    }
    .arx-home-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .arx-resource-viewer { padding: 0; }
    .arx-resource-viewer__top { top: 10px; right: 10px; left: 10px; gap: 8px; }
    .arx-resource-viewer__info { max-width: calc(100vw - 285px); padding: 9px 11px; }
    .arx-resource-viewer__info h2 { font-size: .82rem; }
    .arx-resource-viewer__type { margin-bottom: 3px; padding: 4px 7px; font-size: .55rem; }
    .arx-resource-viewer__stage { display: block; }
    .arx-resource-viewer__arrow { width: 42px; height: 42px; }
    .arx-resource-viewer__arrow--prev { left: 8px; }
    .arx-resource-viewer__arrow--next { right: 8px; }
    .arx-resource-viewer__image-wrap { height: 100vh; }
    .arx-resource-viewer__tools { gap: 1px; padding: 4px; }
    .arx-resource-viewer__tools > button { width: 38px; height: 38px; }
    .arx-resource-viewer__tools > button:not(.arx-resource-viewer__close) svg { width: 23px; height: 23px; }
    .arx-resource-viewer__detail { bottom: 10px; max-width: calc(100vw - 20px); white-space: nowrap; }
    .arx-resource-viewer__help { top: 76px; right: 12px; padding: 18px; max-height: calc(100vh - 100px); overflow-y: auto; }
    .arx-resource-viewer__help-grid { grid-template-columns: 1fr; }
    .arx-resource-viewer__help-wide { grid-column: auto; }
}

/* Indice dei contenuti — categorie organizzate come card autonome. */
body.arx-content-index-page .arx-home-layout {
    padding: 58px clamp(24px, 5vw, 76px) 86px;
    background: #eee9e1;
}
body.arx-content-index-page .arx-home-sidebar {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
    width: min(100%, 1440px);
    max-width: 1440px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.arx-content-index-page .arx-standalone-panel-head {
    grid-column: 1 / -1;
    padding: 4px 0 26px;
    border: 0;
}
body.arx-content-index-page .arx-standalone-panel-head h1 {
    max-width: 900px;
    font-size: clamp(2.8rem, 6vw, 6rem);
    letter-spacing: -.045em;
}
body.arx-content-index-page .arx-standalone-panel-head p { font-size: 1.08rem; }
body.arx-content-index-page .arx-home-sidebar__section {
    grid-column: span 6;
    min-width: 0;
    margin: 0;
    padding: 28px;
    border: 1px solid #ddd6cd;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(39,31,25,.055);
}
body.arx-content-index-page .arx-home-sidebar__section:first-of-type {
    grid-column: 1 / -1;
    padding: 20px 24px;
    border-color: #171717;
    background: #171717;
}
body.arx-content-index-page .arx-home-sidebar__section:first-of-type .arx-home-sidebar__label {
    border-bottom-color: rgba(255,255,255,.3);
    color: #fff;
}
body.arx-content-index-page .arx-home-sidebar__section--cta { grid-column: 1 / -1; }
body.arx-content-index-page .arx-home-sidebar__label {
    margin: 0 0 17px;
    padding: 0 0 13px;
    border-bottom: 2px solid #111;
    color: #111;
    font-size: .78rem;
    font-weight: 850;
    letter-spacing: .13em;
}
body.arx-content-index-page .arx-home-filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
body.arx-content-index-page .arx-home-filter-list li { min-width: 0; }
body.arx-content-index-page .arx-home-filter-item {
    min-height: 52px;
    padding: 10px 13px;
    border: 1px solid #e2ddd6;
    border-radius: 13px;
    background: #f3f1ed;
    color: #17130f;
    font-size: .82rem;
    font-weight: 700;
}
body.arx-content-index-page .arx-home-sidebar .arx-home-filter-item > span:first-child:not([class]) {
    display: inline;
    flex: 1 1 auto;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
}
body.arx-content-index-page .arx-home-filter-item:hover,
body.arx-content-index-page .arx-home-filter-item.is-active {
    border-color: #111;
    background: #111;
    color: #fff;
}
body.arx-content-index-page .arx-home-filter-item em {
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    color: #111;
    font-size: .68rem;
    font-style: normal;
}
body.arx-content-index-page .arx-home-filter-item.is-active em,
body.arx-content-index-page .arx-home-filter-item:hover em { background: #fff; }
body.arx-content-index-page .arx-home-search__wrap {
    min-height: 58px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    background: #fff;
}
body.arx-content-index-page .arx-home-search__wrap input { font-size: .95rem; }
body.arx-content-index-page .arx-home-search__wrap button {
    width: 48px;
    height: 48px;
    margin-right: 5px;
    border-radius: 50%;
    background: #111;
    color: #fff;
}

@media (max-width: 900px) {
    body.arx-content-index-page .arx-home-sidebar__section { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    body.arx-content-index-page .arx-home-layout { padding: 34px 14px 58px; }
    body.arx-content-index-page .arx-home-sidebar { gap: 14px; }
    body.arx-content-index-page .arx-standalone-panel-head { padding-inline: 6px; }
    body.arx-content-index-page .arx-standalone-panel-head h1 { font-size: clamp(2.45rem, 14vw, 3.8rem); }
    body.arx-content-index-page .arx-home-sidebar__section { padding: 21px 18px; border-radius: 17px; }
    body.arx-content-index-page .arx-home-filter-list { grid-template-columns: 1fr; }
}
