/*
Theme Name: TradeIndonesia
Theme URI: https://tradeindonesia.co.id
Description: Child theme for GeneratePress — TradeIndonesia corporate identity
Author: TradeIndonesia Dev Team
Template: generatepress
Version: 1.2.0
Text Domain: tradeindonesia

Changelog:
  1.2.0 (2026-05-04) — Footer 4-kolom via dynamic_sidebar(), fix submenu dropdown desktop,
                        fix global font-size (* → body), logo height via CSS var, lang switcher -50%,
                        register footer-col-1/2/3/4 widget areas, CSS footer widget styles.
  1.1.0 (2026-05-04) — Hapus namespace conflict, inline-relates posisi [2,4,6] + guard <6p,
                        navbar glassmorphism sesuai rules (blur 28px, navy gelap), gradient shift
                        #navbar::before, TikTok icon topbar, tags "Kata Kunci" + icon, sidebar fallback,
                        pagination bahasa Indonesia, main.js max-height + aria-expanded.
  1.0.7 (2026-05-03) — Initial child theme build dari referensi single-artikel.html & arsip-artikel.html.
*/


/* ============================================================
   TYPOGRAPHY & GLOBAL
   ============================================================ */
/* PENTING: jangan set font-size di * — ini akan merusak semua elemen termasuk menu GP */
body {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;       /* 16px base */
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, .font-display {
    font-family: 'Cormorant Garamond', Georgia, serif;
}
/* Reset khusus elemen navigasi agar tidak tertimpa font-size body */
#navbar a,
#navbar button,
#topbar a,
#topbar span,
#topbar div {
    font-size: inherit;
}


/* ============================================================
   1. SCROLLBAR & BASE UTILITIES
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cream, #f8f5ee); }
::-webkit-scrollbar-thumb { background: var(--navy, #003366); border-radius: 10px; }
html { scroll-behavior: smooth; }

/* ============================================================
   2. NAVBAR — GLASSMORPHISM (sesuai User Rules)
   ============================================================ */

/* State Awal (sebelum scroll) */
#navbar {
    background: rgba(0, 19, 38, 0.55);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(212, 175, 55, 0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25),
                inset 0 1px 0 rgba(212,175,55,0.08);
    transition: background 0.4s ease, box-shadow 0.4s ease,
                padding 0.4s ease, top 0.4s ease;
    position: relative; /* needed for ::before */
}

/* Gradient Shift Animation Overlay */
#navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        270deg,
        rgba(212,175,55,0.06),
        rgba(0,51,102,0.15),
        rgba(0,31,63,0.10),
        rgba(212,175,55,0.04)
    );
    background-size: 400% 400%;
    animation: ti-gradient-shift 8s ease infinite;
    border-radius: inherit;
}

@keyframes ti-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Semua child langsung #navbar harus di atas pseudo-element */
#navbar > * {
    position: relative;
    z-index: 1;
}

/* State Scrolled (setelah > 80px) */
#navbar.scrolled {
    background: rgba(0, 19, 38, 0.92) !important;
    backdrop-filter: blur(28px) saturate(2) !important;
    -webkit-backdrop-filter: blur(28px) saturate(2) !important;
    border-color: rgba(212, 175, 55, 0.18) !important;
    box-shadow: 0 2px 24px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(212,175,55,0.1) !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* ============================================================
   3. HERO BACKGROUNDS
   ============================================================ */
.archive-hero-bg, .article-hero-bg {
    background:
        linear-gradient(160deg, rgba(0,19,38,0.92) 0%, rgba(0,51,102,0.85) 60%, rgba(0,31,63,0.95) 100%),
        var(--custom-hero-bg, url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1600&q=80')) center/cover no-repeat !important;
}
.hero-grid-overlay {
    background-image:
        linear-gradient(rgba(212,175,55,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,175,55,0.07) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ============================================================
   4. ANIMATIONS & CARD COMPONENTS
   ============================================================ */
.fade-up { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up.delay-1 { transition-delay: 0.1s; }
.fade-up.delay-2 { transition-delay: 0.2s; }
.fade-up.delay-3 { transition-delay: 0.3s; }
.fade-up.delay-4 { transition-delay: 0.4s; }
.fade-up.delay-5 { transition-delay: 0.5s; }
.fade-up.delay-6 { transition-delay: 0.6s; }
.fade-up.delay-7 { transition-delay: 0.7s; }
.fade-up.delay-8 { transition-delay: 0.8s; }

.artikel-card { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.artikel-card:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(0,51,102,0.12); border-color: rgba(212,175,55,0.35); }

.tag-pill { transition: background 0.2s, color 0.2s, border-color 0.2s; }
.tag-pill:hover, .tag-pill.active { background: var(--navy, #003366); color: #fff; border-color: var(--navy, #003366); }

/* ============================================================
   5. ARTICLE CONTENT — TYPOGRAPHY
   ============================================================ */
.article-body p { margin-bottom: 1.25rem; color: #374151; }
.article-body h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.65rem; font-weight: 600; color: var(--navy, #003366); margin-top: 2.5rem; margin-bottom: 1rem; }
.article-body h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; font-weight: 600; color: var(--navy, #003366); margin-top: 2rem; margin-bottom: 0.75rem; }
.article-body ul { list-style-type: disc; margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-body ol { list-style-type: decimal; margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.5rem; color: #374151; }
.article-body blockquote { border-left: 3px solid var(--gold, #D4AF37); padding-left: 1.25rem; margin: 1.5rem 0; font-style: italic; color: #4B5563; }
.article-body strong { color: var(--navy, #003366); font-weight: 600; }
.article-body a { color: var(--navy, #003366); text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s; }
.article-body a:hover { color: var(--gold, #D4AF37); }
.article-body img { border-radius: 1rem; margin: 1.5rem 0; width: 100%; height: auto; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { text-align: center; font-size: 0.8rem; color: #9CA3AF; margin-top: 0.5rem; }

/* ============================================================
   6. INLINE RELATE "BACA JUGA" & WIDGETS
   ============================================================ */
.inline-relate {
    border: 1px solid rgba(0,51,102,0.12);
    border-left: 3px solid var(--gold, #D4AF37);
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.inline-relate:hover {
    border-color: rgba(212,175,55,0.35);
    box-shadow: 0 4px 16px rgba(0,51,102,0.06);
}
.inline-relate-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold, #D4AF37);
    white-space: nowrap;
    margin-top: 0.15rem;
}
.inline-relate-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy, #003366);
    line-height: 1.5;
    transition: color 0.2s;
}
.inline-relate:hover .inline-relate-title { color: var(--gold, #D4AF37); }

/* Sidebar Widgets */
.sidebar-widget { background: #fff; border: 1px solid rgba(0,51,102,0.08); border-radius: 1rem; padding: 1.5rem; margin-bottom: 1.5rem; }
.sidebar-widget h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold, #D4AF37);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,51,102,0.08);
}
.sidebar-widget ul {
    margin-left: 0 !important;
    list-style: none !important;
}
.sidebar-widget ul.space-y-4 li a.group .min-w-0 { flex: 1; min-width: 0; }

/* Reading Progress Bar */
#reading-progress {
    position: fixed; top: 0; left: 0; height: 3px; z-index: 9999;
    background: linear-gradient(90deg, var(--gold, #D4AF37), #E8CB5B);
    width: 0%;
    transition: width 0.1s linear;
}

/* Share Buttons */
.share-btn { transition: transform 0.2s, background 0.2s, color 0.2s; }
.share-btn:hover { transform: translateY(-2px); }

/* ============================================================
   7. ARCHIVE — FILTER, SEARCH, PAGINATION
   ============================================================ */
.filter-btn { transition: all 0.2s ease; }
.filter-btn:hover, .filter-btn.active { background: var(--navy, #003366); color: #fff; border-color: var(--navy, #003366); }

/* Search Input Focus Ring */
.search-input:focus {
    border-color: var(--gold, #D4AF37) !important;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15) !important;
    outline: none;
}

/* Pagination */
.pagination-wrapper { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.pagination-wrapper a,
.pagination-wrapper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(0,51,102,0.15);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy, #003366);
    transition: all 0.2s ease;
    text-decoration: none;
}
.pagination-wrapper a:hover,
.pagination-wrapper span.current {
    background-color: var(--navy, #003366);
    color: #ffffff;
    border-color: var(--navy, #003366);
}

/* ============================================================
   8. OVERRIDE MENU GENERATEPRESS — DESKTOP
   ============================================================ */

/* Reset list styles GP */
.custom-menu-colors ul,
.custom-menu-colors li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Baris menu utama */
.custom-menu-colors > ul {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
    flex-wrap: nowrap !important;
}

/* Setiap item menu — position: relative untuk anchor dropdown */
.custom-menu-colors > ul > li {
    position: relative !important;
}

/* Link level-1 */
.custom-menu-colors > ul > li > a {
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap;
    text-decoration: none !important;
    padding: 0.4rem 0 !important;
    display: inline-block !important;
    transition: color 0.2s ease !important;
    background: transparent !important;
}
.custom-menu-colors > ul > li > a:hover,
.custom-menu-colors > ul > li.current-menu-item > a,
.custom-menu-colors > ul > li.current-menu-parent > a {
    color: var(--gold, #D4AF37) !important;
}

/* ═══ SUB-MENU: Sembunyikan by default, tampil on hover ═══ */
.custom-menu-colors ul.sub-menu {
    position: absolute !important;
    left: 0 !important;
    top: calc(100% + 0.5rem) !important;
    min-width: 13rem !important;
    background: #ffffff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,51,102,0.06) !important;
    overflow: hidden !important;
    /* KUNCI: hidden by default */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease !important;
    z-index: 500 !important;
    padding: 0.5rem 0 !important;
    list-style: none !important;
}

/* Tampil saat hover ATAU sfHover (GP JS class) */
.custom-menu-colors > ul > li:hover > ul.sub-menu,
.custom-menu-colors > ul > li.sfHover > ul.sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* Link di dalam sub-menu */
.custom-menu-colors ul.sub-menu > li {
    position: relative !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.custom-menu-colors ul.sub-menu > li > a {
    display: block !important;
    padding: 0.6rem 1.25rem !important;
    color: var(--navy, #003366) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease !important;
}
.custom-menu-colors ul.sub-menu > li > a:hover {
    color: var(--gold, #D4AF37) !important;
    background: #f8f5ee !important;
}

/* ============================================================
   9. OVERRIDE MENU GENERATEPRESS — MOBILE
   ============================================================ */
svg.hidden { display: none !important; }

.custom-menu-colors-mobile ul,
.custom-menu-colors-mobile li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main list mobile */
.custom-menu-colors-mobile > ul {
    display: flex !important;
    flex-direction: column !important;
    padding: 0.75rem !important;
    gap: 0.125rem !important;
}

/* Link utama mobile */
.custom-menu-colors-mobile ul > li > a {
    color: rgba(255, 255, 255, 0.88) !important;
    display: block !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
}
.custom-menu-colors-mobile ul > li > a:hover,
.custom-menu-colors-mobile ul > li.current-menu-item > a {
    color: var(--gold, #D4AF37) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Sub-menu mobile — tampil sebagai indented list (bukan dropdown absolut) */
.custom-menu-colors-mobile ul.sub-menu {
    display: flex !important;
    flex-direction: column !important;
    padding: 0.25rem 0 0.25rem 1rem !important;
    border-left: 2px solid rgba(212,175,55,0.3) !important;
    margin: 0 0 0.25rem 1rem !important;
}
.custom-menu-colors-mobile ul.sub-menu > li > a {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.65) !important;
    border-radius: 0.375rem !important;
}
.custom-menu-colors-mobile ul.sub-menu > li > a:hover {
    color: var(--gold, #D4AF37) !important;
    background: rgba(255,255,255,0.06) !important;
}

/* ============================================================
   10. BREADCRUMB RANKMATH — WARNA EMAS
   ============================================================ */
.rankmath-breadcrumb-custom span.last,
.rankmath-breadcrumb-custom strong,
.rankmath-breadcrumb-custom .breadcrumb_last {
    color: var(--gold, #D4AF37) !important;
    font-weight: 500;
}

/* ============================================================
   11. SECTION LABEL (Editorial Badge)
   ============================================================ */
.section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold, #D4AF37);
}

/* ============================================================
   12. TABLE OF CONTENTS LINK
   ============================================================ */
.toc-link { transition: color 0.2s, padding-left 0.2s; }
.toc-link:hover, .toc-link.active { color: var(--gold, #D4AF37); padding-left: 0.5rem; }

/* ============================================================
   13. LOGO — CSS Variable Height Control
   Dikontrol via Customizer: Appearance > TradeIndonesia > Logo Height
   ============================================================ */
.ti-logo-img {
    max-height: var(--ti-logo-height, 40px);
    width: auto;
    object-fit: contain;
    display: block;
}

/* ============================================================
   14. LANGUAGE SWITCHER — 50% lebih kecil dari versi sebelumnya
   ============================================================ */
#ti-lang-switcher {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    overflow: hidden;
    font-size: 0.5rem;   /* ~8px, 50% dari 1rem */
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
}
#ti-lang-switcher a {
    display: inline-block;
    padding: 0.22rem 0.55rem;   /* ~3.5px 9px — 50% dari sebelumnya */
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
#ti-lang-switcher a.active-lang {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}
#ti-lang-switcher a:hover {
    color: #ffffff;
}

/* ============================================================
   15. FOOTER WIDGET AREAS
   ============================================================ */

/* Judul widget di footer */
.footer-widget-title,
.footer-col .widget-title {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.2em !important;
    text-transform: uppercase !important;
    color: var(--gold, #D4AF37) !important;
    margin-bottom: 1.1rem !important;
    padding-bottom: 0.65rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* Nav list di footer (Navigasi & Layanan) */
.footer-nav-list,
.footer-col ul.menu,
.footer-col ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.footer-nav-list li,
.footer-col ul.menu li,
.footer-col ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.footer-nav-list li a,
.footer-col ul.menu li a,
.footer-col ul li a {
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    display: inline-block !important;
    padding: 0.1rem 0 !important;
}

.footer-nav-list li a:hover,
.footer-col ul.menu li a:hover,
.footer-col ul li a:hover {
    color: #fff !important;
}

/* Sembunyikan sub-menu di footer — hanya tampilkan level 1 */
.footer-col ul.menu ul.sub-menu,
.footer-col ul .sub-menu {
    display: none !important;
}

/* Daftar kontak footer (icon + text) */
.footer-contact-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.footer-contact-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.78rem !important;
    line-height: 1.6 !important;
}

.footer-contact-list li svg {
    color: var(--gold, #D4AF37) !important;
    flex-shrink: 0 !important;
    margin-top: 3px !important;
}

.footer-contact-list li a {
    color: rgba(255,255,255,0.55) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.footer-contact-list li a:hover {
    color: #fff !important;
}

/* Widget Text bawaan WP — styling di footer */
.footer-col .textwidget,
.footer-col .widget_text .textwidget {
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.8rem !important;
    line-height: 1.7 !important;
}

.footer-col .textwidget a {
    color: rgba(255,255,255,0.65) !important;
    transition: color 0.2s !important;
}

.footer-col .textwidget a:hover {
    color: var(--gold, #D4AF37) !important;
}

/* Widget Recent Posts di footer */
.footer-col .widget_recent_entries ul {
    gap: 0.5rem !important;
}

.footer-col .widget_recent_entries ul li a {
    font-size: 0.78rem !important;
}