/* FO Ingeniería — brochure en línea / PDF (A4 = 794 × 1123 px a 96 dpi) */
:root {
    --navy: #1f3864; --acc: #365f91; --ice: #d6e4f0; --soft: #f4f7fb;
    --ink: #1b2533; --txt: #3d434b; --mut: #5f6670; --rule: #d5dde7;
    --sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', 'Noto Sans', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #e7ebf0; font-family: var(--sans); color: var(--txt); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--acc); text-decoration: none; }
img { display: block; max-width: 100%; }

/* Barra superior (no se imprime) */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 1.5rem; background: var(--navy); color: #fff; }
.barra a { color: #fff; font-weight: 600; font-size: 14px; }
.barra__titulo { font-weight: 600; font-size: 14px; opacity: 0.85; }
.barra__pdf { background: #fff; color: var(--navy); border: 0; padding: 0.55rem 1.1rem; font: 700 14px var(--sans); cursor: pointer; }
.barra__pdf:hover { background: var(--ice); }
.barra__ayuda { text-align: center; font-size: 13px; color: var(--mut); padding: 0.8rem 1rem 0; }
#hojas { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 0 48px; }

/* Hoja A4 */
.hoja { position: relative; width: 794px; height: 1123px; background: #fff; overflow: hidden; box-shadow: 0 4px 24px rgba(20, 34, 56, 0.15); flex: none; }
.hoja[data-seccion]::before {
    content: ""; position: absolute; top: 40px; left: 56px; right: 56px; height: 47px;
    border-bottom: 1px solid var(--ink); background: url(../images/logo-fo.webp) left top / auto 34px no-repeat;
}
.hoja[data-seccion]::after {
    content: attr(data-seccion); position: absolute; top: 52px; right: 56px; font-size: 12px; color: var(--mut);
}
.hoja__pie {
    position: absolute; left: 56px; right: 56px; bottom: 40px; height: 34px;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--rule); font-size: 12px; line-height: 1; color: var(--mut); background: #fff;
}
.hoja__cuerpo { position: absolute; top: 108px; left: 56px; right: 56px; bottom: 96px; display: flex; flex-direction: column; gap: 15px; overflow: hidden; }
.hoja__cuerpo--corto { bottom: auto; }

.eje { display: flex; align-items: center; gap: 10px; color: var(--acc); font-weight: 600; font-size: 13px; }
.eje b { width: 26px; height: 26px; border: 1.5px solid var(--acc); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.eje::after { content: ""; flex: 1; border-top: 1px dashed var(--rule); }

.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; font-size: 14px; }
.fuerte { color: var(--ink); }
.servicios { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.servicios div { border-top: 1.5px solid var(--navy); padding-top: 10px; }
.servicios h3 { font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.servicios p { font-size: 12.5px; }

.director { display: grid; grid-template-columns: 250px 1fr; gap: 28px; }
.director__ficha { background: var(--soft); border-top: 3px solid var(--acc); padding: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.director__ficha strong { font-size: 18px; color: var(--ink); line-height: 1.25; }
.director__ficha .acento { color: var(--acc); font-weight: 600; font-size: 13px; }
.director__ficha a { margin-top: 6px; font-weight: 600; font-size: 13px; }
.trayectoria { border-top: 1px solid var(--ink); }
.trayectoria div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.trayectoria div > span:first-child { color: var(--mut); }
.trayectoria b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }

.cifras { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.cifras div { padding: 12px 14px 12px 0; }
.cifras strong { display: block; font-size: 30px; line-height: 1; color: var(--navy); }
.cifras span { font-size: 12px; color: var(--mut); }

.seleccion { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 20px; }
.sel { display: flex; flex-direction: column; gap: 5px; }
.sel__img { position: relative; height: 136px; background: var(--soft); border-bottom: 3px solid var(--acc); overflow: hidden; }
.sel__img img, .sel__img svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sel__img .proj__cred { position: absolute; right: 0; bottom: 0; font-size: 9px; padding: 1px 5px; color: #fff; background: rgba(31, 56, 100, 0.8); }
.sel__cat { font-size: 11.5px; color: var(--acc); font-weight: 600; }
.sel__tit { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.sel__meta { font-size: 12px; color: var(--mut); }
.sel__txt { font-size: 12px; }

/* Historial */
.hist__intro { font-size: 12.5px; }
.fila { display: grid; grid-template-columns: 74px 1fr 170px 80px 92px; column-gap: 10px; font-size: 12px; line-height: 1.3; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.fila--cab { font-size: 11.5px; color: var(--mut); border-bottom: 1.5px solid var(--ink); padding-bottom: 5px; }
.fila > span:nth-child(1) { color: var(--mut); }
.fila > span:nth-child(2) { color: var(--ink); }
.fila > span:nth-child(3) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila > span:nth-child(4), .fila > span:nth-child(5) { text-align: right; white-space: nowrap; }
.estado { color: var(--mut); }
.estado::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; margin-right: 7px; vertical-align: 0; }
.estado--activo { color: var(--acc); }
.estado--activo::before { background: var(--acc); }
.cat { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 4px; border-bottom: 1px solid var(--acc); }
.cat b { font-size: 13.5px; color: var(--navy); }
.cat span { font-size: 11.5px; color: var(--mut); }

/* Portada */
.portada__lamina { position: absolute; inset: 0 0 auto 0; height: 640px; background: var(--soft); border-bottom: 3px solid var(--acc); }
.portada__lamina svg { width: 100%; height: 100%; }
.portada__texto { position: absolute; left: 56px; right: 56px; top: 690px; display: flex; flex-direction: column; gap: 18px; }
.portada__logo { height: 92px; width: auto; align-self: flex-start; }
.portada__texto h1 { font-size: 40px; line-height: 1.12; color: var(--ink); letter-spacing: -0.01em; }
.portada__texto p { font-size: 16px; max-width: 560px; }
.portada__pie { position: absolute; left: 56px; right: 56px; bottom: 44px; display: flex; justify-content: space-between; border-top: 1px solid var(--ink); padding-top: 14px; color: var(--mut); }

/* Contacto */
.planos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.planos figure { display: flex; flex-direction: column; gap: 6px; }
.planos img { height: 190px; width: 100%; object-fit: contain; border: 1px solid var(--rule); background: #fff; }
.planos figcaption { font-size: 12px; color: var(--mut); }
.contacto__bloque { position: absolute; left: 0; right: 0; bottom: 0; height: 520px; background: var(--navy); color: #fff; padding: 56px 56px 44px; display: flex; flex-direction: column; gap: 22px; }
.contacto__logo { height: 72px; width: auto; align-self: flex-start; }
.contacto__bloque h2 { font-size: 28px; color: #fff; }
.contacto__bloque dl { display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid rgba(255, 255, 255, 0.5); font-size: 14px; }
.contacto__bloque dt, .contacto__bloque dd { padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.contacto__bloque dt { color: #c4d3e6; }
.contacto__bloque dd, .contacto__bloque a { color: #fff; font-weight: 600; }
.contacto__firma { margin-top: auto; font-size: 12px; color: #c4d3e6; }
.contacto .hoja__pie { display: none; }

/* Impresión / PDF */
@page { size: A4; margin: 0; }
@media print {
    body { background: #fff; }
    .barra, .barra__ayuda { display: none; }
    #hojas { display: block; padding: 0; zoom: 1; }
    .hoja { width: 210mm; height: 297mm; box-shadow: none; page-break-after: always; break-after: page; }
    .hoja:last-child { page-break-after: auto; break-after: auto; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.saltar { position: absolute; left: 1rem; top: -100px; z-index: 20; background: var(--navy); color: #fff; padding: 0.6rem 1rem; font-weight: 700; }
.saltar:focus { top: 0.75rem; }
@media print { .saltar { display: none; } }
