/*
Theme Name: Bungko News
Theme URI: https://bungkonews.com
Author: Bungko News Team
Author URI: https://bungkonews.com
Description: Tema berita profesional modern untuk portal berita Bungko News
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bungkonews
Tags: news, magazine, two-columns, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==============================================
   CSS CUSTOM PROPERTIES
   ============================================== */
:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-active: #1e40af;
    --color-primary-light: #eff6ff;
    --color-primary-ghost: rgba(37, 99, 235, 0.2);
    
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-text-link: #64748b;
    
    --color-bg: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-hover: #f1f5f9;
    --color-bg-code: #f1f5f9;
    --color-bg-blockquote: #f0f7ff;
    --color-bg-dark: #1e293b;
    
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-border-focus: #2563eb;
    --color-shadow-focus: rgba(37, 99, 235, 0.1);
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Google Sans Flex', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-spring: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-image: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Header height (for sticky calculations) */
    --header-height: 4rem;
    --ticker-height: 44px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: var(--color-primary-ghost);
    color: var(--color-text);
}
::-moz-selection {
    background: var(--color-primary-ghost);
    color: var(--color-text);
}

/* Placeholder */
::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}
::-webkit-input-placeholder { color: var(--color-text-muted); }
::-moz-placeholder { color: var(--color-text-muted); opacity: 1; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

ul, ol {
    list-style: none;
}

/* Focus visible */
:focus:not(:focus-visible) {
    outline: none;
}
:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ==============================================
   UTILITIES
   ============================================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ==============================================
   ANIMATIONS
   ============================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-spring),
                transform var(--transition-spring);
}
.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .animate-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Fallback animation */
.animate-fallback { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fallback.delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-fallback.delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-fallback.delay-3 { animation-delay: 0.3s; opacity: 0; }

/* Ticker */
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-scroll {
    animation: ticker 30s linear infinite;
    will-change: transform;
}
.ticker-scroll:hover {
    animation-play-state: paused;
}

/* ==============================================
   NAV LINK UNDERLINE
   ============================================== */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base), left var(--transition-base);
    border-radius: 1px;
}
.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* ==============================================
   NEWS CARD
   ============================================== */
.news-img {
    transition: transform var(--transition-image);
}

.news-title {
    transition: color var(--transition-base);
}

@media (hover: hover) {
    .news-card:hover .news-img {
        transform: scale(1.05);
        will-change: transform;
    }
    .news-card:hover .news-title {
        color: var(--color-primary);
    }
}

@media (hover: none) {
    .news-card:active .news-img {
        transform: scale(0.97);
    }
    .news-card:active {
        opacity: 0.85;
    }
}

/* ==============================================
   SIDEBAR
   ============================================== */
.sidebar-item {
    transition: background-color var(--transition-base), transform var(--transition-base);
}

@media (hover: hover) {
    .sidebar-item:hover {
        background: var(--color-bg-hover);
        transform: translateX(4px);
    }
}

@media (hover: none) {
    .sidebar-item:active {
        background: var(--color-bg-hover);
        transform: translateX(2px);
    }
}

/* Sidebar sticky */
@media (min-width: 1024px) {
    .sidebar-sticky {
        position: sticky;
        top: calc(var(--header-height) + var(--space-lg) + var(--ticker-height));
        max-height: calc(100vh - var(--header-height) - var(--space-lg) - var(--ticker-height));
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--color-text-muted) transparent;
    }
    .sidebar-sticky::-webkit-scrollbar { width: 4px; }
    .sidebar-sticky::-webkit-scrollbar-thumb {
        background: var(--color-text-muted);
        border-radius: var(--radius-full);
    }
    .sidebar-sticky::-webkit-scrollbar-track { background: transparent; }
}

/* ==============================================
   CATEGORY TAGS
   ============================================== */
.category-tag {
    transition: background-color var(--transition-base), 
                color var(--transition-base), 
                border-color var(--transition-base), 
                transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .category-tag:hover {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
    }
}

@media (hover: none) {
    .category-tag:active {
        background: var(--color-primary);
        color: white;
        border-color: var(--color-primary);
        transform: scale(0.95);
    }
}

/* ==============================================
   SOCIAL STATS
   ============================================== */
.social-stat {
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

@media (hover: hover) {
    .social-stat:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px -8px rgba(0,0,0,0.15);
    }
}

@media (hover: none) {
    .social-stat:active {
        transform: scale(0.97);
    }
}

/* ==============================================
   SCROLLBAR
   ============================================== */
@media (hover: none) and (pointer: coarse) {
    ::-webkit-scrollbar { display: none; }
    * { scrollbar-width: none; }
}

@media (hover: hover) {
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: var(--color-bg-hover); }
    ::-webkit-scrollbar-thumb {
        background: var(--color-text-muted);
        border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
}

/* ==============================================
   TOAST
   ============================================== */
.toast {
    position: fixed;
    bottom: max(var(--space-md), env(safe-area-inset-bottom, var(--space-md)));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-bg-dark);
    color: white;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    white-space: nowrap;
    max-width: calc(100vw - var(--space-xl));
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(255,255,255,0.08);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (min-width: 640px) {
    .toast {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        transform: translateY(100px);
        font-size: 0.85rem;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius-md);
        max-width: 360px;
        white-space: normal;
    }
    .toast.show { transform: translateY(0); }
}

/* ==============================================
   SINGLE POST CONTENT
   ============================================== */
.single-content {
    font-size: 0.938rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-content > *:first-child { margin-top: 0; }

.single-content p { margin-bottom: 1.15em; }

/* Headings */
.single-content h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 2em 0 0.75em;
    line-height: 1.35;
}
.single-content h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.75em 0 0.6em;
    line-height: 1.4;
}
.single-content h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1.5em 0 0.5em;
    line-height: 1.45;
}

/* Links */
.single-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    transition: text-decoration-color var(--transition-base);
}
.single-content a:hover {
    text-decoration-color: var(--color-primary);
}

/* Images */
.single-content img {
    border-radius: var(--radius-md);
    margin: 1.25em 0;
}

/* Blockquote */
.single-content blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem var(--space-md);
    margin: 1.5em 0;
    background: var(--color-bg-blockquote);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: 0.95em;
}

/* Lists */
.single-content ul,
.single-content ol {
    padding-left: 1.25rem;
    margin-bottom: 1.15em;
}
.single-content ul { list-style: disc; }
.single-content ol { list-style: decimal; }
.single-content li { margin-bottom: 0.4em; }

/* Table */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.single-content thead { background: var(--color-bg-hover); }
.single-content th,
.single-content td {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
}
.single-content th {
    font-weight: 600;
    color: var(--color-text);
}

/* Code */
.single-content code {
    font-size: 0.85em;
    background: var(--color-bg-code);
    padding: 0.15em 0.35em;
    border-radius: 0.25rem;
    color: var(--color-primary);
    word-break: break-word;
}

.single-content pre {
    background: var(--color-bg-dark);
    color: #e2e8f0;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.25em 0;
    font-size: 0.8rem;
    line-height: 1.6;
}
.single-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* HR */
.single-content hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 2em 0;
}

/* Iframe/Video */
.single-content iframe,
.single-content video {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1.25em 0;
}

/* WordPress embed */
.single-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper::before {
    content: '';
    display: block;
    padding-top: 56.25%;
}
.single-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-md);
}

/* Figure caption */
.single-content figcaption,
.single-content .wp-caption-text {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Pullquote */
.single-content .wp-block-pullquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-md);
    margin: 1.5em 0;
}
.single-content .wp-block-pullquote blockquote {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
}

/* Separator */
.single-content .wp-block-separator {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 2em auto;
}

/* Responsive content */
@media (min-width: 640px) {
    .single-content {
        font-size: 1rem;
        line-height: 1.85;
    }
    .single-content h2 { font-size: 1.4rem; }
    .single-content h3 { font-size: 1.2rem; }
    .single-content img {
        border-radius: var(--radius-lg);
        margin: 1.5em 0;
    }
    .single-content blockquote {
        border-left-width: 4px;
        padding: 1em 1.5em;
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
    }
    .single-content ul,
    .single-content ol { padding-left: 1.5rem; }
    .single-content table { font-size: 0.875rem; margin: 1.5em 0; }
    .single-content th,
    .single-content td { padding: 0.6rem 0.75rem; }
    .single-content pre { padding: var(--space-md); font-size: 0.85rem; margin: 1.5em 0; }
    .single-content figcaption,
    .single-content .wp-caption-text { font-size: 0.8rem; }
    .single-content iframe,
    .single-content video {
        border-radius: var(--radius-lg);
        margin: 1.5em 0;
    }
}

@media (min-width: 1024px) {
    .single-content h2 { font-size: 1.5rem; }
    .single-content h3 { font-size: 1.25rem; }
}

/* ==============================================
   COMMENTS
   ============================================== */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-body {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.comment-author {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.8rem;
}

.comment-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.comment-content p {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.comment-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.children {
    padding-left: var(--space-md);
    border-left: 2px solid var(--color-border-light);
    margin-left: 0.25rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-bg-card);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px var(--color-shadow-focus);
}
.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}
.comment-form .form-submit input[type="submit"] {
    width: auto;
    padding: 0.6rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-base);
}
.comment-form .form-submit input[type="submit"]:hover {
    background: var(--color-primary-hover);
}
.comment-form .form-submit input[type="submit"]:active {
    background: var(--color-primary-active);
    transform: scale(0.97);
}

.comment-reply-link {
    font-size: 0.72rem;
    color: var(--color-primary);
    font-weight: 500;
    padding: 0.2rem 0;
    transition: color var(--transition-base);
}
.comment-reply-link:hover { color: var(--color-primary-hover); }

@media (min-width: 640px) {
    .comment-body { padding: 1.25rem 0; }
    .comment-author { font-size: 0.875rem; }
    .comment-meta { font-size: 0.75rem; margin-bottom: 0.5rem; }
    .comment-content p { font-size: 0.875rem; }
    .comment-author img { width: 36px; height: 36px; }
    .children { padding-left: 2rem; margin-left: 0; }
    .comment-reply-link { font-size: 0.8rem; }
}

@media (min-width: 1024px) {
    .children { padding-left: 2.5rem; }
}

/* ==============================================
   BREADCRUMB
   ============================================== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.breadcrumb a {
    color: var(--color-text-link);
    transition: color var(--transition-base);
    white-space: nowrap;
}
.breadcrumb a:hover { color: var(--color-primary); }

.breadcrumb .separator {
    margin: 0 0.3rem;
    color: var(--color-border);
    flex-shrink: 0;
}

.breadcrumb .breadcrumb-current {
    color: var(--color-text-link);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    display: inline-block;
}

@media (min-width: 640px) {
    .breadcrumb { font-size: 0.8rem; }
    .breadcrumb .separator { margin: 0 0.5rem; }
    .breadcrumb .breadcrumb-current { max-width: none; }
}

/* ==============================================
   PAGINATION
   ============================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 1.5rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    text-decoration: none;
    padding: 0 0.25rem;
    -webkit-tap-highlight-color: transparent;
}

.page-numbers.current {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    border-color: var(--color-primary);
}

.page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-muted);
    min-width: auto;
    width: auto;
    padding: 0 0.25rem;
    cursor: default;
}

.page-numbers.prev,
.page-numbers.next {
    min-width: auto;
    width: auto;
    height: auto;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--color-primary);
}

@media (hover: hover) {
    .page-numbers:hover:not(.current):not(.dots) {
        border-color: var(--color-primary);
        color: var(--color-primary);
        background: var(--color-primary-light);
    }
    .page-numbers.prev:hover,
    .page-numbers.next:hover {
        color: var(--color-primary-hover);
        background: var(--color-primary-light);
    }
}

@media (hover: none) {
    .page-numbers:active:not(.current):not(.dots) {
        border-color: var(--color-primary);
        color: var(--color-primary);
        transform: scale(0.93);
    }
    .page-numbers.prev:active,
    .page-numbers.next:active {
        color: var(--color-primary-active);
        background: var(--color-primary-light);
    }
}

@media (min-width: 640px) {
    .pagination { gap: 0.5rem; margin-top: var(--space-xl); }
    .page-numbers { min-width: 2.5rem; height: 2.5rem; font-size: 0.875rem; padding: 0 0.35rem; }
    .page-numbers.prev,
    .page-numbers.next { padding: 0.35rem 0.65rem; }
}

@media (min-width: 1024px) {
    .page-numbers { min-width: 2.75rem; height: 2.75rem; }
}

/* ==============================================
   404 PAGE
   ============================================== */
.four-oh-four {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.four-oh-four h1 {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-border);
    line-height: 1;
    letter-spacing: -0.03em;
}

.four-oh-four p {
    font-size: 0.9rem;
    color: var(--color-text-link);
    max-width: 28rem;
    margin: var(--space-md) auto var(--space-xl);
    line-height: 1.7;
}

@media (min-width: 640px) {
    .four-oh-four { padding: 5rem var(--space-md); }
    .four-oh-four h1 { font-size: 7rem; }
    .four-oh-four p { font-size: 1rem; margin: 1.25rem auto 2.5rem; }
}

@media (min-width: 1024px) {
    .four-oh-four { padding: 6rem var(--space-md); }
    .four-oh-four h1 { font-size: 9rem; }
}

/* ==============================================
   WIDGET STYLING
   ============================================== */
.widget { margin-bottom: 1.5rem; }

.widget-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--color-border);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 28px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.widget_search .search-form { display: flex; gap: 0.375rem; }

.widget_search .search-field {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--color-text);
    background: var(--color-bg-card);
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.widget_search .search-field:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px var(--color-shadow-focus);
}

.widget_search .search-submit {
    padding: 0.55rem 0.85rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-base);
    flex-shrink: 0;
}
.widget_search .search-submit:hover { background: var(--color-primary-hover); }
.widget_search .search-submit:active { background: var(--color-primary-active); }

@media (min-width: 640px) {
    .widget { margin-bottom: 1.75rem; }
    .widget-title { font-size: 0.85rem; margin-bottom: var(--space-md); padding-bottom: 0.75rem; }
    .widget_search .search-field { padding: 0.6rem 0.85rem; font-size: 0.85rem; }
    .widget_search .search-submit { padding: 0.6rem var(--space-md); font-size: 0.8rem; }
}

/* ==============================================
   READING PROGRESS BAR
   ============================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
    will-change: width;
}

/* ==============================================
   BACK TO TOP BUTTON
   ============================================== */
.back-to-top-btn {
    position: fixed;
    bottom: max(var(--space-md), env(safe-area-inset-bottom, var(--space-md)));
    right: var(--space-md);
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-bg-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 40;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
    transition: opacity var(--transition-slow),
                transform var(--transition-slow),
                background-color var(--transition-base);
}

.back-to-top-btn.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (hover: hover) {
    .back-to-top-btn:hover { background: var(--color-primary); }
}

@media (hover: none) {
    .back-to-top-btn:active {
        background: var(--color-primary);
        transform: scale(0.92);
    }
}

@media (min-width: 640px) {
    .back-to-top-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: var(--radius-md);
    }
}

/* ==============================================
   MOBILE MENU OVERLAY
   ============================================== */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity var(--transition-slow);
}
.mobile-menu-panel.open {
    max-height: 70vh;
    opacity: 1;
    overflow-y: auto;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ==============================================
   SEARCH BAR SLIDE
   ============================================== */
.search-bar-slide {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}
.search-bar-slide.open {
    max-height: 120px;
    opacity: 1;
}

/* ==============================================
   PRINT STYLES
   ============================================== */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
        line-height: 1.5;
        padding: 0;
    }

    .top-bar,
    header,
    .breaking-badge,
    .ticker-scroll,
    aside,
    .breadcrumb,
    .share-btn,
    .tag-chip,
    .related-card,
    .comment-list,
    .pagination,
    .back-to-top-btn,
    .reading-progress,
    .menu-overlay,
    .toast,
    footer {
        display: none !important;
    }

    .single-content {
        font-size: 11pt;
        line-height: 1.6;
        color: #000;
    }

    .single-content a {
        color: #000;
        text-decoration: underline;
    }

    .single-content img {
        border-radius: 0;
        max-width: 100%;
    }

    article { max-width: 100%; }
}

/* ==============================================
   SAFE AREA UTILITY
   ============================================== */
/* FIX: // bukan komentar CSS — diganti /* */ dan @supports dihapus
      karena max() sudah didukung semua browser modern sejak 2020 */
.safe-area-x {
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
}

/* ==============================================
   SHADOW UTILITIES
   ============================================== */
.shadow-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}