/* --- GLOBAL & RESET --- */
:root { interpolate-size: allow-keywords; }

html { scroll-behavior: smooth; }

body {
  font-family: "Figtree", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  text-wrap: pretty;
}

/* Menghilangkan efek kotak biru saat tap di Android/Mobile */
a, button, input, select, textarea, label, summary, [role="button"], [tabindex] {
  -webkit-tap-highlight-color: transparent;
}

/* Scroll Offset for Anchors */
h1, h2, h3, section, div[id] { scroll-margin-top: 80px; }

/* Focus & Selection */
:where(.wp-site-blocks *:focus:not(:focus-visible)) {
    outline: none !important;
    box-shadow: none !important;
}

:where(.wp-site-blocks *:focus-visible) {
    outline: 2px solid var(--wp--preset--color--contrast-2);
    outline-offset: 2px;
}

::selection {
  background-color: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--base-2);
}

::-moz-selection {
  background-color: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--base-2);
}

/* Animations */
@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.anime { animation: slideUp 0.5s ease-out; }
.anime-alt { animation: slideUp 0.75s ease-out; }

@keyframes fadeIn {
    from { opacity: 0.5; }
    to { opacity: 1; }
}
.anime-fade { animation: fadeIn 0.3s ease-in forwards; }

/* Utilities */
.no-select { user-select: none; }
.no-underline a { text-decoration: none; }
.itemhover { transition: box-shadow 0.25s ease; }
.itemhover:hover { box-shadow: 0px 2px 12px 0px rgba(24, 24, 24, 0.1); }

/* Truncation */
.truncate a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}
.truncate-tag.taxonomy-category { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.truncate-tag.taxonomy-category .wp-block-post-terms__separator { white-space: inherit; }

/* Sizes & Limits */
.tag-height-limit { max-height: 16px; width: 100%; box-sizing: border-box; overflow: hidden; }
.tag-width-limit { max-width: 60%; }
.img-height-limit { min-height: 4rem; }

/* Visibility */
@media screen and (max-width: 640px) { .mobile-hide { display: none !important; } }
@media screen and (min-width: 641px) { .desktop-hide { display: none !important; } }

/* PWA Header */
/* 1. Sembunyikan Header WCO secara default (untuk web biasa/mobile) */
.cv-wco-header {
    display: none;
}

/* 2. Hanya munculkan jika fitur WCO aktif di Desktop PWA */
@media (display-mode: window-controls-overlay) {
    .cv-wco-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: env(titlebar-area-width, 100%);
        height: env(titlebar-area-height, 40px);
        background: var(--wp--preset--color--base);
        z-index: 9999;
        app-region: drag;
        -webkit-app-region: drag;
    }
}

/* PWA Header */
.cv-title-bar {
  width: env(titlebar-area-width, 100%);
  height: env(titlebar-area-height, 40px);
  app-region: drag;
  -webkit-app-region: drag;
  display: flex;
  align-items: center;
}

.cv-title-bar a, 
.cv-title-bar button, 
.cv-title-bar input,
.cv-title-bar .wp-block-navigation,
.cv-title-bar .wp-block-search {
  app-region: no-drag;
  -webkit-app-region: no-drag;
}

/* Sembunyikan footer hanya saat aplikasi dijalankan sebagai PWA Desktop */
@media (display-mode: standalone) and (min-width: 769px), 
       (display-mode: window-controls-overlay) and (min-width: 769px) {
    footer, 
    .wp-block-template-part[tagname="footer"], 
    .site-footer {
        display: none !important;
    }

    body {
        padding-bottom: 20px;
    }
}

/* -----------------------------------------------------------
 * DARK MODE
 * ----------------------------------------------------------- */

/* When <html data-theme="dark"> is present */
html[data-theme="dark"] {
    /* CMPLZ Overrides */
    --cmplz_banner_background_color: #1a1a1a !important;
    --cmplz_button_accept_text_color: #1a1a1a !important;
    --cmplz_button_deny_background_color: #1a1a1a !important;
    --cmplz_text_color: #fdfdfd !important;
    --cmplz_banner_border_color: #444444 !important;
    --cmplz_button_accept_background_color: #8ab4f8 !important;
    --cmplz_button_accept_border_color: #8ab4f8 !important;
    --cmplz_button_deny_border_color: #8ab4f8 !important;
    --cmplz_button_deny_text_color: #8ab4f8 !important;
}

/* Force Body Background */
html[data-theme="dark"] body {
    background-color: #111111;
    color: #fdfdfd;
}

/* Image Replacements */
html[data-theme="dark"] .logo-centraverse img { content: url("https://centraverse.id/wp-content/uploads/2025/05/Centraverse-Logo-Dark.png"); }
html[data-theme="dark"] .logo-centranews img { content: url("https://centraverse.id/wp-content/uploads/2025/05/Centranews-Dark.png"); }
html[data-theme="dark"] .logo-centranews-2 img { content: url("https://centraverse.id/wp-content/uploads/2025/11/Centranews-Logo-Dark.png"); }
html[data-theme="dark"] .logo-kelon img { content: url("https://centraverse.id/wp-content/uploads/2025/05/Kelon-Logo-2024-Dark.png"); }
html[data-theme="dark"] .logo-dmn img { content: url("https://centraverse.id/wp-content/uploads/2025/11/DMN-Logo-Dark.png"); }
html[data-theme="dark"] .logo-subslogan img { content: url("https://centraverse.id/wp-content/uploads/2025/12/Sub-Slogan-Dark-png.webp"); }