/* Trieste Guest Core – frontend styles */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tg-appartamenti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tg-appartamento-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: box-shadow 0.2s ease;
}

.tg-appartamento-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.tg-card__thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.tg-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tg-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    flex: 1;
}

.tg-appartamento-card h3.tg-card__title, article.tg-appartamento-card h3.tg-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.tg-card__zona {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    font-size: 0.75rem;
    font-weight: 500;
    color: #1e293b;
    padding: 0.2em 0.65em;
    border-radius: 999px;
    line-height: 1.5;
}

.tg-card__dotazioni {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tg-card__dotazioni li {
    margin: 0;
}

/* Pill shared by both renderers ------------------------------------------ */

.tg-dotazione,
.tg-card__dotazioni .ahi-amenity {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.8125rem;
    color: #475569;
    background: #f1f5f9;
    padding: 0.2em 0.6em;
    border-radius: 999px;
}

/* SVG inside our own fallback renderer */
.tg-dotazione svg,
/* SVG inside AHI's .ahi-icon wrapper */
.tg-card__dotazioni .ahi-icon svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    display: block;
}

/* AHI wraps amenities in a <span>, not a <ul>; force flex layout */
.tg-card__dotazioni.ahi-amenities {
    display: flex;
}

.tg-card__booking-btn {
    display: inline-block;
    margin-top: auto;
    padding: 0.6em 1.2em;
    background: #2b849f;
    color: #fff;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    transition: background 0.2s ease;
}

.tg-card__booking-btn:hover,
.tg-card__booking-btn:focus-visible {
    background: #236b80;
    color: #fff;
}

/* ── Carousel (Swiper-based) ──────────────────────────────────────────────── */

.tg-carousel__wrapper {
    position: relative;
    padding: 0 3rem;
    margin: 2rem 0;
}

.tg-carousel {
    overflow: hidden;
}

/* Slide height: stretch card to fill the tallest slide in the row. */
.tg-carousel__slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

.tg-carousel__slide .tg-appartamento-card {
    flex: 1;
}

/* Navigation buttons — sit in the padding area, outside the slide track. */
.tg-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
    z-index: 10;
    transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    padding: 0;
    color: #1e293b;
}

.tg-carousel__btn:hover,
.tg-carousel__btn:focus-visible {
    background: #f8fafc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.tg-carousel__btn--prev { left:  0.25rem; }
.tg-carousel__btn--next { right: 0.25rem; }

/* Used only when loop:false and boundary is reached. */
.tg-carousel__btn--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.tg-carousel__btn svg {
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
    display: block;
}

@media (min-width: 1024px) {
    .tg-appartamento-card h3.tg-card__title, article.tg-appartamento-card h3.tg-card__title {
        font-size: 1.25rem; /* 20px */
    }
}
