/*
Theme Name: SuperCL
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: Super fast and lightweight WordPress theme (clean version)
Version: 1.1
Text Domain: supercl
*/

/* ==========================================================================
   1. GLOBAL VARIABLES & BASE STYLES
   ========================================================================== */

:root {
    --primary-color: #004aad;
    --accent-color: #c41e3a;
    --secondary-color: #5a4fcf;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --border-color: #eee;
    --mobile-breakpoint: 768px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Roboto, "Inter", -apple-system, "Segoe UI", sans-serif;
    font-display: swap;
    background: #fff;
    color: var(--text-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 7px;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

a:focus,
a:hover {
    text-decoration: underline;
}

/* Animations */
.site-content {
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */

.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-top {
    background: linear-gradient(135deg, #1b8cd9, #2d64e0 40%, #4b4ed9 70%, #5a3fe0);
    padding: 8px 0;
}

.header-container {
    max-width: 970px;
    margin: 0 auto;
    padding: 0 15px;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    max-height: 60px;
}

.logo a,
.logo img {
    max-height: 60px;
    width: auto;
    color: #000;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: block;
    padding: 8px 12px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.main-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 0;
    z-index: 1000;
}

.main-nav ul li:hover > ul {
    display: flex;
}

.main-nav ul ul li {
    width: 100%;
}

.main-nav ul ul a {
    color: #333;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    text-shadow: none;
}

.main-nav ul ul a:hover {
    background: #f5f5f5;
}

.main-nav ul ul ul {
    left: 100%;
    top: 0;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 5px;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 17px;
    cursor: pointer;
    padding: 5px;
}

.search-form-container {
    display: none;
    padding: 15px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

.search-form-container.active {
    display: block;
}

.search-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 8px 15px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* ==========================================================================
   3. LAYOUT STRUCTURE
   ========================================================================== */

.site-content {
    max-width: 970px;
    margin: 20px auto;
    padding: 0 15px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
}

.main-content {
    flex: 0 0 67%;
    max-width: 67%;
}

.sidebar {
    flex: 0 0 34%;
    max-width: 34%;
    min-height: 400px;
}

/* ==========================================================================
   4. POST ITEMS (Index & Archive)
   ========================================================================== */

/* Base post styling */
.post {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Two column layout for post lists */
.two-column-layout .post-grid {
    display: flex;
    gap: 10px;
}

.two-column-layout .post-thumbnail-column {
    flex: 0 0 40%;
}

.two-column-layout .post-content-column {
    flex: 1;
    margin-top: 0;
    padding-top: 0;
}

.two-column-layout .post-thumbnail-column img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Post meta info */
.post-meta-content {
    display: flex;
    line-height: 1;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 13px;
}

.post-meta-content .post-category a {
    color: var(--primary-color);
    text-transform: uppercase;
}

.post-meta-content .post-date {
    color: #666;
}

/* Post title */
.two-column-layout .post-title {
    margin: 0 0 5px;
    font-size: 1.2em;
    line-height: 1.2;
    color: var(--text-color);
}

/* Post excerpt */
.two-column-layout .post-content {
    font-size: 14px;
    line-height: 1.5;
}

/* Section headers */
.posts-header {
    margin: 0 0 20px;
    border-bottom: 4px solid var(--primary-color);
    display: inline-block;
}

.section-title {
    font-size: 1em;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* Index button */
.index-button {
    text-align: center;
    margin: 20px 0;
}

.btn-index {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-index:hover {
    background-color: #4a3fc0;
    text-decoration: none;
}

/* ==========================================================================
   5. SINGLE POST STYLES
   ========================================================================== */

/* Single post container */
.single-post .post-thumbnail {
    position: relative;
    margin: 15px 0;
    overflow: hidden;
    aspect-ratio: 3/2; /* Buat container 1:1 */
}

.single-post .post-thumbnail a {
    display: block;
    position: absolute;
    inset: 0;
}

.single-post .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop gambar */
    object-position: center; /* Crop dari tengah */
}

/* Single post title */
.single-post .post-title {
    font-size: 30px;
    line-height: 36px;
    margin: 5px 0;
}

/* Single post meta */
.single-post .post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Single post content */
.single-post .post-content {
    line-height: 24px;
    margin: 20px 0;
}

.single-post .post-content p + p {
    margin-top: 15px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    margin-bottom: 15px;
}

.breadcrumb .sep {
    margin: 0 5px;
}

/* Tags */
.post-tags {
    margin-top: 20px;
}

.post-tags a {
    background-color: #eaeaea;
    padding: 4px 8px;
    display: inline-block;
    border-radius: 4px;
    font-size: 14px;
}

.post-tags a:hover {
    background-color: #ddd;
    text-decoration: none;
}

/* Banner in article */
.banner-artikel {
    float: left;
    width: 35%;
    margin-right: 10px;
    box-sizing: border-box;
    clear: none;
}

/* Clearfix for floated banner */
.post-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   6. GRID COMPONENTS (Horizontal Grid)
   ========================================================================== */

.horizontal-grid-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.horizontal-grid-container {
    overflow: hidden;
}

.horizontal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-card {
    background: transparent;
}

.card-image {
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 10px 0;
}

.card-title {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.card-title a {
    color: var(--text-color);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Section header with "view all" link */
.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 20px;
    border-bottom: 4px solid var(--primary-color);
}

.posts-header a {
    font-size: 0.8em;
    color: var(--secondary-color);
}

.posts-header a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   7. SEARCH & FILTERS
   ========================================================================== */

.search-filter-bar {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.search-filter-form label {
    margin: 0;
}

.search-filter-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.filter-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-btn:hover {
    background: #4a3fc0;
}

.clear-filter {
    color: var(--accent-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.clear-filter:hover {
    text-decoration: underline;
}

/* ==========================================================================
   8. PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    text-decoration: none;
}

.pagination .current {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.pagination .prev,
.pagination .next {
    font-weight: 600;
}

/* ==========================================================================
   9. WIDGETS & SIDEBAR
   ========================================================================== */

/* Sticky sidebar for desktop */
@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 999;
        background: #fff;
        height: fit-content;
        align-self: flex-start;
    }
}

.widget {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 4px;
    min-height: 150px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.site-footer {
    background: #2d2d2d;
    color: #fff;
    margin-top: 40px;
}

.footer-menu {
    background: linear-gradient(135deg, #1b8cd9, #2d64e0 40%, #4b4ed9 70%, #5a3fe0);
    padding: 15px 0;
}

.footer-menu ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #fff;
    font-size: 13px;
}

.footer-menu a:hover {
    text-decoration: none;
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
}

.footer-bottom a {
    color: #fff;
}

/* ==========================================================================
   11. RESPONSIVE DESIGN (Mobile)
   ========================================================================== */

@media (max-width: 768px) {
    /* Layout */
    .mobile-menu-toggle {
        display: block;
    }
    
    .site-header {
        position: sticky;
        top: 0;
        z-index: 999;
        background: #fff;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1b8cd9, #2d64e0 40%, #4b4ed9 70%, #5a3fe0);
        flex-direction: column;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .main-nav a {
        color: #fff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 15px 20px;
        min-height: 44px;
    }
    
    .main-nav ul ul {
        position: static;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
    }
    
    .main-nav ul ul a {
        padding-left: 30px;
        color: #fff;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .main-content,
    .sidebar {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .header-main {
        padding: 15px 0 0;
    }

    /* Post list mobile */
    .two-column-layout .post-thumbnail-column img {
        height: 85px;
    }
    
    .two-column-layout .post-meta-content {
        font-size: 10px;
    }
    
    .two-column-layout .post-title {
        font-size: 0.9em;
        line-height: 1.3;
    }
    
    .two-column-layout .post-content {
        display: none;
    }

    /* Single post mobile */
    .single-post .post-title {
        font-size: 25px;
        line-height: 29px;
    }

    /* Grid mobile */
    .horizontal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 10px;
    }
    
    .grid-card {
        font-size: 0.95rem;
    }
    
    .card-image {
        height: 90px;
    }
    
    .card-title {
        font-size: 0.8em;
        line-height: 1.3;
    }

    /* Pagination mobile */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Search filter mobile */
    .search-filter-form {
        flex-direction: column;
        width: 100%;
    }
    
    .search-filter-form select {
        width: 100%;
    }
}