/* ============================================================
   MAGAZINE LAYOUT — MeB editorial magazine style
   Full-width, immersive, modern editorial aesthetic
   Rollback: cp magazine.css.bak magazine.css
   ============================================================ */

/* ---- GLOBAL OVERRIDES ---- */
.mag-container a,
.mag-hero a {
    color: inherit;
    text-decoration: none;
}

/* Restore explicit colors for interactive elements */
.mag-container .mag-btn,
.mag-btn { color: #fff !important; }
.mag-container .mag-btn-sm,
.mag-btn-sm { color: var(--meb-red); }
.mag-footer-nav a { color: var(--meb-red); }
.mag-social-bar a,
.mag-social-footer a,
.mag-share a { color: var(--meb-gray-500); }
.mag-issue-bar a { color: var(--meb-red); }

/* Page body tone — warm off-white instead of clinical white */
body:has(.mag-hero) {
    background: #f7f6f3;
}

/* ---- LAYOUT ---- */
.mag-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- HERO ---- */
.mag-hero {
    position: relative;
    background: var(--meb-navy);
    color: #fff;
    overflow: hidden;
    margin-bottom: 0;
}

.mag-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
}

.mag-hero-img {
    position: relative;
    overflow: hidden;
}

.mag-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mag-hero-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 40%, var(--meb-navy) 100%);
}

.mag-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 56px 56px 36px;
    position: relative;
    z-index: 1;
}

.mag-hero-label {
    font-family: var(--meb-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 16px;
}

.mag-hero-title {
    font-family: var(--meb-serif);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 18px;
}

.mag-hero-title a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.mag-hero-title a:hover {
    opacity: 0.85;
}

.mag-hero-authors {
    font-family: var(--meb-sans);
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    font-style: italic;
    margin-bottom: 20px;
}

.mag-hero-excerpt {
    font-family: var(--meb-serif);
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    margin: 0;
    max-width: 520px;
}

.mag-hero-badge {
    display: inline-block;
    background: var(--meb-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 14px;
}

/* ---- SOCIAL BAR (follow + share issue) ---- */
.mag-social-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--meb-navy);
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.mag-social-bar-label {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
}

.mag-social-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.mag-social-bar a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.mag-social-bar-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    margin: 0 10px;
}

/* ---- COVER STRIP ---- */
.mag-cover-strip {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 48px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.mag-cover-strip img {
    height: 170px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    flex-shrink: 0;
}

.mag-cover-strip-text {
    flex: 1;
}

.mag-cover-strip-text h3 {
    font-family: var(--meb-serif);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}

.mag-cover-strip-text p {
    font-size: 14px;
    color: var(--meb-gray-500);
    margin: 0 0 14px;
}

/* ---- SECTION DIVIDER ---- */
.mag-section {
    margin-bottom: 56px;
}

.mag-section-title {
    font-family: var(--meb-sans);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--meb-red);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--meb-red);
    margin-bottom: 32px;
}

.mag-section-title.green {
    color: var(--meb-green);
    border-bottom-color: var(--meb-green);
}

/* ---- FEATURE GRID ---- */
.mag-grid {
    display: grid;
    gap: 36px;
}

.mag-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.mag-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.mag-grid-featured {
    grid-template-columns: 1.5fr 1fr;
}

/* ---- ARTICLE CARD ---- */
.mag-article {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
}

.mag-article:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.mag-article-img {
    width: calc(100% + 40px);
    margin: -20px -20px 16px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    display: block;
}

.mag-article-cat {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-red);
    margin-bottom: 8px;
}

.mag-article-cat.green {
    color: var(--meb-green);
}

.mag-article h3 {
    font-family: var(--meb-serif);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
    color: var(--meb-gray-900);
}

.mag-article h3 a:hover {
    color: var(--meb-red);
}

.mag-article h4 {
    font-family: var(--meb-serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px;
    color: var(--meb-gray-900);
}

.mag-article h4 a:hover {
    color: var(--meb-red);
}

.mag-article-authors {
    font-family: var(--meb-sans);
    font-size: 13px;
    color: var(--meb-gray-500);
    font-style: italic;
    margin-bottom: 8px;
}

.mag-article-note {
    font-family: var(--meb-serif);
    font-size: 15px;
    line-height: 1.65;
    color: var(--meb-gray-700);
    margin-top: 4px;
}

.mag-article-free {
    display: inline-block;
    background: #e8f5e9;
    color: var(--meb-green);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 6px;
}

/* ---- HORIZONTAL ARTICLE (EL lists) ---- */
.mag-article-h {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    align-items: start;
    transition: background 0.2s;
}

.mag-article-h:hover {
    background: rgba(255,255,255,0.7);
    margin: 0 -12px;
    padding: 16px 12px;
    border-radius: 6px;
}

.mag-article-h:last-child {
    border-bottom: none;
}

.mag-article-h h4 {
    font-family: var(--meb-serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
}

.mag-article-h-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.mag-article-h.no-img {
    grid-template-columns: 1fr;
}

/* ---- PULL QUOTE ---- */
.mag-pullquote {
    font-family: var(--meb-serif);
    font-size: 24px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.5;
    color: var(--meb-gray-700);
    border-left: 4px solid var(--meb-red);
    padding: 12px 0 12px 24px;
    margin: 32px 0;
}

/* ---- EL COLUMN GROUP ---- */
.mag-el-group {
    margin-bottom: 32px;
    background: rgba(1,149,52,0.03);
    border-radius: 8px;
    padding: 0 16px 8px;
}

.mag-el-group-title {
    font-family: var(--meb-sans);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-green);
    padding: 14px 0 10px;
    border-bottom: 2px solid var(--meb-green);
    margin-bottom: 0;
}

/* EL articles: green tone */
.mag-el-group .mag-article-h h4 a:hover {
    color: var(--meb-green);
}

.mag-el-group .mag-share a:hover {
    background: var(--meb-green);
}

/* ---- SHARE BUTTONS ---- */
.mag-share {
    display: flex;
    gap: 5px;
    margin-top: 12px;
}

.mag-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--meb-gray-100);
    color: var(--meb-gray-500);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.mag-share a:hover {
    background: var(--meb-navy);
    color: #fff;
}

.mag-share-lg a {
    width: 36px;
    height: 36px;
    font-size: 15px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

.mag-share-lg a:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ---- HIGHLIGHT STRIP (Pediatria Grande Stampa) ---- */
.mag-highlight-strip {
    background: var(--meb-navy);
    color: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 48px;
}

.mag-highlight-strip-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mag-highlight-strip-img {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mag-highlight-strip-label {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.mag-highlight-strip h4 {
    font-family: var(--meb-serif);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.mag-highlight-strip h4 a {
    color: #fff;
}

.mag-highlight-strip h4 a:hover {
    opacity: 0.8;
}

.mag-highlight-strip .mag-article-authors {
    color: rgba(255,255,255,0.5);
}

/* ---- BANNER STRIP (inline ads) ---- */
.mag-banner-strip {
    text-align: center;
    margin-bottom: 48px;
}

.mag-banner-strip img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ---- ATTI STRIP (latest congress proceedings cover) ---- */
.mag-atti-strip {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 48px;
}

.mag-atti-strip-inner {
    display: flex;
    align-items: center;
    gap: 32px;
}

.mag-atti-cover {
    width: 180px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.mag-atti-cover:hover {
    transform: scale(1.03);
}

.mag-atti-text {
    flex: 1;
}

.mag-atti-text h4 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.mag-atti-text .text-muted {
    color: rgba(255,255,255,0.5) !important;
}

.mag-atti-text .mag-btn {
    background: var(--meb-red);
    color: #fff;
    border: none;
}

.mag-atti-text .mag-btn:hover {
    background: #b71c1c;
}

.mag-atti-text .mag-btn-sm {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.3);
}

.mag-atti-text .mag-btn-sm:hover {
    color: #fff;
    border-color: #fff;
}

/* ---- DUAL SECTION (ZD + Congressi side by side) ---- */
.mag-dual-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 56px;
}

.mag-dual-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s;
}

.mag-dual-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.mag-dual-card-img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: var(--meb-gray-100);
    padding: 16px;
}

.mag-dual-card-body {
    padding: 20px 24px;
}

.mag-dual-card-body p {
    font-size: 14px;
    color: var(--meb-gray-500);
    margin: 0 0 14px;
}

/* ---- CONGRESS ITEMS ---- */
.mag-congress-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--meb-border);
    transition: background 0.2s;
}

.mag-congress-item:hover {
    background: var(--meb-gray-100);
}

.mag-congress-item:last-child {
    border-bottom: none;
}

.mag-congress-banner {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.mag-congress-info strong {
    font-size: 14px;
    line-height: 1.3;
}

.mag-congress-info strong a:hover {
    color: var(--meb-red);
}

.mag-congress-meta {
    font-size: 12px;
    color: var(--meb-gray-500);
    margin: 4px 0 8px;
}

/* ---- BUTTONS ---- */
.mag-btn {
    display: inline-block;
    background: var(--meb-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.mag-btn:hover {
    background: var(--meb-red-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196,16,24,0.3);
}

.mag-btn-sm {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--meb-red);
    text-decoration: none;
    border: 1.5px solid var(--meb-red);
    padding: 5px 16px;
    border-radius: 4px;
    margin-top: 8px;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.mag-btn-sm:hover {
    background: var(--meb-red);
    color: #fff;
}

/* ---- EL HERO (compact featured strip) ---- */
.mag-el-hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-left: 4px solid var(--meb-green);
}

.mag-el-hero-badge {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-green);
    margin-bottom: 8px;
}

.mag-el-hero-main h3 {
    font-family: var(--meb-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}

.mag-el-hero-main h3 a {
    color: var(--meb-gray-900);
}

.mag-el-hero-main h3 a:hover {
    color: var(--meb-green);
}

.mag-el-hero-excerpt {
    font-family: var(--meb-serif);
    font-size: 14px;
    line-height: 1.7;
    color: var(--meb-gray-500);
    margin: 8px 0 14px;
}

.mag-el-hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 1px solid var(--meb-border);
    padding-left: 24px;
}

.mag-el-hero-side-item {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--meb-gray-100);
}

.mag-el-hero-side-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mag-el-hero-side-item h4 {
    font-family: var(--meb-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
}

.mag-el-hero-side-item h4 a:hover {
    color: var(--meb-green);
}

@media (max-width: 767px) {
    .mag-el-hero {
        grid-template-columns: 1fr;
    }
    .mag-el-hero-side {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--meb-border);
        padding-top: 16px;
    }
}

/* ---- EL SECTION: green-tinted background ---- */
.mag-section:has(.mag-section-title.green) {
    background: rgba(1,149,52,0.04);
    margin-left: -24px;
    margin-right: -24px;
    padding: 36px 24px;
    border-radius: 0;
}

/* ---- READING CARDS (Da leggere) ---- */
.mag-reading-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s, transform 0.25s;
}

.mag-reading-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Icon placeholder when image is missing */
.mag-reading-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 140px;
    border-radius: 6px;
    font-size: 48px;
    margin-bottom: 6px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.mag-reading-card-icon:hover {
    opacity: 0.8;
}

.mag-reading-card-icon--red {
    background: linear-gradient(135deg, #fce4ec, #ffcdd2);
    color: var(--meb-red);
}

.mag-reading-card-icon--navy {
    background: linear-gradient(135deg, #e3e8ef, #cfd8e3);
    color: var(--meb-navy);
}

.mag-reading-card-icon--green {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--meb-green);
}

.mag-reading-card-img {
    width: 100%;
    max-height: 190px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--meb-gray-100);
    padding: 12px;
    margin-bottom: 6px;
}

.mag-reading-card-label {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-red);
}

.mag-reading-card strong {
    font-family: var(--meb-serif);
    font-size: 15px;
    line-height: 1.4;
}

/* ---- INFO ROW (Newsletter, Classifica, Atlante) — navy band ---- */
.mag-info-row {
    display: flex;
    gap: 0;
    margin: 0 -24px 56px;
    background: var(--meb-navy);
    flex-wrap: wrap;
}

.mag-info-card {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}

.mag-info-card:last-child {
    border-right: none;
}

.mag-info-card-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    padding: 8px;
}

.mag-info-card-body {
    padding: 18px 24px;
}

.mag-info-card .mag-reading-card-label {
    color: rgba(255,255,255,0.4);
}

.mag-info-card-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.65);
    margin-top: 6px;
}

.mag-info-card-text a {
    color: rgba(255,255,255,0.85);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(255,255,255,0.3);
}

.mag-info-card-text a:hover {
    color: #fff;
    text-decoration-color: #fff;
}

.mag-info-card-text ul {
    padding-left: 16px;
    margin: 6px 0;
}

.mag-info-card-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 6px 0;
}

/* Override inline styles from legacy HTML content */
.mag-info-card-text p,
.mag-info-card-text li,
.mag-info-card-text b,
.mag-info-card-text span {
    color: rgba(255,255,255,0.65) !important;
}

.mag-info-card .mag-btn-sm {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.25);
}

.mag-info-card .mag-btn-sm:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

/* ---- FOOTER NAV ---- */
.mag-footer-nav {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 28px 0;
    border-top: 2px solid var(--meb-border);
    margin-top: 48px;
}

.mag-footer-nav a {
    font-size: 13px;
    font-weight: 700;
    color: var(--meb-red);
    text-decoration: none;
    letter-spacing: 0.3px;
}

.mag-footer-nav a:hover {
    color: var(--meb-red-dark);
}

/* ---- SOCIAL FOOTER ---- */
.mag-social-footer {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 24px 0 12px;
}

.mag-social-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--meb-navy);
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s;
}

.mag-social-footer a:hover {
    background: var(--meb-red);
    color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .mag-hero-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .mag-hero-img {
        max-height: 320px;
    }
    .mag-hero-img::after {
        background: linear-gradient(180deg, transparent 30%, var(--meb-navy) 100%);
    }
    .mag-hero-text {
        padding: 32px 24px;
    }
    .mag-hero-title {
        font-size: 30px;
    }
    .mag-grid-2,
    .mag-grid-3,
    .mag-grid-featured {
        grid-template-columns: 1fr;
    }
    .mag-dual-section {
        grid-template-columns: 1fr;
    }
    .mag-section:has(.mag-section-title.green) {
        margin-left: -16px;
        margin-right: -16px;
        padding: 28px 16px;
    }
}

@media (max-width: 767px) {
    body:has(.mag-hero) {
        background: #f5f4f1;
    }
    .mag-hero-title {
        font-size: 26px;
    }
    .mag-hero-text {
        padding: 24px 16px;
    }
    .mag-cover-strip {
        flex-direction: column;
        text-align: center;
    }
    .mag-atti-strip-inner {
        flex-direction: column;
        text-align: center;
    }
    .mag-atti-cover {
        width: 140px;
    }
    .mag-highlight-strip-inner {
        flex-direction: column;
        text-align: center;
    }
    .mag-highlight-strip-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .mag-article {
        padding: 16px;
    }
    .mag-article-img {
        width: calc(100% + 32px);
        margin: -16px -16px 14px;
    }
    .mag-article-h {
        grid-template-columns: 1fr;
    }
    .mag-article-h-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .mag-info-row {
        flex-direction: column;
        margin: 0 -16px 48px;
    }
    .mag-info-card {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .mag-footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .mag-social-bar {
        padding: 14px 16px;
    }
}

/* ============================================================
   MAGAZINE HEADER/NAV/FOOTER — site-wide overrides
   ============================================================ */

/* Masthead: clean, minimal, white with subtle border */
.theme-magazine .meb-masthead {
    border-bottom: 1px solid var(--meb-border);
    background: #fff;
}

.theme-magazine .meb-masthead-inner {
    padding: 20px 16px;
}

.theme-magazine .meb-tagline {
    font-size: 12px;
    color: var(--meb-gray-500);
}

/* User bar: navy, slim */
.theme-magazine .meb-userbar {
    background: var(--meb-navy);
    font-size: 12px;
}

.theme-magazine .meb-userbar-inner {
    min-height: 30px;
}

/* Navigation: clean, magazine-style */
.theme-magazine .meb-nav {
    background: #fff;
    border-bottom: 2px solid var(--meb-navy);
}

.theme-magazine .meb-nav-links a {
    font-family: var(--meb-sans);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--meb-navy);
    padding: 12px 16px;
    border-radius: 0;
    transition: all 0.2s;
}

.theme-magazine .meb-nav-links a:hover {
    background: var(--meb-navy);
    color: #fff;
}

.theme-magazine .meb-search input[type="search"] {
    border-radius: 0;
    border: 2px solid var(--meb-navy);
    font-size: 12px;
    padding: 6px 14px;
}

.theme-magazine .meb-search button {
    border-radius: 0;
    background: var(--meb-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.theme-magazine .meb-search button:hover {
    background: var(--meb-red);
}

/* Footer: elegant dark */
.theme-magazine .meb-footer {
    background: var(--meb-navy);
    margin-top: 56px;
}

.theme-magazine .meb-footer h6 {
    font-family: var(--meb-sans);
    letter-spacing: 2px;
}

/* Login panel */
.theme-magazine .meb-login-panel {
    background: var(--meb-navy);
}

/* ============================================================
   MAGAZINE SUBPAGES — full-site theme support
   Applied when body has .theme-magazine via layout/main.php
   ============================================================ */

/* ---- PAGE WRAPPER ---- */
.theme-magazine {
    background: #f7f6f3;
}

.mag-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

/* ---- ARTICLE PAGE (RI + EL) ---- */
.theme-magazine article {
    background: #fff;
    border-radius: 10px;
    padding: 40px 48px;
    margin: 32px 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.theme-magazine .meb-categoria {
    font-family: var(--meb-sans);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--meb-red);
    margin-bottom: 12px;
}

.theme-magazine article h2 {
    font-family: var(--meb-serif);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--meb-gray-900);
}

.theme-magazine article h4.text-muted {
    font-family: var(--meb-serif);
    font-size: 22px;
    font-style: italic;
    color: var(--meb-gray-500) !important;
    margin-bottom: 16px;
    line-height: 1.35;
}

/* Authors: name line — prominent but not huge */
.theme-magazine .meb-autore-names {
    font-family: var(--meb-sans);
    font-size: 16px;
    color: var(--meb-gray-700);
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.5;
}

/* Affiliations: smaller, lighter, italic */
.theme-magazine .meb-autore-affil {
    font-family: var(--meb-sans);
    font-size: 12px;
    color: var(--meb-gray-500);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 16px;
}

.theme-magazine .meb-autore-affil sup {
    font-size: 9px;
    font-weight: 700;
    color: var(--meb-red);
}

.theme-magazine .meb-autore-names sup {
    font-size: 10px;
    font-weight: 700;
    color: var(--meb-red);
}

/* Fallback for old .meb-autore class */
.theme-magazine .meb-autore {
    font-family: var(--meb-sans);
    font-size: 14px;
    color: var(--meb-gray-500);
    font-style: italic;
    margin-bottom: 8px;
}

.theme-magazine .meb-autore.fs-5 {
    font-size: 14px !important;
}

.theme-magazine .meb-article-toolbar {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--meb-border);
}

.theme-magazine .meb-article-toolbar .btn {
    border-radius: 20px;
    padding: 5px 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.theme-magazine .meb-citation-box {
    border-radius: 8px;
    border-left: 4px solid var(--meb-red);
    background: var(--meb-gray-100);
}

/* Abstract / Riassunto cards */
.theme-magazine article .card {
    border: none;
    border-radius: 8px;
    background: var(--meb-gray-100);
    box-shadow: none;
}

.theme-magazine article .card-header {
    background: transparent;
    border-bottom: 2px solid var(--meb-red);
    font-family: var(--meb-sans);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-red);
    padding: 16px 20px 10px;
}

.theme-magazine article .card-body {
    font-family: var(--meb-serif);
    font-size: 15px;
    line-height: 1.75;
    padding: 16px 20px;
    color: var(--meb-gray-700);
}

/* PDF button */
.theme-magazine .btn-danger.btn-lg,
.theme-magazine a.btn-danger.btn-lg {
    background: var(--meb-red);
    border: none;
    border-radius: 6px;
    padding: 14px 36px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(196,16,24,0.25);
    transition: all 0.2s;
}

.theme-magazine .btn-danger.btn-lg:hover {
    background: var(--meb-red-dark);
    box-shadow: 0 6px 20px rgba(196,16,24,0.35);
    transform: translateY(-1px);
}

/* Paywall */
.theme-magazine .meb-paywall {
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Bibliography */
.theme-magazine .meb-bibliography {
    font-family: var(--meb-serif);
    font-size: 13px;
    line-height: 1.7;
    color: var(--meb-gray-500);
}

.theme-magazine article h5 {
    font-family: var(--meb-sans);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-gray-700);
    margin-top: 28px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--meb-border);
}

/* EL article HTML content */
.theme-magazine .article-content {
    font-family: var(--meb-serif);
    font-size: 16px;
    line-height: 1.8;
}

.theme-magazine .article-content h3 {
    font-family: var(--meb-serif);
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--meb-gray-900);
}

.theme-magazine .article-content figure {
    margin: 24px 0;
    background: var(--meb-gray-100);
    border-radius: 8px;
    padding: 16px;
}

.theme-magazine .article-content figcaption {
    font-family: var(--meb-sans);
    font-size: 13px;
    color: var(--meb-gray-500);
    margin-top: 10px;
    line-height: 1.5;
}

.theme-magazine .article-content table {
    border-radius: 6px;
    overflow: hidden;
}

/* ---- ISSUE PAGES (RI + EL) ---- */
.theme-magazine .meb-text-red,
.theme-magazine h2.meb-text-red {
    font-family: var(--meb-sans);
    font-size: 12px !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.theme-magazine .meb-text-green,
.theme-magazine h2.meb-text-green {
    font-family: var(--meb-sans);
    font-size: 12px !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.theme-magazine .meb-issue-nav {
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.theme-magazine .meb-issue-nav a {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* RI issue: article cards in magazine grid */
.theme-magazine .meb-article {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    border-bottom: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
}

.theme-magazine .meb-article:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.theme-magazine .meb-article h4 {
    font-family: var(--meb-serif);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.theme-magazine .meb-article h4 a:hover {
    color: var(--meb-red);
}

.theme-magazine .meb-article img.img-fluid {
    border-radius: 6px;
    max-width: 35%;
}

/* EL issue: grouped articles */
.theme-magazine .meb-el-column {
    font-family: var(--meb-sans);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--meb-green);
    padding: 14px 0 10px;
    border-bottom: 2px solid var(--meb-green);
}

.theme-magazine .meb-search-result {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-bottom: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
}

.theme-magazine .meb-search-result:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* ---- SEARCH PAGE ---- */
.theme-magazine .input-group .form-control {
    border-radius: 24px 0 0 24px;
    padding: 12px 20px;
    border: 2px solid var(--meb-border);
    font-size: 15px;
}

.theme-magazine .input-group .form-control:focus {
    border-color: var(--meb-red);
    box-shadow: 0 0 0 3px rgba(196,16,24,0.1);
}

.theme-magazine .input-group .btn-danger {
    border-radius: 0 24px 24px 0;
    padding: 12px 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ---- ARCHIVE PAGES ---- */
.theme-magazine .meb-archive-year h3 {
    font-family: var(--meb-sans);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-bottom: none;
}

.theme-magazine .meb-archive-year .card {
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
}

.theme-magazine .meb-archive-year .card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* ---- PROFILE / FORMS ---- */
.theme-magazine .meb-profile-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.theme-magazine .form-control {
    border-radius: 6px;
    border: 2px solid var(--meb-border);
    padding: 10px 14px;
}

.theme-magazine .form-control:focus {
    border-color: var(--meb-red);
    box-shadow: 0 0 0 3px rgba(196,16,24,0.1);
}

.theme-magazine .btn-danger {
    background: var(--meb-red);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.theme-magazine .btn-danger:hover {
    background: var(--meb-red-dark);
    box-shadow: 0 4px 12px rgba(196,16,24,0.3);
}

/* ---- SHOP / TASCABILI ---- */
.theme-magazine .tascabili-div {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    border-bottom: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.theme-magazine .tascabili-div:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ---- QUIZ ECM ---- */
.theme-magazine .meb-quiz-question {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ---- REVIEWS / HIGHLIGHTS ---- */
.theme-magazine .card.mb-3 {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s;
}

.theme-magazine .card.mb-3:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ---- CONGRESS LIST ---- */
.theme-magazine .congress-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
    overflow: hidden;
}

.theme-magazine .congress-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* ---- TOP 20 ---- */
.theme-magazine .table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.theme-magazine .table thead th {
    background: var(--meb-navy);
    color: #fff;
    font-family: var(--meb-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}

.theme-magazine .table td {
    vertical-align: middle;
    border-color: var(--meb-gray-100);
}

/* ---- GENERIC HEADINGS in mag-page ---- */
.mag-page > h2,
.theme-magazine h2.mb-3,
.theme-magazine h2.mb-1 {
    font-family: var(--meb-sans);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--meb-red);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--meb-red);
    margin-bottom: 28px;
}

/* ---- PRINT ---- */
@media print {
    .theme-magazine {
        background: #fff;
    }
    .theme-magazine article {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
}

/* ---- RESPONSIVE subpages ---- */
@media (max-width: 991px) {
    .theme-magazine article {
        padding: 24px;
        margin: 16px 0;
    }
    .theme-magazine article h2 {
        font-size: 26px;
    }
}

@media (max-width: 575px) {
    .mag-page {
        padding: 0 16px;
    }
    .theme-magazine article {
        padding: 20px 16px;
        border-radius: 6px;
    }
    .theme-magazine article h2 {
        font-size: 22px;
    }
}
