/*
Theme Name: Amibalu
Theme URI: https://unheard.me/amibalu
Author: Amibalu
Author URI: https://unheard.me
Description: A modern, high-performance, and responsive WordPress news and magazine theme. Features native Gutenberg blocks & patterns, custom subtitle decks, editorial labels (Breaking, Exclusive, Opinion, etc.), full schema SEO integration with Yoast/RankMath compatibility, flexible native advertisement engine, social sharing, and dedicated mobile administration.
Version: 1.0.0
Requires at least: 6.2
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: amibalu
Tags: news, magazine, blog, block-patterns, full-site-editing, custom-colors, custom-menu, custom-logo, featured-images, sticky-post, threaded-comments, translation-ready, rtl-language-support, wide-blocks, editor-style
*/

/* ==========================================================================
   Amibalu Core CSS Variables & Base Theme Styles
   ========================================================================== */

:root {
  --amibalu-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --amibalu-font-serif: 'Source Serif 4', Georgia, Cambria, 'Times New Roman', Times, serif;
  --amibalu-font-display: 'Instrument Serif', Georgia, serif;
  
  --amibalu-color-primary: #dc2626;
  --amibalu-color-primary-hover: #b91c1c;
  --amibalu-color-secondary: #0f172a;
  --amibalu-color-accent: #2563eb;
  
  --amibalu-bg-main: #fcfcfc;
  --amibalu-bg-surface: #ffffff;
  --amibalu-bg-subtle: #f4f4f5;
  --amibalu-bg-dark: #09090b;
  
  --amibalu-text-main: #18181b;
  --amibalu-text-muted: #71717a;
  --amibalu-text-subtle: #a1a1aa;
  
  --amibalu-border: #e4e4e7;
  --amibalu-border-subtle: #f4f4f5;
  
  --amibalu-container-max: 1280px;
  --amibalu-radius-sm: 4px;
  --amibalu-radius-md: 8px;
  --amibalu-radius-lg: 12px;
  
  --amibalu-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --amibalu-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --amibalu-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
  --amibalu-bg-main: #09090b;
  --amibalu-bg-surface: #121215;
  --amibalu-bg-subtle: #1c1c21;
  --amibalu-text-main: #f4f4f5;
  --amibalu-text-muted: #a1a1aa;
  --amibalu-text-subtle: #71717a;
  --amibalu-border: #27272a;
  --amibalu-border-subtle: #1c1c21;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--amibalu-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--amibalu-text-main);
  background-color: var(--amibalu-bg-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background-color: var(--amibalu-bg-main);
  color: var(--amibalu-text-main);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--amibalu-font-sans);
  font-weight: 700;
  line-height: 1.25;
  color: var(--amibalu-text-main);
  letter-spacing: -0.02em;
}

.amibalu-serif-heading {
  font-family: var(--amibalu-font-serif);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--amibalu-color-primary);
}

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

/* Container */
.amibalu-container {
  width: 100%;
  max-width: var(--amibalu-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .amibalu-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Header & Tickers */
.amibalu-topbar {
  background-color: var(--amibalu-bg-surface);
  border-bottom: 1px solid var(--amibalu-border);
  font-size: 0.8125rem;
  padding: 0.5rem 0;
}

.amibalu-breaking-ticker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.amibalu-ticker-badge {
  background-color: var(--amibalu-color-primary);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--amibalu-radius-sm);
  white-space: nowrap;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.amibalu-main-header {
  background-color: var(--amibalu-bg-surface);
  border-bottom: 2px solid var(--amibalu-border);
  padding: 1.25rem 0;
}

.amibalu-nav-bar {
  background-color: var(--amibalu-bg-surface);
  border-bottom: 1px solid var(--amibalu-border);
}

.amibalu-nav-menu {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

.amibalu-nav-menu a {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 0;
  display: inline-block;
  position: relative;
}

.amibalu-nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--amibalu-color-primary);
  transition: width 0.2s ease;
}

.amibalu-nav-menu a:hover::after,
.amibalu-nav-menu .current-menu-item > a::after {
  width: 100%;
}

/* Editorial Labels */
.amibalu-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--amibalu-radius-sm);
  line-height: 1.2;
}

.amibalu-label-breaking { background-color: #ef4444; color: #ffffff; }
.amibalu-label-live { background-color: #dc2626; color: #ffffff; animation: pulse-badge 1.5s infinite; }
.amibalu-label-exclusive { background-color: #7c3aed; color: #ffffff; }
.amibalu-label-featured { background-color: #0f172a; color: #ffffff; }
.amibalu-label-opinion { background-color: #0284c7; color: #ffffff; }
.amibalu-label-analysis { background-color: #0d9488; color: #ffffff; }
.amibalu-label-sponsored { background-color: #d97706; color: #ffffff; }
.amibalu-label-video { background-color: #e11d48; color: #ffffff; }
.amibalu-label-review { background-color: #4f46e5; color: #ffffff; }
.amibalu-label-updated { background-color: #10b981; color: #ffffff; }

/* Article Typography */
.amibalu-article-headline {
  font-family: var(--amibalu-font-serif);
  font-size: 2.25rem;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.875rem;
}

@media (min-width: 768px) {
  .amibalu-article-headline {
    font-size: 3rem;
  }
}

.amibalu-article-subtitle {
  font-family: var(--amibalu-font-sans);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--amibalu-text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--amibalu-color-primary);
  padding-left: 1rem;
}

.amibalu-article-body {
  font-family: var(--amibalu-font-serif);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--amibalu-text-main);
}

.amibalu-article-body p {
  margin-bottom: 1.5rem;
}

.amibalu-article-body h2 {
  font-family: var(--amibalu-font-sans);
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.amibalu-article-body h3 {
  font-family: var(--amibalu-font-sans);
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.amibalu-article-body blockquote {
  font-family: var(--amibalu-font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  border-left: 4px solid var(--amibalu-color-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--amibalu-text-main);
}

/* Reading Progress Bar */
#amibalu-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--amibalu-color-primary);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Ad Placements */
.amibalu-ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--amibalu-bg-subtle);
  border: 1px dashed var(--amibalu-border);
  padding: 0.75rem;
  margin: 1.5rem 0;
  text-align: center;
  border-radius: var(--amibalu-radius-md);
  overflow: hidden;
}

.amibalu-ad-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--amibalu-text-subtle);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* Responsive Grid System */
.amibalu-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .amibalu-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.amibalu-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .amibalu-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .amibalu-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Social Share Bar */
.amibalu-share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amibalu-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--amibalu-radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.amibalu-share-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #ffffff;
}

.amibalu-share-x { background-color: #000000; }
.amibalu-share-fb { background-color: #1877f2; }
.amibalu-share-whatsapp { background-color: #25d366; }
.amibalu-share-telegram { background-color: #229ed9; }
.amibalu-share-linkedin { background-color: #0a66c2; }
.amibalu-share-reddit { background-color: #ff4500; }
.amibalu-share-copy { background-color: #4b5563; }

/* Sticky Mobile Bottom Ad & Nav */
.amibalu-mobile-sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--amibalu-bg-surface);
  border-top: 1px solid var(--amibalu-border);
  padding: 0.5rem;
  z-index: 900;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Print Styles */
@media print {
  .amibalu-topbar,
  .amibalu-nav-bar,
  .amibalu-share-bar,
  .amibalu-ad-slot,
  .amibalu-sidebar,
  .amibalu-footer,
  #amibalu-reading-progress {
    display: none !important;
  }
  
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  
  .amibalu-article-headline {
    font-size: 24pt;
  }
}
