/* ==========================================================================
   ROCO · Portada V2 (hero corporativo + sectores) — KUBYKA 17/09/2026
   Propuesta de Mauro: "Lo que diseñas es lo que fabricamos."
   CSS propio con prefijo .rh- : el Tailwind de la web está purgado y no
   se puede confiar en clases nuevas. Modo oscuro = html.dark (como el resto).
   ========================================================================== */

.rh {
    --rh-paper: #F4F3F1;
    --rh-ink: #172430;
    --rh-text: #5F6B73;
    --rh-line: rgba(23, 36, 48, .14);
    --rh-card: #FFFFFF;
    --rh-btn-bg: #172430;
    --rh-btn-fg: #FFFFFF;
    --rh-gutter: clamp(20px, 4.4vw, 74px);
    font-family: 'Manrope', 'Inter', system-ui, sans-serif;
    color: var(--rh-ink);
    background: var(--rh-paper);
}

html.dark .rh {
    --rh-paper: #172430;
    --rh-ink: #F2F0EC;
    --rh-text: #A9B4BC;
    --rh-line: rgba(242, 240, 236, .16);
    --rh-card: #1D2C3A;
    --rh-btn-bg: #F2F0EC;
    --rh-btn-fg: #172430;
}

.rh *,
.rh *::before,
.rh *::after { box-sizing: border-box; }

/* ---------- HERO ---------- */
.rh-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
}

.rh-hero__media {
    position: relative;
    aspect-ratio: 16 / 10;   /* foto panorámica 2,4:1: en móvil se muestra el tramo derecho (mesa + silla) */
    max-height: 56vh;
    width: 100%;
    overflow: hidden;
}

.rh-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% 50%;
    display: block;
}

html.dark .rh-hero__media img { filter: brightness(.82) saturate(.92); }

/* Fundido de la foto hacia el papel (móvil: hacia abajo) */
.rh-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 55%, var(--rh-paper) 100%);
    pointer-events: none;
}

.rh-hero__body {
    position: relative;
    z-index: 2;
    padding: 8px var(--rh-gutter) 44px;
    margin-top: -28px;
}

.rh-eyebrow {
    margin: 0 0 18px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--rh-ink);
}

.rh-title {
    margin: 0;
    font-family: inherit;
    font-weight: 300;
    font-size: clamp(1.85rem, 8.3vw, 4.6rem);
    line-height: 1.08;
    letter-spacing: -.025em;
    color: var(--rh-ink);
    text-wrap: balance;
}

.rh-title span { display: block; }

.rh-lead {
    margin: 22px 0 0;
    max-width: 34em;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.6;
    font-weight: 400;
    color: var(--rh-text);
}

.rh-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.rh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 28px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 1px solid var(--rh-btn-bg);
    border-radius: 2px;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.rh-btn svg { width: 18px; height: 18px; flex: none; transition: transform .25s ease; }

.rh-btn--primary { background: var(--rh-btn-bg); color: var(--rh-btn-fg); }
.rh-btn--primary:hover { background: transparent; color: var(--rh-btn-bg); }
.rh-btn--primary:hover svg { transform: translateX(4px); }

.rh-btn--ghost { background: transparent; color: var(--rh-ink); border-color: var(--rh-ink); }
.rh-btn--ghost:hover { background: var(--rh-btn-bg); color: var(--rh-btn-fg); border-color: var(--rh-btn-bg); }

.rh a:focus-visible {
    outline: 2px solid var(--rh-ink);
    outline-offset: 3px;
}

/* Pilares */
.rh-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 18px;
    margin: 38px 0 0;
    padding: 26px 0 0;
    list-style: none;
    border-top: 1px solid var(--rh-line);
}

.rh-pillars li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--rh-ink);
}

.rh-pillars svg { width: 36px; height: 36px; flex: none; }

/* ---------- SECTORES ---------- */
.rh-sectors {
    padding: 10px 0 36px;
}

.rh-sectors__label {
    margin: 0;
    padding: 0 var(--rh-gutter) 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .34em;
    line-height: 1.8;
    text-transform: uppercase;
    color: var(--rh-ink);
}

.rh-sectors__label br { display: none; }

/* Móvil: carrusel táctil con scroll-snap */
.rh-sectors__list {
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 0 var(--rh-gutter) 6px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--rh-gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rh-sectors__list::-webkit-scrollbar { display: none; }

.rh-sectors__list li {
    flex: 0 0 76%;
    max-width: 340px;
    scroll-snap-align: start;
}

.rh-card {
    display: block;
    height: 100%;
    background: var(--rh-card);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: var(--rh-ink);
    box-shadow: 0 1px 2px rgba(23, 36, 48, .06);
    transition: box-shadow .3s ease, transform .3s ease;
}

.rh-card__img {
    display: block;
    aspect-ratio: 16 / 7;
    overflow: hidden;
}

.rh-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}

html.dark .rh-card__img img { filter: brightness(.88); }

.rh-card__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px 18px;
}

.rh-card__name {
    display: block;
    font-size: 1.06rem;
    font-weight: 500;
    line-height: 1.25;
}

.rh-card__desc {
    display: block;
    margin-top: 3px;
    font-size: .82rem;
    line-height: 1.35;
    color: var(--rh-text);
}

.rh-card__body svg { width: 20px; height: 20px; flex: none; transition: transform .3s ease; }

.rh-card:hover { box-shadow: 0 10px 28px rgba(23, 36, 48, .12); transform: translateY(-2px); }
.rh-card:hover .rh-card__img img { transform: scale(1.06); }
.rh-card:hover .rh-card__body svg { transform: translateX(4px); }

/* ---------- TABLET ---------- */
@media (min-width: 640px) {
    .rh-actions { flex-direction: row; flex-wrap: wrap; }
    .rh-pillars { grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; }
    .rh-pillars li { padding: 0 22px; border-left: 1px solid var(--rh-line); }
    .rh-pillars li:first-child { padding-left: 0; border-left: 0; }
    .rh-sectors__list li { flex-basis: 44%; }
}

/* ---------- ESCRITORIO ---------- */
@media (min-width: 1024px) {
    .rh-hero {
        display: grid;
        grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
        min-height: clamp(520px, 62vh, 660px);  /* algo más bajo: la foto es panorámica y así se recorta menos */
    }

    /* La foto ocupa la mitad derecha y sangra hasta el borde */
    .rh-hero__media {
        position: absolute;
        inset: 0 0 0 auto;
        width: 60%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
    }

    /* Anclada a la derecha: las dos sillas y la mesa quedan siempre enteras; el fundido cae sobre la pared vacía */
    .rh-hero__media img { object-position: 100% 50%; }

    /* Fundido lateral: la foto se disuelve en el papel donde vive el titular */
    .rh-hero__media::after {
        background: linear-gradient(to right,
            var(--rh-paper) 0%,
            color-mix(in srgb, var(--rh-paper) 72%, transparent) 14%,
            color-mix(in srgb, var(--rh-paper) 22%, transparent) 30%,
            transparent 46%);
    }

    .rh-hero__body {
        grid-column: 1 / 2;
        align-self: center;
        margin-top: 0;
        padding: 72px 0 64px var(--rh-gutter);
    }

    /* El titular pisa el borde de la foto, como en la referencia */
    .rh-title {
        font-size: clamp(3rem, 4.5vw, 4.6rem);
        width: max-content;
        max-width: 56vw;
    }

    .rh-pillars { border-top: 0; padding-top: 0; margin-top: 56px; width: max-content; max-width: 56vw; }

    .rh-sectors {
        display: grid;
        grid-template-columns: minmax(180px, 13%) minmax(0, 1fr);
        align-items: start;
        gap: 0 18px;
        padding: 16px var(--rh-gutter) 34px;
    }

    .rh-sectors__label { padding: 26px 0 0; }
    .rh-sectors__label br { display: inline; }

    .rh-sectors__list {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        padding: 0;
        overflow: visible;
    }

    .rh-sectors__list li { max-width: none; }
    .rh-card__img { aspect-ratio: 17 / 5; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .rh-pillars li { padding: 0 14px; font-size: .84rem; }
    .rh-pillars svg { width: 30px; height: 30px; }
}

/* ---------- ENTRADA (una sola secuencia, discreta) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .rh-hero__media img { animation: rh-settle 1.6s cubic-bezier(.2, .6, .2, 1) both; }

    .rh-hero__body > * { animation: rh-rise .8s cubic-bezier(.2, .6, .2, 1) both; }
    .rh-hero__body > :nth-child(2) { animation-delay: .08s; }
    .rh-hero__body > :nth-child(3) { animation-delay: .16s; }
    .rh-hero__body > :nth-child(4) { animation-delay: .24s; }
    .rh-hero__body > :nth-child(5) { animation-delay: .32s; }
}

@keyframes rh-settle {
    from { transform: scale(1.05); }
    to { transform: scale(1); }
}

@keyframes rh-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
