/* ================================================================ */
/* UMVA MAG - HOME PAGE DESIGN v2                                   */
/* Compact magazine layout. No wasted space.                        */
/* ================================================================ */
:root {
    --mag-accent: #667eea;
    --mag-accent-light: #8b9cf7;
    --mag-accent-glow: rgba(102,126,234,0.3);
    --mag-dark: #0d0d1a;
    --mag-card-bg: rgba(255,255,255,0.03);
    --mag-card-bg-hover: rgba(255,255,255,0.06);
    --mag-border: rgba(255,255,255,0.08);
    --mag-border-hover: rgba(102,126,234,0.3);
    --mag-muted: rgba(255,255,255,0.5);
    --mag-text: rgba(255,255,255,0.92);
    --mag-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mag-home .container { max-width: 1240px; }

/* MASTHEAD */
.mag-masthead {
    text-align: center;
    padding: 1rem 0 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--mag-border);
}
.mag-masthead h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.15;
}
.mag-masthead h1 span { background: var(--mag-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.mag-masthead .mag-tagline { font-size: 0.78rem; color: var(--mag-muted); margin-top: 0.25rem; letter-spacing: 0.02em; }
.mag-masthead .mag-date { font-size: 0.7rem; color: rgba(255,255,255,0.3); margin-top: 0.15rem; }

/* CATEGORY NAV */
.mag-cat-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 0.2rem;
    margin-bottom: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--mag-border);
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
}
.mag-cat-nav {
    position: sticky !important;
    top: var(--header-height, 70px) !important;
    z-index: 49 !important;
    background: rgba(15, 15, 30, 0.35) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: none !important;
}
body:has(.mag-home) .main-wrapper {
    overflow: visible !important;
}
.mag-cat-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--mag-border);
    color: var(--mag-muted);
    background: var(--mag-card-bg);
    transition: all 0.2s;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    flex-shrink: 1 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: center;
}
.mag-cat-nav a:hover { color: #fff; border-color: var(--mag-accent); background: rgba(102,126,234,0.15); }

/* FEATURED STORIES GRID */
.mag-featured-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.mag-feat-main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    min-height: 380px;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.mag-feat-main:hover { border-color: var(--mag-border-hover); }
.mag-feat-main-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.mag-feat-main-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.05) 80%);
    z-index: 1;
}
.mag-feat-main-body {
    position: relative; z-index: 2; padding: 1.5rem; width: 100%;
}
.mag-feat-main-cat {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--mag-accent); color: #fff; margin-bottom: 0.5rem;
}
.mag-feat-main-title {
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    font-weight: 800; color: #fff; line-height: 1.25;
    margin: 0 0 0.4rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mag-feat-main-desc {
    font-size: 0.8rem; color: rgba(255,255,255,0.65);
    margin: 0 0 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.5;
}
.mag-feat-main-meta {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.7rem; color: rgba(255,255,255,0.45);
}
.mag-feat-main-meta i { margin-right: 0.2rem; }
.mag-feat-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mag-feat-side-card {
    display: flex;
    gap: 0.75rem;
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
    flex: 1;
    min-height: 82px;
}
.mag-feat-side-card:hover { border-color: var(--mag-border-hover); background: var(--mag-card-bg-hover); }
.mag-feat-side-img {
    width: 100px;
    min-height: 82px;
    flex-shrink: 0;
    object-fit: cover;
}
.mag-feat-side-body {
    padding: 0.6rem 0.6rem 0.6rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
}
.mag-feat-side-cat {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--mag-accent); margin-bottom: 0.15rem;
}
.mag-feat-side-title {
    font-size: 0.78rem; font-weight: 700; color: var(--mag-text); line-height: 1.3;
    margin: 0 0 0.15rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mag-feat-side-meta {
    font-size: 0.65rem; color: var(--mag-muted);
}

/* MOST POPULAR GRID */
.mag-section { margin-bottom: 2rem; }
.mag-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.mag-section-title {
    font-size: 1rem; font-weight: 800; color: #fff; margin: 0;
    display: flex; align-items: center; gap: 0.5rem;
}
.mag-section-title i { color: var(--mag-accent); }
.mag-section-link { font-size: 0.75rem; color: var(--mag-muted); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.mag-section-link:hover { color: var(--mag-accent); }
.mag-popular-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.mag-popular-card {
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.mag-popular-card:hover { border-color: var(--mag-border-hover); background: var(--mag-card-bg-hover); }
.mag-popular-img-wrap { width: 100%; height: 150px; overflow: hidden; position: relative; }
.mag-popular-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.mag-popular-card:hover .mag-popular-img { transform: scale(1.03); }
.mag-popular-body { padding: 0.75rem 1rem; flex: 1; display: flex; flex-direction: column; }
.mag-popular-cat {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--mag-accent); margin-bottom: 0.25rem;
}
.mag-popular-title {
    font-size: 0.85rem; font-weight: 700; color: var(--mag-text); line-height: 1.3;
    margin: 0 0 0.25rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mag-popular-meta { font-size: 0.68rem; color: var(--mag-muted); margin-top: auto; }

/* CATEGORY HIGHLIGHT SECTIONS */
.mag-cat-section { margin-bottom: 2rem; }
.mag-cat-highlight {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}
.mag-cat-highlight-main {
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}
.mag-cat-highlight-main:hover { border-color: var(--mag-border-hover); }
.mag-cat-highlight-main .mag-popular-img-wrap { height: 180px; }
.mag-cat-highlight-main .mag-popular-title { font-size: 1rem; }
.mag-cat-highlight-side {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.mag-cat-side-item {
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.mag-cat-side-item:hover { border-color: var(--mag-border-hover); background: var(--mag-card-bg-hover); }
.mag-cat-side-num {
    width: 20px; height: 20px; border-radius: 5px;
    background: rgba(102,126,234,0.15); color: var(--mag-accent);
    font-size: 0.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 0.05rem;
}
.mag-cat-side-title {
    font-size: 0.76rem; font-weight: 600; color: rgba(255,255,255,0.9);
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mag-cat-side-meta { font-size: 0.65rem; color: var(--mag-muted); margin-top: 0.15rem; }
.mag-cat-side-img { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }

/* SIDEBAR */
.mag-sidebar-wrap { position: relative; }
.mag-mustread {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.05));
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 12px;
    padding: 1.15rem;
    margin-bottom: 1rem;
}
.mag-mustread-header { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; }
.mag-mustread-header i { font-size: 1.1rem; color: var(--mag-accent); }
.mag-mustread-title { font-size: 0.9rem; font-weight: 800; color: #fff; margin: 0; }
.mag-mustread-list { display: flex; flex-direction: column; gap: 0.4rem; }
.mag-mustread-item {
    display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.6rem; border-radius: 8px;
    background: rgba(255,255,255,0.03); border: 1px solid transparent; transition: all 0.2s;
}
.mag-mustread-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(102,126,234,0.2); }
.mag-mustread-item a { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 0.65rem; flex: 1; min-width: 0; }
.mag-mustread-thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.mag-mustread-item-title { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.95); margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-mustread-item a:hover .mag-mustread-item-title { color: var(--mag-accent); }
.mag-mustread-item-meta { font-size: 0.65rem; color: var(--mag-muted); margin-top: 0.05rem; }
.mag-side-widget {
    padding: 1rem 1.15rem;
    border-radius: 10px;
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    margin-bottom: 1rem;
}
.mag-side-widget:last-child { margin-bottom: 0; }
.mag-side-widget-title {
    font-size: 0.82rem; font-weight: 700; color: #fff; margin: 0 0 0.75rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.mag-side-widget-title i { color: var(--mag-accent); }
.mag-side-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mag-side-tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.25rem 0.6rem; border-radius: 6px;
    font-size: 0.7rem; font-weight: 600; text-decoration: none;
    background: rgba(102,126,234,0.1); color: var(--mag-muted);
    border: 1px solid rgba(255,255,255,0.06); transition: all 0.2s;
}
.mag-side-tag:hover { background: rgba(102,126,234,0.2); color: #fff; border-color: var(--mag-accent); }
.mag-trending-list { display: flex; flex-direction: column; gap: 0.4rem; }
.mag-trending-item {
    display: flex; align-items: flex-start; gap: 0.5rem;
    text-decoration: none; color: inherit;
    padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mag-trending-item:last-child { border-bottom: none; }
.mag-trending-rank {
    width: 20px; height: 20px; border-radius: 5px;
    background: var(--mag-accent); color: #fff;
    font-size: 0.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 0.05rem;
}
.mag-trending-rank.top1 { background: #ef4444; }
.mag-trending-rank.top2 { background: #f59e0b; }
.mag-trending-rank.top3 { background: #10b981; }
.mag-trending-text {
    font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.9);
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mag-newsletter {
    background: var(--mag-gradient);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 0;
}
.mag-newsletter h3 { font-size: 1rem; font-weight: 800; color: #fff; margin: 0 0 0.35rem; }
.mag-newsletter p { color: rgba(255,255,255,0.8); font-size: 0.78rem; margin: 0 0 0.75rem; line-height: 1.4; }
.mag-newsletter .input-group { max-width: 100%; }

/* AI SEARCH */
.mag-search-trigger {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 999;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--mag-gradient); border: none; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.mag-search-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(102,126,234,0.5); }
.mag-search-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: clamp(4rem, 12vh, 6rem);
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.mag-search-overlay.is-open { opacity: 1; visibility: visible; }
.mag-search-box {
    background: linear-gradient(145deg, rgba(20,20,35,0.98), rgba(13,13,26,0.98));
    border: 1px solid var(--mag-border); border-radius: 14px;
    padding: 1.25rem 1.5rem; width: 100%; max-width: 500px;
    margin: 0 1rem; box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    transform: translateY(-20px);
    transition: transform 0.25s ease-out;
}
.mag-search-overlay.is-open .mag-search-box { transform: translateY(0); }

/* RESPONSIVE */
.mag-main-col { padding-right: 1.5rem; }
@media (min-width: 992px) {
    .mag-main-col { border-right: 1px solid var(--mag-border); }
}
@media (max-width: 991px) {
    .mag-popular-grid { grid-template-columns: repeat(2, 1fr); }
    .mag-cat-highlight { grid-template-columns: 1fr; }
    .mag-featured-grid { grid-template-columns: 1fr; }
    .mag-main-col { padding-right: 0; }
}
@media (max-width: 767px) {
    .mag-masthead { padding: 0.75rem 0 0.5rem; margin-bottom: 1rem; }
    .mag-cat-nav { gap: 0.15rem; padding: 0.3rem 0; margin-bottom: 0.6rem; overflow: hidden !important; flex-wrap: wrap !important; justify-content: center; }
    .mag-cat-nav a { font-size: 0.55rem; padding: 0.12rem 0.35rem; }
    .mag-feat-main { min-height: 280px; border-radius: 10px; }
    .mag-feat-main-body { padding: 1rem; }
    .mag-feat-main-title { font-size: 1rem; }
    .mag-feat-main-desc { display: none; }
    .mag-feat-side-card { min-height: 70px; }
    .mag-feat-side-img { width: 80px; min-height: 70px; }
    .mag-popular-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .mag-popular-img-wrap { height: 140px; }
    .mag-cat-highlight-main .mag-popular-img-wrap { height: 160px; }
    .mag-mustread { padding: 0.85rem; }
    .mag-search-trigger { right: 0.75rem; bottom: 0.75rem; width: 42px; height: 42px; font-size: 1.1rem; }
    .mag-main-col { padding-right: 0; }
    .mag-featured-grid { gap: 0.75rem; }
}
.mag-pagination { margin-top: 1.5rem; }

.mag-lazy-placeholder { transition: opacity 0.3s ease; }
.mag-lazy-loaded .mag-lazy-placeholder { opacity: 0; }

/* EXTENDED CATEGORIES */
.mag-extended-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}
.mag-ext-card {
    background: var(--mag-card-bg);
    border: 1px solid var(--mag-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.mag-ext-card:hover { border-color: var(--mag-border-hover); }
.mag-ext-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--mag-border);
}
.mag-ext-cat-name {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: opacity 0.2s;
}
.mag-ext-cat-name:hover { opacity: 0.8; }
.mag-ext-all {
    color: var(--mag-muted);
    font-size: 0.7rem;
    text-decoration: none;
    transition: color 0.2s;
}
.mag-ext-all:hover { color: var(--mag-accent); }
.mag-ext-items { display: flex; flex-direction: column; gap: 0; }
.mag-ext-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.mag-ext-item:last-child { border-bottom: none; }
.mag-ext-item:hover { background: var(--mag-card-bg-hover); }
.mag-ext-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.mag-ext-item-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.mag-ext-item-body { min-width: 0; flex: 1; }
.mag-ext-item-title {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--mag-text);
    line-height: 1.3;
    margin: 0 0 0.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mag-ext-item-meta {
    font-size: 0.62rem;
    color: var(--mag-muted);
}
@media (max-width: 991px) {
    .mag-extended-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .mag-extended-grid { grid-template-columns: 1fr; gap: 0.65rem; }
    .mag-ext-item-img { width: 38px; height: 38px; }
    .mag-ext-header { padding: 0.45rem 0.6rem; }
    .mag-ext-item { padding: 0.4rem 0.6rem; }
}
