/* ============================================================
   04-pages.css — Secciones y composiciones por página
   ============================================================ */

/* ============ Hero (home) ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--grad-deep);
  color: var(--white);
  padding-block: clamp(3rem, 2rem + 6vw, 6.5rem);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/patron-red.svg");
  background-size: 34rem;
  opacity: 0.35;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  top: -18%;
  right: -22%;
  width: 44rem;
  height: 44rem;
  background: radial-gradient(circle, rgba(63, 134, 236, 0.34), transparent 62%);
  z-index: -1;
  pointer-events: none;
}
.hero__inner { display: grid; gap: var(--space-2xl); align-items: center; }
.hero h1 { color: var(--white); }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand-300), var(--white) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__text > p { color: var(--brand-100); font-size: var(--step-1); margin-top: var(--space-lg); }
.hero__cta { margin-top: var(--space-xl); }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.hero__meta div { min-width: 7rem; }
.hero__meta dt { font-size: var(--step--1); color: var(--brand-300); }
.hero__meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--step-1);
  color: var(--white);
}
.hero__media { position: relative; }
.hero__media img { width: 100%; border-radius: var(--radius-lg); }

/* Tarjeta flotante sobre la ilustración */
.hero__card {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--brand-900);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  max-width: 17rem;
  margin-top: calc(var(--space-lg) * -1);
  margin-inline: auto;
}
.hero__card svg { width: 2rem; height: 2rem; flex: none; color: var(--success-600); }

@media (min-width: 60rem) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-3xl); }
  .hero__card { position: absolute; bottom: -1.5rem; left: -1.5rem; margin: 0; }
}

/* ============ Hero interior de página ============ */
.page-hero {
  background: var(--grad-deep);
  color: var(--white);
  padding-block: clamp(2.25rem, 1.5rem + 4vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/patron-red.svg");
  background-size: 30rem;
  opacity: 0.28;
}
.page-hero__inner { position: relative; max-width: 46rem; }
.page-hero h1 { color: var(--white); margin-top: var(--space-md); font-size: var(--step-4); }
.page-hero p { color: var(--brand-100); margin-top: var(--space-md); font-size: var(--step-1); }

/* ============ Split (texto + media) ============ */
.split { display: grid; gap: var(--space-2xl); align-items: center; }
@media (min-width: 58rem) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-3xl); }
  .split--media-first > :first-child { order: 2; }
}
.split__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ============ Lista con check ============ */
.checklist { display: grid; gap: var(--space-sm); }
.checklist li {
  position: relative;
  padding-left: 2.1rem;
  color: var(--color-text-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.15em;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  background: var(--brand-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312509f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 0.85rem no-repeat;
}
.checklist--invert li { color: var(--brand-100); }
.checklist--invert li::before { background-color: rgba(255, 255, 255, 0.16); }

/* ============ Servicios: detalle ancla ============ */
.service-detail {
  display: grid;
  gap: var(--space-xl);
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}
.service-detail:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 58rem) {
  .service-detail { grid-template-columns: 0.85fr 1.15fr; gap: var(--space-3xl); }
  .service-detail__aside { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
}
.service-detail__aside .card__icon { margin-bottom: var(--space-md); }
.service-detail__body > * + * { margin-top: var(--space-lg); }
.service-detail__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.mini-card {
  padding: var(--space-md);
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-md);
}
.mini-card h4 { font-size: var(--step-0); margin-bottom: 0.25rem; }
.mini-card p { font-size: var(--step--1); color: var(--color-text-soft); }

/* Índice de servicios (chips) */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chips a {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--white);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.chips a:hover { background: rgba(255, 255, 255, 0.22); }

/* ============ Equipo ============ */
.team { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.member { text-align: center; }
.member img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--brand-100);
  margin-bottom: var(--space-md);
}
.member h3 { font-size: var(--step-1); }
.member p { font-size: var(--step--1); color: var(--color-text-soft); margin-inline: auto; }

/* ============ Valores / timeline ============ */
.timeline { display: grid; gap: var(--space-xl); border-left: 2px solid var(--brand-100); padding-left: var(--space-xl); }
.timeline__item { position: relative; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(var(--space-xl) * -1 - 6px);
  top: 0.55em;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.timeline__year {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  color: var(--brand-600);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
}
.timeline__item h3 { font-size: var(--step-1); margin: 0.2rem 0 0.35rem; }
.timeline__item p { color: var(--color-text-soft); }

/* ============ Contacto ============ */
.contact-layout { display: grid; gap: var(--space-2xl); }
@media (min-width: 60rem) {
  .contact-layout { grid-template-columns: 1.15fr 0.85fr; gap: var(--space-3xl); align-items: start; }
}
.contact-panel {
  padding: var(--space-lg);
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
}
.contact-panel + .contact-panel { margin-top: var(--space-lg); }
.contact-list { display: grid; gap: var(--space-md); }
.contact-list li { display: flex; gap: var(--space-md); align-items: flex-start; }
.contact-list svg { width: 1.35rem; height: 1.35rem; flex: none; color: var(--brand-500); margin-top: 0.2rem; }
.contact-list a { color: var(--brand-700); text-decoration: none; font-weight: var(--weight-semibold); }
.contact-list a:hover { text-decoration: underline; }
.contact-list li > span { display: block; }
.contact-list li > span span { display: block; font-size: var(--step--1); color: var(--ink-500); }

.map-embed {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--brand-050);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; }

.form-card {
  padding: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* ============ Blog ============ */
.posts { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.post {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  position: relative;
  height: 100%;
}
.post:hover, .post:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post__thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--brand-100); }
.post__body { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-lg); flex: 1; }
.post__meta { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-size: var(--step--1); color: var(--ink-500); }
.post__title { font-size: var(--step-1); }
.post__title a { color: inherit; text-decoration: none; }
.post__title a::after { content: ""; position: absolute; inset: 0; }
.post p { color: var(--color-text-soft); font-size: var(--step--1); }
.post__foot { margin-top: auto; padding-top: var(--space-sm); font-size: var(--step--1); color: var(--brand-600); font-weight: var(--weight-semibold); }

/* ============ 404 ============ */
.error-page {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 70dvh;
  padding-block: var(--section-y);
}
.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 3rem + 10vw, 9rem);
  font-weight: var(--weight-extra);
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
