/* The front page (btg-home.php), on the rentals and shop pages' styles. */

.btg-home__head {
    max-width: 820px;
    margin-bottom: 2rem;
}

.btg-home__title {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.02;
}

.btg-home__section {
    margin-top: 4rem;
}

.btg-home__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--btg-rentals-line);
}

.btg-home__section-head p {
    flex: 1;
    margin: 0;
    color: var(--btg-rentals-muted);
    font-size: 0.9rem;
}

.btg-home__section-head .btg-rentals__all {
    margin-left: auto;
}

.btg-home__heading {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

/* Rentals: a carousel of smaller cards, arrows in the heading row */
.btg-home__rental-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 1.25rem) / 4);
    grid-template-columns: none;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.btg-home__rental-grid::-webkit-scrollbar {
    display: none;
}

.btg-home__rental-grid:focus-visible {
    outline: 2px solid #0f0f0f;
    outline-offset: 4px;
}

.btg-home__rental-grid .btg-rentals__card {
    scroll-snap-align: start;
}

.btg-home__rental-grid .btg-rentals__cta {
    display: none;
}

.btg-home__rental-grid .btg-rentals__name {
    font-size: 0.92rem;
}

.btg-home__rental-grid .btg-rentals__price {
    margin-bottom: 0;
}

.btg-home__rental-grid .btg-rentals__day {
    font-size: 0.95rem;
}

.btg-home__arrows {
    display: flex;
    gap: 0.4rem;
}

.btg-home__arrows[hidden] {
    display: none;
}

.btg-home .btg-home__arrow,
.btg-home .btg-home__arrow:hover,
.btg-home .btg-home__arrow:focus {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid var(--btg-rentals-line);
    border-radius: 50%;
    background: transparent;
    color: #0f0f0f;
    cursor: pointer;
}

.btg-home .btg-home__arrow:hover:not(:disabled) {
    border-color: #0f0f0f;
}

.btg-home .btg-home__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.btg-home__arrow svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

/* Blog */
.btg-home__posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.btg-home__post {
    margin: 0;
}

.btg-home__post > a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
}

.btg-home__post-image {
    display: block;
    aspect-ratio: 3 / 2;
    margin-bottom: 0.6rem;
    overflow: hidden;
    border-radius: 8px;
    background: var(--btg-rentals-tile);
}

.btg-home__post-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.btg-home__post > a:hover img,
.btg-home__post > a:focus-visible img {
    transform: scale(1.03);
}

.btg-home__post-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.3;
}

.btg-home__post > a:hover .btg-home__post-title {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.btg-home__post-text {
    color: var(--btg-rentals-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

@media (max-width: 960px) {
    .btg-home__rental-grid {
        grid-auto-columns: calc((100% - 1.25rem) / 2.4);
    }

    .btg-home__posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .btg-home__section {
        margin-top: 2.5rem;
    }

    /* Phones: swipe; the next card peeks in */
    .btg-home__rental-grid {
        grid-auto-columns: 62%;
        gap: 0.75rem;
        margin: 0 -20px;
        padding: 0 20px 4px;
        scroll-padding: 0 20px;
    }

    .btg-home__rental-grid .btg-rentals__card {
        border: 0 !important;
    }

    .btg-home__rental-grid .btg-rentals__card > a {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .btg-home__rental-grid .btg-rentals__image {
        flex: none;
        aspect-ratio: 4 / 3;
    }

    .btg-home__rental-grid .btg-rentals__body {
        padding-top: 0.6rem;
    }

    .btg-home__arrows {
        display: none;
    }

    .btg-home__posts {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btg-home__rental-grid {
        scroll-behavior: auto;
    }
}

/* No visible title: the feature leads */
.btg-rentals.btg-home:not(.btg-blog) {
    padding-top: 32px;
}

@media (max-width: 640px) {
    .btg-rentals.btg-home:not(.btg-blog) {
        padding-top: 0;
    }
}
