/* ──────────────────────────────────────
   Alanews Homepage Manager — Frontend Styles v1.9.0
   Font Schema:
     Inter Bold       → Titoli (h2, h3, hero-title)
     Libre Baskerville → Body (excerpt, paragraphs)
     Source Sans 3    → UI / Meta (date, labels, links, authors)
   ────────────────────────────────────── */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;600&display=swap');

/* ── Base wrapper ── */
.ahm-block {
    margin-bottom: 0;
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
}

/* ── Inter-block divider ── */
hr.ahm-block-divider {
    border-bottom: none;
    border-left: none;
    border-right: none;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #d1d5db;
    margin: 1.5rem 0;
}

/* v1.21.6 — Top divider sits flush with the container top edge so it aligns
   with the bottom of the sidebar header separator. */
hr.ahm-block-divider.ahm-block-divider--top {
    margin-top: 0;
}

/* ── Double-line divider ── */
.ahm-divider-double {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 1.5rem 0 0.5rem;
    padding: 0;
}
.ahm-divider-double .ahm-divider-line {
    width: 100%;
    border: none !important;
    border-top: 1px solid #d1d5db !important;
    margin: 0;
}
.ahm-divider-double .ahm-divider-accent {
    width: 160px;
    height: 4px;
    border-radius: 9999px;
}

/* v1.24.0 — accent_bar: solo barretta, senza linea principale */
.ahm-divider-accent-only {
    display: flex;
    /* v1.24.46 — margin-top 1.5rem per allinearsi a .ahm-divider-double
       ed evitare che la barretta accent risulti incollata al bordo
       inferiore del blocco precedente (es. ::after delle grid card
       in modalità "Linee verticali tra colonne ON"). La regola di
       collasso fra divider consecutivi (sotto) compensa con -1.25rem. */
    margin: 1.5rem 0 1.15rem;
    padding: 0;
}
.ahm-divider-accent-only .ahm-divider-accent {
    height: 4px;
    border-radius: 9999px;
}

/* F1 (v1.21.2) — Collapse margin between CONSECUTIVE double-line dividers.
   Quando 2+ blocchi adiacenti emettono entrambi un divider, il margine
   accumulato (1.5rem × 2 = 48px) crea un vuoto verticale interpretato
   come "linee colorate fluttuanti". Soluzione: il secondo divider in poi
   ha margin-top negativo per collassare con il precedente. */
.ahm-divider-double + .ahm-divider-double {
    margin-top: -1.25rem; /* collassa con margin-bottom 1.5rem precedente → spacing netto ~4px */
}
hr.ahm-block-divider + hr.ahm-block-divider,
hr.ahm-block-divider + .ahm-divider-double,
.ahm-divider-double + hr.ahm-block-divider {
    margin-top: -1.25rem;
}
.ahm-divider-accent-only + .ahm-divider-accent-only,
.ahm-divider-accent-only + .ahm-divider-double,
.ahm-divider-double + .ahm-divider-accent-only,
hr.ahm-block-divider + .ahm-divider-accent-only,
.ahm-divider-accent-only + hr.ahm-block-divider {
    margin-top: -1.25rem;
}

/* ── Footer Comments (Commento Editoriale) ── */
.ahm-footer-comments {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 1rem;
    margin-top: 0.75rem;
    border-radius: 4px;
}
.ahm-footer-comment {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ahm-footer-comment__label {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ahm-footer-comment__title {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #1e293b;
    text-decoration: none;
}
.ahm-footer-comment__title:hover {
    text-decoration: underline;
}
.ahm-footer-comment__author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}
.ahm-footer-comment__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.ahm-fc-author {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}
.ahm-fc-author em {
    font-size: 11px;
    font-style: italic;
    font-weight: 400;
    color: #64748b;
}
.ahm-fc-author-link {
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
}
.ahm-fc-author-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .ahm-footer-comments {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Blocchi con sfondo colorato: padding interno per distanziare titolo e contenuto */
.ahm-block[style*="background-color"] {
    padding: 1.25rem 1.25rem 1rem;
    border-radius: 4px;
}

/* ── Block Label (green left border, no bottom line) ── */
.ahm-block__label {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.15rem;
    line-height: 1.25;
    position: relative;
    margin: 0 0 15px;
    padding: 0 8px 0 12px;
    border-left: 4px solid #4a8b45;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* ════════════════════════════════════════
   SHARED HERO STYLES
   ════════════════════════════════════════ */

/* ── Hero: Title + Excerpt (above & below share these) ── */
.ahm-hero__title,
.ahm-hero__title a {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.35rem;
    line-height: 1.2;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.02em;
    margin: 0;
}

.ahm-hero__title a:hover {
    color: #2271b1;
}

.ahm-hero__excerpt {
    font-family: 'Libre Baskerville', Georgia, serif !important;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: #334155;
    margin: 8px 0 0;
}

.ahm-hero__img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ahm-hero__img-link {
    display: block;
    overflow: hidden;
    border-radius: 6px;
}

.ahm-hero__img-link:hover .ahm-hero__img {
    transform: scale(1.03);
}

/* ── Hero Above: title → author → excerpt → image ── */
.ahm-hero--above .ahm-hero__title {
    margin-bottom: 4px;
}

.ahm-hero--above .ahm-hero__author {
    margin-bottom: 8px;
}

.ahm-hero--above .ahm-hero__excerpt {
    margin-bottom: 12px;
}

/* ── Hero Below: image → title → author → excerpt ── */
.ahm-hero--below .ahm-hero__media {
    margin-bottom: 12px;
}

.ahm-hero--below .ahm-hero__img-link {
    margin-bottom: 0;
}

.ahm-hero--below .ahm-hero__title {
    margin-top: 0;
    margin-bottom: 4px;
}

.ahm-hero--below .ahm-hero__author {
    margin-bottom: 8px;
}

/* ── Hero Overlay: image + gradient caption ── */
.ahm-hero--overlay {
    border-radius: 6px;
    margin-bottom: 4px;
}

/* Media wrapper: image + caption overlay — isolates absolute caption from timeline */
.ahm-hero--overlay__media,
.ahm-hero-overlay__media {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.ahm-hero--overlay__link {
    display: block;
    position: relative;
    text-decoration: none;
    color: #fff;
}

/* Title-only link inside caption (no nested <a>) */
.ahm-hero--overlay__title-link,
.ahm-hero-overlay__title-link {
    text-decoration: none;
    color: inherit;
}
.ahm-hero--overlay__title-link:hover .ahm-hero--overlay__title,
.ahm-hero-overlay__title-link:hover .ahm-hero-overlay__title {
    text-decoration: underline;
}

.ahm-hero--overlay__img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ahm-hero--overlay__link:hover .ahm-hero--overlay__img {
    transform: scale(1.03);
}

.ahm-hero--overlay__placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #cbd5e1;
}

.ahm-hero--overlay__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.82) 0%,
        rgba(0, 0, 0, 0.45) 60%,
        transparent 100%
    );
}

.ahm-hero--overlay__title {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    line-height: 1.2;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ahm-hero--overlay__excerpt {
    font-family: 'Libre Baskerville', Georgia, serif !important;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    margin: 8px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ════════════════════════════════════════
   AUTHOR BYLINE — Shared styles (Corriere-inspired)
   ════════════════════════════════════════ */
.ahm-hero__author {
    margin: 6px 0 8px;
}

.ahm-hero__author--overlay {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.85) !important;
}

.ahm-author--overlay,
.ahm-author--overlay .ahm-author--overlay__link,
.ahm-author--overlay .ahm-author--overlay__name {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.85rem;
    font-weight: 400;
}

.ahm-author--overlay__link:hover {
    color: #fff !important;
    text-decoration: underline;
}

.ahm-author,
.ahm-secondary-author {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif !important;
    font-weight: 400;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #4a5568;
}

.ahm-author__link,
.ahm-secondary-author__link {
    color: #2271b1;
    text-decoration: none;
}

.ahm-author__link:hover,
.ahm-secondary-author__link:hover {
    text-decoration: underline;
}

.ahm-author__name,
.ahm-secondary-author__name {
    color: #2271b1;
}

/* Secondary item: author below title, same style as hero author */
.ahm-secondary__item .ahm-secondary-author {
    display: block;
    grid-column: 2;
    margin-top: 2px;
    font-size: 0.92rem;
}

/* Grid card author */
.ahm-grid-card__author {
    margin-top: 4px;
}

/* ════════════════════════════════════════
   SECONDARY: Bullet List
   ════════════════════════════════════════ */
.ahm-secondary--list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.ahm-secondary__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 8px;
    padding: 8px 0;
    align-items: start;
}

.ahm-secondary__item::before {
    --ahm-bullet-size: 10px;
    content: '';
    color: #4a8b45;
    width: var(--ahm-bullet-size);
    height: var(--ahm-bullet-size);
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    font-size: 0.93rem;
    line-height: 1.3;
    align-self: start;
    margin-top: calc((1.3em - var(--ahm-bullet-size)) / 2);
}

/* ── Icon variants (data-icon attribute) ── */
.ahm-secondary__item[data-icon="arrow"]::before {
    content: '';
    color: #4a8b45;
}
.ahm-secondary__item[data-icon="pen"]::before {
    width: auto;
    height: auto;
    background: none;
    clip-path: none;
    content: '✎';
    color: #339966;
    font-size: 1.1rem;
    margin-top: 0;
}
.ahm-secondary__item[data-icon="red_dot"]::before {
    width: auto;
    height: auto;
    background: none;
    clip-path: none;
    content: '●';
    color: #dc2626;
    font-size: 0.7rem;
    margin-top: 0;
}
.ahm-secondary__item[data-icon="speciale"]::before {
    width: auto;
    height: auto;
    background: none;
    clip-path: none;
    content: '▸⁺';
    color: #dc2626;
    font-size: 1.5rem;
    margin-top: 0;
}

/* Desktop: rimuovi linee tra articoli */
@media (min-width: 769px) {
    .ahm-secondary__item {
        border-bottom: none;
    }
    .ahm-secondary__item:first-child {
        border-top: none;
    }
    .ahm-secondary--list {
        border-bottom: none;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
}

.ahm-secondary__item > a {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.93rem;
    line-height: 1.3;
    color: #0f172a;
    text-decoration: none;
}

.ahm-secondary__item > a:hover {
    color: #2271b1;
}

/* ════════════════════════════════════════
   SECONDARY: Image Grid (3 cards) — Corriere-style borders
   ════════════════════════════════════════ */
.ahm-secondary--grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 20px;
    border-top: 1px solid #d1d5db;
    padding-top: 16px;
}

.ahm-grid-card {
    display: block;
    padding: 0 16px;
    border-left: 1px solid #d1d5db;
}

.ahm-grid-card:first-child {
    padding-left: 0;
    border-left: none;
}

/* ── Toggle OFF = default grid, Toggle ON = Corriere segmented rules ── */
.ahm-secondary--ruled {
    border-top: none;
    padding-top: 0;
}

.ahm-secondary--ruled .ahm-grid-card {
    padding-top: 16px;
    padding-bottom: 16px;
    border-top: none;
    border-bottom: none;
    position: relative;
}

/* Horizontal rules drawn as pseudo-elements so they don't touch the vertical separators. */
.ahm-secondary--ruled .ahm-grid-card::before,
.ahm-secondary--ruled .ahm-grid-card::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    height: var(--ahm-col-sep-thickness, 1px);
    background: var(--ahm-col-sep-color, #d1d5db);
    pointer-events: none;
}
.ahm-secondary--ruled .ahm-grid-card::before {
    top: 0;
}
.ahm-secondary--ruled .ahm-grid-card::after {
    bottom: 0;
}
/* First card has no left padding, so its horizontal rules start at 0. */
.ahm-secondary--ruled .ahm-grid-card:first-child::before,
.ahm-secondary--ruled .ahm-grid-card:first-child::after {
    left: 0;
}

/* When ruled, vertical separators keep inheriting the configured vars. */
.ahm-secondary--ruled .ahm-grid-card {
    border-left-color: var(--ahm-col-sep-color, #d1d5db);
    border-left-style: var(--ahm-col-sep-style, solid);
    border-left-width: var(--ahm-col-sep-thickness, 1px);
}
.ahm-secondary--ruled .ahm-grid-card:first-child {
    border-left: none;
}

/* Explicit OFF = keep the default current look. */
.ahm-secondary--no-rules {
    border-top: 1px solid #d1d5db;
    padding-top: 16px;
}

.ahm-secondary--no-rules .ahm-grid-card {
    padding-top: 0;
    padding-bottom: 0;
    border-top: none !important;
    border-bottom: none !important;
    border-left: 1px solid #d1d5db;
}

.ahm-secondary--no-rules .ahm-grid-card:first-child {
    border-left: none;
}

/* Same opt-in for the simple grid layout (block-grid.php) which has no borders by default. */
.ahm-block__grid--ruled {
    border-top: var(--ahm-col-sep-thickness, 1px) var(--ahm-col-sep-style, solid) var(--ahm-col-sep-color, #d1d5db);
    padding-top: 16px;
    gap: 0;
}
.ahm-block__grid--ruled .ahm-block__grid-item {
    padding: 0 16px;
    border-left: var(--ahm-col-sep-thickness, 1px) var(--ahm-col-sep-style, solid) var(--ahm-col-sep-color, #d1d5db);
}
.ahm-block__grid--ruled .ahm-block__grid-item:first-child {
    padding-left: 0;
    border-left: none;
}

.ahm-grid-card__img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    display: block;
}

.ahm-grid-card__img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ahm-grid-card__img-wrap:hover .ahm-grid-card__img {
    transform: scale(1.03);
}

.ahm-grid-card__placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #cbd5e1;
    border-radius: 6px;
}

.ahm-grid-card__title {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.93rem;
    line-height: 1.25;
    margin: 8px 0 0;
}

.ahm-grid-card__title a {
    color: #0f172a;
    text-decoration: none;
}

.ahm-grid-card__title a:hover {
    color: #2271b1;
}

/* ════════════════════════════════════════
   LEGACY LAYOUTS (grid, list, compact)
   Keep for backward compat
   ════════════════════════════════════════ */
.ahm-block--hero-list .ahm-block__content { display: block; }
.ahm-block__hero { margin-bottom: 20px; }
.ahm-block__hero img { width: 100%; height: auto; border-radius: 6px; display: block; margin-bottom: 12px; }

.ahm-block__hero-title,
.ahm-block__hero-title a {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.68rem; line-height: 1.2; color: #0f172a;
    text-decoration: none; letter-spacing: -0.02em;
}
.ahm-block__hero-title a:hover { color: #2271b1; }

.ahm-block__hero-excerpt {
    font-family: 'Libre Baskerville', Georgia, serif !important;
    font-weight: 400; font-size: 1rem; line-height: 1.65;
    color: #334155; margin: 8px 0 0;
}

.ahm-block__list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px;
}

.ahm-block__list-item {
    display: flex; align-items: baseline; gap: 8px;
    padding: 8px 0;
}
.ahm-block__list-item::before { content: ''; color: #4a8b45; width: 10px; height: 10px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); line-height: 1.3; flex-shrink: 0; margin-top: calc((1.3em - 10px) / 2); }

.ahm-block__list-item a {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important; font-size: 0.95rem; line-height: 1.3;
    color: #0f172a; text-decoration: none;
}
.ahm-block__list-item a:hover { color: #2271b1; }

.ahm-block__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.ahm-block__grid-item img {
    width: 100%; height: auto; border-radius: 6px; display: block;
    aspect-ratio: 16/9; object-fit: cover;
}
.ahm-block__grid-item h3, .ahm-block__grid-item h3 a {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important; font-size: 1.05rem; line-height: 1.25;
    color: #0f172a; text-decoration: none; margin: 8px 0 0;
}
.ahm-block__grid-item h3 a:hover { color: #2271b1; }

.ahm-block__compact { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ahm-block__compact-item {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important; font-size: 0.9rem; line-height: 1.3;
    color: #0f172a; text-decoration: none !important;
}
.ahm-block__compact-item:hover { color: #2271b1; }

/* Legacy hero overlay */
.ahm-hero-overlay { border-radius: 6px; margin-bottom: 16px; }
.ahm-hero-overlay__link { display: block; position: relative; text-decoration: none; color: #fff; }
.ahm-hero-overlay__img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; transition: transform 0.35s ease; }
.ahm-hero-overlay__link:hover .ahm-hero-overlay__img { transform: scale(1.03); }
.ahm-hero-overlay__placeholder { width: 100%; aspect-ratio: 16/9; background: #cbd5e1; }
.ahm-hero-overlay__caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 20px 20px; background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 60%, transparent 100%); }
.ahm-hero-overlay__title { font-family: 'Inter', -apple-system, sans-serif !important; font-weight: 700 !important; font-size: 1.65rem; line-height: 1.2; color: #fff; margin: 0; letter-spacing: -0.02em; text-shadow: 0 1px 4px rgba(0,0,0,0.3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ahm-hero-overlay__excerpt { font-family: 'Libre Baskerville', Georgia, serif !important; font-weight: 400; font-size: 0.95rem; line-height: 1.5; color: rgba(255,255,255,0.88); margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ahm-block__list-date {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif !important;
    font-weight: 400; font-size: 0.82rem; color: #64748b; white-space: nowrap;
}

/* ════════════════════════════════════════
   RESPONSIVE — Mobile (Corriere-style compact margins)
   v1.21.0 — Mobile polish release
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    /* ── Secondary lists: single column on mobile ── */
    .ahm-secondary--list,
    .ahm-block__list {
        grid-template-columns: 1fr;
    }

    /* ── Grid: single column on mobile, Corriere-style spacing ── */
    .ahm-secondary--grid {
        grid-template-columns: 1fr !important; /* override inline style template */
        gap: 0;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }

    /* B5 — Spacing card grid secondaria mobile più compatto */
    .ahm-grid-card {
        padding: 14px 0;
        border-left: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .ahm-grid-card:first-child {
        padding-left: 0;
        padding-top: 14px;
    }

    .ahm-grid-card:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* B2 — Hero title: allineato ai font scoped (28px = 1.75rem default) */
    .ahm-hero__title,
    .ahm-hero__title a {
        font-size: 1.75rem;
        line-height: 1.18;
    }

    .ahm-block__hero-title,
    .ahm-block__hero-title a {
        font-size: 1.75rem;
    }

    /* B9 — Hero image: aspect-ratio 3/2 più "presente" su mobile */
    .ahm-hero__img {
        aspect-ratio: 3/2;
    }

    .ahm-hero--overlay__title,
    .ahm-hero-overlay__title {
        font-size: 1.25rem;
    }

    .ahm-hero--overlay__excerpt,
    .ahm-hero-overlay__excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }

    .ahm-hero--overlay__caption,
    .ahm-hero-overlay__caption {
        padding: 30px 14px 14px;
    }

    /* ── Corriere-style: compact hero spacing ── */
    .ahm-hero--above .ahm-hero__title { margin-bottom: 4px; }
    .ahm-hero--above .ahm-hero__author { margin-bottom: 8px; }
    .ahm-hero--above .ahm-hero__excerpt { margin-bottom: 10px; }
    .ahm-hero--below .ahm-hero__media { margin-bottom: 10px; }
    .ahm-hero--below .ahm-hero__img-link { margin-bottom: 0; }
    .ahm-hero--below .ahm-hero__title { margin-bottom: 4px; }
    .ahm-hero--below .ahm-hero__author { margin-bottom: 8px; }
    .ahm-hero--overlay { margin-bottom: 4px; }

    /* B3 — Block label: riduco padding-left da 12px a 8px su mobile */
    .ahm-block__label {
        margin-bottom: 8px;
        font-size: 1.05rem;
        padding-left: 8px;
    }


    /* B10 + B18 — Secondary items: align icon to title center, area tap 44px */
    .ahm-secondary__item {
        padding: 16px 0;
        min-height: 44px;
        align-items: start;
        border-bottom: 1px solid #d1d5db;
    }

    .ahm-secondary__item::before {
        --ahm-bullet-size: 10px;
        font-size: 0.95rem;
        align-self: start;
        margin-top: calc((1.3em - var(--ahm-bullet-size)) / 2);
    }

    .ahm-secondary__item:last-child {
        border-bottom: none;
    }

    /* ── Secondary author on mobile: below title in grid col 2 ── */
    .ahm-secondary__item .ahm-secondary-author {
        display: block;
        grid-column: 2;
        margin-top: 4px;
    }

    /* B16 — Grid card author & title: spacing più compatto */
    .ahm-grid-card__author { margin-top: 4px; }

    .ahm-grid-card__title {
        font-size: 1rem;
        line-height: 1.3;
        margin-top: 8px;
    }

    /* B14 — Inter-block divider: spacing più compatto su mobile */
    hr.ahm-block-divider {
        margin: 0.75rem 0;
    }

    .ahm-divider-double {
        margin: 1rem 0;
    }

    /* B15 — Double divider accent: 50% del viewport su mobile (più armonioso) */
    .ahm-divider-double .ahm-divider-accent {
        width: 50%;
        max-width: 160px;
    }

    .ahm-divider-accent-only {
        /* v1.24.x — mobile fix: ripristino margin-top per evitare che la
           accent bar (e le linee inter-blocco) risultino schiacciate sul
           blocco superiore. Allineato a .ahm-divider-double mobile (1rem). */
        margin: 1rem 0 0.85rem;
    }
    .ahm-divider-accent-only .ahm-divider-accent {
        width: 50%;
        max-width: 160px;
    }

    /* F1 (v1.21.2) — Mobile collapse: divider consecutivi più aggressivi
       perché su mobile il vuoto verticale percepito è proporzionalmente maggiore. */
    .ahm-divider-double + .ahm-divider-double,
    hr.ahm-block-divider + hr.ahm-block-divider,
    hr.ahm-block-divider + .ahm-divider-double,
    .ahm-divider-double + hr.ahm-block-divider {
        margin-top: -0.85rem; /* collassa con margin 1rem precedente → ~2-3px netti */
    }
    .ahm-divider-accent-only + .ahm-divider-accent-only,
    .ahm-divider-accent-only + .ahm-divider-double,
    .ahm-divider-double + .ahm-divider-accent-only,
    hr.ahm-block-divider + .ahm-divider-accent-only,
    .ahm-divider-accent-only + hr.ahm-block-divider {
        margin-top: -0.85rem;
    }

    /* ── Tighter block wrapper margin ── */
    .ahm-block { margin-bottom: 0; }

    /* ── Opinion grid: single column on mobile ── */
    .ahm-opinion-grid__list {
        grid-template-columns: 1fr !important;
    }

    .ahm-opinion-grid__avatar {
        width: 48px;
        height: 48px;
    }

    .ahm-opinion-grid__item {
        gap: 10px;
        padding: 12px;
    }

    .ahm-opinion-grid__headline {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .ahm-opinion-grid {
        padding: 16px 12px;
    }

    /* ── Responsive layout toggle: show mobile version ── */
    .ahm-desktop-only { display: none !important; }
    .ahm-mobile-only { display: block !important; }
}

/* B12 — Breakpoint extra-small: phone <= 480px (iPhone SE 375, Galaxy 360) */
@media (max-width: 480px) {
    .ahm-block__label {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .ahm-hero__title,
    .ahm-hero__title a,
    .ahm-block__hero-title,
    .ahm-block__hero-title a {
        font-size: 1.5rem;
    }

    .ahm-secondary__item > a {
        font-size: 0.95rem;
    }

    .ahm-grid-card__title {
        font-size: 0.95rem;
    }

    .ahm-opinion-grid {
        padding: 20px 12px;
    }

    .ahm-footer-comments {
        padding: 1rem 0.75rem;
    }
}

/* B4 — Breakpoint micro: phone <= 360px — overlay title clamp 2 righe */
@media (max-width: 360px) {
    .ahm-hero--overlay__title,
    .ahm-hero-overlay__title {
        font-size: 1.1rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .ahm-hero--overlay__caption,
    .ahm-hero-overlay__caption {
        padding: 24px 12px 12px;
    }

    .ahm-hero--overlay__excerpt,
    .ahm-hero-overlay__excerpt {
        display: none; /* su 320px lo spazio è troppo poco */
    }
}

/* ════════════════════════════════════════
   OPINION GRID — Avatar + headline (Opinioni & Commenti)
   ════════════════════════════════════════ */

/* ── Tablet breakpoint (641-768px): keep 2 cols with tighter spacing ── */
@media (min-width: 641px) and (max-width: 768px) {
    .ahm-opinion-grid__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }

    .ahm-opinion-grid__avatar {
        width: 52px;
        height: 52px;
    }

    .ahm-opinion-grid__headline {
        font-size: 0.95rem;
    }
}

/* ════════════════════════════════════════
   OPINION GRID — Base styles
   ════════════════════════════════════════ */
.ahm-opinion-grid {
    padding: 24px 16px;
    border-radius: 4px;
    background-color: #ecfeec;
}

.ahm-opinion-grid .ahm-block__label {
    text-align: center;
    border-left: none;
    padding-left: 0;
    margin: 0 0 10px;
    position: relative;
    z-index: 2;
    background-color: transparent;
    font-family: 'Fraunces' !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-synthesis: none;
    font-optical-sizing: auto;
    font-variant: normal !important;
    text-transform: none !important;
    letter-spacing: -0.01em;
}

/* Wrapper della griglia: contiene il pattern diagonale così il titolo resta pulito */
.ahm-opinion-grid__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: relative;
}

/* Sfondo a righe diagonali bianche — applicato a tutto il container (titolo incluso) */
.ahm-opinion-grid--striped {
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 5px,
        rgba(255, 255, 255, 0.95) 5px,
        rgba(255, 255, 255, 0.95) 6px
    );
}

.ahm-opinion-grid__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    padding: 16px;
    z-index: 1;
}

.ahm-opinion-grid__item::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 1px;
    background: #d1d5db;
    z-index: 2;
}

@media (min-width: 769px) {
    /* Linea verticale continua tra le 2 colonne */
    .ahm-opinion-grid__list > .ahm-opinion-grid__item:nth-child(odd)::before {
        content: "";
        position: absolute;
        top: 16px;
        bottom: 16px;
        right: 0;
        width: 1px;
        background: #d1d5db;
        z-index: 2;
    }
    /* Niente linea orizzontale sull'ultima riga (ultimi 2 item) */
    .ahm-opinion-grid__list > .ahm-opinion-grid__item:nth-last-child(-n+2)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .ahm-opinion-grid__list > .ahm-opinion-grid__item:last-child::after {
        display: none;
    }
}

.ahm-opinion-grid__avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.ahm-opinion-grid__avatar-img,
.ahm-opinion-grid__avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ahm-opinion-grid__content {
    flex: 1;
    min-width: 0;
}

.ahm-opinion-grid__headline {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: var(--ahm-secondary-title-font-size, 1rem);
    line-height: 1.25;
    margin: 0 0 4px;
}

.ahm-opinion-grid__headline a {
    color: inherit;
    text-decoration: none;
}

.ahm-opinion-grid__headline a:hover {
    color: #2271b1;
}

.ahm-opinion-grid__author {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif !important;
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.ahm-opinion-grid__excerpt {
    font-family: 'Libre Baskerville', Georgia, serif !important;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin: 4px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Opinion author link styles */
.ahm-opinion-author__link {
    color: #2271b1;
    text-decoration: none;
}
.ahm-opinion-author__link:hover {
    text-decoration: underline;
}
.ahm-opinion-author__name {
    color: #2271b1;
}

/* ════════════════════════════════════════
   RESPONSIVE LAYOUT TOGGLE (desktop/mobile dual rendering)
   ════════════════════════════════════════ */
.ahm-desktop-only {
    display: block;
}
.ahm-mobile-only {
    display: none;
}
