/*
Theme Name: Web Stories Native Theme
Theme URI: https://www.ricojayusirawan.eu.org    
Author: RICO. J.I
Author URI: https://www.ricojayusirawan.eu.org    
Description: Ultra-light native Web Stories theme — no plugins, no bloat.
Version: 2.0
Text Domain: web-stories-theme
License: GNU GPL2
*/

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    font-size: 16px; 
    scroll-behavior: smooth; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
}
body { line-height: 1.7; color: #222; background: #fafafa; }

/* HEADER & MAIN CONTENT */
header, main, footer { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 1.5rem 2rem; 
}

/* HEADER STYLES - DESKTOP */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    max-height: 48px;
    object-fit: contain;
    margin-right: 1rem;
}

.site-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.site-name a {
    text-decoration: none;
    color: inherit;
}

/* Navigation styles */
header nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav a {
    color: #374151;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    font-weight: 500;
    padding: 0.5rem 0;
}

header nav a:hover,
header nav a:focus {
    color: #1e40af;
    text-decoration: underline;
    outline: none;
}

/* MOBILE HEADER STYLES */
@media (max-width: 768px) {
    header, main, footer { 
        padding: 1rem; 
    }
    
    header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
    }

    .header-brand {
        flex: 1;
    }

    .header-logo {
        max-height: 40px;
        margin-right: 0.8rem;
    }

    .site-name {
        font-size: 1.5rem;
    }
}

/* Untuk layar sangat kecil (mobile kecil) */
@media (max-width: 480px) {
    header {
        padding: 0.8rem;
    }

    .header-logo {
        max-height: 36px;
        margin-right: 0.6rem;
    }

    .site-name {
        font-size: 1.3rem;
    }
}

/* CONTENT READABILITY ENHANCEMENT */
.entry-content {
    line-height: 1.8;
    color: #333;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.entry-content h2.wp-block-heading {
    font-size: 1.8rem;
    color: #1a202c;
    margin: 2.5rem 0 1.2rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
}

.entry-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.entry-content p:last-child {
    margin-bottom: 0;
}

.entry-content strong.privacy-policy-tutorial {
    color: #2b8a3e;
    font-weight: 600;
}

.entry-content p:has(> strong.privacy-policy-tutorial) {
    background-color: rgba(43, 138, 62, 0.05);
    padding: 1rem 1.2rem;
    border-left: 4px solid #2b8a3e;
    border-radius: 0 4px 4px 0;
}

/* Spacing untuk meningkatkan keterbacaan */
.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

/* BUTTON STYLES */
.btn-more {
    display: inline-block; 
    background-color: #2563eb; 
    color: white; 
    padding: 0.6rem 1.2rem;
    text-decoration: none; 
    border-radius: 4px; 
    font-weight: 500; 
    transition: background-color 0.2s;
    border: none; 
    cursor: pointer;
}
.btn-more:hover, .btn-more:focus {
    background-color: #1d4ed8; 
    color: white; 
    outline: 2px solid #3b82f6; 
    outline-offset: 2px;
}

/* PAGINATION */
.pagination { text-align: center; margin: 2rem 0; }
.pagination ul { display: inline-flex; list-style: none; gap: 0.5rem; }
.pagination li { display: inline; }
.pagination a, .pagination span {
    display: inline-block; 
    padding: 0.5rem 0.8rem; 
    border: 1px solid #e5e7eb; 
    border-radius: 4px;
    text-decoration: none; 
    color: #374151; 
    font-weight: 500;
}
.pagination a:hover, .pagination a:focus { 
    background-color: #f3f4f6; 
    border-color: #d1d5db; 
    outline: 2px solid #3b82f6; 
    outline-offset: 2px; 
}
.pagination .current { 
    background-color: #2563eb; 
    color: white; 
    border-color: #2563eb; 
}

/* FOOTER */
footer { 
    margin: 4rem auto 0; 
    text-align: center; 
    color: #222; 
    font-size: 0.9rem; 
    border-top: 1px solid #eee; 
}

/* PAGE TITLE */
.page-title {
    text-align: center; 
    margin: 2rem auto; 
    padding: 1.5rem; 
    background-color: rgba(26, 32, 44, 0.05);
    border-radius: 8px; 
    width: 90%; 
    max-width: 800px; 
    display: block; 
    box-sizing: border-box; 
    border-left: 4px solid #1a202c;
}

/* ACCESSIBILITY */
.screen-reader-text { 
    position: absolute; 
    width: 1px; 
    height: 1px; 
    padding: 0; 
    margin: -1px; 
    overflow: hidden; 
    clip: rect(0,0,0,0); 
    white-space: nowrap; 
    border: 0; 
}
a:focus, button:focus, input:focus, textarea:focus, select:focus { 
    outline: 2px solid #3b82f6; 
    outline-offset: 2px; 
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { 
        animation-duration: 0.01ms !important; 
        animation-iteration-count: 1 !important; 
        transition-duration: 0.01ms !important; 
    }
}

/* BREADCRUMB STYLES - SIMPLE & CLEAN */
.breadcrumb {
    font-size: 0.9rem;
    margin: 1.5rem 0 2rem;
    padding: 0.8rem 1.2rem;
    color: #6b7280;
    background-color: #f2f2f5;
    border-radius: 2px;
    border-left: 3px solid #2563eb;
}
.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb a:hover {
    color: #1e40af;
    text-decoration: underline;
}
.breadcrumb .separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}
.breadcrumb span[property="name"] {
    color: #374151;
    font-weight: 600;
}

/* ================================
   WEB STORIES HOMEPAGE SECTION
   ================================ */

/* Section wrapper */
.web-stories-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
}

/* Section title */
.web-stories-section .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 1.8rem;
    position: relative;
    padding-bottom: 0.6rem;
}

.web-stories-section .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #1e40af);
    border-radius: 2px;
}

/* Grid container */
.web-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
    padding: 0 10px;
}

/* Story card */
.web-story-card {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    aspect-ratio: 9 / 16;
    background: #f8f9fa;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: inherit;
}

.web-story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

/* Cover image */
.web-story-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
/* Fallback placeholder untuk Web Story tanpa thumbnail */
.web-story-card .web-story-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.web-story-card .placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.web-story-card .placeholder-icon i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.web-story-card:hover img {
    transform: scale(1.03);
}

/* Title overlay (like YouTube) */
.web-story-card .story-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 14px 10px 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Regular posts section */
.regular-posts-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eaeaea;
}

.regular-posts-section .section-title {
    font-size: 1.6rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.regular-post-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #e5e7eb;
}

.regular-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.regular-post-item h3 {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.regular-post-item h3 a {
    color: #1e3a8a;
    text-decoration: none;
}

.regular-post-item h3 a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.regular-post-thumb {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.8rem 0;
}

.regular-post-item p {
    margin-bottom: 0.8rem;
    color: #4b5563;
}

.read-more {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .web-stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 18px;
    }
    .web-story-card .story-title-overlay {
        font-size: 13px;
        padding: 12px 8px 8px;
    }
    .web-stories-section .section-title,
    .regular-posts-section .section-title {
        font-size: 1.5rem;
    }
    
    /* Page title mobile adjustment */
    .page-title {
        width: 100%;
        margin: 1rem auto;
        padding: 1rem;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .web-stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 16px;
    }
    .web-story-card .story-title-overlay {
        font-size: 12px;
        padding: 10px 6px 6px;
    }
    .web-stories-section .section-title,
    .regular-posts-section .section-title {
        font-size: 1.4rem;
    }
}

@media (min-width: 768px) {
    .web-stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1024px) {
    .web-stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Breadcrumb responsive */
@media (max-width: 768px) {
    .breadcrumb {
        margin: 1rem 0 1.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}
@media (max-width: 480px) {
    .breadcrumb {
        margin: 0.8rem 0 1.2rem;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    .breadcrumb .separator {
        margin: 0 0.3rem;
    }
}

/* Fallback untuk browser yang tidak support flexbox gap */
@supports not (gap: 1rem) {
    header nav ul li {
        margin-right: 1.5rem;
    }
    
    .pagination ul li {
        margin-right: 0.5rem;
    }
    
    .web-stories-grid .web-story-card {
        margin: 8px;
    }
}