/* Hôtel Mariama — responsive global */

html {
    overflow-x: clip;
    scroll-behavior: smooth;
}

body.hm-site {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
video {
    max-width: 100%;
    height: auto;
}

/* Safe areas (encoches) */
@supports (padding: max(0px)) {
    .hm-topbar {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    .hm-header__inner,
    .hm-mobile-nav__panel {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    .hm-fab-wa {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Topbar compact */
.hm-topbar__text--hide-xs {
    display: none;
}
@media (min-width: 480px) {
    .hm-topbar__text--hide-xs {
        display: inline;
    }
}
@media (max-width: 479px) {
    :root {
        --hm-topbar-h: 42px;
    }
    .hm-topbar__list {
        gap: 12px;
    }
    .hm-topbar__social {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .hm-topbar__socials {
        gap: 4px;
    }
    .hm-topbar__left {
        min-width: 0;
        flex: 1;
    }
}

/* Header mobile */
@media (max-width: 1023px) {
    :root {
        --hm-header-h: 68px;
    }
    .hm-header.is-scrolled {
        height: var(--hm-header-h);
    }
    .hm-header__logo {
        height: 46px;
        max-width: min(240px, 52vw);
    }
    .hm-header.is-scrolled .hm-header__logo {
        height: 42px;
    }
    .hm-header__burger {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 767px) {
    body.hm-site {
        font-size: 15px;
    }
}

/* Hero — contenu empilé, hauteur fluide */
@media (max-width: 1023px) {
    #hero.hm-hero-medium,
    #hero.hm-hero-fullscreen,
    #hero.hm-hero-compact {
        min-height: 100svh !important;
        height: auto !important;
        display: block;
    }
    #hero .hm-hero-shell {
        position: relative;
        inset: auto;
        min-height: calc(100svh - var(--hm-topbar-h) - var(--hm-header-h));
        align-items: flex-start;
        padding: 12px 0 96px;
        overflow: visible;
        z-index: 25;
    }
    #hero .hm-hero-shell::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 42%;
        z-index: -1;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(6, 40, 33, 0.55) 0%, transparent 100%);
    }
    #hero .hm-hero-grid {
        padding: 0 16px;
        gap: 16px;
        display: flex;
        flex-direction: column;
    }
    #hero .hm-hero-story {
        order: 1;
        position: relative;
        z-index: 2;
        min-height: 0;
    }
    #hero .hm-hero-panel {
        order: 2;
        max-width: none;
        justify-self: stretch;
        position: relative;
        z-index: 3;
        margin-top: 4px;
    }
    #hero .hm-hero-story--compact {
        min-height: 0;
    }
    /* Évite le chevauchement : légendes en flux (plus en absolute) */
    #hero .hero-caption {
        position: relative;
        inset: auto;
        opacity: 0;
        visibility: hidden;
        height: 0;
        overflow: hidden;
        margin: 0;
        padding: 0;
        transform: none;
        pointer-events: none;
    }
    #hero .hero-caption.is-active {
        opacity: 1;
        visibility: visible;
        height: auto;
        overflow: visible;
        pointer-events: auto;
        padding-bottom: 4px;
    }
    #hero .hm-booking-panel--hero {
        background: #fff;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(12, 61, 50, 0.08);
    }
    #hero .hm-hero-headline__gold {
        font-size: clamp(1.55rem, 7vw, 2.1rem);
    }
    #hero .hm-hero-headline__green {
        font-size: clamp(1.2rem, 5.5vw, 1.65rem);
    }
    #hero .hm-hero-trust {
        gap: 8px 12px;
        font-size: 12px;
    }
    #hero .hm-hero-nav--floating {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        z-index: 30;
    }
    .hm-booking-panel {
        padding: 18px 16px 20px;
    }
    .hm-booking-panel__title {
        font-size: 1.35rem;
    }
}

@media (max-width: 639px) {
    #hero .hm-hero-grid {
        gap: 12px;
    }
    #hero .hm-hero-shell {
        padding-top: 8px;
    }
    #hero .hm-hero-trust,
    #hero .hm-hero-desc--compact {
        display: none;
    }
    #hero .hm-hero-actions-row {
        margin-top: 8px;
    }
    #hero .hm-hero-actions-row .hm-btn {
        width: 100%;
        justify-content: center;
    }
    #hero .hm-hero-kicker--sm {
        margin-bottom: 8px;
        font-size: 11px;
    }
    #hero .hm-hero-headline {
        margin-bottom: 8px;
    }
    .hm-booking-panel__title-short {
        font-size: 1.05rem;
    }
    .hm-booking-panel__hint {
        font-size: 12px;
        margin-bottom: 12px;
    }
}

/* Pages intérieures */
@media (max-width: 767px) {
    .hm-page-hero {
        min-height: 180px;
    }
    .hm-page-hero__inner {
        padding: 28px 0 32px;
    }
    .hm-page-hero__title {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
    }
    .hm-breadcrumb {
        font-size: 13px;
        line-height: 1.45;
    }
    .hm-lead {
        font-size: 1rem;
        line-height: 1.6;
    }
    .hm-section-title {
        font-size: clamp(1.45rem, 5.5vw, 1.85rem);
    }
}

/* Filtres & grilles */
@media (max-width: 639px) {
    .hm-room-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }
    .hm-room-filter::-webkit-scrollbar {
        display: none;
    }
    .hm-room-filter__btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 14px;
    }
    .hm-gallery-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 4px;
    }
    .hm-gallery-filter__btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Cartes chambres */
@media (max-width: 479px) {
    .hm-room-card__top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .hm-room-card__price {
        text-align: left;
        align-self: flex-start;
    }
    .hm-room-card__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hm-room-card__actions .hm-btn {
        width: 100%;
        justify-content: center;
    }
    .hm-room-card__detail {
        justify-content: center;
        padding: 8px 0;
    }
    .hm-room-card__body {
        padding: 18px 16px 20px 18px;
    }
    .hm-detail-gallery__hint {
        font-size: 10px;
        padding: 6px 10px;
        right: 10px;
        bottom: 10px;
    }
    .hm-detail-gallery__hint span:not(.material-symbols-outlined) {
        display: none;
    }
}

@media (max-width: 639px) {
    .hm-detail-gallery__thumbs {
        grid-template-columns: repeat(2, 1fr);
    }
    .hm-detail-panel {
        position: static !important;
        top: auto !important;
    }
    .hm-detail-panel .hm-btn {
        min-height: 48px;
    }
}

/* Services & activités */
@media (max-width: 479px) {
    .hm-service-card-v2__body {
        padding: 16px 14px 18px;
    }
    .hm-activity-card__body {
        padding: 16px 14px 18px;
    }
}

/* Contact */
@media (max-width: 767px) {
    .hm-contact-v2__shell {
        border-radius: 16px;
    }
    .hm-contact-v2__aside {
        padding: 28px 20px 32px;
    }
    .hm-contact-v2__visual {
        min-height: 220px;
    }
    .hm-contact-rail {
        display: none;
    }
    .hm-contact-v2__row {
        padding: 14px 12px;
    }
}

/* Footer */
@media (max-width: 767px) {
    .hm-site-footer > div {
        padding-top: 3rem !important;
        padding-bottom: 2.5rem !important;
    }
    .hm-footer-logo {
        max-width: 200px;
        height: auto;
    }
    .hm-footer-bottom {
        text-align: center;
        font-size: 13px;
        line-height: 1.5;
    }
}

/* Lightbox tactile */
@media (max-width: 767px) {
    .hm-lightbox {
        padding: 56px 12px 72px;
    }
    .hm-lightbox__close {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        width: 44px;
        height: 44px;
    }
    .hm-lightbox__nav {
        width: 44px;
        height: 44px;
    }
    .hm-lightbox__nav--prev {
        left: max(8px, env(safe-area-inset-left));
    }
    .hm-lightbox__nav--next {
        right: max(8px, env(safe-area-inset-right));
    }
    .hm-lightbox__counter {
        bottom: max(16px, env(safe-area-inset-bottom));
        font-size: 12px;
    }
}

/* Boutons touch-friendly */
@media (max-width: 1023px) {
    .hm-btn {
        min-height: 44px;
    }
    .hm-btn--sm {
        min-height: 42px;
    }
}

/* Sections avec en-tête flex */
@media (max-width: 767px) {
    .hm-section-wrap .flex.flex-col.lg\:flex-row,
    .hm-section-wrap .flex.flex-col.md\:flex-row {
        gap: 1rem;
    }
    .hm-section-wrap .hm-btn.shrink-0 {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile nav pleine largeur sur très petit écran */
@media (max-width: 380px) {
    .hm-mobile-nav__panel {
        width: 100%;
    }
}

/* Réduction motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .hero-slide.active .hm-hero-bg {
        animation: none;
    }
    .hm-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
