/*
Theme Name:  Hello Elementor Child
Theme URI:   https://ahorroluzhogar.com/
Description: Tema hijo de Hello Elementor con la línea gráfica de Ahorro Luz Hogar.
Author:      Royal Comunicación
Template:    hello-elementor
Version:     1.0.0
Text Domain: hello-elementor-child
*/

/* ==========================================================================
   Ahorro Luz Hogar — blog
   Los colores y la tipografía son los mismos tokens de la landing, para que
   el visitante que salta del artículo al comparador no note el cambio.
   ========================================================================== */

:root {
  --alh-bg:        #f7f9fd;   /* background */
  --alh-surface:   #ffffff;   /* surface-container-lowest */
  --alh-surface-2: #eceef2;   /* surface-container */
  --alh-text:      #191c1f;   /* on-surface */
  --alh-text-soft: #43474e;   /* on-surface-variant */
  --alh-primary:   #001630;   /* primary — cabecera oscura y pie */
  --alh-accent:    #9c4500;   /* secondary — CTA y enlaces */
  --alh-border:    #c4c6cf;   /* outline-variant */
  --alh-max:       1140px;    /* el contenedor que impone Hello Elementor */
  --alh-read:      880px;     /* ancho de lectura cómodo */
}

/* ----------------------------------------------------------------- base */
body {
  background: var(--alh-bg);
  color: var(--alh-text);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Hello Elementor pinta los enlaces con `a{color:#c36}` y los pasa a #336 al
   pasar el ratón. Como `a:hover` tiene más peso que `body a`, hay que declarar
   el color también en el estado hover o vuelve el color del tema. */
body a { color: var(--alh-accent); text-decoration: none; }

body a:hover,
body a:focus,
body a:active { color: var(--alh-accent); text-decoration: underline; text-underline-offset: 2px; }

img { max-width: 100%; height: auto; }

/* El tema padre limita a 1140px el propio <header> y el propio <footer>, no su
   contenido, así que la banda de color no llegaba a los bordes de la pantalla.
   Se libera el elemento y el centrado lo hacen los .alh-*-inner de dentro. */
html .site-header:not(.dynamic-header),
html .site-footer:not(.dynamic-footer) { max-width: none; width: 100%; }

/* --------------------------------------------------------------- header */
.site-header {
  background: var(--alh-surface);
  border-bottom: 1px solid var(--alh-border);
  padding: 0;
}

.alh-header-inner {
  /* El tema padre declara display:flex en .site-header, así que esto es un
     ítem flexible: sin width:100% se encogería al tamaño de su contenido. */
  width: 100%;
  max-width: var(--alh-max);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.alh-brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.alh-brand:hover { text-decoration: none; }

.alh-brand-logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }

.alh-brand-text { display: flex; flex-direction: column; }

.alh-brand-name {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--alh-accent);
  line-height: 1.2;
}

.alh-brand-claim {
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--alh-primary);
  line-height: 1.4;
}

.alh-nav a {
  display: inline-block;
  background: var(--alh-accent);
  color: #fff;
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .75rem 1.5rem;
  border-radius: 8px;
  transition: opacity .2s;
}
.alh-nav a:hover,
.alh-nav a:focus { color: #fff; opacity: .9; text-decoration: none; }

@media (min-width: 768px) {
  .alh-header-inner { padding: 1.5rem 2rem; }
  .alh-brand-logo { width: 64px; height: 64px; }
  .alh-brand-name { font-size: 1.25rem; }
  .alh-brand-claim { font-size: .75rem; }
}

/* ----------------------------------------------------------------- main */
.site-main { max-width: var(--alh-max); margin: 0 auto; padding: 3rem 1rem; }

@media (min-width: 768px) { .site-main { padding: 4rem 2rem; } }

.site-main > .page-header { margin-bottom: 2.5rem; }

.site-main > .page-header .entry-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--alh-text);
  margin: 0;
}

@media (min-width: 768px) {
  .site-main > .page-header .entry-title { font-size: 2.5rem; }
}

/* --------------------------------------------------- listado de entradas */
.blog .page-content,
.archive .page-content,
.search .page-content {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .blog .page-content,
  .archive .page-content,
  .search .page-content { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
  .blog .page-content,
  .archive .page-content,
  .search .page-content { grid-template-columns: repeat(3, 1fr); }
}

.blog .page-content > article.post,
.archive .page-content > article.post,
.search .page-content > article.post {
  background: var(--alh-surface);
  border: 1px solid var(--alh-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .2s, transform .2s;
}

.blog .page-content > article.post:hover,
.archive .page-content > article.post:hover,
.search .page-content > article.post:hover {
  box-shadow: 0 8px 24px rgba(0, 22, 48, .08);
  transform: translateY(-2px);
}

.page-content > article.post .entry-title { font-size: 1.25rem; line-height: 1.3; margin: 0; }

.page-content > article.post .entry-title a { color: var(--alh-text); font-weight: 700; }
.page-content > article.post .entry-title a:hover { color: var(--alh-accent); text-decoration: none; }

.page-content > article.post p { color: var(--alh-text-soft); font-size: .9375rem; margin: 0; }

/* ------------------------------------------------- contenido del artículo */
/* Hello Elementor fija la columna en 1140px desde una media query con
   `body:not([class*=elementor-page-]) .site-main`, que pesa (0,2,1). Para el
   artículo eso son líneas demasiado largas, así que se sube a (0,2,2). */
html body.single .site-main { max-width: var(--alh-read); }

.single .page-content { font-size: 1.125rem; line-height: 1.75; }

.single .site-main > .page-header .entry-title { font-size: 2rem; }

@media (min-width: 768px) {
  .single .site-main > .page-header .entry-title { font-size: 2.75rem; }
}

.alh-meta {
  color: var(--alh-text-soft);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: .75rem;
}

.single .page-content > h2,
.single .page-content > h3,
.single .page-content > h4 {
  color: var(--alh-text);
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 .75rem;
}

.single .page-content > h2 { font-size: 1.5rem; }
.single .page-content > h3 { font-size: 1.25rem; }
.single .page-content > h4 { font-size: 1.0625rem; }

.single .page-content > p,
.single .page-content > ul,
.single .page-content > ol { margin: 0 0 1.25rem; }

.single .page-content ul,
.single .page-content ol { padding-left: 1.5rem; }

.single .page-content li { margin-bottom: .5rem; }

.single .page-content img { border-radius: 12px; margin: 2rem 0; }

/* Imagen destacada. Especificidad por encima de las reglas generales de
   img y figure de más abajo, para que no herede sus márgenes. */
.single .page-content .alh-destacada-wrap {
  margin: 0 0 2.5rem;
  padding: 0;
}

.single .page-content .alh-destacada-wrap img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 16px;
  background: var(--alh-surface-2);
}

.single .page-content blockquote {
  border-left: 4px solid var(--alh-accent);
  background: var(--alh-surface-2);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 12px 12px 0;
  color: var(--alh-text-soft);
  font-style: italic;
}

.single .page-content blockquote p:last-child { margin-bottom: 0; }

.single .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .9375rem;
}

.single .page-content th,
.single .page-content td {
  border: 1px solid var(--alh-border);
  padding: .75rem 1rem;
  text-align: left;
}

.single .page-content th { background: var(--alh-surface-2); font-weight: 700; }

.single .page-content code {
  background: var(--alh-surface-2);
  border-radius: 4px;
  padding: .125rem .375rem;
  font-size: .875em;
}

.single .page-content figure { margin: 2rem 0; }
.single .page-content figcaption {
  color: var(--alh-text-soft);
  font-size: .8125rem;
  text-align: center;
  margin-top: .5rem;
}

/* ------------------------------------------- llamada al comparador, al pie */
.alh-cta {
  background: var(--alh-primary);
  border-radius: 16px;
  padding: 2rem;
  margin: 3rem 0 0;
  text-align: center;
}

.alh-cta-title { color: #fff; font-size: 1.25rem; font-weight: 700; margin: 0 0 .5rem; line-height: 1.3; }
.alh-cta-text  { color: rgba(255,255,255,.8); font-size: .9375rem; margin: 0 0 1.5rem; }

.alh-cta a {
  display: inline-block;
  background: var(--alh-accent);
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .875rem 2rem;
  border-radius: 8px;
}
.alh-cta a:hover,
.alh-cta a:focus { color: #fff; opacity: .9; text-decoration: none; }

/* ---------------------------------------------------------- paginación */
.pagination, .nav-links { margin-top: 3rem; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }

.pagination .page-numbers, .nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .75rem;
  border: 1px solid var(--alh-border);
  border-radius: 8px;
  background: var(--alh-surface);
  color: var(--alh-text);
  font-weight: 600;
  font-size: .875rem;
}

.pagination .page-numbers.current, .nav-links .page-numbers.current {
  background: var(--alh-accent);
  border-color: var(--alh-accent);
  color: #fff;
}

.pagination a.page-numbers:hover, .nav-links a.page-numbers:hover {
  border-color: var(--alh-accent);
  color: var(--alh-accent);
  text-decoration: none;
}

/* --------------------------------------------------------------- footer */
.site-footer {
  background: var(--alh-primary);
  border-top: 1px solid var(--alh-border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.alh-footer-inner {
  max-width: var(--alh-max);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .alh-footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; text-align: left; padding: 0 2rem; }
}

.alh-footer-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--alh-accent);
  margin-bottom: 1rem;
  letter-spacing: .02em;
}

.alh-footer-copy { color: #fff; font-size: 1rem; margin: 0; max-width: 24rem; }

.alh-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }

/* El reset del tema le pone fondo rosa (#c36) a todo [type=button] en hover y
   en foco. Por eso el estado hover se declara aquí de forma explícita: si no,
   los tres enlaces legales se encienden en rosa al pasar el ratón. */
.alh-footer-nav button,
.alh-footer-nav button:hover,
.alh-footer-nav button:focus,
.alh-footer-nav button:active {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: .75rem;
  transition: opacity .2s;
  text-underline-offset: 2px;
  text-decoration: none;
}

.alh-footer-nav button { opacity: .7; }

.alh-footer-nav button:hover,
.alh-footer-nav button:focus { opacity: 1; text-decoration: underline; }

/* ------------------------------------------------------------- limpieza */
.comments-area { display: none; }        /* comentarios desactivados */
.site-header .site-branding { display: none; }   /* branding por defecto de Hello */
