/*
 * Los Altillos — Pilar 1: ¿Qué es el Steel Framing?
 * Archivo: assets/pilar-que-es.css
 * Prefijo: p1-
 * Cargado condicionalmente desde functions.php solo en page-que-es-steel-framing.php
 *
 * Depende de: assets/main.css (variables CSS globales la-)
 * ============================================================ */


/* ---- BREADCRUMB ------------------------------------------ */

.p1-breadcrumb {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}

.p1-breadcrumb__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.p1-breadcrumb a {
  color: var(--color-text-subtle);
  transition: color var(--transition-fast);
}

.p1-breadcrumb a:hover { color: var(--color-accent); }

.p1-breadcrumb__sep { color: var(--color-steel); }

.p1-breadcrumb__current {
  color: var(--color-text-muted);
  font-weight: 500;
}


/* ---- HERO ------------------------------------------------ */
/*
 * Imagen de fondo se inyecta como inline style desde PHP.
 * El background-image CSS es el fallback cuando no hay imagen.
 */

.p1-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  background-color: var(--color-bg-dark);
  /* fallback — reemplazar con imagen real vía ACF 'hero_image' */
  background-image: linear-gradient(135deg, #011730 0%, #023060 55%, #011f50 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.p1-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(1,20,50,0.92) 0%,
    rgba(1,20,50,0.60) 45%,
    rgba(1,20,50,0.25) 100%
  );
}

.p1-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.p1-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.p1-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.875rem;
  background: rgba(199,8,29,0.18);
  border: 1px solid rgba(199,8,29,0.38);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.82);
  margin-bottom: 1rem;
}

.p1-hero__eyebrow svg { width: 11px; height: 11px; flex-shrink: 0; }

.p1-hero__h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 0.875rem;
  max-width: 640px;
}

.p1-hero__subtitle {
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  line-height: 1.65;
  color: rgba(255,255,255,0.58);
  max-width: 540px;
  margin-bottom: 1.75rem;
}

.p1-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.p1-hero__meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.42);
}

.p1-hero__meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }


/* ---- TOC MOBILE ------------------------------------------ */

.p1-toc-mobile {
  display: none;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.p1-toc-mobile__toggle {
  width: 100%;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.p1-toc-mobile__chevron {
  width: 16px;
  height: 16px;
  stroke: var(--color-text-subtle);
  fill: none;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.p1-toc-mobile__toggle.is-open .p1-toc-mobile__chevron {
  transform: rotate(180deg);
}

.p1-toc-mobile__list {
  display: none;
  padding: 0 1.5rem 1rem;
  list-style: none;
}

.p1-toc-mobile__list.is-open { display: block; }

.p1-toc-mobile__list li {
  border-bottom: 1px solid var(--color-border);
}

.p1-toc-mobile__list li:last-child { border-bottom: none; }

.p1-toc-mobile__list a {
  display: block;
  padding: 0.625rem 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.p1-toc-mobile__list a:hover { color: var(--color-accent); }


/* ---- LAYOUT ---------------------------------------------- */
/*
 * grid-template-columns: 1fr 240px
 * Artículo en columna 1 (izquierda), sidebar en columna 2 (derecha).
 * No se usan propiedades order: el DOM ya está en el orden correcto.
 */

.p1-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 4rem;
  align-items: start;
}


/* ---- SIDEBAR TOC ----------------------------------------- */

.p1-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.p1-toc {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.375rem;
}

.p1-toc__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.p1-toc__label svg { width: 11px; height: 11px; flex-shrink: 0; }

.p1-toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.p1-toc__list li a {
  display: block;
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-subtle);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

.p1-toc__list li a:hover,
.p1-toc__list li a.is-active {
  color: var(--color-accent);
  background: rgba(199,8,29,0.05);
  border-left-color: var(--color-accent);
}

.p1-toc__list li a.is-active { font-weight: 600; }

.p1-toc__divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}


/* ---- SECCIONES DEL ARTÍCULO ------------------------------ */

.p1-section {
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.p1-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.p1-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.p1-h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.p1-p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.p1-p:last-child { margin-bottom: 0; }

.p1-note {
  padding: 1rem 1.25rem;
  background: rgba(2,55,120,0.05);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 1.5rem 0;
}

.p1-note strong { color: var(--color-text); }


/* ---- FEATURE CARDS (ventajas / desventajas) -------------- */

.p1-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.p1-feature-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.375rem;
  transition: all var(--transition-base);
}

.p1-feature-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.p1-feature-card--warn { border-color: rgba(245,158,11,0.2); }
.p1-feature-card--warn:hover { border-color: var(--color-warning); }

.p1-feature-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.p1-feature-card__icon svg { width: 18px; height: 18px; fill: none; stroke-width: 1.75; }
.p1-feature-card__icon--green { background: rgba(34,197,94,0.1); }
.p1-feature-card__icon--blue  { background: rgba(2,55,120,0.08); }
.p1-feature-card__icon--red   { background: rgba(199,8,29,0.09); }
.p1-feature-card__icon--amber { background: rgba(245,158,11,0.1); }

.p1-feature-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.p1-feature-card__text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}


/* ---- COMPONENTES CARDS ----------------------------------- */

.p1-components-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.p1-component-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.p1-component-card__num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--color-steel);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.p1-component-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.p1-component-card__desc {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-text-subtle);
}


/* ---- STAT BARS ------------------------------------------- */

.p1-stat-bar {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.p1-stat-bar__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-subtle);
  margin-bottom: 1.25rem;
}

.p1-stat-item { margin-bottom: 1rem; }
.p1-stat-item:last-child { margin-bottom: 0; }

.p1-stat-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.p1-stat-item__name { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }

.p1-stat-item__value {
  font-size: 0.875rem;
  font-weight: 700;
  font-family: monospace;
}

.p1-stat-item__value--steel { color: var(--color-success); }
.p1-stat-item__value--mampo { color: var(--color-text-subtle); }

.p1-stat-track {
  height: 7px;
  background: var(--color-bg-tertiary);
  border-radius: 100px;
  overflow: hidden;
}

.p1-stat-fill {
  height: 100%;
  width: 0; /* animado via JS con data-width */
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

.p1-stat-fill--steel { background: linear-gradient(90deg, var(--color-success), #16a34a); }
.p1-stat-fill--mampo { background: var(--color-steel); }


/* ---- COMPARISON TABLE ------------------------------------ */

.p1-comparison {
  margin-top: 1.75rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.p1-comparison__head {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  background: var(--color-bg-dark);
}

.p1-comparison__head-cell {
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.p1-comparison__head-cell--sf {
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.p1-comparison__head-cell--sf::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.p1-comparison__row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border-top: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.p1-comparison__row:hover { background: var(--color-bg-secondary); }

.p1-comparison__cell {
  padding: 0.8125rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.p1-comparison__cell:first-child {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.p1-comparison__cell--good { color: var(--color-success); font-weight: 600; }
.p1-comparison__cell--mid  { color: var(--color-warning); font-weight: 500; }
.p1-comparison__cell--bad  { color: #94a3b8; font-style: italic; }


/* ---- CUANDO CONVIENE ------------------------------------- */

.p1-when-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.p1-when-card {
  border-radius: var(--radius-lg);
  padding: 1.375rem;
  border: 1px solid;
}

.p1-when-card--yes { background: rgba(34,197,94,0.04); border-color: rgba(34,197,94,0.2); }
.p1-when-card--no  { background: rgba(100,116,139,0.04); border-color: var(--color-border); }

.p1-when-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.p1-when-card__title svg { width: 13px; height: 13px; fill: none; stroke-width: 2; flex-shrink: 0; }
.p1-when-card--yes .p1-when-card__title { color: var(--color-success); }
.p1-when-card--no  .p1-when-card__title { color: var(--color-text-subtle); }

.p1-when-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.p1-when-list li {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.p1-when-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 0.5em;
  flex-shrink: 0;
}

.p1-when-card--yes .p1-when-list li::before { background: var(--color-success); }
.p1-when-card--no  .p1-when-list li::before { background: var(--color-steel-dark); }


/* ---- PROYECTOS GRID -------------------------------------- */

.p1-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.p1-project-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.p1-project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.p1-project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.p1-project-card:hover::before { opacity: 1; }

.p1-project-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.p1-project-card__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--color-secondary); stroke-width: 1.5; }

.p1-project-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.p1-project-card__text {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}


/* ---- FAQ ACCORDION --------------------------------------- */

.p1-faq {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.p1-faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.p1-faq__item.is-open { border-color: var(--color-accent); }

.p1-faq__trigger {
  width: 100%;
  padding: 1.0625rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition-fast);
}

.p1-faq__trigger:hover { background: var(--color-bg-secondary); }
.p1-faq__item.is-open .p1-faq__trigger { background: var(--color-bg-secondary); }

.p1-faq__q-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: monospace;
  flex-shrink: 0;
  min-width: 1.5rem;
}

.p1-faq__q-text {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.p1-faq__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.p1-faq__icon svg {
  width: 10px;
  height: 10px;
  stroke: var(--color-text-subtle);
  fill: none;
  stroke-width: 2;
  transition: transform var(--transition-fast);
}

.p1-faq__item.is-open .p1-faq__icon { background: var(--color-accent); }
.p1-faq__item.is-open .p1-faq__icon svg { stroke: white; transform: rotate(45deg); }

.p1-faq__body { display: none; padding: 0 1.25rem 1.25rem; }
.p1-faq__item.is-open .p1-faq__body { display: block; }

.p1-faq__answer {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}


/* ---- CTA BLOCK ------------------------------------------- */

.p1-cta {
  background: var(--color-bg-dark);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-top: 3.5rem;
  position: relative;
  overflow: hidden;
}

.p1-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 100% 50%, rgba(11,74,161,0.4) 0%, transparent 70%),
    radial-gradient(ellipse 35% 60% at 0% 80%,  rgba(199,8,29,0.14) 0%, transparent 60%);
  pointer-events: none;
}

.p1-cta__inner { position: relative; z-index: 1; }

.p1-cta__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent-light);
  margin-bottom: 0.625rem;
}

.p1-cta__title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  color: white;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.p1-cta__text {
  font-size: 1rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.p1-cta__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.625rem;
}

.p1-cta__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.p1-cta__link:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.22);
  transform: translateX(4px);
}

.p1-cta__link-icon {
  width: 34px;
  height: 34px;
  background: rgba(199,8,29,0.22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.p1-cta__link-icon svg { width: 15px; height: 15px; stroke: rgba(255,255,255,0.75); fill: none; stroke-width: 1.5; }

.p1-cta__link-text { flex: 1; min-width: 0; }

.p1-cta__link-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.32);
  display: block;
  margin-bottom: 0.15rem;
}

.p1-cta__link-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
}

.p1-cta__link-arrow { color: rgba(255,255,255,0.25); flex-shrink: 0; display: flex; }
.p1-cta__link-arrow svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }


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

@media (max-width: 960px) {
  .p1-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 2rem;
  }
  .p1-sidebar      { display: none; }
  .p1-toc-mobile   { display: block; }
  .p1-when-grid    { grid-template-columns: 1fr; }
  .p1-components-grid { grid-template-columns: 1fr 1fr; }
  .p1-projects-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .p1-hero          { min-height: 340px; }
  .p1-hero__inner,
  .p1-breadcrumb__inner,
  .p1-layout        { padding-left: 1.5rem; padding-right: 1.5rem; }
  .p1-cards-grid    { grid-template-columns: 1fr; }
  .p1-components-grid { grid-template-columns: 1fr; }
  .p1-comparison__head,
  .p1-comparison__row { grid-template-columns: 1fr 1fr; }
  .p1-comparison__head-cell:first-child,
  .p1-comparison__cell:first-child { display: none; }
  .p1-cta           { padding: 1.75rem 1.5rem; }
  .p1-cta__links    { grid-template-columns: 1fr; }
}
