/*
 * Samba y Karim — capa de basecore sobre la hoja del tema (tema.css).
 *
 * Todo lo que el prototipo no traía y basecore necesita:
 *
 *   1. El contrato del panel de Apariencia: --section-text para el color del
 *      texto de cualquier sección (las maquetas llevan la clase `sk-sec`).
 *   2. Markup que basecore genera y el prototipo no tenía: el formulario
 *      dinámico, las redes del pie, el aviso de reCAPTCHA, la miga.
 *   3. Las tarjetas de servicios con un número de columnas que depende de
 *      cuántas haya (en "Otros servicios" se quita la de la página actual).
 *   4. Las animaciones: entrada al hacer scroll, la del hero al cargar y los
 *      estados de hover. Todas condicionadas a `html.sk-anim`, que el layout
 *      pone en el <head> solo si el navegador entiende IntersectionObserver
 *      y el usuario no ha pedido reducir el movimiento. Sin esa clase, todo
 *      se ve quieto y desde el principio.
 *   5. La galería: filtros, desplazamiento de la columna par y el visor.
 *   6. Las secciones obligatorias que el prototipo no tenía: texto, blog y
 *      artículo.
 *   7. Contraste y foco, para Lighthouse.
 */

/* ---- 1. Apariencia ------------------------------------------------------- */

.sk-sec[style*="--section-text"] { color: var(--section-text); }
.sk-sec[style*="--section-text"] :where(h1, h2, h3, h4, p, li, .eyebrow, .split > p, .lead) { color: var(--section-text); }
.sk-sec[style*="background-image"] { background-size: cover; background-position: center; }

/* ---- 2. Markup de basecore ----------------------------------------------- */

main { display: block; }

/* Formulario dinámico: los campos del gestor de formularios con el aspecto
   del prototipo (etiqueta pequeña en mayúsculas, línea inferior). */
.form .form-row { gap: 0 24px; }
.form .form-field { margin-bottom: 22px; }
.form .form-field > label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.form .form-field--full { grid-column: 1 / -1; }
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form textarea:focus, .form select:focus { border-bottom-color: var(--sk-ink); }
.form .privacy { align-items: flex-start; margin: 4px 0 24px; line-height: 1.5; }
.form .privacy input { margin-top: 3px; accent-color: var(--sk-ink); }
.form .privacy a { text-decoration: underline; }
.form .button > span { transition: transform .25s ease; }
.form .form-options { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.form .form-options label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.form .privacy label { margin: 0; font-size: 11px; }
.form .form-title { margin: 0 0 26px; font-family: var(--font-heading); font-weight: 400; font-size: 28px; text-transform: uppercase; }
#output-contact:not(:empty) { margin-top: 16px; font-size: 13px; }
.form .recaptcha-aviso { margin-top: 12px; font-size: 10px; color: var(--sk-muted); }
.form .recaptcha-aviso a { text-decoration: underline; }

/* Pie: los títulos de columna son <h3> (en el prototipo, <p>). */
.footer .footer-title { margin: 0 0 12px; }
.footer-hours { font-size: 12px; line-height: 1.65; }
/* Redes del pie (template/parts/social). */
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer .footer-social a { display: grid; place-items: center; width: 36px; height: 36px; margin: 0; border: 1px solid #3a3d36; color: #fff; font-size: 14px; }
.footer .footer-social a:hover { background: var(--sk-accent); border-color: var(--sk-accent); color: var(--sk-on-accent); }
.footer-brand img { display: block; max-height: 56px; width: auto; margin-bottom: 18px; }
.footer-brand .footer-text p { color: #b5b8af; }
.footer a:hover { color: var(--sk-accent); }

/* Cabecera de las páginas sin hero: la banda oscura de la galería, con la
   miga encima del título. */
.page-hero .breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.page-hero .breadcrumb li + li::before { content: "/"; margin-right: 8px; color: #8f9489; }
.page-hero .breadcrumb a { color: var(--sk-accent); }
.page-hero .breadcrumb [aria-current] { color: #c1c5ba; }

/* Barra superior: va toda en mayúsculas, salvo el correo, que se lee tal
   cual está escrito. */
.utility a[href^="mailto:"] { text-transform: none; }

/* Cabecera: idiomas y la versión compacta al bajar. */
.header { transition: box-shadow .3s ease; }
.header-row { transition: min-height .3s ease; }
.header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.nav .nav-lang { text-transform: uppercase; }
.menu .fa-xmark, .menu[aria-expanded="true"] .fa-bars { display: none; }
.menu[aria-expanded="true"] .fa-xmark { display: inline; }
@media (min-width: 1101px) {
    .header.is-scrolled .header-row { min-height: 70px; }
    .header.is-scrolled .nav a:not(.nav-cta) { padding: 25px 0 21px; }
    .nav a { transition: color .2s ease, padding .3s ease; }
    .nav a:not(.nav-cta):hover { color: #fff; }
}

/* ---- 2 bis. Piezas de las maquetas que el prototipo no tenía ----------- */

/* Hero: el teléfono con su icono; el texto de la cabecera sin foto. */
.phone i { margin-right: 6px; color: var(--sk-accent); }
.gallery-hero .gallery-hero-text { max-width: 650px; margin: 28px 0 0; color: #b7bbb1; font-size: 18px; line-height: 1.6; }
.gallery-hero .hero-actions { margin-top: 34px; }

/* Lista de "por qué": el párrafo de cierre y el botón bajo el titular. */
.why-intro { max-width: 440px; margin: 28px 0 0; color: var(--sk-muted); font-size: 17px; line-height: 1.6; }
.why-actions { margin-top: 32px; }

/* Bandas de la marca: el párrafo bajo el titular y los botones. */
.statement-lead { margin: 0; }
.statement-text { max-width: 700px; margin: 22px 0 0; font-size: 18px; line-height: 1.6; }
.statement-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.service-statement-grid.sin-numero { grid-template-columns: 1fr; }
.service-statement .eyebrow { margin-bottom: 18px; }
.service-statement .hero-actions { margin-top: 32px; }

/* Ventajas: sin foto, el texto ocupa la fila. */
.benefits-grid.sin-foto { grid-template-columns: 1fr; }
.benefits ul { margin: 0 0 36px; }

/* Contacto: las cajas de contacto directo con su etiqueta encima. */
.contact-copy > .direct-text { margin-top: 30px; font-size: 15px; }
.direct a { min-width: 150px; }
.direct-box small { display: block; margin-bottom: 8px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* Galería: el pie de foto, en <h2> o <h3> según haya título de sección. */
.caption h2, .caption h3 { margin: 8px 0 0; font-size: 20px; font-weight: 700; line-height: 1.3; }

/* Móvil: lo que el prototipo no resolvía. La franja de marcas no cabía en
   una fila (se cortaba) y los huecos entre columnas (70-105px) seguían ahí
   con las columnas ya apiladas. */
@media (max-width: 820px) {
    .why, .benefits-grid, .contact-grid, .inner-grid { gap: 48px; }
    .brand-strip { flex-wrap: wrap; gap: 10px 28px; padding: 22px 0; }
    .brand-strip span { flex-basis: 100%; }
    .process-grid article, .types-grid article { min-height: 0; }
    .process-grid h3, .types-grid h3 { margin-top: 36px; }
}
/* ---- 3. Tarjetas de servicios ------------------------------------------- */

@media (min-width: 1051px) {
    .cards.cols-1 { grid-template-columns: 1fr; }
    .cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
    .cards.cols-5 { grid-template-columns: repeat(5, 1fr); }
}
.card { transition: background-color .3s ease, color .3s ease; }
.card p { transition: color .3s ease; }
.card .card-arrow { display: inline-block; transition: transform .3s ease; }
.card:hover .card-arrow { transform: translateX(6px); }
.card h3 { font-family: var(--font-heading); font-weight: 400; text-transform: uppercase; letter-spacing: -.01em; font-size: 26px; line-height: 1; }

/* Los tipos de cada servicio van con la tipografía de los titulares, como
   las tarjetas (diseño página a página); la lista de "por qué" y los pasos
   del proceso, en negrita de texto. */
.types-grid h3 { font-family: var(--font-heading); font-weight: 400; text-transform: uppercase; letter-spacing: -.01em; font-size: 26px; line-height: 1; }

/* Botones: la flecha avanza. Sin flecha, el texto va centrado. */
.button:not(:has(.arrow)) { justify-content: center; }
.button-label i { margin-right: 4px; }
.button { transition: transform .25s ease, background-color .25s ease, color .25s ease; }
.button .arrow { display: inline-block; transition: transform .25s ease; }
.button:hover .arrow { transform: translateX(5px); }
.button.outline:hover { background: var(--sk-ink); color: var(--sk-white); }
.direct a { transition: background-color .25s ease, color .25s ease; }
.direct a:hover { background: var(--sk-ink); color: var(--sk-white); }
.whatsapp { transition: transform .25s ease; }
.whatsapp:hover { transform: scale(1.08); }

/* Fotos: un zoom muy leve al pasar por encima. */
.photo > img, .visual > img, .service-visual > img { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.gallery-card:hover .photo > img, .benefits-grid:hover .photo > img { transform: scale(1.04); }

/* ---- 4. Animaciones ------------------------------------------------------ */

/* Entrada al hacer scroll: sambakarim.js añade .is-visible. */
.sk-anim .sk-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.sk-anim .sk-reveal.is-visible { opacity: 1; transform: none; }
.sk-anim .sk-stagger > .sk-reveal:nth-child(6n + 2) { transition-delay: .08s; }
.sk-anim .sk-stagger > .sk-reveal:nth-child(6n + 3) { transition-delay: .16s; }
.sk-anim .sk-stagger > .sk-reveal:nth-child(6n + 4) { transition-delay: .24s; }
.sk-anim .sk-stagger > .sk-reveal:nth-child(6n + 5) { transition-delay: .32s; }
.sk-anim .sk-stagger > .sk-reveal:nth-child(6n + 6) { transition-delay: .40s; }

/* Las líneas de la lista de ventajas entran de lado. */
.sk-anim .benefits li.sk-reveal { transform: translateX(-18px); }
.sk-anim .benefits li.sk-reveal.is-visible { transform: none; }

/* Hero: al cargar, sin esperar al scroll. */
@keyframes sk-subir { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes sk-destapar { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes sk-entrar-izq { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: none; } }
@keyframes sk-aparecer { from { opacity: 0; } to { opacity: 1; } }
.sk-anim .sk-intro > * { animation: sk-subir .9s cubic-bezier(.2, .7, .2, 1) both; }
.sk-anim .sk-intro > :nth-child(2) { animation-delay: .12s; }
.sk-anim .sk-intro > :nth-child(3) { animation-delay: .24s; }
.sk-anim .sk-intro > :nth-child(4) { animation-delay: .36s; }
.sk-anim .sk-intro > :nth-child(5) { animation-delay: .48s; }
.sk-anim .visual, .sk-anim .service-visual { animation: sk-destapar 1.1s cubic-bezier(.7, 0, .2, 1) .15s both; }
.sk-anim .experience { animation: sk-entrar-izq .7s cubic-bezier(.2, .7, .2, 1) 1s both; }
.sk-anim .service-visual .number { animation: sk-subir 1s cubic-bezier(.2, .7, .2, 1) .9s both; }
.sk-anim .brand-strip > * { animation: sk-aparecer .8s ease both; }
.sk-anim .brand-strip > :nth-child(2) { animation-delay: .6s; }
.sk-anim .brand-strip > :nth-child(3) { animation-delay: .7s; }
.sk-anim .brand-strip > :nth-child(4) { animation-delay: .8s; }
.sk-anim .brand-strip > :nth-child(5) { animation-delay: .9s; }
.sk-anim .brand-strip > :nth-child(n + 6) { animation-delay: 1s; }

/* El número grande de la banda de enfoque sube un poco más tarde. */
.sk-anim .service-statement .big-number.sk-reveal { transform: translateY(60px); transition-duration: 1.1s; }
.sk-anim .service-statement .big-number.sk-reveal.is-visible { transform: none; }

/* ---- 5. Galería ---------------------------------------------------------- */

.gallery-grid .gallery-card:nth-child(even) { margin-top: 0; }
.gallery-grid .gallery-card.is-par { margin-top: 65px; }
.gallery-card[hidden] { display: none; }
.gallery-card .photo { display: block; border-left: 0; cursor: zoom-in; }
.filters button { transition: background-color .2s ease, color .2s ease; }
.filters button:hover { border-color: var(--sk-ink); }
@media (max-width: 560px) {
    .gallery-grid .gallery-card.is-par { margin-top: 0; }
}

/* Visor: un <dialog> que crea sambakarim.js. */
.sk-visor { width: min(1100px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; background: transparent; color: #fff; overflow: visible; }
.sk-visor::backdrop { background: rgba(10, 11, 9, .92); }
.sk-visor figure { margin: 0; }
.sk-visor img { display: block; max-width: 100%; max-height: calc(100vh - 140px); margin: 0 auto; }
.sk-visor figcaption { margin-top: 14px; text-align: center; font-size: 13px; letter-spacing: .06em; }
.sk-visor figcaption small { display: block; margin-bottom: 4px; color: var(--sk-accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sk-visor button { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: var(--radius); background: var(--sk-accent); color: var(--sk-on-accent); font-size: 18px; cursor: pointer; }
.sk-visor .sk-visor-cerrar { top: -56px; right: 0; }
.sk-visor .sk-visor-ant { top: 50%; left: -8px; transform: translate(-100%, -50%); }
.sk-visor .sk-visor-sig { top: 50%; right: -8px; transform: translate(100%, -50%); }
@media (max-width: 1240px) {
    .sk-visor .sk-visor-ant { left: 8px; transform: translateY(-50%); }
    .sk-visor .sk-visor-sig { right: 8px; transform: translateY(-50%); }
}
.sk-anim .sk-visor[open] figure { animation: sk-aparecer .3s ease both; }

/* ---- 6. Texto, blog y artículo ------------------------------------------ */

.prose-block { max-width: var(--prose-width, 820px); margin: 0 auto; text-align: var(--prose-align, left); }
.prose-block .section-title { margin-bottom: 28px; font-size: clamp(40px, 5vw, 64px); }
.prose-block .prose-subtitle { margin: 0 0 28px; color: var(--sk-muted); font-size: 18px; line-height: 1.55; }
.prose-body { font-size: var(--prose-size, 16px); line-height: 1.75; column-count: var(--prose-cols, 1); column-gap: 48px; }
.prose-body > :first-child { margin-top: 0; }
.prose-body h2, .prose-body h3, .prose-body h4 { font-family: var(--font-heading); font-weight: 400; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.05; }
.prose-body h2 { font-size: 36px; margin: 1.6em 0 .6em; }
.prose-body h3 { font-size: 26px; margin: 1.4em 0 .5em; }
.prose-body a { text-decoration: underline; }
.prose-body blockquote { margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--sk-accent); font-size: 1.15em; }
.prose-body img { height: auto; }
@media (max-width: 820px) { .prose-body { column-count: 1; } }

.news-grid { display: grid; grid-template-columns: repeat(var(--news-cols, 3), 1fr); border-top: 1px solid var(--sk-line); border-left: 1px solid var(--sk-line); }
.news-card { display: flex; flex-direction: column; border-right: 1px solid var(--sk-line); border-bottom: 1px solid var(--sk-line); background: var(--sk-white); }
.news-card .photo { min-height: 0; aspect-ratio: 4 / 3; border-left: 0; }
.news-card-body { display: flex; flex-direction: column; flex: 1; padding: 26px; }
.news-card time { color: var(--sk-muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.news-card h3 { margin: 14px 0 12px; font-family: var(--font-heading); font-weight: 400; font-size: 26px; line-height: 1.05; text-transform: uppercase; }
.news-card p { margin: 0; color: var(--sk-muted); line-height: 1.6; }
.news-card .more { padding-top: 22px; }
.news-card:hover .photo > img { transform: scale(1.04); }
.news-actions { margin-top: 42px; text-align: center; }
.news-empty { color: var(--sk-muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 48px 0 0; padding: 0; list-style: none; }
.pagination a { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--sk-line); border-radius: var(--radius); font-weight: 700; }
.pagination a:hover, .pagination [aria-current] { background: var(--sk-ink); border-color: var(--sk-ink); color: #fff; }
@media (max-width: 1050px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }

.article-block { max-width: 860px; margin: 0 auto; }
.article-block .photo { min-height: 0; aspect-ratio: 16 / 9; margin-bottom: 42px; border-left: 0; }
.article-block time { color: var(--sk-muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.article-block h1 { margin: 14px 0 22px; font-size: clamp(44px, 5.4vw, 76px); }
.article-block .article-subtitle { margin: 0 0 28px; font-size: 19px; font-weight: 700; line-height: 1.5; }
.article-back { margin-top: 48px; }

/* ---- 7. Contraste y foco ------------------------------------------------- */

/* Las marcas de la franja del hero: el gris del prototipo (#74786f) se queda
   en 3,9:1 sobre la tinta; con el de su etiqueta pasan de 4,5. */
.brand-strip strong { color: #8f9489; }

:focus-visible { outline: 2px solid var(--sk-accent); outline-offset: 3px; }
.statement :focus-visible, .contact :focus-visible, .service-statement :focus-visible, .utility :focus-visible, .form :focus-visible { outline-color: var(--sk-ink); }

