/* --- VARIABLES --- */
:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db; /* gray-300 */
    --text-muted: #9ca3af;     /* gray-400 */
    --accent-red: #dc2626;
    --accent-blue: #2563eb;
    --glass-bg: rgba(15, 15, 20, 0.8);
    --border-color: #1f2937;   /* gray-800 */
    --card-hover-border: #4b5563;
}

/* --- RESET & BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    /* Grid Pattern Background */
    background-image: linear-gradient(rgba(20, 20, 20, 0.5) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(20, 20, 20, 0.5) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

h1, h2, h3, h4, .font-racing {
    font-family: 'Teko', sans-serif;
    text-transform: uppercase;
    line-height: 1.1;
}

/* --- LAYOUT --- */
.container {
    width: 100%;
    max-width: 72rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
        gap: 2rem;
    }
}

/* --- GLASSMORPHISM COMPONENT --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.15);
    transition: all 0.5s ease;
}

@media (min-width: 768px) {
    .glass-panel {
        border-radius: 2rem;
    }
}

.glass-panel:hover {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.3);
}

/* Decorative Top Line */
.top-accent {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.top-accent.blue {
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.top-accent.green {
    background: linear-gradient(90deg, transparent, #10b981, transparent);
}

/* --- HEADER --- */
.site-header {
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    background: var(--glass-bg);
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.15);
    overflow: hidden;
    position: relative;
    padding-bottom: 1rem;
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-header .top-accent {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
}

.banner-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
    transition: opacity 0.3s;
}

.banner-img:hover {
    opacity: 0.9;
}

@media (min-width: 640px) { .banner-img { max-width: 380px; } }
@media (min-width: 768px) { 
    .banner-img { max-width: 580px; margin-bottom: 1rem; } 
    .site-header { padding: 2.5rem 1.5rem; }
}

.header-tagline {
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    display: inline-block;
}

@media (min-width: 768px) {
    .header-tagline {
        font-size: 1rem;
        letter-spacing: 0.2em;
        padding-top: 1rem;
    }
}

/* Navigation under logo */
.site-header nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.site-header nav a {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    position: relative;
    transition: color 0.3s ease;
}

.site-header nav a:hover {
    color: var(--text-primary);
}

.site-header nav a.active {
    color: var(--accent-red);
}

/* --- GRID CARDS (F1 & MotoGP) --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

.race-card {
    padding: 1.5rem;
    display: block;
    position: relative;
    transform: translateY(0);
    transition: all 0.3s;
}

@media (min-width: 768px) { .race-card { padding: 2rem; } }

.race-card:hover {
    background: linear-gradient(to bottom, #111827, #000);
    transform: translateY(-4px);
}

.race-card.f1:hover { border-color: var(--accent-red); box-shadow: 0 10px 40px rgba(220, 38, 38, 0.2); }
.race-card.motogp:hover { border-color: var(--accent-blue); box-shadow: 0 10px 40px rgba(37, 99, 235, 0.2); }

/* --- NEW: LATEST UPDATES SECTION (WIDGET STYLE) --- */
.latest-updates {
    margin-top: 1.5rem;
    width: 100%;
    background: #080808; 
    border: 1px solid #333;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.race-card:hover .latest-updates {
    border-color: #555;
}

.update-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.update-label.red { 
    color: var(--accent-red); 
}

.update-label.blue { 
    color: var(--accent-blue); 
}

.update-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.update-list li {
    font-size: 0.8rem;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .update-label { font-size: 0.8rem; }
    .update-list li { font-size: 0.9rem; }
}

/* External Icon */
.icon-corner {
    position: absolute;
    top: 1rem; right: 1rem;
    color: var(--text-muted);
}
.race-card.f1:hover .icon-corner { color: var(--accent-red); }
.race-card.motogp:hover .icon-corner { color: var(--accent-blue); }

/* Card Content */
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 1rem;
}

.logo-wrapper {
    padding: 0.75rem;
    background: white;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    margin-bottom: 1rem;
}

@media (min-width: 768px) { .logo-wrapper { padding: 1rem; } }

.race-card.f1:hover .logo-wrapper { border-color: var(--accent-red); box-shadow: 0 0 20px rgba(220, 38, 38, 0.4); }
.race-card.motogp:hover .logo-wrapper { border-color: var(--accent-blue); box-shadow: 0 0 20px rgba(37, 99, 235, 0.4); }

.logo-icon {
    width: 4rem; height: 4rem; object-fit: contain; display: block;
}
@media (min-width: 768px) { .logo-icon { width: 5rem; height: 5rem; } }

.card-title {
    font-size: 2.25rem; font-weight: bold; color: #f3f4f6; margin: 0;
    transition: color 0.3s;
}
.race-card:hover .card-title { color: white; }
@media (min-width: 768px) { .card-title { font-size: 3rem; } }

.card-desc {
    font-size: 0.75rem; color: var(--text-secondary); margin: 0.5rem 0;
    transition: color 0.3s;
}
.race-card:hover .card-desc { color: var(--text-secondary); }
@media (min-width: 768px) { .card-desc { font-size: 0.875rem; margin: 1rem 0; } }

/* CTA Button */
.btn-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.5);
    font-weight: bold; font-size: 0.625rem; letter-spacing: 0.05em;
    transition: 0.3s;
    margin-top: 0.5rem;
}
@media (min-width: 768px) { .btn-cta { font-size: 0.75rem; padding: 0.5rem 1.5rem; margin-top: 1rem; } }

.f1 .btn-cta { color: var(--accent-red); }
.f1:hover .btn-cta { background: var(--accent-red); color: white; border-color: var(--accent-red); }

.motogp .btn-cta { color: var(--accent-blue); }
.motogp:hover .btn-cta { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }

/* --- UPDATED: POST LIST VIEW (Title Only) --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.post-card-list {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 1rem 1.5rem;
    min-height: auto;
}

.post-card-list:hover {
    border-color: var(--accent-red);
    background: rgba(220, 38, 38, 0.05);
    transform: translateX(4px);
}

/* Body khusus teks */
.post-body-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-title-list {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
}

@media (min-width: 768px) {
    .post-title-list { font-size: 1.125rem; }
}

.post-date-list {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading State */
.loading-container {
    width: 100%;
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: monospace;
}

/* --- ARTICLE SECTION --- */
.article-box {
    padding: 1.5rem;
}
@media (min-width: 768px) { .article-box { padding: 2.5rem; } }

.article-head {
    display: flex; align-items: center; gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem; margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .article-head { gap: 1rem; padding-bottom: 1.5rem; margin-bottom: 2rem; } }

.icon-circle {
    padding: 0.5rem; background: rgba(220, 38, 38, 0.1); border-radius: 9999px; display: flex;
}
@media (min-width: 768px) { .icon-circle { padding: 0.75rem; } }

.article-title-main {
    font-size: 1.25rem; font-weight: bold; color: white; margin: 0;
}
.article-subtitle-main {
    font-size: 0.625rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; display: block;
}
@media (min-width: 768px) {
    .article-title-main { font-size: 1.5rem; }
    .article-subtitle-main { font-size: 0.75rem; }
}

/* Typography Content */
.prose p {
    font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6;
}
@media (min-width: 768px) { .prose p { font-size: 1rem; margin-bottom: 1.5rem; } }

.prose strong { color: white; }
.prose em { font-style: italic; }

.section-title {
    font-size: 1.125rem; font-weight: bold; color: white;
    margin: 1.5rem 0 0.75rem 0;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-red);
}
.section-title.blue { border-color: var(--accent-blue); }
@media (min-width: 768px) { .section-title { font-size: 1.25rem; margin: 2rem 0 1rem 0; } }

.feature-list {
    padding-left: 1.25rem; list-style: disc; margin-bottom: 1.5rem; color: var(--text-secondary); font-size: 0.875rem;
}
@media (min-width: 768px) { .feature-list { font-size: 1rem; } }
.feature-list li { margin-bottom: 0.5rem; }
.feature-list li::marker { color: var(--accent-red); }

/* Feature Grid */
.feature-grid {
    display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }

.feature-item {
    background: rgba(0,0,0,0.4); border: 1px solid var(--border-color);
    border-radius: 0.75rem; padding: 1.25rem; transition: border-color 0.3s;
}
.feature-item:hover { border-color: var(--card-hover-border); }

.feature-name {
    font-weight: bold; color: white; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; font-size: 0.875rem;
}
@media (min-width: 768px) { .feature-name { font-size: 1rem; } }

.feature-desc { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

.disclaimer {
    font-size: 0.625rem; color: var(--text-muted); text-align: center;
    border-top: 1px solid var(--border-color); padding-top: 1rem; margin-top: 2rem;
}
@media (min-width: 768px) { .disclaimer { font-size: 0.75rem; } }

/* --- FOOTER --- */
.site-footer {
    text-align: center; color: var(--text-muted); font-size: 0.75rem;
    padding: 1.5rem 0; border-top: 1px solid rgba(17, 24, 39, 0.5);
    width: 100%;
}

.footer-nav {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
    margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.625rem;
}
@media (min-width: 768px) { .footer-nav { font-size: 0.75rem; gap: 1.5rem; margin-bottom: 1.5rem; } }

.footer-nav a:hover { color: white; }

.social-links {
    display: flex; justify-content: center; gap: 1rem; margin-bottom: 1rem;
}

.social-btn {
    padding: 0.5rem; background: black; border-radius: 0.5rem;
    border: 1px solid var(--border-color); color: inherit;
    display: inline-flex; transition: 0.3s;
}
.social-btn:hover { border-color: white; color: white; }
.social-btn.fb:hover { border-color: #1877F2; color: #1877F2; box-shadow: 0 0 15px rgba(24, 119, 242, 0.3); }
.social-btn.x:hover { border-color: white; background: #111; box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); }
.social-btn.discord:hover { border-color: #5865F2; color: #5865F2; box-shadow: 0 0 15px rgba(88, 101, 242, 0.3); }
.social-btn.telegram:hover { border-color: #0088cc; color: #0088cc; box-shadow: 0 0 15px rgba(0, 136, 204, 0.3); }

/* --- UTILITIES --- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }

/* ========================================================= */
/* === TIMER FEATURE CSS (ADDED TO BOTTOM) === */
/* ========================================================= */
.countdown-wrapper {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-align: center;
}

.next-race-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.next-race-name {
    color: var(--text-primary);
    font-weight: bold;
}

.timer-display {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.time-unit {
    min-width: 40px;
}

.time-sep {
    color: var(--text-muted);
    font-size: 2rem;
    margin-top: -0.5rem;
}

.unit-label {
    font-size: 0.7rem;
    display: block;
    line-height: 1;
    margin-top: 0.25rem;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* F1 Specific Timer Colors */
.f1 .unit-label { color: var(--accent-red); }

/* MotoGP Specific Timer Colors */
.motogp .unit-label { color: var(--accent-blue); }