.mag { max-width: 1180px; margin: 0 auto; padding: .35rem 1.25rem 2.6rem; }

.mag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 1.05rem; align-items: start; }
.mag-main { min-width: 0; }
.mag-side { position: sticky; top: 4.2rem; display: flex; flex-direction: column; gap: .5rem; }

.mag-front { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .95fr); gap: .75rem; margin-bottom: 1.05rem; }
.mag-hero {
    position: relative; display: block; overflow: hidden; border-radius: .7rem;
    min-height: 100%; color: #fff; text-decoration: none; background: #1c1917;
}
.mag-hero img { width: 100%; height: 100%; min-height: 292px; object-fit: cover; display: block; }
.mag-hero-ph { min-height: 292px; background: linear-gradient(135deg, #292524, #57534e); }
.mag-hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 36%, rgba(28,25,23,.88) 100%);
}
.mag-hero-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: .85rem .95rem .8rem; }
.mag-hero .mag-label { background: var(--primary); color: #1c1917; }
.mag-hero h2 { color: #fff; font-size: clamp(1.12rem, 1.9vw, 1.48rem); letter-spacing: -.02em; line-height: 1.15; margin: .22rem 0 .28rem; }
.mag-hero .mag-ex { color: rgba(255,255,255,.78); font-size: .78rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-hero .mag-meta { color: rgba(255,255,255,.62); margin-top: .3rem; }

.mag-headlines { display: flex; flex-direction: column; min-height: 292px; }
.mag-headlines a {
    display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: .55rem; align-items: center;
    padding: .42rem 0; border-bottom: 1px solid rgba(28,25,23,.08); text-decoration: none;
}
.mag-headlines a:first-child { padding-top: 0; }
.mag-headlines a:last-child { border-bottom: 0; padding-bottom: 0; }
.mag-headlines a:hover h3 { color: var(--primary-dark); }
.mag-headlines img, .mag-thumb {
    width: 72px; height: 54px; object-fit: cover; border-radius: .35rem; display: block; background: var(--bg-card);
}
.mag-headlines h3 { font-size: .8rem; margin: 0 0 .1rem; line-height: 1.25; letter-spacing: -.01em; }
.mag-headlines .mag-ex { font-size: .72rem; line-height: 1.35; margin: .1rem 0 .15rem; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-headlines .mag-meta { font-size: .62rem; }

.mag-label { width: fit-content; padding: .08rem .36rem; border-radius: 999px; background: rgba(245,158,11,.16); font-size: .52rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-dark); }
.mag-meta { font-size: .64rem; display: flex; gap: .25rem; flex-wrap: wrap; color: var(--text-main); }

.mag-sec { margin: 0 0 1.05rem; }
.mag-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: .5rem; padding-bottom: .28rem; border-bottom: 1px solid rgba(28,25,23,.1); }
.mag-sec-head h2 { font-size: .86rem; margin: 0; }
.mag-more { font-size: .68rem; font-weight: 700; color: var(--primary-dark); }

.mag-feed { display: flex; flex-direction: column; }
.mag-feed a {
    display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: .7rem; align-items: start;
    padding: .55rem 0; border-bottom: 1px solid rgba(28,25,23,.07); text-decoration: none;
}
.mag-feed a:first-child { padding-top: 0; }
.mag-feed a:last-child { border-bottom: 0; }
.mag-feed a:hover h3 { color: var(--primary-dark); }
.mag-feed-img { width: 128px; height: 80px; border-radius: .42rem; overflow: hidden; background: var(--bg-card); flex-shrink: 0; }
.mag-feed-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-feed h3 { font-size: .9rem; margin: .08rem 0 .18rem; line-height: 1.25; letter-spacing: -.012em; }
.mag-feed p { font-size: .74rem; line-height: 1.45; margin: 0; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mag-tcard { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.mag-tcard:hover h3 { color: var(--primary-dark); }
.mag-tcard-img { display: block; overflow: hidden; border-radius: .5rem; background: var(--bg-card); aspect-ratio: 16/10; flex: none; }
.mag-tcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-tcard-body { display: block; }
.mag-tcard h3 { font-size: .82rem; margin: .35rem 0 .12rem; line-height: 1.28; }
.mag-tcard p { font-size: .72rem; line-height: 1.4; margin: 0; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 0: big card left, three stacked right — text always sits under the image */
.mag-topic-0 .mag-topic-grid { display: grid; grid-template-columns: 1.35fr .85fr; grid-template-rows: repeat(3, auto); gap: .55rem .8rem; align-items: start; }
.mag-topic-0 .mag-tcard:first-child { grid-row: 1 / span 3; }
.mag-topic-0 .mag-tcard:first-child .mag-tcard-img { aspect-ratio: 16/11; }
.mag-topic-0 .mag-tcard:not(:first-child) { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .5rem; align-items: center; }
.mag-topic-0 .mag-tcard:not(:first-child) .mag-tcard-img { aspect-ratio: 4/3; }
.mag-topic-0 .mag-tcard:not(:first-child) h3 { margin-top: 0; }

/* 1: full-bleed overlay hero, then a 3-up row */
.mag-topic-1 .mag-topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.mag-topic-1 .mag-tcard:first-child { grid-column: 1 / -1; position: relative; color: #fff; border-radius: .6rem; overflow: hidden; }
.mag-topic-1 .mag-tcard:first-child .mag-tcard-img { aspect-ratio: 21/8; border-radius: 0; }
.mag-topic-1 .mag-tcard:first-child .mag-tcard-body { position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem 1rem; background: linear-gradient(transparent, rgba(12,10,8,.8)); }
.mag-topic-1 .mag-tcard:first-child h3 { color: #fff; font-size: 1.15rem; }
.mag-topic-1 .mag-tcard:first-child p { color: rgba(255,255,255,.85); }

/* 2: three equal image cards, lead spans two columns on top */
.mag-topic-2 .mag-topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.mag-topic-2 .mag-tcard:first-child { grid-column: span 2; }
.mag-topic-2 .mag-tcard:first-child .mag-tcard-img { aspect-ratio: 16/8; }

/* 3: horizontal strip, image on the left of every row */
.mag-topic-3 .mag-topic-grid { display: flex; flex-direction: column; gap: .15rem; }
.mag-topic-3 .mag-tcard { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .7rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid rgba(28,25,23,.07); }
.mag-topic-3 .mag-tcard:first-child { grid-template-columns: 220px minmax(0, 1fr); }
.mag-topic-3 .mag-tcard-img { aspect-ratio: 3/2; }

.mag-between-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.mag-between-row a { text-decoration: none; }
.mag-between-row a:hover h3 { color: var(--primary-dark); }
.mag-between-row img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: .45rem; display: block; background: var(--bg-card); }
.mag-between-row h3 { font-size: .82rem; margin: .35rem 0 .1rem; line-height: 1.28; }
.mag-between-row span { font-size: .62rem; color: var(--text-main); }

.mag-widget { background: var(--bg-card); border-radius: .65rem; padding: .65rem .7rem; }
.mag-widget h2 { font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .4rem; }
.mag-widget p { font-size: .74rem; line-height: 1.5; margin: 0; }
.mag-topics { list-style: none; margin: 0; padding: 0; }
.mag-topics a { display: flex; justify-content: space-between; gap: .4rem; padding: .28rem 0; border-bottom: 1px dashed rgba(28,25,23,.09); font-size: .74rem; font-weight: 650; }
.mag-topics li:last-child a { border-bottom: 0; padding-bottom: 0; }
.mag-topics a:hover { color: var(--primary-dark); }
.mag-topics em { font-style: normal; font-size: .58rem; font-weight: 800; color: var(--text-main); background: rgba(255,255,255,.5); border-radius: 999px; min-width: 1.25rem; text-align: center; padding: .04rem .26rem; }
.mag-pop a { display: grid; grid-template-columns: 1.1rem 52px minmax(0, 1fr); gap: .35rem; align-items: center; padding: .28rem 0; border-bottom: 1px dashed rgba(28,25,23,.09); }
.mag-pop img { width: 52px; height: 40px; object-fit: cover; border-radius: .28rem; display: block; background: rgba(28,25,23,.06); }
.mag-pop a:last-child { border-bottom: 0; }
.mag-pop b { font-family: var(--font-heading); font-size: .78rem; color: var(--primary-dark); }
.mag-pop h3 { font-size: .74rem; margin: 0 0 .06rem; line-height: 1.28; }
.mag-pop span { font-size: .6rem; color: var(--text-main); }
.mag-prod { display: block; padding: .32rem 0; border-bottom: 1px dashed rgba(28,25,23,.09); }
.mag-prod:last-of-type { border-bottom: 0; }
.mag-prod h3 { font-size: .76rem; margin: 0 0 .06rem; }
.mag-prod p { font-size: .68rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-rss { display: inline-flex; align-items: center; gap: .28rem; margin-top: .38rem; font-size: .68rem; font-weight: 700; color: var(--primary-dark); }
.mag-rss svg { width: 11px; height: 11px; }
.mag-more-btn {
    display: block; width: 100%; margin-top: .45rem; padding: .32rem 0 0;
    border: 0; border-top: 1px dashed rgba(28,25,23,.12); background: none;
    font: inherit; font-size: .68rem; font-weight: 700; color: var(--primary-dark);
    cursor: pointer; text-align: left;
}
.mag-more-btn:hover { color: var(--text-heading); }
.mag-load-btn {
    display: block; margin: .7rem auto 0; padding: .4rem 1.1rem;
    border: 1px solid rgba(28,25,23,.1); border-radius: 999px; background: var(--bg-card);
    font: inherit; font-size: .72rem; font-weight: 700; color: var(--text-heading); cursor: pointer;
}
.mag-load-btn:hover { border-color: var(--primary-dark); color: var(--primary-dark); }

@media (max-width: 1040px) {
    .mag-layout { grid-template-columns: 1fr; }
    .mag-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .mag-front, .mag-topic-0 .mag-topic-grid, .mag-between-row { grid-template-columns: 1fr; }
    .mag-topic-0 .mag-tcard:first-child { grid-row: auto; }
    .mag-topic-0 .mag-tcard:not(:first-child) { grid-template-columns: 84px minmax(0, 1fr); }
    .mag-topic-1 .mag-topic-grid, .mag-topic-2 .mag-topic-grid { grid-template-columns: 1fr 1fr; }
    .mag-topic-1 .mag-tcard:first-child, .mag-topic-2 .mag-tcard:first-child { grid-column: 1 / -1; }
    .mag-topic-1 .mag-tcard:first-child .mag-tcard-img { aspect-ratio: 16/9; }
    .mag-headlines { min-height: 0; }
    .mag-hero img, .mag-hero-ph { min-height: 220px; }
}
@media (max-width: 640px) {
    .mag { padding: .55rem .9rem 2rem; }
    .mag-feed a { grid-template-columns: 84px minmax(0, 1fr); gap: .5rem; }
    .mag-feed-img { width: 84px; height: 58px; }
    .mag-side { display: flex; }
}
