/*
 * Theme Name:   MikirTekno
 * Theme URI:    https://mikirtekno.com/
 * Author:       EK Dev Studio
 * Author URI:   https://ekdev-studio.vercel.app/
 * Description:  Tema minimalis dan modern untuk portal berita teknologi. Dibangun dengan performa tinggi, aksesibilitas penuh, dan dukungan dark mode.
 * Version:      2.0.0
 * Requires PHP: 8.0
 * License:      GNU General Public License v2 or later
 * License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:  mikirtekno
 * Tags:         blog, news, technology, dark-mode, responsive, accessibility-ready
 */

/* ==========================================================================
   TABLE OF CONTENTS
   1.  Design Tokens & CSS Custom Properties
   2.  Dark Mode Overrides
   3.  Modern CSS Reset
   4.  Base & Typography
   5.  Utility Classes
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* --- Color Palette --- */
  --blue: #2563eb;
  --blue-mid: #3b82f6;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;

  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow: #d97706;
  --yellow-light: #fffbeb;

  /* --- Neutral Palette --- */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* --- Semantic Colors (Light Mode) --- */
  --bg: #f1f5f9;
  --bg-page: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* --- Typography --- */
  --font-sans: "Plus Jakarta Sans", "Noto Sans", system-ui, sans-serif;
  --font-serif: "Lora", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;

  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.8125rem; /* 13px */
  --text-base: 1rem; /* 16px */
  --text-md: 1.0625rem; /* 17px */
  --text-lg: 1.125rem; /* 18px */
  --text-xl: 1.25rem; /* 20px */
  --text-2xl: 1.5rem; /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem; /* 36px */

  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* --- Spacing Scale --- */
  --space-1: 0.25rem; /* 4px  */
  --space-2: 0.5rem; /* 8px  */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */

  /* --- Border Radius --- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.08);

  /* --- Animation & Transitions --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  /* --- Layout --- */
  --container-max: 1200px;
  --content-max: 720px;
  --sidebar-width: 280px;
  --header-height: 64px;

  /* --- Z-index Scale --- */
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 9000;
  --z-header: 9990;
  --z-top: 99999;
}

/* ==========================================================================
   2. DARK MODE OVERRIDES
   ========================================================================== */
body.dark-mode {
  --bg: #0f172a;
  --bg-page: #0b1120;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border: #1e293b;
  --border-strong: #334155;

  --blue-light: #0f2a52;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.7), 0 8px 20px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ==========================================================================
   3. MODERN CSS RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

/* Menghormati preferensi 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;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Media */
img,
video,
svg,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

/* Tipografi */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text);
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

/* Link */
a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease);
}

a:hover {
  color: var(--blue-dark);
}

/* List */
ul,
ol {
  list-style: none;
}

/* Form elements */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

input,
textarea {
  outline: none;
}

/* Table */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* HR */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

/* ==========================================================================
   4. BASE & TYPOGRAPHY
   ========================================================================== */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

/* Konten artikel — WordPress the_content() */
.single-content,
.entry-content,
.page-content {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

.single-content h2,
.entry-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  margin: var(--space-10) 0 var(--space-4);
  color: var(--text);
  line-height: var(--leading-snug);
}

.single-content h3,
.entry-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin: var(--space-8) 0 var(--space-3);
  color: var(--text);
}

.single-content h4,
.entry-content h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin: var(--space-6) 0 var(--space-2);
}

.single-content p,
.entry-content p {
  margin-bottom: var(--space-6);
}

.single-content p:last-child,
.entry-content p:last-child {
  margin-bottom: 0;
}

.single-content a,
.entry-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-base) var(--ease);
}

.single-content a:hover,
.entry-content a:hover {
  color: var(--blue-dark);
}

/* List di konten */
.single-content ul,
.single-content ol,
.entry-content ul,
.entry-content ol {
  list-style: revert;
  padding-left: var(--space-6);
  margin-bottom: var(--space-6);
}

.single-content li,
.entry-content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

/* Blockquote */
.single-content blockquote,
.entry-content blockquote {
  border-left: 4px solid var(--blue);
  background: var(--blue-light);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  color: var(--text-muted);
}

body.dark-mode .single-content blockquote,
body.dark-mode .entry-content blockquote {
  background: #0f2a52;
  color: #94a3b8;
}

/* Code */
.single-content code,
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  color: var(--blue-dark);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--gray-200);
}

.single-content pre,
.entry-content pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: var(--space-6);
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: var(--space-8) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  border: 1px solid var(--gray-800);
}

.single-content pre code,
.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

body.dark-mode .single-content code,
body.dark-mode .entry-content code {
  background: #1e3a5f;
  color: var(--blue-mid);
  border-color: #1e3a5f;
}

/* Gambar di konten */
.single-content img,
.entry-content img {
  border-radius: var(--r);
  margin: var(--space-6) 0;
}

/* Figcaption */
.single-content figcaption,
.entry-content figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: calc(var(--space-2) * -1);
  margin-bottom: var(--space-6);
  font-style: italic;
}

/* Table di konten */
.single-content table,
.entry-content table {
  width: 100%;
  margin: var(--space-8) 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-size: var(--text-sm);
}

.single-content th,
.entry-content th {
  background: var(--bg);
  font-weight: var(--font-semibold);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.single-content td,
.entry-content td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.single-content tr:last-child td,
.entry-content tr:last-child td {
  border-bottom: none;
}

.single-content tr:nth-child(even),
.entry-content tr:nth-child(even) {
  background: var(--bg);
}

body.dark-mode .single-content tr:nth-child(even),
body.dark-mode .entry-content tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   5. UTILITY CLASSES
   ========================================================================== */

/* Visually hidden (accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Truncate teks */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flex helpers */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}

/* Focus ring — aksesibilitas keyboard */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* WordPress alignment classes */
.alignleft {
  float: left;
  margin: 0 var(--space-6) var(--space-4) 0;
}
.alignright {
  float: right;
  margin: 0 0 var(--space-4) var(--space-6);
}
.aligncenter {
  display: block;
  margin-inline: auto;
  text-align: center;
}

/* WordPress caption */
.wp-caption {
  max-width: 100%;
}
.wp-caption-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-top: var(--space-2);
}
