/*
Theme Name: Hora de Mujer
Theme URI: https://horademujer.com
Author: Hora de Mujer
Description: Tema a medida para la revista Hora de Mujer — mujeres, estilo y cultura a través de relojes. Basado en el mockup original y en las mejoras propuestas por el equipo de diseño (CTA en hero, metadatos de artículo, imagen destacada en "En la muñeca de...", footer legal, etc.)
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: hora-de-mujer
*/

/* ==========================================================================
   NOTA SOBRE TIPOGRAFÍAS
   El mockup original pedía "Canela" para titulares. Canela es una tipografía
   de pago (Colophon Foundry) y no se puede enlazar libremente sin licencia.
   Aquí se usa Cormorant Garamond (Google Fonts, gratuita) como sustituta,
   tal y como el propio CSS original ya contemplaba como fallback.
   Si compráis la licencia de Canela, solo hay que cambiar la variable
   --font-display más abajo.
   ========================================================================== */

:root {
  --bg: #f7f4ee;
  --text: #111111;
  --muted: #6f6258;
  --accent: #9b6a43;
  --line: #d8d0c6;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Espaciado entre grandes secciones (mejora nº6 del PDF) */
  --section-gap: 88px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  text-align: center;
  padding: 28px 48px 0;
}

.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}

/* Fijamos la columna de cada elemento explícitamente: si no lo hacemos,
   al ocultar el botón hamburguesa con display:none en escritorio, CSS Grid
   reordena los elementos restantes en las primeras columnas disponibles
   y descoloca el título y la lupa. */
.topbar .menu { grid-column: 1; }
.topbar .site-title { grid-column: 2; }
.topbar .search { grid-column: 3; }

.topbar .menu,
.topbar .search {
  font-size: 20px;
  background: none;
  border: none;
}

.site-title {
  font-size: clamp(64px, 9vw, 128px);
  letter-spacing: .06em;
  margin: 0;
}

.site-title a { color: var(--text); }

/* Mejora nº1: subtítulo más grande y legible (18px -> 22px) */
.claim {
  margin: 14px 0 42px;
  font-size: 22px;
  color: var(--muted);
  letter-spacing: .01em;
}

nav.main-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 56px;
  padding-bottom: 28px;
  text-transform: uppercase;
  /* Mejora nº7: algo más de cuerpo y tracking en textos pequeños */
  font-size: 14px;
  letter-spacing: .1em;
}

nav.main-nav a:hover,
nav.main-nav a.current-menu-item { color: var(--accent); }

/* Botón hamburguesa: en escritorio el menú ya está visible debajo,
   así que el botón solo hace falta (y solo se ve) en móvil */
#hdm-menu-toggle { display: none; }

/* Caja de búsqueda desplegable */
.site-search-box {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
  display: none;
}

.site-search-box.is-open { display: block; margin-bottom: 28px; }

.site-search-box form {
  display: flex;
  gap: 8px;
}

.site-search-box input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
  font-size: 14px;
}

.site-search-box button[type="submit"] {
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

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

/* ==========================================================================
   HEADER COMPACTO (aparece al hacer scroll)
   ========================================================================== */

.sticky-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .25s ease;
}

/* Cuando el visitante está conectado a WordPress, la barra negra de
   administración ocupa los primeros 32px (o 46px en móvil) — evitamos que
   nuestro header compacto se solape con ella */
body.admin-bar .sticky-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .sticky-header { top: 46px; }
}

.sticky-header.is-visible { transform: translateY(0); }

.sticky-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.sticky-topbar .menu { grid-column: 1; }
.sticky-title { grid-column: 2; }
.sticky-topbar .search { grid-column: 3; }

.sticky-topbar .menu,
.sticky-topbar .search {
  font-size: 18px;
  background: none;
  border: none;
  justify-self: center;
}

.sticky-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .03em;
  text-align: center;
  color: var(--text);
}

.sticky-nav {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .08em;
}

.sticky-nav.is-open { display: flex; }

.sticky-nav a:hover { color: var(--accent); }

.sticky-header .site-search-box { padding: 0 24px 20px; }
.sticky-header .site-search-box.is-open { margin-bottom: 0; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 460px;
}

.hero img {
  width: 100%;
  height: 560px;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 35%, rgba(0,0,0,.72));
  pointer-events: none;
}

.hero-text {
  position: absolute;
  right: 9%;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  max-width: 440px;
  z-index: 2;
}

.hero-text .eyebrow,
.article-card .eyebrow {
  text-transform: uppercase;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: .1em;
}

.hero-text h2 {
  font-size: 54px;
  line-height: .98;
  margin: 16px 0 24px;
}

.hero-text p {
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 28px;
}

/* Mejora nº2: CTA en el hero */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .1em;
  border-bottom: 1px solid rgba(255,255,255,.6);
  padding-bottom: 6px;
  transition: gap .2s ease, border-color .2s ease;
}

.hero-cta:hover {
  gap: 16px;
  border-color: #fff;
}

/* ==========================================================================
   SECCIONES / TITULARES
   ========================================================================== */

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* Mejora nº3: títulos de sección más grandes para jerarquía visual */
.section-title {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 22px;
  font-family: var(--font-body);
}

/* ==========================================================================
   ÚLTIMOS ARTÍCULOS
   ========================================================================== */

.latest {
  padding: var(--section-gap) 0 64px;
  text-align: center;
}

.latest .section-title { margin-bottom: 48px; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  text-align: left;
}

.article-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.article-card h4 {
  font-size: 25px;
  line-height: 1.12;
  margin: 10px 0 0;
}

/* Mejora nº4: fecha + tiempo de lectura */
.article-meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .03em;
  margin-top: 10px;
}

.article-meta .dot { margin: 0 6px; }

/* ==========================================================================
   VÍDEOS "EN 60 SEGUNDOS"
   ========================================================================== */

.videos {
  display: grid;
  grid-template-columns: 1.2fr 3fr 1.1fr;
  gap: 36px;
  border: 1px solid var(--line);
  padding: 44px;
  margin: 0 auto var(--section-gap);
  max-width: 1180px;
}

.videos-intro .section-title { margin-bottom: 12px; }
.videos-intro p { color: var(--muted); margin: 0 0 20px; }

/* Mejora nº5: botón "Ver todos" */
.btn-outline {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--text);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
}

.btn-outline:hover { background: var(--text); color: #fff; }

.video-grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.video-card { position: relative; }

.video-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.video-card .play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid #fff;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.video-card .duration {
  position: absolute;
  bottom: 10px; right: 10px;
  color: #fff;
  font-size: 12px;
  background: rgba(0,0,0,.4);
  padding: 2px 6px;
}

.video-card p {
  font-size: 14px;
  line-height: 1.35;
  margin-top: 10px;
}

/* Mejora nº8: imágenes reales en la sección Instagram (antes solo texto) */
.instagram { }

.instagram .section-title { margin-bottom: 4px; }
.instagram p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.instagram-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.instagram a.ir {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

/* ==========================================================================
   EN LA MUÑECA DE... + GUÍAS DESTACADAS
   ========================================================================== */

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto var(--section-gap);
}

/* Mejora nº9: imagen mayor con overlay y texto superpuesto */
.feature {
  position: relative;
  min-height: 460px;
  overflow: hidden;
}

.feature img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}

.feature-content {
  position: relative;
  z-index: 2;
  padding: 28px;
  color: #fff;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.feature-content .section-title { color: #fff; opacity: .85; }

.feature-content h4 {
  font-size: 30px;
  line-height: 1.1;
  margin: 14px 0 12px;
  font-family: var(--font-display);
}

.feature-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: .9;
}

.guides { border: 1px solid var(--line); padding: 28px; }
.guides .section-title { margin-bottom: 24px; }

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

.mini-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.mini-grid h4 {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.3;
  margin-top: 10px;
}

/* ==========================================================================
   FOOTER
   Mejora nº10 y nº11: logo en el footer, copyright, política de privacidad
   y de cookies, y estructura reorganizada.
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 0;
}

.footer-columns {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr repeat(3, 1.2fr);
  gap: 48px;
  font-size: 14px;
  align-items: start;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: .04em;
}

.footer-columns strong {
  display: block;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .06em;
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.footer-columns p { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
  font-size: 13px;
}

.newsletter-form button {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.footer-legal {
  border-top: 1px solid var(--line);
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 0 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.footer-legal nav {
  display: flex;
  gap: 20px;
}

.footer-social {
  display: flex;
  gap: 14px;
  font-size: 16px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .videos { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .lower-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-columns { grid-template-columns: 1fr 1fr; }
  .hero-text { max-width: 90%; right: 5%; }

  /* Menú principal plegable detrás del botón hamburguesa */
  #hdm-menu-toggle { display: block; }
  nav.main-nav {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  nav.main-nav.is-open { display: flex; }
}

@media (max-width: 560px) {
  .article-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr; }
  .hero-text h2 { font-size: 36px; }
}

/* Accesibilidad: foco visible */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
