/* Stessa palette/font/angoli del pannello admin e di prenota.php (Manrope auto-ospitato,
   blu #2271b1, angoli dritti sui contenitori, niente ombre) — vedi project_hasset_book_design_system
   in memoria. Font copiato nella cartella del plugin: gira su domini di terzi (siti WordPress
   dei clienti), non può puntare all'installazione principale di hasset-book. */
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/manrope/Manrope-VariableFont_wght.woff2') format('woff2-variations'),
         url('../fonts/manrope/Manrope-VariableFont_wght.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --hb-font: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --hb-acc: #2271b1;
    --hb-acc-d: #135e96;
    --hb-acc-l: #eaf2f8;
    --hb-text: #1d2327;
    --hb-muted: #646970;
    --hb-bdr: #dcdcde;
    --hb-bg: #f0f0f1;
}

.hb-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--hb-bg);
    border: 1.5px solid var(--hb-bdr);
    border-radius: 0;
    font-family: var(--hb-font);
}

.hb-search__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hb-search__field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hb-muted);
}

.hb-search__field input,
.hb-search__field .hb-cal-trigger {
    padding: 0.5rem 0.6rem;
    border: 1.5px solid var(--hb-bdr);
    border-radius: 3px;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--hb-text);
}

.hb-search__field .hb-cal-trigger {
    min-width: 9.5rem;
}

.hb-search__field input:focus,
.hb-search__field .hb-cal-trigger:focus {
    outline: none;
    border-color: var(--hb-acc);
    box-shadow: 0 0 0 3px var(--hb-acc-l);
}

.hb-search__field--narrow input {
    width: 5.5rem;
}

.hb-search__submit {
    padding: 0.6rem 1.25rem;
    background: var(--hb-acc);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.hb-search__submit:hover {
    background: var(--hb-acc-d);
}

.hb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    font-family: var(--hb-font);
}

.hb-card {
    border: 1.5px solid var(--hb-bdr);
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.hb-card__cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    display: block;
    background: var(--hb-bg);
}

.hb-card__placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hb-bg);
    font-size: 2.5rem;
}

.hb-card__body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hb-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hb-text);
    margin: 0;
}

.hb-card__tipo {
    font-size: 0.8rem;
    color: var(--hb-text-muted, #6b7280);
    margin: -0.1rem 0 0.15rem;
}

.hb-card__excerpt {
    font-size: 0.88rem;
    color: var(--hb-muted);
    line-height: 1.45;
    margin: 0;
}

.hb-card--non-disponibile {
    opacity: 0.65;
}

.hb-availability {
    display: inline-block;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.hb-availability.is-available {
    color: #15803d;
    background: #dcfce7;
}

.hb-availability.is-unavailable {
    color: #b91c1c;
    background: #fee2e2;
}

.hb-card__price {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-card__price-notti {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--hb-muted);
    margin-left: 0.3rem;
}

.hb-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    font-family: var(--hb-font);
    font-size: 0.88rem;
}

.hb-pager__link {
    color: var(--hb-acc);
    font-weight: 600;
    text-decoration: none;
    /* button.hb-pager__link (esperienza dinamica) deve avere lo stesso aspetto di a.hb-pager__link
       (vetrina statica) — reset degli stili nativi del browser */
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

.hb-pager__link:hover {
    text-decoration: underline;
}

.hb-pager__status {
    color: var(--hb-muted);
}

.hb-card__book--disabled {
    display: inline-block;
    margin-top: auto;
    padding: 0.55rem 1rem;
    background: var(--hb-bg);
    color: #a7aaad;
    text-align: center;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: not-allowed;
}

.hb-card__book {
    display: inline-block;
    margin-top: auto;
    padding: 0.55rem 1rem;
    background: var(--hb-acc);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease;
    /* button.hb-card__book (esperienza dinamica "Prenota") deve avere lo stesso aspetto di
       a.hb-card__book (vetrina statica [hasset_alloggi]) — reset degli stili nativi del browser */
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.hb-card__book:hover,
.hb-card__book:focus {
    background: var(--hb-acc-d);
    color: #fff;
    text-decoration: none;
}

.hb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.hb-chips--scheda {
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.hb-chip {
    background: var(--hb-bg);
    border: 1px solid var(--hb-bdr);
    border-radius: 2px;
    padding: 0.15rem 0.45rem;
    font-size: 0.78rem;
    color: var(--hb-muted);
}

.hb-chip--scheda {
    border-radius: 2px;
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
}

.hb-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.hb-services--card {
    margin-top: auto;
    padding-top: 0.4rem;
}

.hb-service {
    background: var(--hb-acc-l);
    border: 1px solid #b5d4f4;
    border-radius: 2px;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    color: var(--hb-acc-d);
}

.hb-service--scheda {
    border-radius: 2px;
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
}

.hb-service .bi {
    margin-right: 0.2rem;
}

.hb-service--scheda .bi {
    margin-right: 0.25rem;
}

.hb-scheda {
    font-family: var(--hb-font);
    color: var(--hb-text);
    line-height: 1.55;
    max-width: 860px;
}

.hb-scheda__hero {
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--hb-bg);
}

.hb-scheda__cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.hb-scheda__placeholder {
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hb-bg);
    font-size: 4rem;
}

.hb-scheda__gallery {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

.hb-scheda__thumb {
    height: 90px;
    width: auto;
    border-radius: 0;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    cursor: zoom-in;
}

.hb-scheda__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.hb-scheda__tipo {
    font-size: 0.9rem;
    color: var(--hb-text-muted, #6b7280);
    margin: 0.1rem 0 0.75rem;
}

.hb-scheda__lead {
    font-size: 1rem;
    color: var(--hb-text);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

.hb-scheda__description {
    font-size: 0.93rem;
    color: var(--hb-muted);
    margin-bottom: 1.1rem;
}

.hb-scheda__services {
    margin-top: 0.5rem;
}

.hb-scheda__services-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hb-muted);
    margin-bottom: 0.5rem;
}

.hb-message {
    margin: 0;
}

.hb-message--error {
    color: #dc2626;
}

.hb-message--empty {
    color: var(--hb-muted);
}

.hb-altri-periodi {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1.5px solid var(--hb-bdr);
    font-family: var(--hb-font);
}

.hb-altri-periodi__toggle {
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hb-text);
    list-style: none;
}

.hb-altri-periodi__toggle::-webkit-details-marker {
    display: none;
}

.hb-altri-periodi__toggle::before {
    content: "▸ ";
    color: var(--hb-muted);
}

.hb-altri-periodi[open] .hb-altri-periodi__toggle::before {
    content: "▾ ";
}

.hb-altri-periodi__hint {
    margin: 0.5rem 0 1rem;
    font-size: 0.85rem;
    color: var(--hb-muted);
}

.hb-card__periodi-link {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    margin: -0.2rem 0 0.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hb-acc);
    cursor: pointer;
    font-family: inherit;
}

.hb-card__periodi-link:hover {
    text-decoration: underline;
}

.hb-periodi-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 35, 39, 0.55);
    font-family: var(--hb-font);
}

/* L'attributo HTML "hidden" da solo non basta: una regola CSS dell'autore con la stessa
   specificità (come .hb-periodi-modal sopra) lo sovrascrive comunque, lasciando il popup
   visibile — e sopra tutta la pagina — fin dal caricamento. Questa regola, più specifica
   (classe + attributo), riafferma display:none quando l'attributo è presente. */
.hb-periodi-modal[hidden] {
    display: none;
}

.hb-periodi-modal__box {
    position: relative;
    background: #fff;
    border: 1px solid var(--hb-bdr);
    border-radius: 0;
    padding: 1.5rem;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.hb-periodi-modal__close {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--hb-muted);
    cursor: pointer;
    padding: 0;
}

.hb-periodi-modal__title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-periodi-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.hb-periodi-modal__list li {
    font-size: 0.88rem;
    color: var(--hb-text);
    line-height: 1.5;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--hb-bg);
}

.hb-periodi-modal__list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hb-periodi-modal__empty {
    font-size: 0.88rem;
    color: var(--hb-muted);
    margin: 0;
}

.hb-pos {
    margin: 0.45rem 0 0.75rem;
    font-size: 0.84rem;
    color: var(--hb-muted);
    line-height: 1.45;
}

.hb-pos-testo {
    margin-bottom: 0.2rem;
}

.hb-pos-mappa {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hb-acc);
    text-decoration: none;
}

.hb-pos-mappa:hover {
    text-decoration: underline;
}

.hb-courtesy {
    font-family: var(--hb-font);
    max-width: 520px;
    margin: 1.5rem auto;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--hb-bg);
    border: 1px solid var(--hb-bdr);
    border-radius: 0;
    color: var(--hb-text);
}

.hb-courtesy__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.hb-courtesy__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--hb-text);
    margin: 0 0 0.65rem;
}

.hb-courtesy__text {
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 1rem;
}

.hb-courtesy__contact {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.hb-courtesy__link {
    color: var(--hb-acc);
    font-weight: 600;
    text-decoration: none;
}

.hb-courtesy__link:hover {
    text-decoration: underline;
}

.hb-courtesy__retry {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border: 1.5px solid var(--hb-acc);
    border-radius: 3px;
    background: #fff;
    color: var(--hb-acc);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.hb-courtesy__retry:hover {
    background: var(--hb-acc-l);
}

.hb-courtesy__debug {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: #fff8e1;
    border: 1px dashed #dba617;
    border-radius: 0;
    font-size: 12px;
    text-align: left;
    color: #5c4a00;
}

.hb-courtesy__debug a {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--hb-acc);
    font-weight: 600;
}
