/* =============================================================
   LA INDUSTRIAL — Full-Screen Bento Grid (6 tiles)
   ============================================================= */

:root {
    --gap:    4px;
    --radius: 10px;
    --gold:   #C9A96E;
    --gold-l: #E8CFA0;
    --cream:  #F5EFE2;
    --dark:   #0A0807;
    --muted:  #7A6F63;
    --ease:   cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: var(--dark);
}

body {
    padding-bottom: 6rem;
}

body.rh-body {
    font-family: 'Geist', 'Helvetica Neue', sans-serif;
    cursor: none;
    background: var(--dark) !important;
}

a { color: inherit; text-decoration: none; }

/* =============================================================
   CUSTOM CURSOR
   ============================================================= */
#rh-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition:
        width  .3s var(--ease),
        height .3s var(--ease),
        background .2s,
        border-color .3s;
    will-change: transform;
}

#rh-cursor.is-hovering {
    width: 68px;
    height: 68px;
    background: rgba(201,169,110,.08);
    border: 1.5px solid rgba(201,169,110,.65);
    backdrop-filter: blur(4px);
}

#rh-cursor.is-hovering::after {
    content: 'Ver';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .58rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold-l);
}

/* =============================================================
   BENTO GRID
   Layout: 4 cols × 3 rows
   Col widths:  1.9fr  1.4fr  1fr   1fr
   Row heights: 1fr    1.3fr  1fr
   ============================================================= */
.rh-bento {
    display: grid;
    width: 100vw;
    height: 100dvh;
    padding: var(--gap);
    gap: var(--gap);
    background: var(--dark);
    grid-template-columns: 1.9fr 1.4fr 1fr 1fr;
    grid-template-rows: 1fr 1.3fr 1fr;
}

/* =============================================================
   TILE — base
   ============================================================= */
.rh-tile {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111009;
    cursor: none;
    outline: none;
    /* entrance: set by GSAP */
    opacity: 0;
}

/* Gold glow ring on hover */
.rh-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    box-shadow: inset 0 0 0 0px rgba(201,169,110,0);
    transition: box-shadow .55s var(--ease);
    pointer-events: none;
}

.rh-tile:hover::before,
.rh-tile:focus-visible::before {
    box-shadow: inset 0 0 0 1.5px rgba(201,169,110,.55);
}

/* Image */
.rh-tile__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(.75) brightness(.85);
    transform: scale(1.04);
    transition:
        transform  .95s var(--ease),
        filter     .7s  var(--ease);
    will-change: transform, filter;
}

.rh-tile:hover .rh-tile__img,
.rh-tile:focus-visible .rh-tile__img {
    transform: scale(1.1);
    filter: saturate(1) brightness(.95);
}

/* Dark gradient overlay */
.rh-tile__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        155deg,
        rgba(10,8,7,.04) 0%,
        rgba(10,8,7,.28) 55%,
        rgba(10,8,7,.62) 100%
    );
    transition: opacity .5s;
}

.rh-tile:hover .rh-tile__overlay { opacity: .75; }

/* Content body */
.rh-tile__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 1.4rem 1.6rem 1.7rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

/* Category pill */
.rh-tile__cat {
    display: inline-block;
    align-self: flex-start;
    font-size: .6rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(10,8,7,.5);
    border: 1px solid rgba(201,169,110,.28);
    border-radius: 9999px;
    padding: .22rem .7rem;
    margin-bottom: .15rem;
    transform: translateY(5px);
    opacity: .8;
    transition:
        opacity   .35s var(--ease),
        transform .35s var(--ease);
}

.rh-tile:hover .rh-tile__cat,
.rh-tile:focus-visible .rh-tile__cat {
    opacity: 1;
    transform: translateY(0);
}

/* Title */
.rh-tile__title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: var(--cream);
    line-height: 1.05;
    letter-spacing: -.01em;
    transform: translateY(14px);
    opacity: 0;
    transition:
        opacity   .42s .05s var(--ease),
        transform .48s .05s var(--ease);
    will-change: transform, opacity;
}

.rh-tile:hover .rh-tile__title,
.rh-tile:focus-visible .rh-tile__title {
    transform: translateY(0);
    opacity: 1;
}

/* Arrow badge */
.rh-tile__arrow {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(10,8,7,.5);
    border: 1px solid rgba(201,169,110,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-l);
    opacity: 0;
    transform: scale(.65) translate(-3px, 3px);
    transition:
        opacity   .3s  var(--ease),
        transform .38s var(--ease);
}

.rh-tile:hover .rh-tile__arrow,
.rh-tile:focus-visible .rh-tile__arrow {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

/* =============================================================
   NEIGHBOR DIM — cuando un tile está en hover
   ============================================================= */
.rh-bento:has(.rh-tile:hover) .rh-tile:not(:hover):not(.rh-tile--brand) .rh-tile__img,
.rh-bento:has(.rh-tile:focus-visible) .rh-tile:not(:focus-visible):not(.rh-tile--brand) .rh-tile__img {
    filter: saturate(.3) brightness(.55);
}

/* =============================================================
   GRID POSITIONS
   4 cols × 3 rows

   [BRAND    ][LOS REMEDIOS — 2col×2row][TORRE PELLI — 1col×2row]
   [CONTACTO ][                        ][                        ]
   [CONTACTO ][EVENTOS    ][GALERÍA — 2col×1row                 ]

   ============================================================= */

/* BRAND — col 1, row 1 */
.rh-tile--brand {
    grid-column: 1 / 2;
    grid-row:    1 / 2;
    background: var(--dark);
    border: 1px solid rgba(201,169,110,.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.75rem;
    cursor: pointer;
    opacity: 0;
    transition: border-color .45s var(--ease);
}

.rh-tile--brand:hover {
    border-color: rgba(201,169,110,.4);
}

.rh-tile--brand::before { display: none; }

.rh-brand__logo-img {
    width: clamp(80px, 7vw, 110px);
    height: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

/* Brand image overlay — same as other tiles */
.rh-tile--brand .rh-tile__overlay {
    background: linear-gradient(
        155deg,
        rgba(10,8,7,.04) 0%,
        rgba(10,8,7,.28) 55%,
        rgba(10,8,7,.62) 100%
    );
}

/* Brand text content sits above image */
.rh-brand__content,
.rh-brand__meta {
    position: relative;
    z-index: 2;
}

.rh-brand__logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 1.6vw, 1.55rem);
    font-style: italic;
    font-weight: 300;
    color: var(--gold-l);
    letter-spacing: .03em;
    line-height: 1.1;
}

.rh-brand__tagline {
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: .4rem;
}

.rh-brand__meta {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.rh-brand__locations {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.rh-brand__loc {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .68rem;
    color: var(--muted);
    letter-spacing: .06em;
}

.rh-brand__loc-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    opacity: .6;
    flex-shrink: 0;
}

.rh-brand__divider {
    width: 100%;
    height: 1px;
    background: rgba(201,169,110,.12);
}

/* LOS REMEDIOS — col 2-3, row 1-2 */
.rh-tile--remedios {
    grid-column: 2 / 4;
    grid-row:    1 / 3;
}

.rh-tile--remedios .rh-tile__title {
    font-size: clamp(1.6rem, 2.8vw, 3rem);
}

/* TORRE PELLI — col 4, row 1-2 */
.rh-tile--pelli {
    grid-column: 4 / 5;
    grid-row:    1 / 3;
}

.rh-tile--pelli .rh-tile__title {
    font-size: clamp(1.1rem, 1.8vw, 2rem);
}

.rh-tile--pelli .rh-tile__overlay {
    background: linear-gradient(to top, rgba(10,8,7,.85) 0%, rgba(10,8,7,.2) 55%, transparent 100%);
}

/* CONTACTO — col 1, row 2-3 */
.rh-tile--contacto {
    grid-column: 1 / 2;
    grid-row:    2 / 4;
}

.rh-tile--contacto .rh-tile__title {
    font-size: clamp(1.1rem, 1.8vw, 2rem);
}

.rh-tile--contacto .rh-tile__overlay {
    background: linear-gradient(to top, rgba(10,8,7,.85) 0%, rgba(10,8,7,.2) 55%, transparent 100%);
}

/* EVENTOS — col 2, row 3 */
.rh-tile--eventos {
    grid-column: 2 / 3;
    grid-row:    3 / 4;
}

.rh-tile--eventos .rh-tile__title {
    font-size: clamp(1rem, 1.6vw, 1.7rem);
}

/* GALERÍA — col 3-4, row 3 */
.rh-tile--galeria {
    grid-column: 3 / 5;
    grid-row:    3 / 4;
}

.rh-tile--galeria .rh-tile__title {
    font-size: clamp(1rem, 1.6vw, 1.7rem);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 960px) {
    html, body { overflow: auto; }

    /* Fill the full viewport; fr units distribute remaining space after brand row */
    .rh-bento {
        height: 100dvh;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 100px 2.2fr 1.7fr 1.4fr;
        padding: 5px;
        gap: 5px;
    }

    /* ── Override BOTH column AND row — desktop grid-row spans bleed in otherwise ── */
    /*    Row 1: Brand (full width)                                                  */
    /*    Row 2: Remedios | Pelli   (side by side)                                  */
    /*    Row 3: Contacto | Galería (side by side)                                  */
    /*    Row 4: Eventos (full width)                                                */
    .rh-tile--brand    { grid-column: 1 / 3; grid-row: 1; }
    .rh-tile--remedios { grid-column: 1 / 2; grid-row: 2; }
    .rh-tile--pelli    { grid-column: 2 / 3; grid-row: 2; }
    .rh-tile--contacto { grid-column: 1 / 2; grid-row: 3; }
    .rh-tile--galeria  { grid-column: 2 / 3; grid-row: 3; }
    .rh-tile--eventos  { grid-column: 1 / 3; grid-row: 4; }

    /* All tiles: always visible, cursor restored */
    .rh-tile        { opacity: 1; cursor: pointer; }
    .rh-tile__img   { filter: saturate(.82) brightness(.84); transform: scale(1); }
    .rh-tile__cat   { opacity: 1; transform: translateY(0); }
    .rh-tile__arrow { opacity: 1; transform: scale(1) translate(0, 0); }
    .rh-tile__title { opacity: 1; transform: translateY(0); }

    /* Suppress neighbor-dim (no hover intent on touch) */
    .rh-bento:has(.rh-tile:hover) .rh-tile:not(:hover):not(.rh-tile--brand) .rh-tile__img {
        filter: saturate(.82) brightness(.84);
    }

    /* ── Overlays más oscuros en móvil para que los textos destaquen ── */
    .rh-tile__overlay,
    .rh-tile--brand .rh-tile__overlay {
        background: linear-gradient(
            155deg,
            rgba(10,8,7,.15) 0%,
            rgba(10,8,7,.45) 50%,
            rgba(10,8,7,.82) 100%
        );
    }
    .rh-tile--pelli .rh-tile__overlay,
    .rh-tile--contacto .rh-tile__overlay {
        background: linear-gradient(to top, rgba(10,8,7,.92) 0%, rgba(10,8,7,.35) 55%, rgba(10,8,7,.1) 100%);
    }

    /* ── Brand: horizontal strip ── */
    .rh-tile--brand {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1.1rem 1.5rem;
        gap: 1.25rem;
        opacity: 1;
    }
    .rh-brand__logo-img { width: clamp(68px, 19vw, 88px); }
    .rh-tile--brand .rh-brand__tagline { margin-top: .2rem; color: var(--cream); }
    .rh-tile--brand .rh-brand__loc     { color: var(--cream); }
    .rh-tile--brand .rh-brand__divider { display: none; }
    .rh-tile--brand .rh-brand__meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: .28rem;
        flex-shrink: 0;
    }
    .rh-tile--brand .rh-brand__locations {
        flex-direction: column;
        align-items: flex-end;
        gap: .25rem;
    }

    /* ── Tamaño unificado — todos los tiles al mismo nivel en móvil ── */
    .rh-tile--remedios .rh-tile__title,
    .rh-tile--pelli    .rh-tile__title,
    .rh-tile--contacto .rh-tile__title,
    .rh-tile--galeria  .rh-tile__title { font-size: clamp(1.3rem, 4.2vw, 1.6rem); }

    /* Eventos full-width puede ir ligeramente más grande */
    .rh-tile--eventos  .rh-tile__title { font-size: clamp(1.4rem, 4.5vw, 1.75rem); }

    body.rh-body { cursor: auto; }
    #rh-cursor   { display: none; }
}

@media (max-width: 480px) {
    .rh-bento {
        grid-template-rows: 88px 2fr 1.7fr 1.4fr;
        padding: 4px;
        gap: 4px;
    }
    .rh-tile--brand { padding: .85rem 1.1rem; gap: .9rem; }
    .rh-brand__logo-img { width: clamp(56px, 17vw, 72px); }
    .rh-tile__body  { padding: 1rem 1.1rem 1.25rem; }
    .rh-tile__arrow { width: 1.65rem; height: 1.65rem; top: .85rem; right: .85rem; }
}
