/*
Theme Name: Cazuelas Modern
Theme URI: https://cazuelas.online/
Author: Cazuelas Online
Author URI: https://cazuelas.online/
Description: Tema a medida, moderno y orientado a rendimiento (Core Web Vitals) para Cazuelas Online: guías de compra de cazuelas, ollas, cacerolas y sartenes.
Version: 0.1.0
Requires at least: 6.0
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: cazuelas-modern
Tags: blog, e-commerce, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   Design tokens
   ========================================================= */
:root {
  /* Color */
  --c-bg: #ffffff;
  --c-surface: #f7f5f2;
  --c-text: #1d1b19;
  --c-muted: #5f5a54;
  --c-border: #e7e2db;
  --c-brand: #c0392b;      /* rojo cazuela / terracota */
  --c-brand-dark: #97291c;
  --c-accent: #e08a1e;     /* ámbar */
  --c-link: var(--c-brand);

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Georgia", "Times New Roman", serif;
  --fs-base: 1.0625rem;
  --lh-base: 1.65;

  /* Spacing / layout */
  --space: 1rem;
  --container: 72rem;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration-thickness: .08em; text-underline-offset: .15em; }
a:hover { color: var(--c-brand-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--c-text); }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }

/* =========================================================
   Layout helpers
   ========================================================= */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 1000; }

/* =========================================================
   Site header
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space); padding-block: .75rem;
}
.site-branding a { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--c-text); text-decoration: none; }
/* Navigation -------------------------------------------------- */
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { text-decoration: none; color: var(--c-text); font-weight: 500; display: block; }
.main-nav a:hover { color: var(--c-brand); }

/* Top-level (desktop) */
.main-nav > ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a { padding-block: .5rem; }

/* Dropdowns (desktop) */
.main-nav .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 60;
  min-width: 14rem; max-height: 70vh; overflow-y: auto;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .4rem; display: none;
}
.main-nav .menu-item-has-children:hover > .sub-menu,
.main-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
.main-nav .sub-menu a { padding: .5rem .7rem; border-radius: 8px; font-weight: 400; }
.main-nav .sub-menu a:hover { background: var(--c-surface); }

/* Submenu toggle button (used on mobile) */
.submenu-toggle { display: none; background: none; border: 0; cursor: pointer; }

/* Hamburger toggle */
.nav-toggle { display: none; }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block; width: 22px; height: 2px; background: var(--c-text);
  position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }

/* Mobile */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: none; border: 1px solid var(--c-border);
    border-radius: 10px; cursor: pointer;
  }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--c-bg); border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow); padding: 1rem;
    max-height: 80vh; overflow-y: auto;
  }
  .main-nav.is-open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: .25rem; }
  .main-nav > ul > li { display: flex; flex-wrap: wrap; align-items: center; }
  .main-nav > ul > li > a { flex: 1; padding: .7rem .25rem; }
  .main-nav .submenu-toggle {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
  }
  .main-nav .submenu-toggle::before { content: "▾"; color: var(--c-muted); font-size: 1rem; }
  .main-nav .menu-item-has-children.submenu-open > .submenu-toggle::before { content: "▴"; }
  .main-nav .sub-menu {
    position: static; display: none; box-shadow: none; border: 0;
    max-height: none; padding-left: 1rem; width: 100%;
  }
  .main-nav .menu-item-has-children.submenu-open > .sub-menu { display: block; }
  .main-nav .menu-item-has-children:hover > .sub-menu { display: none; }
  .main-nav .menu-item-has-children.submenu-open:hover > .sub-menu { display: block; }
}

/* =========================================================
   Content
   ========================================================= */
.site-main { padding-block: clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.entry-content { max-width: 46rem; }
.entry-content > * + * { margin-top: 1.1em; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-muted);
  padding-block: 2rem; font-size: .95rem;
}

/* =========================================================
   Utilities
   ========================================================= */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  background: linear-gradient(160deg, var(--c-surface), #fff 70%);
  border-bottom: 1px solid var(--c-border);
}
.hero__inner {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  text-align: center;
}
.hero__title { margin: 0 0 .5em; }
.hero__lead {
  max-width: 42rem; margin: 0 auto 1.5rem;
  font-size: 1.15rem; color: var(--c-muted);
}
.hero__search form { display: flex; gap: .5rem; max-width: 32rem; margin-inline: auto; }
.hero__search input[type="search"] {
  flex: 1; padding: .8rem 1rem; border: 1px solid var(--c-border);
  border-radius: var(--radius); font-size: 1rem;
}
.hero__search input[type="submit"] {
  padding: .8rem 1.2rem; border: 0; border-radius: var(--radius);
  background: var(--c-brand); color: #fff; font-weight: 600; cursor: pointer;
}
.hero__search input[type="submit"]:hover { background: var(--c-brand-dark); }

/* =========================================================
   Sections
   ========================================================= */
.section {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  padding-block: clamp(2rem, 1.2rem + 3vw, 3.5rem);
}
.section__title { margin: 0 0 1.25rem; }
.section--cta { background: var(--c-surface); border-block: 1px solid var(--c-border); }
.section--cta__inner {
  width: min(100% - 2rem, 52rem); margin-inline: auto; text-align: center;
  padding-block: 1rem;
}

/* =========================================================
   Card grid
   ========================================================= */
.card-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.card-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}
.card {
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card__media { aspect-ratio: 16 / 10; background: var(--c-surface); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1rem; }
.card__title { margin: 0 0 .4em; font-size: 1.1rem; }
.card__excerpt { margin: 0; color: var(--c-muted); font-size: .95rem; }

/* Category cards */
.card--category a {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem; text-decoration: none; color: inherit; height: 100%;
}
.card--category__name { font-family: var(--font-head); font-weight: 700; }
.card--category__count { color: var(--c-muted); font-size: .85rem; }

/* =========================================================
   Single article / page
   ========================================================= */
.single-article, .single-page { max-width: 46rem; margin-inline: auto; }
.entry-header { margin-bottom: 1.5rem; }
.entry-title { margin: .2em 0 .4em; }
.entry-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  color: var(--c-muted); font-size: .9rem;
}
.entry-meta a { color: var(--c-muted); }
.entry-meta a:hover { color: var(--c-brand); }
.entry-meta__updated { color: var(--c-brand-dark); font-weight: 600; }
.entry-featured { margin: 0 0 1.5rem; }
.entry-featured img { width: 100%; border-radius: var(--radius); }

/* Rank Math breadcrumbs */
.rank-math-breadcrumb { font-size: .85rem; color: var(--c-muted); margin-bottom: .75rem; }
.rank-math-breadcrumb a { color: var(--c-muted); }

.entry-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--c-border); }
.affiliate-disclosure {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: .8rem 1rem;
  font-size: .85rem; color: var(--c-muted);
}
.entry-tags { margin-top: 1rem; font-size: .85rem; }
.entry-tags a {
  display: inline-block; padding: .15rem .6rem; margin: .15rem;
  background: var(--c-surface); border-radius: 999px; text-decoration: none;
}

/* =========================================================
   Amazon product box (sin precio cacheado — guardarraíl Associates)
   ========================================================= */
.amz-box {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  align-items: center; border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1rem; margin: 1.5rem 0;
  background: var(--c-bg);
}
.amz-box__media { width: 120px; }
.amz-box__title { font-size: 1.05rem; margin: 0 0 .5rem; }
.amz-box__cta {
  display: inline-block; padding: .65rem 1.1rem; border-radius: var(--radius);
  background: var(--c-accent); color: #1d1b19; font-weight: 700; text-decoration: none;
}
.amz-box__cta:hover { background: #c9760f; color: #1d1b19; }
@media (max-width: 480px) {
  .amz-box { grid-template-columns: 1fr; text-align: center; }
  .amz-box__media { margin-inline: auto; }
}

/* Manual box (con imagen hotlink, sin precio cacheado) */
.amz-box--manual {
  display: block; border-left: 4px solid var(--c-brand);
  background: var(--c-surface);
}
.amz-box--has-img {
  display: grid; grid-template-columns: 160px 1fr; gap: 1.25rem; align-items: start;
}
.amz-box--manual .amz-box__media { display: block; width: 160px; }
.amz-box--manual .amz-box__media img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain;
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: .35rem;
}
@media (max-width: 560px) {
  .amz-box--has-img { grid-template-columns: 1fr; }
  .amz-box--manual .amz-box__media { width: 120px; }
}
.amz-box--manual .amz-box__badge {
  display: inline-block; background: var(--c-brand); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: .2rem .6rem; border-radius: 999px; margin-bottom: .5rem;
  text-transform: uppercase;
}
.amz-box--manual .amz-box__title { margin: 0 0 .4rem; font-size: 1.15rem; }
.amz-box__rating { margin: 0 0 .6rem; color: var(--c-muted); font-size: .95rem; }
.amz-box__stars { color: var(--c-accent); letter-spacing: .05em; }
.amz-box__features {
  margin: 0 0 1rem; padding-left: 1.1rem; display: grid; gap: .25rem;
  color: var(--c-text); font-size: .95rem;
}
.amz-box--manual .amz-box__cta { width: fit-content; }
