/* =========================
   HOME.CSS - página de inicio
   Estética del social preview: pergamino, verde
   bosque, naranja fuego, tipografía rústica.
   Todo ámbito-limitado a .home para no filtrarse
   al resto del sitio.
========================= */

body:has(.home) {
  background: var(--fogata-paper);
}

.home {
  /* Valores en fogata.css (--fogata-*) */
  --home-paper: var(--fogata-paper);
  --home-paper-dark: var(--fogata-paper-dark);
  --home-card: var(--fogata-card);
  --home-forest: var(--fogata-forest);
  --home-fire: var(--fogata-fire);
  --home-fire-dark: var(--fogata-fire-dark);
  --home-ink: var(--fogata-ink);
  --home-muted: var(--fogata-muted);
  --home-display: var(--fogata-display);
  --home-slab: var(--fogata-slab);

  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.home h2,
.home h3 {
  font-family: var(--home-slab);
  font-weight: 800;
  color: var(--home-forest);
}

.home h2 { font-size: 1.9rem; margin: 0 0 1.25rem; }


/* ---------- HERO ---------- */

.home-hero {
  position: relative;
  /* Sin overflow:hidden: los resultados del buscador
     tienen que poder salir del hero. Cada capa se
     recorta sola contra las esquinas. */
  display: grid;
  grid-template-columns: 440px 1fr;
  align-items: center;
  min-height: 520px;
  border-radius: 20px;
  border-block: 10px solid var(--home-forest);
  background:
    url("../../imagenes/hero-bosque.svg") center bottom / cover no-repeat,
    radial-gradient(rgba(120,90,40,.06) 1px, transparent 1px) 0 0 / 6px 6px,
    radial-gradient(ellipse at 30% 40%, #f6eedb 0%, #ebdfc2 70%, var(--home-paper-dark) 100%);
}

.home-hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 2.5rem 1rem 3.5rem 2.5rem;
  /* Resplandor detrás del fuego */
  background: radial-gradient(circle at 50% 50%, rgba(255,170,80,.35) 0%, rgba(255,170,80,0) 60%);
}

.home-hero-art img {
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(80,40,10,.25));
}

.home-hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 3rem 3.5rem 5rem 1rem;
}

.home-hero h1 {
  margin: 0;
  font-family: var(--home-display);
  font-weight: 400;
  color: var(--home-forest);
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: .95;
}

.home-hero-word {
  display: block;
  font-size: 4.6rem;
}

.home-hero-de {
  display: flex;
  align-items: center;
  gap: .8rem;
  max-width: 430px;
  margin: .3rem 0;
  font-size: 1.8rem;
  text-transform: lowercase;
  color: var(--home-fire);
}

.home-hero-de::before,
.home-hero-de::after {
  content: "";
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--home-fire);
}

.home-hero-content > p:not(.home-popular) {
  max-width: 520px;
  margin: 1.2rem 0 1.6rem;
  font-family: var(--home-slab);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--home-ink);
}



/* ---------- BUSCADOR ---------- */

.home-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: 640px;
  padding: .45rem .5rem .45rem 1.2rem;
  border: 2px solid var(--home-forest);
  border-radius: 999px;
  background: white;
  box-shadow: 0 6px 0 var(--home-forest);
}

.home-search > .material-symbols-outlined {
  color: #6b746c;
}

.home-search input {
  flex: 1;
  min-width: 0;
  padding: .6rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
}

.home-search:focus-within {
  outline: 3px solid var(--home-fire);
  outline-offset: 3px;
}

.home-search button[type="submit"]:not(.home-search-all) {
  padding: .8rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--home-fire);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-search button[type="submit"]:not(.home-search-all):hover {
  background: var(--home-fire-dark);
}

.home-search-results {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  right: 0;
  z-index: var(--z-dropdown, 100);
  max-height: 60vh;
  overflow-y: auto;
  padding: .5rem;
  border: 2px solid var(--home-forest);
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}

.home-search-result {
  display: block;
  padding: .7rem .9rem;
  border-radius: 12px;
}

.home-search-result:hover,
.home-search-result:focus {
  background: var(--home-card);
}

.home-search-result strong {
  display: block;
  color: var(--home-forest);
}

.home-search-result span {
  display: block;
  margin-top: .2rem;
  font-size: .9rem;
  color: var(--home-muted);
}

.home-search-all {
  width: 100%;
  margin-top: .3rem;
  padding: .7rem;
  border: 0;
  border-radius: 12px;
  background: var(--home-card);
  color: var(--home-forest);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-search-empty {
  margin: 0;
  padding: .8rem;
  color: var(--home-muted);
}

.home-popular {
  margin: 1rem 0 0;
  font-size: .9rem;
  color: #4a4632;
}

.home-popular a {
  margin-right: .7rem;
  font-weight: 600;
  color: var(--home-forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ---------- CONTADORES ---------- */

.home-stats {
  display: flex;
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 0;
  list-style: none;
  font-family: var(--home-slab);
  color: var(--home-forest);
}

.home-stats li {
  flex: 1;
  text-align: center;
  border-right: 2px dashed #d0bf98;
}

.home-stats li:last-child {
  border-right: 0;
}

.home-stats b {
  display: block;
  font-family: var(--home-display);
  font-weight: 400;
  font-size: 2.6rem;
  color: var(--home-fire);
}


/* ---------- SECCIONES ---------- */

.home-section {
  margin: 4rem 0;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-section-header h2 { margin-bottom: .3rem; }

.home-section-header p {
  margin: 0;
  color: var(--home-muted);
}

.home-more {
  font-weight: 700;
  color: var(--home-forest);
}

.home-more:hover { color: var(--home-fire-dark); }

/* Accesos */
.home-paths {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.home-path {
  padding: 1.8rem 1rem;
  text-align: center;
  border: 2px solid var(--home-paper-dark);
  border-radius: 18px;
  background: var(--home-card);
  color: var(--home-ink);
  transition: transform var(--transition-base, .2s ease), border-color var(--transition-base, .2s ease);
}

.home-path:hover,
.home-path:focus-visible {
  transform: translateY(-3px);
  border-color: var(--home-fire);
}

.home-path .material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border: 3px solid var(--home-forest);
  border-radius: 50%;
  background: #efe4cb;
  color: var(--home-forest);
  font-size: 2.4rem;
}

.home-path h3 { margin: 1rem 0 .3rem; }

.home-path p {
  margin: 0;
  color: var(--home-muted);
}

/* Temas */
.home-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.home-topics a {
  padding: .45rem .95rem;
  border: 1px solid var(--home-paper-dark);
  border-radius: 999px;
  background: var(--home-card);
  color: var(--home-ink);
}

.home-topics a:hover,
.home-topics a:focus-visible {
  border-color: var(--home-fire);
  color: var(--home-fire-dark);
}

/* Llamado a colaborar */
.home-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 3rem;
  border-radius: 20px;
  background: var(--home-forest);
  color: var(--home-paper);
}

.home-cta h2 {
  margin: 0 0 .4rem;
  color: white;
}

.home-cta p {
  margin: 0;
  opacity: .85;
}

.home-cta a {
  flex-shrink: 0;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  background: var(--home-fire);
  color: white;
  font-weight: 700;
}

.home-cta a:hover { background: var(--home-fire-dark); }


/* ---------- RESPONSIVE ---------- */

@media (max-width: 1000px) {
  .home-paths { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    /* En angosto el centro del SVG no tiene bosque: se muestra
       el borde izquierdo (bosque y dibujos) al pie del hero. */
    background-size: auto 280px, 6px 6px, 100% 100%;
    background-position: 8% bottom, 0 0, 0 0;
  }

  .home-hero-art { padding: 1.5rem 1rem .5rem; }
  .home-hero-art img { max-width: 170px; }

  /* Espacio abajo para que el bosque no quede detrás del texto */
  .home-hero-content { padding: 0 1.3rem 13rem; }
  .home-hero-word { font-size: 2.9rem; }
  .home-hero-de { font-size: 1.3rem; }

  .home-search input { font-size: .95rem; }
  .home-search button[type="submit"]:not(.home-search-all) { padding: .7rem 1rem; }

  .home-stats { flex-wrap: wrap; }
  .home-stats li {
    flex: 1 0 50%;
    margin-bottom: 1rem;
    border-right: 0;
  }

  .home-cta {
    flex-direction: column;
    align-items: start;
    padding: 2rem 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-path { transition: none; }
  .home-path:hover { transform: none; }
}
