/* Custom CSS for Thetic Theme v2.0 - Exact Match detik.com */

/* Additional styling to perfect the match */

/* Ensure proper spacing and layout */
body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* Fix any layout issues */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Enhanced featured grid styling */
.featured-grid article {
    transition: transform 0.2s ease;
}

.featured-grid article:hover {
    transform: translateY(-2px);
}

/* News feed enhancements */
.news-feed {
    background: transparent;
}

.news-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Sidebar enhancements */
.sidebar-widget {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    color: #111827;
}

/* Link styling */
a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #dc2626;
}

/* Button styling */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #dc2626;
    color: white;
}

.btn-primary:hover {
    background: #b91c1c;
    color: white;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Clear floats */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Loading animation for AJAX */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Print styles */
/* Footer Styles */
.main-footer {
    background: #1a1a1a;
    color: #ffffff;
    padding: 40px 0 20px;
    margin-top: 40px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Header: left-align main menu */
.nav-wrapper {
    justify-content: flex-start;
}

.main-menu {
    justify-content: flex-start;
}

/* Blue header: small site name/logo */
.top-header-left {
    display: flex;
    align-items: center;
}

.topbar-mini-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    margin-left: 12px;
    white-space: nowrap;
}

.topbar-mini-logo .thetic-text {
    color: #dc2626;
    font-weight: 700;
}

.topbar-mini-logo .news-text {
    color: #ffffff;
    font-weight: 600;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #dc2626;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 15px;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 8px;
    display: inline-block;
}

.footer-desc {
    color: #cccccc;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #cccccc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #dc2626;
}

/* Quick Links arrow bullets */
.footer-quick-links .footer-links li {
    position: relative;
    padding-left: 14px;
}

.footer-quick-links .footer-links li::before {
    content: "›";
    position: absolute;
    left: 0;
    top: 0;
    color: #999999;
    line-height: 1.7;
}

.social-media {
    display: flex;
    gap: 10px;
}

.social-media a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #333333;
    color: #ffffff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-media a:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #333333;
    background: #2a2a2a;
    color: #ffffff;
    border-radius: 4px 0 0 4px;
}

.newsletter-form input::placeholder {
    color: #999999;
}

.newsletter-form button {
    padding: 10px 15px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background: #b91c1c;
}

/* Footer newsletter (stacked fields) */
.main-footer .footer-newsletter .newsletter-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.main-footer .footer-newsletter .newsletter-form input,
.main-footer .footer-newsletter .newsletter-form button {
    width: 100%;
    box-sizing: border-box;
}

.main-footer .footer-newsletter .newsletter-form input {
    flex: none;
    border-radius: 4px;
    margin: 0;
}

.main-footer .footer-newsletter .newsletter-form button {
    flex: none;
    border-radius: 4px;
}

.footer-bottom {
    border-top: 1px solid #333333;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    color: #999999;
    font-size: 14px;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: #999999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: #dc2626;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
}

@media print {
    .top-header-bar,
    .main-navigation,
    .header-ad-banner,
    .main-sidebar,
    .main-footer {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}

/* ============================================================
   THETIC ENHANCEMENTS
   ============================================================ */

/* Logo image (SVG file or custom logo upload) */
.main-logo img,
.main-logo .custom-logo,
.thetic-logo-img {
    max-height: 50px;
    height: 50px;
    width: auto;
    display: block;
}

/* Skip link */
.thetic-skip-link {
    position: absolute;
    left: -9999px;
    top: 6px;
    z-index: 99999;
    background: #dc2626;
    color: #fff;
    padding: 8px 18px;
    border-radius: 0 0 4px 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.thetic-skip-link:focus {
    left: 6px;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Image hover zoom on cards */
.featured-main img,
.featured-small img,
.featured-large img,
.news-image img,
.related-image img {
    transition: transform .35s ease;
}
.featured-main:hover img,
.featured-small:hover img,
.featured-large:hover img,
.news-item:hover .news-image img,
.related-item:hover .related-image img {
    transform: scale(1.04);
}
.featured-main,
.featured-small,
.featured-large,
.news-image {
    overflow: hidden;
}

/* Copy-link copied state */
.save-btn.copied {
    background: #16a34a !important;
    color: #fff !important;
}

/* Article blockquote */
.article-content blockquote {
    border-left: 4px solid #dc2626;
    margin: 1.5em 0;
    padding: .75em 1.25em;
    background: #fef2f2;
    font-style: italic;
    color: #555;
}

/* Article heading hierarchy */
.article-content h2 { font-size: 1.5rem; margin: 1.4em 0 .5em; }
.article-content h3 { font-size: 1.25rem; margin: 1.2em 0 .4em; }
.article-content p  { line-height: 1.8; margin-bottom: 1em; }

/* Footer nav */
.footer-nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0 0 12px;
}
.footer-nav-menu a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 13px;
}
.footer-nav-menu a:hover { color: #fff; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background: #111;
        color: #e5e7eb;
    }
    .site-wrapper,
    .single-post-main,
    .main-content {
        background: #111;
    }
    .logo-header {
        background: #1a1a1a;
        border-color: #2d2d2d;
    }
    .article-content,
    .single-article {
        background: #1a1a1a;
        color: #e5e7eb;
    }
    .article-content a { color: #fca5a5; }
    .article-content blockquote {
        background: #1f1f1f;
        color: #9ca3af;
        border-left-color: #dc2626;
    }
    .news-item,
    .related-item {
        background: #1a1a1a;
    }
    .news-title a,
    .related-item h4 a {
        color: #f9fafb;
    }
    .footer-bottom,
    .main-footer {
        background: #0b0b0b;
    }
    .breadcrumb-wrapper {
        background: #1f1f1f;
    }
    .breadcrumb,
    .breadcrumb a {
        color: #9ca3af;
    }
    .widget-title,
    .footer-widget-title {
        color: #f9fafb;
    }
}

/* ============================================================
   NAV OVERFLOW — "More ▼" dropdown for overflowing menu items
   ============================================================ */
.nav-wrapper {
    overflow: hidden;
    position: relative;
}

.nav-more-item {
    flex-shrink: 0;
    position: relative;
    list-style: none;
}

.nav-more-item > a.nav-more-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    color: white !important;
    padding: 12px 18px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    background: rgba(0,0,0,.15) !important;
    transition: background .2s !important;
    text-decoration: none !important;
}

.nav-more-item > a.nav-more-toggle:hover {
    background: rgba(0,0,0,.28) !important;
    text-decoration: none !important;
}

.nav-more-item > a.nav-more-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform .2s;
}

.nav-more-item.is-open > a.nav-more-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-more-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,.16);
    border-radius: 0 0 6px 6px;
    border-top: 2px solid #dc2626;
    z-index: 2000;
    list-style: none !important;
    padding: 6px 0 !important;
    margin: 0 !important;
}

.nav-more-item.is-open .nav-more-dropdown {
    display: block;
    animation: navDropIn .15s ease;
}

@keyframes navDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-more-dropdown > li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.nav-more-dropdown > li:last-child {
    border-bottom: none !important;
}

.nav-more-dropdown > li > a {
    display: block !important;
    padding: 11px 18px !important;
    color: #1f2937 !important;
    background: transparent !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-left: 3px solid transparent !important;
    white-space: nowrap;
    transition: all .18s !important;
    text-decoration: none !important;
}

.nav-more-dropdown > li > a:hover {
    background: #fef2f2 !important;
    border-left-color: #dc2626 !important;
    color: #dc2626 !important;
    padding-left: 22px !important;
    text-decoration: none !important;
}

/* On mobile — all items already in hamburger; hide the More button */
@media (max-width: 768px) {
    .nav-more-item { display: none !important; }
}

/* ============================================================
   RESPONSIVE — 1024px (Tablet Landscape)
   ============================================================ */
@media (max-width: 1024px) {
    .featured-container {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        height: auto !important;
        gap: 8px !important;
    }

    .featured-main {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        height: 260px !important;
    }

    .featured-small,
    .featured-large {
        height: 180px !important;
    }

    .content-wrapper {
        grid-template-columns: 1fr !important;
    }

    .main-sidebar {
        max-width: 100% !important;
        width: 100% !important;
    }

    .top-header-center {
        max-width: 300px !important;
    }

    .logo-header {
        padding: 10px 0 !important;
    }

    .main-logo {
        font-size: 38px !important;
    }

    .thetic-logo-img {
        max-height: 44px !important;
        height: 44px !important;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   RESPONSIVE — 768px (Tablet Portrait & Large Phone)
   ============================================================ */
@media (max-width: 768px) {
    /* Top bar */
    .top-header-center {
        max-width: 180px !important;
        margin: 0 6px !important;
    }

    .header-search-field {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    .menu-text {
        display: none !important;
    }

    /* Logo header */
    .logo-header {
        padding: 8px 0 !important;
    }

    .logo-container {
        text-align: left !important;
    }

    .main-logo {
        font-size: 28px !important;
    }

    .thetic-logo-img {
        max-height: 36px !important;
        height: 36px !important;
    }

    /* Featured grid — single column */
    .featured-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        height: auto !important;
        gap: 6px !important;
    }

    .featured-main {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 210px !important;
    }

    .featured-small,
    .featured-large {
        height: 160px !important;
    }

    /* Content & sidebar stack */
    .content-wrapper,
    .grid-main {
        display: block !important;
    }

    .main-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 24px !important;
    }

    /* Sidebar widget compact */
    .sidebar-widget,
    .widget {
        margin-bottom: 16px !important;
    }

    /* Breadcrumb */
    .breadcrumb-wrapper {
        padding: 5px 0 !important;
    }

    /* Share bar */
    .share-bar,
    .article-share {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .footer-bottom-content {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }

    .footer-bottom-links {
        justify-content: center !important;
    }

    /* Single post */
    .single-article,
    .article-container {
        padding: 14px !important;
    }

    /* Back to top */
    .back-to-top {
        bottom: 14px !important;
        right: 14px !important;
        width: 42px !important;
        height: 42px !important;
        font-size: 14px !important;
    }

    /* Category/tag page grid */
    .category-grid,
    .archive-grid {
        grid-template-columns: 1fr !important;
    }

    /* News items full width */
    .news-item {
        padding: 12px !important;
    }
}

/* ============================================================
   RESPONSIVE — 480px (Phones)
   ============================================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 12px !important;
    }

    /* Hide search bar in topbar on very small phones */
    .top-header-center {
        display: none !important;
    }

    .main-logo {
        font-size: 22px !important;
    }

    .thetic-logo-img {
        max-height: 30px !important;
        height: 30px !important;
    }

    .logo-header {
        padding: 8px 0 !important;
    }

    .featured-main {
        height: 180px !important;
    }

    .featured-small,
    .featured-large {
        height: 140px !important;
    }

    .single-article h1,
    .article-title {
        font-size: 1.35rem !important;
        line-height: 1.35 !important;
    }

    .article-content h2 { font-size: 1.2rem !important; }
    .article-content h3 { font-size: 1.05rem !important; }

    #thetic-reading-progress {
        height: 4px !important;
    }

    .news-item {
        flex-direction: column !important;
    }

    .news-image {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   RESPONSIVE — 360px (Extra small phones)
   ============================================================ */
@media (max-width: 360px) {
    .container {
        padding: 0 8px !important;
    }

    .menu-toggle {
        padding: 8px 8px !important;
        gap: 0 !important;
    }

    .topbar-mini-logo {
        font-size: 11px !important;
        margin-left: 6px !important;
    }

    .main-logo {
        font-size: 18px !important;
    }

    .thetic-logo-img {
        max-height: 26px !important;
        height: 26px !important;
    }

    .featured-main {
        height: 150px !important;
    }

    .featured-small,
    .featured-large {
        height: 120px !important;
    }

    .article-content h2 { font-size: 1.1rem !important; }

    .footer-section h3 {
        font-size: 15px !important;
    }

    .back-to-top {
        width: 36px !important;
        height: 36px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}
