@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,700;0,800;0,900;1,700;1,800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --navy: #071833;
    --ink: #0f2445;
    --gold: #d6a843;
    --softgold: #f4e2b5;
    --gold-rgb: 214, 168, 67;
    --navy-rgb: 7, 24, 51;
    color-scheme: light;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* ===== Typography — Playfair headings ===== */
.font-playfair {
    font-family: 'Playfair Display', Georgia, serif;
}

.headline-playfair h1,
.headline-playfair h2 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ===== Keyframe Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--gold-rgb), 0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(var(--gold-rgb), 0); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes progressBar {
    from { width: 0; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Animation Utilities ===== */
.animate-fade-in-up { animation: fadeInUp 0.6s ease both; }
.animate-fade-in    { animation: fadeIn 0.5s ease both; }
.animate-scale-in   { animation: scaleIn 0.4s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

/* ===== Breaking News Ticker ===== */
.ticker-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.ticker-inner {
    display: inline-block;
    animation: ticker 30s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }

/* ===== Reading Progress Bar ===== */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), #f4c842);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ===== Cards ===== */
.orbit-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.orbit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(var(--navy-rgb), 0.13);
    border-color: rgba(var(--gold-rgb), 0.4) !important;
}
.orbit-card img {
    transition: transform 0.4s ease;
}
.orbit-card:hover img {
    transform: scale(1.04);
}

/* ===== Gold Rule ===== */
.gold-rule {
    background: linear-gradient(90deg, var(--gold), rgba(214,168,67,0));
}
.gold-rule-full {
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ===== Section Headings ===== */
.section-label {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
}

/* ===== News Body (Article Content) ===== */
.news-body {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.875;
}
.news-body p {
    margin-bottom: 1.25rem;
}
.news-body h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin: 2.25rem 0 0.85rem;
    line-height: 1.3;
}
.news-body h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin: 1.75rem 0 0.65rem;
}
.news-body blockquote {
    border-left: 4px solid var(--gold);
    background: rgba(var(--gold-rgb), 0.07);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--ink);
}
.news-body a {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: rgba(var(--gold-rgb), 0.5);
}
.news-body a:hover {
    color: var(--gold);
}
.news-body ul, .news-body ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}
.news-body li { margin-bottom: 0.4rem; }
.news-body strong { color: var(--navy); font-weight: 700; }
.news-body img {
    border-radius: 8px;
    max-width: 100%;
    margin: 1.5rem auto;
    display: block;
}

/* First paragraph dropcap */
.news-body > p:first-child::first-letter {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 900;
    float: left;
    line-height: 0.8;
    margin-right: 0.15em;
    margin-top: 0.1em;
    color: var(--navy);
}

/* ===== Author Box ===== */
.author-box {
    background: linear-gradient(135deg, rgba(var(--navy-rgb), 0.04), rgba(var(--gold-rgb), 0.06));
    border: 1px solid rgba(var(--gold-rgb), 0.25);
    border-radius: 12px;
    padding: 1.5rem;
}
.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--ink));
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold);
    flex-shrink: 0;
}

/* ===== Share Buttons ===== */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1.5px solid;
    transition: all 0.2s ease;
    cursor: pointer;
}
.share-btn:hover { transform: translateY(-2px); }
.share-btn-wa  { color: #16a34a; border-color: #16a34a; }
.share-btn-wa:hover  { background: #16a34a; color: #fff; }
.share-btn-tw  { color: #0f172a; border-color: #0f172a; }
.share-btn-tw:hover  { background: #0f172a; color: #fff; }
.share-btn-fb  { color: #1d4ed8; border-color: #1d4ed8; }
.share-btn-fb:hover  { background: #1d4ed8; color: #fff; }
.share-btn-copy { color: var(--navy); border-color: var(--gold); }
.share-btn-copy:hover { background: var(--gold); color: var(--navy); }

/* ===== Stat Cards (Admin) ===== */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(var(--navy-rgb), 0.12);
}

/* ===== Admin Sidebar ===== */
[data-admin-sidebar] {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-admin-sidebar] nav a {
    transition: all 0.15s ease;
}

/* ===== Hero Gradient ===== */
.hero-gradient {
    background-color: var(--navy);
    background-image: linear-gradient(135deg, var(--navy) 0%, #0c2d5c 50%, #071833 100%);
}
.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(214,168,67,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(214,168,67,0.05) 0%, transparent 40%),
        linear-gradient(135deg, var(--navy) 0%, #0c2d5c 50%, #071833 100%);
}

/* ===== Pagination ===== */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.15s ease;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    background: #fff;
}
.page-btn:hover { border-color: var(--gold); color: var(--navy); }
.page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-btn:disabled, .page-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* ===== Keyword Highlight ===== */
.search-highlight {
    background: rgba(var(--gold-rgb), 0.3);
    color: var(--navy);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

/* ===== Tags / Badges ===== */
.badge-pub   { background:#d1fae5; color:#065f46; }
.badge-draft { background:#fef3c7; color:#92400e; }

/* ===== Back to Top ===== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(var(--navy-rgb), 0.35);
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    border: none;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover {
    background: var(--gold);
    color: var(--navy);
    transform: translateY(-2px);
}

/* ===== Login Page ===== */
.login-brand-bg {
    background: linear-gradient(160deg, var(--navy) 0%, #0c2d5c 60%, #0a2040 100%);
}
.login-brand-dots {
    background-image: radial-gradient(rgba(214,168,67,0.15) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ===== DataTables Override ===== */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--gold);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    padding: 0.35rem 0.75rem !important;
    margin: 0 2px;
    font-weight: 700;
    font-size: 0.8125rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--navy) !important;
    border-color: var(--navy) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    background: rgba(var(--gold-rgb),0.15) !important;
    border-color: var(--gold) !important;
    color: var(--navy) !important;
}
.dataTables_wrapper .dataTables_info { font-size: 0.8125rem; color: #64748b; }

/* ===== Summernote Override ===== */
.note-editor.note-frame {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden;
}
.note-editor.note-frame:focus-within {
    border-color: var(--gold) !important;
}
.note-toolbar { background: #f8fafc !important; border-bottom: 1px solid #e2e8f0 !important; }

/* ===== Category Icon Colors ===== */
.cat-icon-politik    { background: rgba(220,38,38,0.1); color: #dc2626; }
.cat-icon-ekonomi    { background: rgba(5,150,105,0.1); color: #059669; }
.cat-icon-teknologi  { background: rgba(37,99,235,0.1); color: #2563eb; }
.cat-icon-pendidikan { background: rgba(124,58,237,0.1); color: #7c3aed; }
.cat-icon-olahraga   { background: rgba(234,88,12,0.1); color: #ea580c; }
.cat-icon-nasional   { background: rgba(var(--gold-rgb),0.12); color: #92400e; }
.cat-icon-default    { background: rgba(var(--navy-rgb),0.08); color: var(--navy); }

/* ===== Sticky Sidebar ===== */
.sticky-sidebar { position: sticky; top: 5.5rem; }

/* ===== Image Preview ===== */
#image-preview-wrapper { transition: all 0.3s ease; }

/* ===== Print ===== */
@media print {
    header, footer, #back-to-top, #reading-progress,
    .share-section, .comment-form-section, .related-section { display: none !important; }
    .news-body { font-size: 12pt; line-height: 1.7; color: #000; }
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 640px) {
    .news-body > p:first-child::first-letter {
        font-size: 2.5rem;
    }
    .ticker-inner { animation-duration: 20s; }
}
