/* =========================================================
   FMed Investiga — main stylesheet
   Paleta:
     --fmed-primary: #1e3a5f    (azul oscuro)
     --fmed-accent : #4361ee    (azul acento)
     --fmed-light  : #f4f6fb    (fondo)
     --fmed-border : #e2e6ef    (borde)
   ========================================================= */
:root {
    --fmed-primary: #1e3a5f;
    --fmed-primary-dark: #162a45;
    --fmed-primary-darker: #0f1e33;
    --fmed-accent: #4361ee;
    --fmed-accent-hover: #2f4dd8;
    --fmed-light: #f4f6fb;
    --fmed-border: #e2e6ef;
    --fmed-text: #1a2332;
    --fmed-muted: #6c7a94;
    --fmed-success: #10b981;
    --fmed-error: #ef4444;
    --fmed-warning: #f59e0b;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 30, 51, 0.06);
    --shadow: 0 4px 12px rgba(15, 30, 51, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 30, 51, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--fmed-light);
    color: var(--fmed-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--fmed-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--fmed-primary) 0%, var(--fmed-primary-darker) 100%);
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo {
    height: 32px;
    width: auto;
    display: block;
    background: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.brand-sub { font-size: 10px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.8px; }

@media (max-width: 600px) {
    .brand-logo { height: 28px; padding: 3px 6px; }
    .brand-title { font-size: 15px; }
    .brand-sub { display: none; }
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    opacity: 0.9;
    transition: all 0.15s ease;
}
.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    text-decoration: none;
}
.main-nav a.active {
    background: rgba(255, 255, 255, 0.14);
    opacity: 1;
}

/* ---------- Flash ---------- */
.flash {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--fmed-accent);
    background: #fff;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}
.flash-success { border-left-color: var(--fmed-success); }
.flash-error   { border-left-color: var(--fmed-error); }
.flash-warning { border-left-color: var(--fmed-warning); }

/* ---------- Hero / Search panel ---------- */
.hero {
    background: linear-gradient(135deg, var(--fmed-primary) 0%, var(--fmed-primary-dark) 100%);
    color: #fff;
    padding: 40px 0 32px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(67, 97, 238, 0.25), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(67, 97, 238, 0.15), transparent 40%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}
.hero p {
    font-size: 14px;
    opacity: 0.85;
    margin: 0 0 20px;
    max-width: 680px;
}

.search-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    color: var(--fmed-text);
    position: relative;
    z-index: 2;
}
.search-panel h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fmed-muted);
    margin: 0 0 16px;
}
.search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
}
.search-grid-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    margin-top: 12px;
    align-items: end;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--fmed-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field input,
.field select,
.field textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--fmed-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--fmed-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--fmed-accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}
.field textarea { min-height: 110px; resize: vertical; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-primary { background: var(--fmed-accent); color: #fff; }
.btn-primary:hover { background: var(--fmed-accent-hover); text-decoration: none; }
.btn-secondary {
    background: #fff;
    color: var(--fmed-primary);
    border-color: var(--fmed-border);
}
.btn-secondary:hover { border-color: var(--fmed-accent); color: var(--fmed-accent); text-decoration: none; }
.btn-danger { background: var(--fmed-error); color: #fff; }
.btn-danger:hover { background: #d93535; }
.btn-ghost { background: transparent; color: var(--fmed-primary); }
.btn-ghost:hover { background: var(--fmed-light); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Stat cards ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.stat-card .label {
    font-size: 12px;
    color: var(--fmed-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--fmed-primary);
    margin-top: 4px;
}

/* ---------- Sections ---------- */
section { padding: 32px 0; }
section h2.section-title {
    font-size: 20px;
    margin: 0 0 16px;
    color: var(--fmed-primary);
    font-weight: 700;
}

/* ---------- Publication cards / list ---------- */
.pub-list { display: flex; flex-direction: column; gap: 12px; }
.pub-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.pub-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pub-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--fmed-primary);
    line-height: 1.4;
}
.pub-card h3 a { color: inherit; }
.pub-meta {
    font-size: 13px;
    color: var(--fmed-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 6px;
}
.pub-meta span strong { color: var(--fmed-text); font-weight: 500; }
.pub-authors { font-size: 13px; color: #3c4a63; margin-top: 2px; }
.pub-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
    display: inline-block;
    background: var(--fmed-light);
    color: var(--fmed-primary);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    border: 1px solid var(--fmed-border);
}
.badge-accent { background: var(--fmed-accent); color: #fff; border-color: transparent; }

/* ---------- Table ---------- */
.table-wrap {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--fmed-muted);
    font-weight: 600;
    letter-spacing: 0.6px;
    background: var(--fmed-light);
    border-bottom: 1px solid var(--fmed-border);
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fmed-border);
    font-size: 14px;
    vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfe; }
.table .actions { white-space: nowrap; }

/* ---------- Forms (admin) ---------- */
.form-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--fmed-border);
}
.doi-lookup-row {
    display: flex;
    gap: 8px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--fmed-light);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--fmed-border);
}
.doi-lookup-row .field { flex: 1; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 24px 0;
}
.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--fmed-primary);
    font-weight: 500;
    font-size: 14px;
}
.pagination a:hover { border-color: var(--fmed-accent); text-decoration: none; }
.pagination .current {
    background: var(--fmed-accent);
    color: #fff;
    border-color: var(--fmed-accent);
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Detail ---------- */
.detail-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.detail-card h1 {
    color: var(--fmed-primary);
    font-size: 26px;
    margin: 0 0 8px;
    line-height: 1.35;
}
.detail-meta {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 20px;
    margin-top: 24px;
    font-size: 14px;
}
.detail-meta dt { color: var(--fmed-muted); font-weight: 600; }
.detail-meta dd { margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--fmed-primary-darker);
    color: #e2e6ef;
    margin-top: 64px;
    padding: 32px 0;
    font-size: 13px;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-meta { opacity: 0.7; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .search-grid { grid-template-columns: 1fr 1fr; }
    .search-grid-row2 { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 12px; }
    .main-nav { flex-wrap: wrap; justify-content: center; }
    .hero h1 { font-size: 24px; }
    .detail-meta { grid-template-columns: 1fr; gap: 4px 0; }
}

@media (max-width: 600px) {
    .search-grid, .search-grid-row2 { grid-template-columns: 1fr; }
    .container { padding: 0 16px; }
    .hero { padding: 32px 0 72px; }
}

/* ===========================================================
   Admin layout (sidebar + main)
   =========================================================== */
.admin-layout {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--fmed-light);
}

.admin-sidebar {
    background: linear-gradient(180deg, var(--fmed-primary) 0%, var(--fmed-primary-darker) 100%);
    color: #e9edf5;
    padding: 22px 16px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 8px rgba(15, 30, 51, 0.1);
}

.admin-brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff;
    text-decoration: none;
    padding: 4px 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 14px;
}
.admin-brand:hover { text-decoration: none; }
.admin-brand img {
    height: 32px;
    width: auto;
    background: #fff;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}
.admin-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.admin-brand strong { font-weight: 700; font-size: 15px; }
.admin-brand small { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.7px; }

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #d2d9e8;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}
.admin-nav a.active {
    background: var(--fmed-accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(67,97,238,0.3);
}
.admin-nav .ico {
    width: 18px;
    text-align: center;
    opacity: 0.85;
    font-size: 13px;
}
.admin-nav-sep {
    margin: 20px 8px 6px;
    font-size: 10px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    opacity: 0.55;
}

.admin-user {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.admin-user-info { display: flex; align-items: center; gap: 10px; }
.admin-user-avatar {
    width: 36px; height: 36px;
    background: var(--fmed-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    color: #fff;
}
.admin-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.admin-user-role { font-size: 11px; opacity: 0.6; }

.admin-main {
    padding: 24px 28px 48px;
    min-width: 0;
}
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fmed-border);
}
.admin-page-title {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--fmed-primary);
    font-weight: 700;
}
.admin-topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-flashes { margin-bottom: 16px; }
.admin-content { }

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
        padding: 14px;
    }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-nav a { flex: 1 1 auto; }
    .admin-nav-sep { flex-basis: 100%; margin: 8px 0 4px; }
    .admin-user { display: none; }
}

/* ===========================================================
   Login
   =========================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--fmed-primary) 0%, var(--fmed-primary-darker) 100%);
    padding: 20px;
    margin: 0;
}
.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    display: block;
    margin: 0 auto 20px;
    height: 44px;
}
.login-card h1 {
    color: var(--fmed-primary);
    font-size: 22px;
    margin: 0 0 4px;
    text-align: center;
}
.login-card .subtitle {
    text-align: center;
    color: var(--fmed-muted);
    font-size: 13px;
    margin: 0 0 24px;
}

/* ===========================================================
   Public portal: home / news / events
   =========================================================== */

/* ---------- Top search bar (investigations) ---------- */
.top-search {
    background: linear-gradient(135deg, var(--fmed-primary) 0%, var(--fmed-primary-dark) 100%);
    padding: 22px 0 18px;
    color: #fff;
}
.top-search-form { display: flex; flex-direction: column; gap: 8px; }
.top-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    padding: 4px 6px 4px 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.top-search-icon { color: var(--fmed-muted); flex-shrink: 0; }
.top-search-inner input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--fmed-text);
    outline: none;
    min-width: 0;
}
.top-search-inner .btn {
    border-radius: 999px;
    padding: 10px 22px;
    flex-shrink: 0;
}
.top-search-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.8;
    padding: 0 8px;
}
.top-search-meta a { color: #fff; border-bottom: 1px dotted rgba(255,255,255,0.5); }
.top-search-meta a:hover { text-decoration: none; opacity: 1; }

/* ---------- Featured article ---------- */
.featured { padding: 24px 0 0; }
.featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.featured-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.featured-img {
    background-size: cover;
    background-position: center;
    min-height: 380px;
    position: relative;
}
.featured-category {
    position: absolute;
    top: 18px; left: 18px;
    background: var(--fmed-accent);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.featured-body { padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.featured-label {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--fmed-accent);
    font-weight: 700;
    margin-bottom: 10px;
}
.featured-body h1 {
    font-size: 28px;
    margin: 0 0 10px;
    color: var(--fmed-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.featured-subtitle { color: var(--fmed-muted); font-size: 15px; margin: 0 0 16px; line-height: 1.5; }
.featured-meta { color: var(--fmed-muted); font-size: 13px; }

/* ---------- Category chips ---------- */
.category-strip {
    padding: 20px 0 12px;
    border-bottom: 1px solid var(--fmed-border);
    margin-bottom: 24px;
}
.category-strip .container { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
    display: inline-block;
    padding: 6px 14px;
    border: 1.5px solid var(--fmed-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fmed-primary);
    background: #fff;
    transition: all 0.15s ease;
}
.cat-chip:hover {
    background: var(--fmed-light);
    text-decoration: none;
    transform: translateY(-1px);
}
.cat-chip.active { background: var(--fmed-primary); color: #fff; border-color: var(--fmed-primary); }

/* ---------- Portal grid (main + sidebar) ---------- */
.portal-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    padding-bottom: 48px;
}
.portal-main { min-width: 0; }
.portal-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}
.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--fmed-accent);
}

/* ---------- News grid (cards) ---------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.news-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.news-card-link { display: block; color: inherit; height: 100%; }
.news-card-link:hover { text-decoration: none; }
.news-card-img {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    background-color: var(--fmed-light);
    position: relative;
}
.news-card-cat {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--fmed-accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.news-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card-body h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--fmed-primary);
    line-height: 1.35;
}
.news-card-body p {
    margin: 0;
    font-size: 13.5px;
    color: var(--fmed-muted);
    line-height: 1.5;
}
.news-card-meta {
    margin-top: auto;
    padding-top: 8px;
    font-size: 12px;
    color: var(--fmed-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--fmed-border);
}
.news-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.tag-pill {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--fmed-light);
    color: var(--fmed-primary);
    border-radius: 999px;
    font-weight: 500;
    border: 1px solid var(--fmed-border);
}
.tag-pill-link { transition: background 0.15s ease; }
.tag-pill-link:hover { background: var(--fmed-accent); color: #fff; text-decoration: none; border-color: var(--fmed-accent); }

/* ---------- Side cards (events, latest pubs) ---------- */
.side-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.side-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--fmed-border);
    background: var(--fmed-light);
}
.side-card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--fmed-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.side-card-head a {
    font-size: 12px;
    font-weight: 600;
    color: var(--fmed-accent);
}

/* ---------- Event list (sidebar) ---------- */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--fmed-border);
}
.event-item:last-child { border-bottom: none; }
.event-date {
    flex-shrink: 0;
    width: 52px;
    background: var(--fmed-primary);
    color: #fff;
    border-radius: 8px;
    text-align: center;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}
.event-month { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; opacity: 0.9; }
.event-day { font-size: 22px; font-weight: 700; }
.event-year { font-size: 10px; font-weight: 600; opacity: 0.8; margin-top: 2px; }
.event-body h4 { margin: 0 0 4px; font-size: 14px; color: var(--fmed-primary); font-weight: 600; line-height: 1.35; }
.event-body h4 a { color: inherit; }
.event-meta { font-size: 12px; color: var(--fmed-muted); }

/* ---------- Mini publication list ---------- */
.pub-mini-list { list-style: none; margin: 0; padding: 0; }
.pub-mini-list li {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fmed-border);
}
.pub-mini-list li:last-child { border-bottom: none; }
.pub-mini-list a {
    color: var(--fmed-primary);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.35;
    display: block;
}
.pub-mini-meta { font-size: 12px; color: var(--fmed-muted); margin-top: 4px; }

/* ---------- Page head (news archive / events) ---------- */
.page-head {
    background: linear-gradient(135deg, var(--fmed-primary) 0%, var(--fmed-primary-dark) 100%);
    color: #fff;
    padding: 36px 0 30px;
}
.page-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.4px; }
.page-head p { margin: 0 0 18px; opacity: 0.88; font-size: 15px; }
.inline-search { display: flex; gap: 8px; max-width: 520px; }
.inline-search input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

/* ---------- Event grid (full page) ---------- */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.event-card {
    background: #fff;
    border: 1px solid var(--fmed-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease;
}
.event-card:hover { box-shadow: var(--shadow); }
.event-card.past { opacity: 0.72; }
.event-card-date {
    flex-shrink: 0;
    width: 68px;
    background: linear-gradient(180deg, var(--fmed-primary), var(--fmed-primary-darker));
    color: #fff;
    border-radius: 8px;
    padding: 10px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.event-card-date .event-month { font-size: 11px; }
.event-card-date .event-day { font-size: 28px; }
.event-card-body { min-width: 0; }
.event-card-body h3 { margin: 0 0 6px; color: var(--fmed-primary); font-size: 16px; }
.event-card-body p { margin: 0 0 8px; color: var(--fmed-muted); font-size: 13.5px; }
.event-card-meta { font-size: 12px; color: var(--fmed-muted); }

/* ---------- Article detail page ---------- */
.article-hero {
    background-size: cover;
    background-position: center;
    min-height: 420px;
    position: relative;
    color: #fff;
    display: flex;
    align-items: flex-end;
}
.article-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,30,51,0.1) 0%, rgba(15,30,51,0.85) 100%);
}
.article-hero-inner { position: relative; z-index: 1; padding: 48px 24px 40px; }
.article-hero h1 {
    font-size: 36px;
    margin: 10px 0 12px;
    letter-spacing: -0.6px;
    line-height: 1.15;
    max-width: 880px;
}
.article-subtitle { font-size: 18px; opacity: 0.92; margin: 0 0 14px; max-width: 780px; }
.article-meta { font-size: 14px; opacity: 0.85; }

.article-header { padding: 32px 24px 16px; }
.article-header h1 { font-size: 32px; margin: 10px 0 8px; color: var(--fmed-primary); }

.article-body {
    padding: 40px 0 32px;
    max-width: 820px;
    font-size: 16.5px;
    line-height: 1.72;
    color: #1a2332;
}
.article-body h2, .article-body h3 { color: var(--fmed-primary); margin-top: 28px; }
.article-body p { margin: 0 0 18px; }
.article-body a { color: var(--fmed-accent); text-decoration: underline; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 28px;
    margin-top: 32px;
    border-top: 1px solid var(--fmed-border);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-img { min-height: 240px; }
    .featured-body { padding: 24px 20px; }
    .featured-body h1 { font-size: 22px; }
    .portal-grid { grid-template-columns: 1fr; gap: 32px; }
    .article-hero { min-height: 280px; }
    .article-hero h1 { font-size: 26px; }
}

@media (max-width: 600px) {
    .top-search-inner { padding: 4px; border-radius: 8px; flex-wrap: wrap; }
    .top-search-icon { margin-left: 10px; }
    .top-search-inner input { width: 100%; padding: 10px; }
    .top-search-inner .btn { width: 100%; border-radius: 6px; }
    .top-search-meta { flex-direction: column; gap: 4px; }
}

/* ---------- Utils ---------- */
.muted { color: var(--fmed-muted); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.text-small { font-size: 13px; }
