/*
Theme Name: Comiweb
Theme URI: https://comiweb.com
Author: Comiweb Team
Author URI: https://comiweb.com
Description: Tema oficial de Comiweb — Recetas, Tips y mucho más para cocinar en casa. Optimizado para SEO y Google AdSense. Diseñado para madres, padres y amantes de la cocina casera.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: comiweb
Tags: cooking, food, recipes, blog, custom-menu, featured-images, footer-widgets, custom-logo, rtl-language-support, responsive-layout, translation-ready
*/

/* ============================================================
   ROOT VARIABLES — DESIGN SYSTEM COMIWEB
   ============================================================ */
:root {
  /* Brand Colors */
  --cw-orange:        #E85D04;
  --cw-orange-dark:   #C44B02;
  --cw-orange-light:  #FFF0E6;
  --cw-orange-glow:   rgba(232, 93, 4, 0.15);
  --cw-green:         #0D4F2E;
  --cw-green-dark:    #083520;
  --cw-green-mid:     #155D38;
  --cw-gold:          #F5C518;
  --cw-gold-light:    #FDE68A;

  /* Neutral */
  --cw-white:         #FFFFFF;
  --cw-off-white:     #FFF8F3;
  --cw-gray-light:    #F4F1EE;
  --cw-gray:          #9CA3AF;
  --cw-gray-dark:     #4B5563;
  --cw-text:          #1C1917;
  --cw-text-light:    #57534E;

  /* Typography */
  --font-title:       'Playfair Display', Georgia, serif;
  --font-body:        'Nunito', 'Segoe UI', sans-serif;
  --font-display:     'Bebas Neue', 'Impact', sans-serif;

  /* Spacing */
  --cw-gap:           1.5rem;
  --cw-gap-sm:        0.75rem;
  --cw-gap-lg:        3rem;
  --cw-radius:        10px;
  --cw-radius-sm:     6px;
  --cw-radius-lg:     20px;

  /* Shadows */
  --cw-shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
  --cw-shadow:        0 4px 20px rgba(0,0,0,0.12);
  --cw-shadow-lg:     0 8px 40px rgba(0,0,0,0.18);
  --cw-shadow-orange: 0 4px 20px rgba(232, 93, 4, 0.35);

  /* Layout */
  --cw-max-width:     1280px;
  --cw-content-width: 860px;
  --cw-sidebar-width: 320px;
  --header-height:    110px;

  /* AdSense-safe padding (keeps content away from ad edges) */
  --ad-safe-pad:      1.25rem;
  --ad-block-margin:  2rem;

  /* Transitions */
  --cw-transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--cw-text);
  background-color: var(--cw-off-white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.cw-container {
  max-width: var(--cw-max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.cw-container--narrow {
  max-width: var(--cw-content-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Main wrapper — offset by header height */
#cw-main-content {
  min-height: calc(100vh - var(--header-height) - 420px);
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

/* ============================================================
   GLOBAL AD-SAFE SPACING (Google AdSense compliance)
   ============================================================ */
.ad-unit {
  display: block;
  margin: var(--ad-block-margin) auto;
  padding: var(--ad-safe-pad);
  text-align: center;
  clear: both;
  overflow: hidden;
}

.ad-unit--top    { margin-top: 0; }
.ad-unit--bottom { margin-bottom: 0; }

/* ============================================================
   TYPOGRAPHY BASELINE — autoridad del tema
   Reglas mínimas. Elementor widgets sobreescriben con su scope.
   ============================================================ */
h1, h2, h3, h4, h5, h6,
.cw-h1, .cw-h2, .cw-h3, .cw-h4, .cw-h5, .cw-h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cw-text);
  margin: 0 0 0.6em;
}
h1, .cw-h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2, .cw-h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3, .cw-h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
h4, .cw-h4 { font-size: 1.2rem; }
h5, .cw-h5 { font-size: 1.05rem; }
h6, .cw-h6 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 0 0 1rem; }

/* Enlaces SOLO dentro de contenido del tema, NO Elementor */
.entry-content a,
.cw-content a,
.cw-prose a {
  color: var(--cw-orange);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.entry-content a:hover,
.cw-content a:hover,
.cw-prose a:hover {
  color: var(--cw-orange-dark);
}

/* ============================================================
   BUTTON SYSTEM — .cw-btn (reutilizable por tema + plugins)
   ÚNICA fuente de verdad para botones de marca.
   NO toca .elementor-button (Elementor self-styled).
   ============================================================ */
.cw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--cw-radius-sm);
  cursor: pointer;
  line-height: 1.2;
  background: var(--cw-orange);
  color: var(--cw-white);
  box-shadow: 0 4px 14px rgba(232, 93, 4, 0.25);
  transition: var(--cw-transition);
  white-space: nowrap;
}
.cw-btn:hover,
.cw-btn:focus {
  background: var(--cw-orange-dark);
  color: var(--cw-white);
  box-shadow: 0 6px 18px rgba(232, 93, 4, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
}
.cw-btn:active { transform: scale(0.98); }

/* Variantes */
.cw-btn--secondary {
  background: transparent;
  color: var(--cw-text);
  border-color: var(--cw-gray-light);
  box-shadow: none;
}
.cw-btn--secondary:hover,
.cw-btn--secondary:focus {
  background: var(--cw-orange-light);
  color: var(--cw-orange-dark);
  border-color: var(--cw-orange);
  box-shadow: none;
}

.cw-btn--ghost {
  background: transparent;
  color: var(--cw-orange);
  border-color: var(--cw-orange);
  box-shadow: none;
}
.cw-btn--ghost:hover,
.cw-btn--ghost:focus {
  background: var(--cw-orange);
  color: var(--cw-white);
}

.cw-btn--green {
  background: var(--cw-green);
  box-shadow: 0 4px 14px rgba(13, 79, 46, 0.25);
}
.cw-btn--green:hover,
.cw-btn--green:focus {
  background: var(--cw-green-dark);
  color: var(--cw-white);
  box-shadow: 0 6px 18px rgba(13, 79, 46, 0.4);
}

.cw-btn--sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.cw-btn--lg { padding: 0.9rem 2rem; font-size: 1rem; }
.cw-btn--block { display: flex; width: 100%; }
.cw-btn--pill { border-radius: 30px; }

.cw-btn:disabled,
.cw-btn[disabled] {
  background: var(--cw-gray);
  color: var(--cw-white);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Forms básicos coherentes con el tema */
.cw-input,
.cw-textarea,
.cw-select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--cw-text);
  background: var(--cw-white);
  border: 2px solid var(--cw-gray-light);
  border-radius: var(--cw-radius-sm);
  padding: 0.6rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cw-input:focus,
.cw-textarea:focus,
.cw-select:focus {
  outline: none;
  border-color: var(--cw-orange);
  box-shadow: 0 0 0 3px var(--cw-orange-glow);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--cw-orange);
  color: var(--cw-white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--cw-radius);
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-orange { color: var(--cw-orange); }
.text-green  { color: var(--cw-green); }
.text-gold   { color: var(--cw-gold); }
.bg-orange   { background-color: var(--cw-orange); }
.bg-green    { background-color: var(--cw-green); }
.fw-bold     { font-weight: 700; }
.font-title  { font-family: var(--font-title); }
.font-display{ font-family: var(--font-display); }
.hidden      { display: none; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ============================================================
   WORDPRESS CORE CLASSES
   ============================================================ */
.alignleft  { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }
.aligncenter{ display: block; margin-inline: auto; }
.wp-caption  { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: var(--cw-text-light); text-align: center; margin-top: 0.5rem; }
.sticky { /* sticky posts */ }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }

/* ============================================================
   PAGINATION
   ============================================================ */
.cw-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
  flex-wrap: wrap;
}
.cw-pagination a,
.cw-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: var(--cw-radius-sm);
  border: 2px solid var(--cw-gray-light);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cw-text);
  background: var(--cw-white);
  transition: var(--cw-transition);
}
.cw-pagination a:hover,
.cw-pagination .current {
  background: var(--cw-orange);
  border-color: var(--cw-orange);
  color: var(--cw-white);
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================ */
@media (max-width: 1280px) {
  :root { --cw-max-width: 100%; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 130px;
    --cw-gap-lg: 2rem;
  }
  #cw-main-content { padding-top: 1.5rem; }
}

@media (max-width: 480px) {
  :root { --header-height: 120px; }
}

/* ============================================================
   FIX: Ocultar título de sitio suelto (WordPress lo puede
   imprimir en algunos contextos como h1.site-title o
   .wp-site-blocks .site-title)
   ============================================================ */

#cw-header .site-title,
#cw-header h1.site-title {
  display: block; /* dentro del header sí se muestra si aplica */
}

/* ============================================================
   COMPAT — CookieYes / GDPR Cookie Consent
   El banner usa z-index altísimo (~2147483645). Aseguramos que
   nuestro menú móvil no quede atrapado debajo del backdrop de
   CookieYes y que el banner no oculte completamente el contenido
   en móvil.
   ============================================================ */
.cli-modal-backdrop,
.cky-overlay { z-index: 9990; }
.cky-consent-container,
.cky-modal { z-index: 9999; }
@media (max-width: 600px) {
  .cky-consent-bar { max-height: 70vh; overflow-y: auto; }
}

