/* ============================================================
   STEEL FRAMING ESPAÑA
   Los Altillos · losaltillos.com/steel-framing/espana/
   Prefijo: gx-
   Depende de: assets/main.css (variables globales, reset)

   FIX v1.1
   · Tipografía en px para evitar herencia de base 12px
   · Imágenes (figure > .gx-img-break) confinadas al ancho de lectura
   · Tabla confinada al ancho de lectura
   · Todo el contenido alineado al mismo ancho: 740px
   ============================================================ */


/* ============================================================
   BARRA DE PROGRESO
   ============================================================ */

.gx-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-accent)       0%,
        var(--color-accent-light) 100%
    );
    z-index: 9999;
    transition: width 100ms linear;
    pointer-events: none;
}


/* ============================================================
   MAIN WRAPPER
   ============================================================ */

.gx-main {
    min-height: 60vh;
}


/* ============================================================
   CONTAINERS
   ============================================================

   Ancho de lectura: 740px — esta es la referencia única de
   contenido. Imágenes, tablas y cajas se alinean a este valor.
   ============================================================ */

.gx-container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 24px;
}

.gx-container--reading {
    max-width: 740px;
    margin-inline: auto;
    padding-inline: 24px;
}

@media (min-width: 768px) {
    .gx-container,
    .gx-container--reading {
        padding-inline: 32px;
    }
}


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

.gx-hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.gx-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    z-index: 0;
}

.gx-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(1, 43, 96, 0.45) 0%,
        rgba(1, 43, 96, 0.80) 55%,
        rgba(1, 43, 96, 0.92) 100%
    );
    z-index: 1;
}

.gx-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    margin-inline: 0;
    padding-inline: 24px;
    padding-top: calc(var(--header-height) + 5rem);
    padding-bottom: 5rem;
}

@media (min-width: 768px) {
    .gx-hero__inner {
        padding-inline: 32px;
    }
}

/* Breadcrumb */
.gx-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
}

.gx-breadcrumb a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.gx-breadcrumb a:hover {
    color: #fff;
}

.gx-breadcrumb__sep {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}

/* Tags del hero */
.gx-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.gx-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1;
}

.gx-tag--hero {
    background: rgba(199, 8, 29, 0.20);
    color: #fff;
    border: 1px solid rgba(199, 8, 29, 0.45);
}

.gx-tag--geo {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* H1 */
.gx-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 20px;
}

.gx-hero h1 em {
    font-style: normal;
    color: rgba(255, 255, 255, 0.72);
}

.gx-hero__subtitle {
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 640px;
    margin: 0 0 28px;
}

/* Meta */
.gx-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 24px;
}

.gx-hero__meta-item {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    position: relative;
}

.gx-hero__meta-item + .gx-hero__meta-item::before {
    content: '·';
    position: absolute;
    left: -14px;
    color: rgba(255, 255, 255, 0.30);
}


/* ============================================================
   TABLA DE CONTENIDOS
   ============================================================ */

.gx-toc-wrap {
	margin-top: 20px;
	max-height: 950px;
    background: var(--color-bg);
    position: sticky;
    top: var(--header-height);
    z-index: 90;
}

.gx-toc-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 740px;
    margin-inline: auto;
    padding: 16px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: left;
    gap: 16px;
	border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .gx-toc-trigger {
        padding-inline: 32px;
    }
}

.gx-toc-trigger__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.gx-toc-chevron {
    display: flex;
    align-items: center;
    color: var(--color-text-subtle);
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.gx-toc-chevron svg {
    width: 16px;
    height: 16px;
}

.gx-toc-trigger[aria-expanded="true"] .gx-toc-chevron {
    transform: rotate(180deg);
}

.gx-toc-body {
    border-top: 1px solid var(--color-border);
    padding: 20px 24px 24px;
    max-width: 740px;
    margin-inline: auto;
}

.gx-toc-body[hidden] {
    display: none;
}

@media (min-width: 768px) {
    .gx-toc-body {
        padding-inline: 32px;
    }
}

.gx-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 32px;
    counter-reset: toc-counter;
}

.gx-toc-list li {
    counter-increment: toc-counter;
}

.gx-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.gx-toc-list a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-accent);
    flex-shrink: 0;
}

.gx-toc-list a:hover {
    color: var(--color-secondary);
}


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

.gx-section {
    padding: 64px 0;
    background: var(--color-bg);
}

.gx-section--steel {
    background: var(--color-steel-light);
}

.gx-section--secondary {
    background: var(--color-secondary);
}

.gx-section--dark {
    background: var(--color-bg-dark);
}

@media (max-width: 767px) {
    .gx-section {
        padding: 48px 0;
    }
}


/* ============================================================
   TIPOGRAFÍA DEL CONTENIDO
   — Todos los tamaños en px para independencia del root 12px
   ============================================================ */

.gx-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 14px;
}

.gx-h2 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin: 0 0 24px;
}

.gx-h3 {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
    margin: 40px 0 14px;
}

.gx-p {
    font-size: 16px;
    line-height: 1.78;
    color: var(--color-text-muted);
    margin: 0 0 18px;
}

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

.gx-list {
    padding-left: 22px;
    margin: 12px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gx-list li {
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text-muted);
}

/* Links en cuerpo de secciones claras */
.gx-section .gx-p a,
.gx-section .gx-list a {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(2, 55, 120, 0.25);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.gx-section .gx-p a:hover,
.gx-section .gx-list a:hover {
    color: var(--color-secondary-light);
    border-bottom-color: var(--color-secondary-light);
}


/* -------- variantes de color por tipo de sección -------- */

.gx-section--secondary .gx-eyebrow  { color: rgba(255,255,255,0.55); }
.gx-section--secondary .gx-h2,
.gx-section--secondary .gx-h3       { color: #fff; }
.gx-section--secondary .gx-p,
.gx-section--secondary .gx-list li  { color: rgba(255,255,255,0.82); }

.gx-section--dark .gx-eyebrow       { color: rgba(255,255,255,0.45); }
.gx-section--dark .gx-h2,
.gx-section--dark .gx-h3            { color: #fff; }
.gx-section--dark .gx-p,
.gx-section--dark .gx-list li       { color: rgba(255,255,255,0.80); }

.gx-section--dark .gx-p a,
.gx-section--dark .gx-list a {
    color: rgba(255,255,255,0.90);
    border-bottom-color: rgba(255,255,255,0.30);
}


/* ============================================================
   CALLOUT
   ============================================================ */

.gx-callout {
    margin: 24px 0;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-steel);
    background: var(--color-bg-secondary);
}

.gx-callout--blue {
    border-left-color: var(--color-secondary);
    background: rgba(2, 55, 120, 0.05);
}

.gx-callout__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-secondary);
    margin-bottom: 10px;
}

.gx-callout p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-muted);
    margin: 0;
    font-weight: 500;
}


/* ============================================================
   ANÉCDOTA
   ============================================================ */

.gx-anecdote {
    margin: 32px 0;
    padding: 24px 28px;
    background: rgba(199, 8, 29, 0.04);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.gx-anecdote p {
    font-size: 16px;
    line-height: 1.78;
    color: var(--color-text-muted);
    margin: 0 0 14px;
    font-style: italic;
}

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

.gx-section--dark .gx-anecdote {
    background: rgba(255,255,255,0.05);
    border-left-color: var(--color-accent);
}

.gx-section--dark .gx-anecdote p {
    color: rgba(255,255,255,0.75);
}


/* ============================================================
   LINK BOX
   ============================================================ */

.gx-link-box {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 28px;
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-secondary);
    text-decoration: none;
    color: var(--color-text);
    transition:
        border-color var(--transition-base),
        transform var(--transition-base),
        box-shadow var(--transition-base);
}

.gx-link-box:hover {
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gx-link-box__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 55, 120, 0.08);
    border-radius: var(--radius-md);
    color: var(--color-secondary);
}

.gx-link-box__icon svg {
    width: 22px;
    height: 22px;
}

.gx-link-box__content {
    flex: 1;
    min-width: 0;
}

.gx-link-box__meta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 6px;
}

.gx-link-box__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
}

.gx-link-box__arrow {
    font-size: 18px;
    color: var(--color-text-subtle);
    flex-shrink: 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.gx-link-box:hover .gx-link-box__arrow {
    transform: translateX(4px);
    color: var(--color-secondary);
}

@media (max-width: 480px) {
    .gx-link-box__icon { display: none; }
}


/* ============================================================
   TABLA COMPARATIVA
   — Contenida al mismo ancho que el texto (740px)
   ============================================================ */

.gx-table-wrap {
    /* Cuando está dentro de .gx-container (1280px), se contiene
       manualmente para igualar el ancho del lector */
    max-width: 740px;
    margin-inline: auto;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow-sm);
}

/* Cuando la tabla está dentro de .gx-container--reading,
   ya está confinada: quitamos el max-width redundante */
.gx-container--reading .gx-table-wrap {
    max-width: 100%;
}

.gx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--color-bg-dark);
    color: rgba(255,255,255,0.85);
    min-width: 520px;
}

.gx-table thead tr {
    background: rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.gx-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}

.gx-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: background var(--transition-fast);
}

.gx-table tbody tr:last-child {
    border-bottom: none;
}

.gx-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

.gx-table td {
    padding: 15px 18px;
    vertical-align: top;
    line-height: 1.6;
    color: rgba(255,255,255,0.80);
    font-size: 15px;
}

.gx-table td:first-child {
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    white-space: nowrap;
}


/* ============================================================
   IMÁGENES INTERTRAMO
   — El <figure> está fuera de cualquier container (full bleed
     por defecto). Se confina al mismo ancho que el lector.
   ============================================================ */

figure:has(.gx-img-break) {
    display: block;
    max-width: 740px;
    margin-inline: auto;
    padding-inline: 24px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    figure:has(.gx-img-break) {
        padding-inline: 32px;
    }
}

.gx-img-break {
    display: block;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.gx-img-break--mid {
    height: clamp(180px, 22vw, 320px);
    object-position: center 40%;
}

.gx-img-caption {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-subtle);
    text-align: left;
    padding: 12px 0 0;
    background: none;
    border: none;
}


/* ============================================================
   FAQ — separadores entre preguntas
   ============================================================ */

#faq .gx-h3 {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

#faq .gx-h3:first-of-type {
    border-top: none;
    padding-top: 0;
}

.gx-section--dark #faq .gx-h3,
.gx-section--secondary #faq .gx-h3 {
    border-top-color: rgba(255,255,255,0.12);
}


/* ============================================================
   RESPONSIVE MÓVIL
   ============================================================ */

@media (max-width: 767px) {

    .gx-hero {
        min-height: 85vh;
    }

    .gx-hero h1 {
        font-size: 26px;
    }

    .gx-hero__subtitle {
        font-size: 16px;
    }

    .gx-h2 {
        font-size: 22px;
    }

    .gx-h3 {
        font-size: 18px;
        margin-top: 32px;
    }

    .gx-anecdote {
        padding: 18px 20px;
    }

    .gx-toc-list {
        grid-template-columns: 1fr;
    }

    .gx-table {
        font-size: 14px;
    }

    .gx-table th,
    .gx-table td {
        padding: 12px 14px;
    }
}