/*
Theme Name: Criterio.hn
Theme URI: https://criterio.hn
Author: Criterio.hn
Author URI: https://criterio.hn
Description: Tema personalizado para Criterio.hn — Periodismo independiente y de investigación en Honduras. Diseño premium con modo claro/oscuro, tipografía serif editorial, secciones de fact-checking, y sistema de donaciones integrado.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: criterio-hn
Tags: news, blog, one-column, two-columns, custom-menu, featured-images, translation-ready, dark-mode
*/

/* ==========================================================================
   CSS VARIABLES — Modo Claro / Oscuro
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #111111;
  --text-secondary: #555555;
  --border: #e0e0e0;
  --surface: rgba(0,0,0,.035);
  --color-brand-red: #911e2e;
  --color-brand-burgundy: #6b1521;
  color-scheme: light;
}

html.dark {
  --bg: #050608;
  --text: #f7f8f8;
  --text-secondary: #8a8f98;
  --border: rgba(255,255,255,.085);
  --surface: rgba(255,255,255,.035);
  color-scheme: dark;
}

/* ==========================================================================
   GLOBAL THEME TRANSITIONS
   ========================================================================== */

html, body, header, main, footer, article, section, p,
h1, h2, h3, h4, h5, h6, a, span {
  transition: background-color 0.25s ease-in-out,
              border-color 0.25s ease-in-out,
              color 0.25s ease-in-out;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg) !important;
  color: var(--text) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-serif,
.entry-title,
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, Times, serif;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background-color: rgba(145, 30, 46, 0.2);
  color: inherit;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-featured-image {
  aspect-ratio: 16 / 9 !important;
  max-height: 380px !important;
  width: 100% !important;
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-brand-red);
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0%;
}

/* ==========================================================================
   AD LABEL
   ========================================================================== */

.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 4px;
}

.ad-unit {
  container-type: inline-size;
}

/* ==========================================================================
   NEWS TICKER
   ========================================================================== */

.ticker-wrap {
  overflow: hidden;
  width: 100%;
}
.ticker {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}
.ticker:hover {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   CARD HOVER
   ========================================================================== */

.post-card {
  will-change: transform;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   BRAND COLORS (Tailwind equivalents)
   ========================================================================== */

.bg-brand-red { background-color: #911e2e; }
.bg-brand-burgundy { background-color: #6b1521; }
.text-brand-red { color: #911e2e; }
.hover\:text-brand-red:hover { color: #911e2e; }
.border-brand-red { border-color: #911e2e; }
.ring-brand-red { --tw-ring-color: #911e2e; }

/* ==========================================================================
   CATEGORY CHIP COLORS — taxonomía real de Criterio.hn
   (definidos aquí para no depender del build de Tailwind)
   ========================================================================== */

.bg-sky-700     { background-color: #0369a1; }
.bg-blue-600    { background-color: #2563eb; }
.bg-violet-600  { background-color: #7c3aed; }
.bg-teal-600    { background-color: #0d9488; }
.bg-amber-600   { background-color: #d97706; }
.bg-cyan-700    { background-color: #0e7490; }
.bg-emerald-600 { background-color: #059669; }
.bg-purple-600  { background-color: #9333ea; }
.bg-orange-600  { background-color: #ea580c; }
.bg-gray-600    { background-color: #4b5563; }
.bg-red-600     { background-color: #dc2626; }
.bg-amber-500   { background-color: #f59e0b; }
.bg-gray-500    { background-color: #6b7280; }

/* ==========================================================================
   PROSE / CONTENT STYLES
   ========================================================================== */

.prose {
  max-width: 72ch;
  color: var(--text);
  line-height: 1.85;
  font-size: 1.125rem;
  margin-left: auto;
  margin-right: auto;
}
.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.5em;
  color: var(--text);
  font-size: 1.125rem;
  line-height: 1.85;
}
.prose > p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.8;
}
.prose a {
  color: var(--color-brand-red, #911e2e);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--color-brand-red, #911e2e);
  transition: border-color 0.2s ease;
}
.prose a:hover {
  text-decoration: none;
  border-bottom-style: solid;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: 'Playfair Display', Georgia, Times, serif;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}
.prose h2 {
  font-size: 1.75em;
  margin-top: 2.25em;
  margin-bottom: 0.85em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.prose h3 {
  font-size: 1.35em;
  margin-top: 1.75em;
  margin-bottom: 0.65em;
}
.prose img {
  margin: 2em auto;
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.prose blockquote {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
  border-left: 4px solid var(--color-brand-red, #911e2e);
  padding: 0.75rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--surface);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--text);
}
.prose ul, .prose ol {
  padding-left: 1.625em;
  margin-top: 1em;
  margin-bottom: 1em;
}
.prose li {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
  line-height: 1.7;
}
.prose figure {
  margin: 2em auto;
}
.prose figcaption {
  font-size: 0.875em;
  color: var(--text-secondary);
  margin-top: 0.5em;
  text-align: center;
  font-style: italic;
}
.prose pre {
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1em;
  overflow-x: auto;
}
.prose code {
  font-size: 0.875em;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-top: 3em;
  margin-bottom: 3em;
}

/* Restrict SVGs inside prose to prevent giant social icon overflows */
.prose svg:not(.ad-unit svg),
.entry-content svg:not(.ad-unit svg) {
  max-width: 24px !important;
  max-height: 24px !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  vertical-align: middle;
}

/* Hide third-party bloated social sharing blocks inside content */
.prose .sharedaddy,
.prose .sd-sharing,
.prose .sd-content,
.prose .jp-relatedposts,
.prose .shared-counts,
.prose .wp-block-social-links {
  display: none !important;
}

/* Related posts grid CSS fallback */
.related-posts-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 1.5rem !important;
}

/* Dark mode prose overrides */
html.dark .prose {
  color: #f7f8f8;
}
html.dark .prose a {
  color: #f87171;
  border-bottom-color: #f87171;
}
html.dark .prose blockquote {
  color: #d1d5db;
}

/* ==========================================================================
   CONTENT FIXES — Constrain imported/scraped HTML
   ========================================================================== */

/* Prevent images and media from breaking layout (excluding ad units) */
.prose img:not(.ad-unit img),
.prose video,
.prose iframe,
.prose canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* Ensure SVG icons inside content are constrained without collapsing ad units */
.prose svg:not(.ad-unit svg) {
  max-width: 24px !important;
  max-height: 24px !important;
  height: auto !important;
}

/* Fix Ad Unit heights and boundaries explicitly */
.ad-unit {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.ad-unit > div {
  min-height: 90px !important;
  display: flex !important;
}

.ad-unit svg {
  width: 24px !important;
  height: 24px !important;
  max-width: none !important;
  max-height: none !important;
}

/* Override any fixed widths from Elementor/Bootstrap */
.prose [style*="width"]:not(.ad-unit):not(.ad-unit *) {
  max-width: 100% !important;
}

/* Ensure all content stays inside the prose container */
.prose > * {
  max-width: 100%;
  word-wrap: break-word;
}
