/* ===================================================
   MRC MainNew — Modern Design System
   =================================================== */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    background: #f0f2f5;
}

a { text-decoration: none; color: inherit; }

/* ===== Brand Bar ===== */
.brand-bar {
    background: #fff url('/images/ibar_bg.png') repeat-x left center;
    border-bottom: 1px solid #e8e8e8;
    height: 100px;
}
.brand-bar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 36px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.brand-bar img { height: 70px; vertical-align: middle; }

.brand-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 3em;
    font-weight: bold;
    font-family: 'TYPOGRAPH_BOLD', 'Inter', 'Droid Sans', sans-serif;
    color: #B34C4C;
    pointer-events: none;
}

.brand-right { margin-left: auto; }

/* ===================================================
   NAVBAR — Dark glassmorphism sticky nav
   =================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 30, 0.93);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: center;
}

.nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-item { position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 16px 16px;
    color: rgba(255,255,255,0.75);
    font-size: 0.88em;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
    position: relative;
    white-space: nowrap;
}

/* Animated gradient underline */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 10px; left: 16px; right: 16px;
    height: 2px;
    background: linear-gradient(90deg, #e63946, #f4a261);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-item:hover .nav-link { color: #fff; }
.nav-item:hover .nav-link::after { transform: scaleX(1); }
.nav-link.active { color: #fff; }
.nav-link.active::after { transform: scaleX(1); }

/* Navbar scrolled state */
.navbar.scrolled {
    background: rgba(10, 10, 20, 0.98);
    box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

/* Dropdown open class (JS-driven, for touch/mobile) */
.has-dropdown.open .dropdown-panel { display: block; }

/* Chevron */
.chevron {
    font-size: 1.1em;
    display: inline-block;
    transition: transform 0.25s ease;
    color: rgba(255,255,255,0.4);
}

.nav-item:hover .chevron {
    transform: rotate(180deg);
    color: #f4a261;
}

/* ===================================================
   DROPDOWN PANEL
   =================================================== */
.dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);
    min-width: 240px;
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.07);
    animation: dropFadeIn 0.18s ease forwards;
}

.dropdown-panel::before {
    content: '';
    position: absolute;
    top: -6px; left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #fff;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.06));
}

@keyframes dropFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-item:hover .dropdown-panel { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #2d2d2d;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #fff0f0, #fff8f2);
    color: #e63946;
}

.dropdown-icon {
    font-size: 1.3em;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.dropdown-item:hover .dropdown-icon { background: #ffe0e0; }

.dropdown-item span:last-child {
    display: flex; flex-direction: column; line-height: 1.3;
}

.dropdown-item strong { font-size: 0.88em; font-weight: 600; }
.dropdown-item small  { font-size: 0.76em; color: #888; margin-top: 1px; }
.dropdown-item:hover small { color: #c0665f; }

/* ===================================================
   PAGE CONTAINER
   =================================================== */
.page-container {
    max-width: 1140px;
    margin: 30px auto;
    padding: 30px 36px 36px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    min-height: 500px;
    overflow-x: hidden;
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: rgba(255,255,255,0.6);
    padding: 22px 40px;
    text-align: center;
    font-size: 0.88em;
    margin-top: 30px;
    letter-spacing: 0.3px;
}

.site-footer a { color: #f4a261; font-weight: 600; transition: color 0.2s; }
.site-footer a:hover { color: #fff; }
.footer-sep { margin: 0 12px; opacity: 0.4; }

/* ===================================================
   CONTENT COMPONENTS
   =================================================== */

.paper { padding: 10px 6px; font-size: 16px; }

.paper h2 {
    color: #C23C33;
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 14px;
    border-bottom: 3px solid #e63946;
    padding-bottom: 10px;
    display: inline-block;
}

.text { line-height: 1.4; color: #333; text-align: justify; letter-spacing: 0.05em; overflow: hidden; }
.content-text { font-size: 16px; line-height: 1.4; color: #333; text-align: justify; letter-spacing: 0.05em; }
.text img, .content-text img { max-width: 100%; height: auto; }
.text table, .content-text table { max-width: 100%; table-layout: fixed; word-wrap: break-word; }
.news-item-body { overflow: hidden; max-width: 100%; }
.news-item-body * { max-width: 100% !important; box-sizing: border-box !important; }
.news-item-body img { height: auto !important; }
.news-item-body div, .news-item-body p, .news-item-body span, .news-item-body table { width: auto !important; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: #fff !important;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(230,57,70,0.35);
}

.btn-download:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== FABA Journal Header ===== */
.faba-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid #f0f0f4;
    position: relative;
}
.faba-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 36px;
    height: 2px;
    background: #C23C33;
}
.faba-logo {
    max-width: 320px;
    height: auto;
}

/* ===== Page Title ===== */
.page-title {
    font-size: 1.45em;
    font-weight: 700;
    color: #C23C33;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f4;
    position: relative;
    letter-spacing: -0.2px;
}
.page-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 36px;
    height: 2px;
    background: #C23C33;
}

/* ===== External Link Card ===== */
.ext-link-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #e2e2e8;
    border-radius: 10px;
    color: #C23C33;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.ext-link-card:hover {
    background: #fdecea;
    border-color: #C23C33;
    box-shadow: 0 4px 14px rgba(194,60,51,0.18);
    transform: translateY(-1px);
    color: #a02c24;
}
.ext-link-card__icon {
    flex-shrink: 0;
    opacity: 0.8;
}

/* Compact inline variant — for PDF/file links inside lists */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: #fff;
    border: 1.5px solid #e2e2e8;
    border-radius: 6px;
    color: #C23C33;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    vertical-align: middle;
}
.btn-pdf:hover {
    background: #fdecea;
    border-color: #C23C33;
    box-shadow: 0 2px 8px rgba(194,60,51,0.15);
    color: #a02c24;
}

/* Author link */
.author-link {
    color: #C23C33;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(194,60,51,0.3);
    transition: border-color 0.2s, color 0.2s;
    margin-right: 4px;
}
.author-link:hover {
    color: #a02c24;
    border-bottom-color: #a02c24;
}

/* Back navigation link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #C23C33;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: gap 0.2s, color 0.2s;
}
.back-link:hover {
    color: #a02c24;
    gap: 10px;
}
.back-link__arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.back-link:hover .back-link__arrow {
    transform: translateX(-4px);
}

/* ===================================================
   HAMBURGER BUTTON
   =================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: auto;
    z-index: 1100;
}
.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================
   RESPONSIVE — TABLET (≤900px)
   =================================================== */
@media (max-width: 900px) {
    .brand-title { font-size: 2em; padding: 0 120px; }
    .brand-bar { height: 80px; }
    .brand-bar img { height: 55px; }

    .page-container { padding: 20px 20px 28px; margin: 16px 12px; border-radius: 8px; }

    /* sidebar layouts — stack vertically */
    .two-col, .layout-with-sidebar, [class*="layout"] {
        flex-direction: column !important;
    }
    .sidebar, .left-sidebar, .right-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e8e8e8;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }
    .main-content, .content-area {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===================================================
   RESPONSIVE — MOBILE (≤640px)
   =================================================== */
@media (max-width: 640px) {
    /* Brand bar */
    .brand-bar { height: auto; padding: 8px 0 6px; }
    .brand-bar-inner {
        padding: 0 12px;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        position: static;
    }
    .brand-logo { display: flex; justify-content: center; }
    .brand-bar img { height: 40px; }
    .brand-title {
        position: static;
        font-size: 1.15em;
        text-align: center;
        padding: 0 8px;
        pointer-events: none;
    }
    .brand-right { display: none; }

    /* Hamburger */
    .hamburger { display: flex; }

    /* Nav: hidden by default, slides down when open */
    .navbar-inner { padding: 0 14px; justify-content: flex-start; }
    .nav-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        background: rgba(15,15,30,0.97);
        padding: 8px 0 14px;
    }
    .nav-list.open { display: flex; }

    .nav-link {
        padding: 13px 20px;
        font-size: 0.92em;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    /* Dropdown panel in mobile: static, full-width */
    .dropdown-panel {
        display: none;
        position: static;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        border: none;
        background: rgba(255,255,255,0.05);
        padding: 0;
        animation: none;
        min-width: 0;
        width: 100%;
    }
    .dropdown-panel::before { display: none; }
    .has-dropdown.open .dropdown-panel { display: block; }
    .nav-item:hover .dropdown-panel { display: none; }
    .has-dropdown.open .dropdown-panel { display: block; }

    .dropdown-item {
        padding: 10px 28px;
        border-radius: 0;
        color: rgba(255,255,255,0.75);
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .dropdown-item:hover { background: rgba(255,255,255,0.08); color: #f4a261; }
    .dropdown-icon { background: rgba(255,255,255,0.08); }

    /* Page container */
    .page-container { padding: 14px 14px 20px; margin: 10px 8px; border-radius: 6px; }

    /* Sidebar sections stacked */
    .two-col, .layout-with-sidebar, [class*="layout"] {
        flex-direction: column !important;
    }
    .sidebar, .left-sidebar, .right-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e8e8e8;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    /* News panel on data page */
    .news-panel { width: 100% !important; margin-top: 16px; }

    /* Tables scroll */
    table { display: block; overflow-x: auto; }

    /* Fellow cards */
    .fellow-card { width: 100% !important; }

    /* Alpha filter wrap */
    .alpha-filter { flex-wrap: wrap; gap: 4px; }

    /* Page title */
    .page-title { font-size: 1.2em; }

    /* Footer */
    .site-footer { padding: 16px 16px; font-size: 0.82em; }
}


/* Pager */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 24px;
    padding-top: 16px;
}
.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e6;
    background: #fff;
    color: #444;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pager-btn:hover {
    border-color: #C23C33;
    color: #C23C33;
    background: #fff8f7;
}
.pager-btn.active {
    background: #C23C33;
    border-color: #C23C33;
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

/* Year filter */
.year-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f4;
}

