/*
Theme Name: EAD Blocks
Theme URI: https://ead.dev.l3m.mx
Description: Child theme for Astra with hierarchical taxonomy support and EAD color system
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
Author: El Águila Descalza
Author URI: https://ead.dev.l3m.mx
Template: astra
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ead-blocks
Domain Path: /languages
Tags: astra, child-theme, responsive, ead, hierarchical-taxonomy
*/

/* ============================================================================
   EAD Blocks Theme - Child Theme for Astra
   
   This theme extends Astra with:
    - Dynamic color system based on EAD taxonomy (OPINIÓN, SOCIEDAD, CULTURA, etc.)
    - Hierarchical category support (2-level: Parent > Child)
    - Semantic styling for El Águila Descalza content
   
   ========================================================================== */

:root {
  /* EAD Color System - Set by ead-taxonomy.php dynamically */
  --ead-color-primary: #1a1a1a;
  --ead-color-secondary: #666666;
  --ead-color-accent: #2196F3;
}

/* ============================================================================
   Base Styles (inherited from parent theme, customized as needed)
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  /* Color system injected by ead-taxonomy.php via inline styles */
}

/* ============================================================================
   Typography Overrides
   ========================================================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

/* ============================================================================
  EAD Category System - Dynamic Styling
   ========================================================================== */

/* These classes are added by ead-taxonomy.php based on post's parent category */

.ead-category {
  position: relative;
}

.ead-category::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background-color: var(--ead-color-primary);
}

/* ============================================================================
  Category Colors - Specific to EAD Taxonomy
   ========================================================================== */

.ead-opinion,
.ead-opinion * {
  --ead-color-primary: #805AD5;
}

.ead-sociedad,
.ead-sociedad * {
  --ead-color-primary: #718096;
}

.ead-cultura,
.ead-cultura * {
  --ead-color-primary: #38B2AC;
}

.ead-politica,
.ead-politica * {
  --ead-color-primary: #3182CE;
}

.ead-tecnologia,
.ead-tecnologia * {
  --ead-color-primary: #4299E1;
}

.ead-deportes,
.ead-deportes * {
  --ead-color-primary: #DD6B20;
}

/* Body class fallback to ensure color variable is present even if inline CSS fails */
body.ead-opinion { --ead-color-primary: #805AD5; }
body.ead-sociedad { --ead-color-primary: #718096; }
body.ead-cultura { --ead-color-primary: #38B2AC; }
body.ead-politica { --ead-color-primary: #3182CE; }
body.ead-tecnologia { --ead-color-primary: #4299E1; }
body.ead-deportes { --ead-color-primary: #DD6B20; }

/* ============================================================================
   Post Meta & Category Badges
   ========================================================================== */

.post-category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--ead-color-primary);
  color: white;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 0.5rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.post-category-badge:hover {
  opacity: 0.85;
  text-decoration: none;
}

.post-category-parent {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.post-category-child {
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================================
   Breadcrumbs
   ========================================================================== */

.ead-breadcrumb {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

.ead-breadcrumb-item {
  display: inline;
  margin-right: 0.5rem;
}

.ead-breadcrumb-item::after {
  content: ' / ';
  margin-left: 0.5rem;
  opacity: 0.5;
}

.ead-breadcrumb-item:last-child::after {
  content: '';
}

.ead-breadcrumb-item a {
  color: var(--ead-color-primary);
  text-decoration: none;
  font-weight: 500;
}

.ead-breadcrumb-item a:hover {
  text-decoration: underline;
}

/* ============================================================================
   Archive / Category Pages
   ========================================================================== */

.archive-header {
  padding: 2rem;
  background-color: var(--ead-color-primary);
  color: white;
  margin-bottom: 2rem;
}

.archive-header h1 {
  color: white;
  margin: 0;
}

.archive-header .category-description {
  margin-top: 0.5rem;
  opacity: 0.95;
}

/* ============================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
  .ead-breadcrumb {
    font-size: 0.875rem;
  }

  .archive-header {
    padding: 1.5rem;
  }

  /* Typography and spacing adjustments for mobile */
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .site-content { padding-left: 1rem; padding-right: 1rem; }
  .post-category-badge { margin-bottom: 0.35rem; }
  .search .ast-row,
  .archive .ast-row,
  .blog .ast-row {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .ast-archive-description,
  .search .ast-archive-description {
    padding: 1.25rem 1rem;
  }
}

/* Header accent to surface EAD color in nav */
.main-header-bar {
  border-bottom: 3px solid var(--ead-color-primary);
}

/* Search result emphasis */
.search .entry-title a {
  color: var(--ead-color-primary);
}

/* ============================================================================
   Utility Classes
   ========================================================================== */

.highlight-primary {
  background-color: var(--ead-color-primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
}

.border-left-primary {
  border-left: 4px solid var(--ead-color-primary);
  padding-left: 1rem;
}

.divider-primary {
  height: 2px;
  background-color: var(--ead-color-primary);
  margin: 1.5rem 0;
}

/* Creative Polish: underline-as-marker effect for links */
.entry-content a {
  text-decoration: none;
  background-image: linear-gradient(var(--ead-color-primary), var(--ead-color-primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 150ms ease-in;
}

.entry-content a:hover {
  background-size: 100% 2px;
}

/* Creative Polish: urgent headline tone */
h1.entry-title {
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.1;
}

/* Creative Polish: stamp-like category badges */
.ast-post-meta-taxonomy a {
  border: 2px solid var(--ead-color-primary);
  color: var(--ead-color-primary);
  text-transform: uppercase;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 0;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ast-post-meta-taxonomy a:hover {
  background-color: var(--ead-color-primary);
  color: #fff;
}

/* ==========================================================================
   Ticker: slim rail for latest posts
   ========================================================================== */

.ead-ticker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, rgba(0,0,0,0.02), rgba(0,0,0,0));
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ead-ticker__label {
  flex-shrink: 0;
  background-color: var(--ead-color-primary);
  color: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.ead-ticker__items {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.ead-ticker__items::-webkit-scrollbar {
  display: none;
}

.ead-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ead-color-primary);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 120ms ease, color 120ms ease;
}

.ead-ticker__item::before {
  content: "•";
  color: var(--ead-color-primary);
  font-size: 0.9rem;
}

.ead-ticker__item:hover {
  border-color: var(--ead-color-primary);
}

@media (max-width: 768px) {
  .ead-ticker {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .ead-ticker__items {
    gap: 0.75rem;
  }
}

/* ==========================================================================
   Category filter tabs
   ========================================================================== */

.ead-category-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.25rem 0;
}

.ead-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--ead-color-primary);
  border-radius: 999px;
  color: var(--ead-color-primary);
  background: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ead-category-tab:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.ead-category-tab.is-active {
  background-color: var(--ead-color-primary);
  color: #fff;
}

@media (max-width: 768px) {
  .ead-category-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* ============================================================================
   Ensure Astra parent theme styles are properly inherited
   ========================================================================== */

@import url("../astra/style.css");
