/* Portada: carrusel de destacados y eventos activos (index.php, js/home.js). */

.ht-home-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 4px;
}

.ht-home-top.has-both {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

/* ─── Carrusel ─── */
.ht-hero-wrap {
    display: flex;
}

.ht-hero {
    position: relative;
    flex: 1;
    min-height: 170px;
    image-rendering: pixelated;
}

/* El carrusel no crece: mide siempre lo mismo y la columna de al lado se
   ajusta a él (franjas de eventos o "Tu día en HT"). */
@media (min-width: 781px) {
    .ht-home-top.has-both {
        grid-template-rows: 180px;
    }

    .ht-home-top.has-both > * {
        min-height: 0;
        overflow: hidden;
    }
}

.ht-hero-slide {
    position: absolute;
    inset: 0;
    display: block;
    /* A su tamaño: son pixel art y escaladas se deforman (como las destacadas de antes). */
    background-color: #000;
    background-position: center;
    background-size: auto;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0s linear 0.5s;
}

.ht-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s;
}

/* Mismo degradado que tenían las destacadas (.featured-content .desc). */
.ht-hero-slide .desc {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 60px;
    padding: 10px 50px 18px;
    background: linear-gradient(#fff0 0%, #000);
    font-size: 1rem;
    color: #fff;
    text-align: center;
}

.ht-hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.15s, background 0.15s;
}

.ht-hero-arrow.is-prev {
    left: 8px;
}

.ht-hero-arrow.is-next {
    right: 8px;
}

.ht-hero:hover .ht-hero-arrow,
.ht-hero-arrow:focus-visible {
    opacity: 1;
}

.ht-hero-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.ht-hero-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    z-index: 2;
    display: flex;
    gap: 5px;
    transform: translateX(-50%);
}

.ht-hero-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.ht-hero-dots button.is-active {
    background: #fff;
}

/* ─── Eventos: las franjas de siempre, apiladas en su columna ─── */
.ht-home-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ht-home-events > .content-border {
    margin-bottom: 0 !important;
}

/* Todo el ancho de la columna: en móvil .content lleva márgenes automáticos y
   se encogería al ancho del texto (se notaba en las franjas con título corto). */
.ht-home-events > .content-border > main,
.ht-home-events > .content-border > main > .box-100,
.ht-home-events > .content-border > main > .box-100 > section,
.ht-home-events > .content-border > main > .box-100 > section > a {
    width: 100%;
    min-width: 0;
    margin-right: 0;
    margin-left: 0;
}

/* Con el carrusel al lado, las franjas se estiran para llenar la columna. */
.ht-home-top.has-both .ht-home-events > .content-border,
.ht-home-top.has-both .ht-home-events > .content-border > main,
.ht-home-top.has-both .ht-home-events > .content-border > main > .box-100,
.ht-home-top.has-both .ht-home-events > .content-border > main > .box-100 > section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.ht-home-top.has-both .ht-home-events > .content-border > main > .box-100 > section > a {
    display: flex;
    flex: 1 1 auto;
}

.ht-home-top.has-both .ht-home-events :is(.section-cloud-pass, .section-advent-calendar) {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 3px 6px;
    height: auto;
    min-height: 46px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
}

.ht-home-top.has-both .ht-home-events :is(.section-cloud-pass, .section-advent-calendar) p {
    margin: 0;
}

.ht-home-top.has-both .ht-home-events .ht-event-banner-head {
    gap: 3px 6px;
}

/* Con 3 franjas, más bajas; con 4 o más, 2 y el botón con el resto. */
.ht-home-top.has-both .ht-home-events.is-count-3 :is(.section-cloud-pass, .section-advent-calendar) {
    min-height: 36px;
    padding: 3px 8px;
    font-size: 0.9rem;
}

.ht-home-events-more {
    flex: 0 0 auto;
    align-self: stretch;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.ht-events-more-list > .content-border + .content-border {
    margin-top: 6px;
}

/* ─── "Tu día en HT" en franja (con un solo evento) ─── */
.section-cloud-pass.ht-today-strip {
    flex-wrap: wrap;
    gap: 4px 8px;
    background: url(https://images.habbotemplarios.com/web/fondos/profiles/default_background.gif) -185px -10px #0a7fb0;
}

.ht-today-strip p {
    margin: 0;
}

.ht-today-strip .fa-sun {
    color: #ffd24a;
}

.ht-today-strip-chips {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.ht-today-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
    font-size: 0.78rem;
    color: #fff;
}

.ht-today-chip .fa-bullseye {
    color: #7dff8f;
}

.ht-today-chip .fa-fire {
    color: #c8d4d8;
}

.ht-today-chip .fa-fire.is-lit {
    color: #ff9b3d;
}

/* ─── "Tu día en HT" ─── */
.ht-today-wrap {
    display: flex;
}

.ht-today {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px 10px;
    background: url(https://images.habbotemplarios.com/web/fondos/profiles/default_background.gif) 250px 0px #0a7fb0;
}

.ht-today-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.ht-today-head b {
    font-size: 0.95rem;
    color: #004960;
}

.ht-today-head b .fa-sun {
    color: #f0b400;
}

.ht-today-head small {
    font-size: 0.72rem;
    color: #5a6d75;
    white-space: nowrap;
}

.ht-today-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Misiones y racha (o, sin sesión, el texto de bienvenida), dos renglones
   por debajo del título. */
.ht-today-head + .ht-today-row,
.ht-today-head + .ht-today-guest {
    margin-top: 2.4em;
}

.ht-today-label {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: bold;
    color: #004960;
    white-space: nowrap;
}

.ht-today-label .fa-bullseye {
    color: #1c9c44;
}

.ht-today-label .fa-fire {
    color: #b7c4c9;
}

.ht-today-label .fa-fire.is-lit {
    color: #ff6a00;
}

.ht-today-progress {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
}

.ht-today-progress > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.ht-today-note {
    min-width: 0;
    overflow: hidden;
    font-size: 0.74rem;
    color: #5a6d75;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ht-today-note .fa-check {
    color: #1c9c44;
}

.ht-today-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.ht-today-claim {
    margin-right: auto;
    font-size: 0.75rem;
}

.ht-today-guest {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #3d5a66;
}

/* ─── Móvil: uno debajo de otro ─── */
@media (max-width: 780px) {
    .ht-home-top.has-both {
        grid-template-columns: minmax(0, 1fr);
    }

    .ht-hero {
        min-height: 140px;
    }

    .ht-hero-arrow {
        opacity: 1;
    }
}

/* ─── Vista previa para administradores (?ht_home_preview=…) ─── */
.ht-home-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px 10px;
    border: 2px dashed #e6a100;
    border-radius: 8px;
    background: #fff8e1;
    font-size: 0.8rem;
    color: #6b5200;
}

.ht-home-preview-bar a {
    padding: 2px 8px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 0 1px #e8d8a0;
    font-weight: bold;
    color: #6b5200;
}

.ht-home-preview-bar a.active {
    background: #e6a100;
    color: #fff;
}

/* ─── Noticias destacadas en una fila compacta (index.php) ───
   Hasta 4 repartidas en la fila; con más, la fila se desliza de lado. */
.ht-pinned-bare {
    margin-bottom: 4px;
}

.ht-pinned-scroller {
    position: relative;
}

.ht-pinned-list {
    display: grid;
    grid-template-columns: repeat(var(--ht-pinned-cols, 4), minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
}

.ht-pinned-bare .ht-pinned-list {
    padding: 2px;
}

.ht-pinned-list.is-scroll {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 8px - 3 * 6px) / 4);
    padding-right: 4px;
    padding-left: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    /* Al ajustar, deja sitio al contorno negro de la primera y la última tarjeta. */
    scroll-padding: 0 4px;
    scrollbar-width: none;
}

.ht-pinned-list.is-scroll::-webkit-scrollbar {
    display: none;
}

.ht-pinned-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 2px;
    padding-right: 2px;
    border: 2px solid #fff;
    border-radius: 8px;
    background: linear-gradient(#fff 30%, #e6eef2 100%);
    box-shadow: 0 0 0 2px #000;
    color: #333;
    text-decoration: none;
    scroll-snap-align: start;
}

.ht-pinned-item:hover {
    background: #fff;
    color: #333;
}

/* La miniatura a su tamaño, sin escalar (pixel art), como en las noticias. */
.ht-pinned-thumb {
    position: relative; /* la etiqueta "En vivo" va sobre su esquina */
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background-color: #bfe6f2;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.ht-pinned-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.ht-pinned-text b {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ht-pinned-text small {
    display: flex;
    gap: 8px;
    overflow: hidden;
    font-size: 0.72rem;
    color: #5a6d75;
    white-space: nowrap;
}

/* "En vivo" sobre la miniatura (css/live-updates.css), en una línea: la miniatura
   mide 60px y la etiqueta de las noticias no cabría. */
.ht-pinned-thumb .ht-live-pill.is-thumb {
    right: 2px;
    bottom: 2px;
    left: 2px;
    justify-content: center;
    gap: 3px;
    padding: 0 3px;
    font-size: 0.55rem;
    letter-spacing: 0;
    white-space: nowrap;
}

.ht-pinned-thumb .ht-live-pill.is-thumb .ht-live-dot {
    width: 5px;
    height: 5px;
}

/* Si no cabe, se acorta la fecha, no el número de comentarios. */
.ht-pinned-time {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ht-pinned-comments {
    flex: 0 0 auto;
}

/* Sin título de sección: la chincheta de cada tarjeta dice que es destacada. */
.ht-pinned-pin {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    color: #6a6a6a;
    transform: rotate(30deg);
}

.ht-pinned-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
}

/* Con flechas, un carril a cada lado para que no tapen las tarjetas. */
.ht-pinned-scroller:has(.ht-pinned-arrow) {
    padding: 0 26px;
}

.ht-pinned-arrow.is-prev {
    left: 0;
}

.ht-pinned-arrow.is-next {
    right: 0;
}

.ht-pinned-arrow[disabled] {
    opacity: 0.3;
    cursor: default;
}

/* En móvil, una fila que se desliza de lado (salvo que haya solo una). */
@media (max-width: 600px) {
    .ht-pinned-list:not([style*="--ht-pinned-cols: 1"]) {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 78%;
        padding-right: 4px;
        padding-left: 4px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 4px;
    }

    .ht-pinned-arrow {
        display: none;
    }

    .ht-pinned-scroller:has(.ht-pinned-arrow) {
        padding: 0;
    }
}
