/*
Theme Name: TacoRecipe Modern
Theme URI: https://tacorecipe.net
Author: TacoRecipe Team
Author URI: https://tacorecipe.net
Description: A modern, SEO-optimized blog theme for recipe and tutorial content. Built for speed, AI readability, and maximum search engine performance.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: tacorecipe-modern
Tags: blog, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, threaded-comments, translation-ready, editor-style, responsive-layout, rtl-language-support, wide-blocks
*/

/* =============================================
   GOOGLE FONTS IMPORT
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* =============================================
   CSS VARIABLES - DESIGN TOKENS
   ============================================= */
:root {
  /* Brand Colors */
  --color-primary: #E84545;
  --color-primary-dark: #C73232;
  --color-primary-light: #FF6B6B;
  --color-accent: #F7A440;
  --color-accent-light: #FFD166;

  /* Neutrals */
  --color-dark: #1A1A2E;
  --color-dark-2: #16213E;
  --color-mid: #4A4A6A;
  --color-text: #2D2D3A;
  --color-text-muted: #6B6B85;
  --color-light: #F8F7FF;
  --color-white: #FFFFFF;
  --color-border: #E8E6F0;
  --color-border-light: #F0EFF8;

  /* Semantic */
  --color-success: #06D6A0;
  --color-warning: #FFB703;
  --color-info: #4361EE;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Font Sizes */
  --text-xs: clamp(0.7rem, 1vw, 0.75rem);
  --text-sm: clamp(0.8rem, 1.2vw, 0.875rem);
  --text-base: clamp(0.9rem, 1.5vw, 1rem);
  --text-md: clamp(1rem, 1.8vw, 1.125rem);
  --text-lg: clamp(1.1rem, 2vw, 1.25rem);
  --text-xl: clamp(1.2rem, 2.5vw, 1.5rem);
  --text-2xl: clamp(1.4rem, 3vw, 2rem);
  --text-3xl: clamp(1.7rem, 4vw, 2.5rem);
  --text-4xl: clamp(2rem, 5vw, 3.5rem);
  --text-5xl: clamp(2.5rem, 6vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,26,46,0.08), 0 1px 2px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 16px rgba(26,26,46,0.1), 0 2px 6px rgba(26,26,46,0.06);
  --shadow-lg: 0 10px 40px rgba(26,26,46,0.12), 0 4px 12px rgba(26,26,46,0.08);
  --shadow-xl: 0 20px 60px rgba(26,26,46,0.15), 0 8px 20px rgba(26,26,46,0.1);
  --shadow-glow: 0 0 30px rgba(232,69,69,0.2);
  --shadow-glow-accent: 0 0 30px rgba(247,164,64,0.25);

  /* Layout */
  --container-sm: 680px;
  --container-md: 860px;
  --container-lg: 1140px;
  --container-xl: 1340px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-dark);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); margin: var(--space-12) 0 var(--space-6); }
h3 { font-size: var(--text-2xl); margin: var(--space-8) 0 var(--space-4); }
h4 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-3); font-family: var(--font-body); font-weight: 700; }
h5 { font-size: var(--text-lg); font-family: var(--font-body); font-weight: 600; }
h6 { font-size: var(--text-md); font-family: var(--font-body); font-weight: 600; }

p {
  margin-bottom: var(--space-5);
  font-size: var(--text-md);
  color: var(--color-text);
  line-height: 1.8;
}

ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

li { margin-bottom: var(--space-2); line-height: 1.7; }

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  background: linear-gradient(135deg, rgba(232,69,69,0.04), rgba(247,164,64,0.04));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-mid);
}

code {
  font-family: var(--font-mono);
  background: var(--color-light);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
}

pre {
  background: var(--color-dark);
  color: #e8e6f0;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-8) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  position: relative;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--space-10) 0;
}

/* =============================================
   LAYOUT & CONTAINERS
   ============================================= */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--sm { max-width: var(--container-sm); }
.container--md { max-width: var(--container-md); }
.container--xl { max-width: var(--container-xl); }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition-base);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--space-8);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 40px;
  width: auto;
}

.site-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-dark);
  line-height: 1;
}

.site-logo-text span {
  color: var(--color-primary);
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.main-nav a {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-mid);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.current-menu-item {
  color: var(--color-primary);
  background: rgba(232,69,69,0.06);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-search-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--color-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-mid);
  transition: all var(--transition-fast);
}

.header-search-btn:hover {
  background: var(--color-border);
  color: var(--color-dark);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  position: relative;
  padding: var(--space-20) 0;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(232,69,69,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(247,164,64,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--color-white), transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--color-accent-light);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  animation: fadeInDown 0.6s ease;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--color-white);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title em {
  color: var(--color-accent-light);
  font-style: italic;
}

.hero-desc {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* =============================================
   CATEGORY PILLS / TAGS
   ============================================= */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: rgba(232,69,69,0.08);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid rgba(232,69,69,0.15);
}

.category-pill:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* =============================================
   CARD SYSTEM
   ============================================= */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--color-light);
}

.card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card__image-wrap img {
  transform: scale(1.06);
}

.card__badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1;
}

.card__reading-time {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(26,26,46,0.8);
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-3);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.card__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.3;
  color: var(--color-dark);
  margin: 0;
  transition: color var(--transition-fast);
}

.card:hover .card__title { color: var(--color-primary); }

.card__title a {
  color: inherit;
  text-decoration: none;
}

.card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.card__author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.card__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.card__author-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-mid);
}

.card__read-more {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--transition-fast);
}

.card:hover .card__read-more { gap: var(--space-2); }

/* Featured Card */
.card--featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  border-radius: var(--radius-xl);
}

.card--featured .card__image-wrap {
  aspect-ratio: auto;
  grid-row: 1 / -1;
}

.card--featured .card__body {
  padding: var(--space-10);
  justify-content: center;
}

.card--featured .card__title {
  font-size: var(--text-3xl);
}

/* =============================================
   GRID LAYOUTS
   ============================================= */
.posts-grid {
  display: grid;
  gap: var(--space-8);
}

.posts-grid--3 { grid-template-columns: repeat(3, 1fr); }
.posts-grid--2 { grid-template-columns: repeat(2, 1fr); }
.posts-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.section-header__text { flex: 1; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-dark);
  line-height: 1.15;
  margin: 0;
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: gap var(--transition-fast);
}

.section-link:hover { gap: var(--space-3); }

/* =============================================
   ARTICLE PAGE
   ============================================= */
.article-hero {
  padding: var(--space-16) 0 var(--space-10);
  background: linear-gradient(180deg, var(--color-light) 0%, var(--color-white) 100%);
}

.article-hero__inner {
  max-width: var(--container-md);
  margin: 0 auto;
  text-align: center;
}

.article-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.article-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  line-height: 1.15;
  margin-bottom: var(--space-5);
  color: var(--color-dark);
}

.article-hero__intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.article-hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.article-hero__stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.article-hero__stat svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  display: inline-block;
}

/* Article Featured Image */
.article-featured-image {
  max-width: var(--container-lg);
  margin: 0 auto var(--space-12);
  padding: 0 var(--space-6);
}

.article-featured-image img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  aspect-ratio: 16/7;
  object-fit: cover;
}

/* Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-12);
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-20);
  align-items: start;
}

/* Article Content */
.article-content {
  min-width: 0;
}

.article-content h2 {
  font-size: var(--text-3xl);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border-light);
  position: relative;
}

.article-content h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.article-content h3 {
  font-size: var(--text-2xl);
}

.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(232,69,69,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast);
}

.article-content a:hover {
  text-decoration-color: var(--color-primary);
}

.article-content ul li, .article-content ol li {
  padding-left: var(--space-2);
}

.article-content ul li::marker { color: var(--color-primary); }

/* =============================================
   CONTENT BOXES (matching prompt.txt style)
   ============================================= */

/* Step Box */
.step-box {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 14px 18px;
  margin: 10px 0;
  border-radius: 6px;
  position: relative;
}

/* Tip Box */
.tip-box {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 4px;
}

/* Warning Box */
.warning-box {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 4px;
}

/* Info Box */
.info-box {
  background: #e8f0ff;
  border-left: 4px solid #4361EE;
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 4px;
}

/* TOC Box */
.toc-box {
  background-color: #f1f8ff;
  border-left: 4px solid #0078d4;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

/* FAQ Item */
.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 14px 0;
}

/* CTA Box */
.cta-box {
  background-color: #0078d4;
  color: white;
  padding: 20px;
  margin-top: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Author Bio Box */
.author-bio-box {
  background-color: #f5f5f5;
  padding: 20px;
  margin-top: 30px;
  border-radius: 8px;
}

/* =============================================
   TABLE OF CONTENTS (SIDEBAR STICKY)
   ============================================= */
.toc-sidebar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: sticky;
  top: calc(72px + var(--space-6));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.toc-sidebar__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toc-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-sidebar__nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.toc-sidebar__nav a:hover,
.toc-sidebar__nav a.is-active {
  color: var(--color-primary);
  background: rgba(232,69,69,0.06);
  border-left-color: var(--color-primary);
}

.toc-sidebar__nav li li a {
  padding-left: var(--space-6);
  font-size: var(--text-xs);
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* =============================================
   SIDEBAR WIDGETS
   ============================================= */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.widget {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.widget__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Recent Posts Widget */
.widget-recent-post {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.widget-recent-post:last-child { border-bottom: none; }

.widget-recent-post:hover { opacity: 0.8; }

.widget-recent-post__img {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.widget-recent-post__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.widget-recent-post__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Newsletter Widget */
.widget--newsletter {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
  border-color: transparent;
  color: white;
  position: relative;
  overflow: hidden;
}

.widget--newsletter::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(232,69,69,0.3), transparent);
  pointer-events: none;
}

.widget--newsletter .widget__title { color: rgba(255,255,255,0.5); border-bottom-color: rgba(255,255,255,0.1); }
.widget--newsletter h3 { font-size: var(--text-xl); color: white; font-family: var(--font-display); margin: 0 0 var(--space-2); }
.widget--newsletter p { font-size: var(--text-sm); color: rgba(255,255,255,0.6); margin-bottom: var(--space-5); }

.newsletter-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  margin-bottom: var(--space-3);
  transition: border-color var(--transition-fast);
}

.newsletter-input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-input:focus { outline: none; border-color: var(--color-primary-light); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-spring);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(232,69,69,0.35);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,69,69,0.4);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.btn--ghost {
  background: var(--color-light);
  color: var(--color-mid);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-border);
  color: var(--color-dark);
}

.btn--white {
  background: white;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn--white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-primary-dark);
}

.btn--full { width: 100%; }
.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); }
.btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }

/* =============================================
   SEARCH OVERLAY
   ============================================= */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26,26,46,0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.search-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  width: 100%;
  max-width: 680px;
  padding: 0 var(--space-6);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.search-input {
  flex: 1;
  border: none;
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  font-family: var(--font-body);
  color: var(--color-dark);
  background: transparent;
}

.search-input:focus { outline: none; }

.search-submit {
  padding: 0 var(--space-6);
  height: 100%;
  background: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}

.search-submit:hover { background: var(--color-primary-dark); }

/* =============================================
   BREADCRUMBS
   ============================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.breadcrumbs__sep {
  font-size: 10px;
  opacity: 0.5;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-12) 0;
}

.page-num {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.page-num:hover {
  background: var(--color-light);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.page-num.is-current {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* =============================================
   COMMENTS
   ============================================= */
.comments-section {
  padding: var(--space-12) 0;
  border-top: 2px solid var(--color-border-light);
}

.comments-section h2 {
  font-size: var(--text-2xl);
}

.comment {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.comment__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment__meta {
  margin-bottom: var(--space-2);
}

.comment__author {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-dark);
}

.comment__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comment__body {
  font-size: var(--text-sm);
  line-height: 1.7;
  margin: 0;
}

/* Comment Form */
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
  background: white;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.comment-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
}

.footer-top {
  padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
}

.footer-brand .site-logo-text {
  color: white;
  margin-bottom: var(--space-4);
  display: block;
  font-size: var(--text-2xl);
}

.footer-desc {
  font-size: var(--text-sm);
  line-height: 1.8;
  margin-bottom: var(--space-6);
  color: rgba(255,255,255,0.5);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(232,69,69,0.1);
}

.footer-widget__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-5);
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  color: rgba(255,255,255,0.5);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--color-accent-light); }

.footer-bottom {
  padding: var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
}

.footer-legal {
  display: flex;
  gap: var(--space-5);
}

.footer-legal a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal a:hover { color: rgba(255,255,255,0.7); }

/* =============================================
   BACK TO TOP
   ============================================= */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-spring);
  font-size: 18px;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-4px);
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .article-layout { grid-template-columns: 1fr 280px; }
}

@media (max-width: 1024px) {
  .posts-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .posts-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card--featured { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
  .posts-grid--2, .posts-grid--3, .posts-grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2rem, 6vw, 3rem); }
  .article-hero__title { font-size: clamp(1.6rem, 5vw, 2.5rem); }
  .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .card__body { padding: var(--space-4); }
  .back-to-top { bottom: var(--space-4); right: var(--space-4); }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .site-header, .sidebar, .back-to-top,
  .reading-progress, .search-overlay,
  .site-footer { display: none !important; }
  .article-layout { grid-template-columns: 1fr; }
  body { font-size: 12pt; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; }
}

/* =============================================
   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: 0;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 700;
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus { top: 0; }

/* =============================================
   ANCHOR SCROLL FIX — TOC dari prompt.txt
   span[id] HARUS display:block dan scroll-margin-top
   agar sticky header tidak menutupi section target
   ============================================= */

html {
  scroll-behavior: smooth;
}

/* span kosong anchor target: <span id="s1"></span>
   HARUS block — inline span tidak punya posisi vertikal akurat */
span[id] {
  display: block !important;
  scroll-margin-top: 100px !important;
  visibility: hidden;
  height: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

/* heading dan elemen anchor lainnya */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id],
section[id] {
  scroll-margin-top: 100px !important;
}

/* TOC link style */
.article-content a[href^="#"] {
  text-decoration: underline;
  text-decoration-color: rgba(14, 120, 212, 0.4);
  text-underline-offset: 3px;
}
.article-content a[href^="#"]:hover {
  text-decoration-color: #0078d4;
}
