/* ==================== TEMPLATE GALLERY ==================== */

.templates-page {
    overflow-x: hidden;
}

.template-gallery {
    padding: clamp(3rem, 5vw, 4.5rem) 0 var(--space-20);
    overflow: hidden;
}

.template-gallery__heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.65fr);
    gap: var(--space-10);
    align-items: end;
    margin-bottom: var(--space-10);
}

.template-gallery__heading h1 {
    font-size: clamp(2.75rem, 5.2vw, 5rem);
}

.template-gallery__heading-copy {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-6);
}

.template-gallery__heading-copy > p {
    max-width: 25rem;
}

.template-gallery__controls {
    display: flex;
    gap: var(--space-2);
}

.template-gallery__controls .icon-button {
    width: 3rem;
    height: 3rem;
}

.template-gallery__controls .icon-button:disabled {
    opacity: 0.35;
}

.template-carousel__track {
    display: grid;
    grid-auto-columns: min(68rem, 76vw);
    grid-auto-flow: column;
    gap: var(--space-5);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 max(var(--gutter), calc((100vw - var(--container)) / 2)) var(--space-5);
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2));
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
}

.template-carousel__track::-webkit-scrollbar {
    display: none;
}

.template-carousel__track:focus-visible {
    outline-offset: -0.2rem;
}

.template-card {
    position: relative;
    display: grid;
    min-height: clamp(31rem, 64vh, 42rem);
    grid-template-rows: auto 1fr;
    padding: var(--space-8);
    overflow: hidden;
    color: #101412;
    border-radius: var(--radius-md);
    scroll-snap-align: start;
}

.template-card--sage { background: #b9c9bd; }
.template-card--sand { background: #d7c3a5; }
.template-card--ink { background: #86948e; }
.template-card--clay { background: #c99478; }
.template-card--blue { background: #aebed1; }
.template-card--violet { background: #beb3ca; }

.template-card__header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-5);
}

.template-card__header p {
    color: rgb(16 20 18 / 68%);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.template-card__header h2 {
    margin-top: var(--space-1);
    color: #101412;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

.template-card__header > span {
    padding: 0.35rem 0.65rem;
    border: 1px solid rgb(16 20 18 / 35%);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
}

.template-preview {
    display: grid;
    place-items: center;
    min-height: 0;
    padding-top: var(--space-6);
}

.template-preview__window {
    width: min(82%, 48rem);
    overflow: hidden;
    background: #fbfbf8;
    border: 1px solid rgb(16 20 18 / 22%);
    border-radius: var(--radius-sm);
    box-shadow: 0 1.5rem 4rem rgb(28 35 31 / 18%);
    transform: translateY(2%);
}

.template-preview__bar {
    display: flex;
    height: 2rem;
    align-items: center;
    gap: 0.35rem;
    padding-inline: 0.75rem;
    background: #eceeea;
    border-bottom: 1px solid #d2d7d3;
}

.template-preview__bar span {
    width: 0.45rem;
    height: 0.45rem;
    background: #91a098;
    border-radius: 50%;
}

.template-preview__layout {
    min-height: 25rem;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.template-preview__layout--split {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: var(--space-6);
    align-items: center;
}

.template-preview__layout--reverse .template-preview__copy {
    order: 2;
}

.template-preview__layout--center {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: var(--space-6);
    text-align: center;
}

.template-preview__layout--center .template-preview__copy {
    width: min(78%, 30rem);
    justify-self: center;
    justify-items: center;
}

.template-preview__copy {
    display: grid;
    justify-items: start;
}

.template-preview__copy > span:not(.template-preview__button),
.template-preview__copy > strong,
.template-preview__copy > small {
    display: block;
    background: #13201b;
    border-radius: 0.1rem;
}

.template-preview__copy > span:not(.template-preview__button) {
    width: 4rem;
    height: 0.35rem;
    margin-bottom: 1rem;
    background: #10b981;
}

.template-preview__copy > strong {
    width: 100%;
    height: 1rem;
    margin-bottom: 0.35rem;
}

.template-preview__copy > strong:nth-of-type(2) {
    width: 72%;
}

.template-preview__copy > small {
    width: 84%;
    height: 0.35rem;
    margin-top: 0.75rem;
    background: #98a59f;
}

.template-preview__button {
    display: inline-block;
    margin-top: var(--space-5);
    padding: 0.55rem 1rem;
    background: #10b981;
    color: #052d21;
    border-radius: 0.2rem;
    font-size: 0.65rem;
    font-weight: 800;
}

.template-preview__media {
    display: grid;
    min-height: 14rem;
    place-items: center;
    align-content: center;
    gap: var(--space-2);
    background: #e3e8e4;
    color: #64736c;
    border: 1px dashed #aab6b0;
    border-radius: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 700;
}

.template-preview__media svg {
    width: 1.75rem;
    height: 1.75rem;
}

.template-carousel__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    padding-top: var(--space-3);
}

.template-carousel__status p {
    color: var(--color-text);
    font-family: var(--font-mono);
    font-weight: 700;
}

.template-carousel__status > span {
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
}

@media (max-width: 52rem) {
    .template-gallery__heading {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .template-gallery__heading-copy {
        align-items: center;
    }

    .template-carousel__track {
        grid-auto-columns: 86vw;
    }

    .template-card {
        min-height: 34rem;
        padding: var(--space-6);
    }

    .template-preview__window {
        width: 92%;
    }
}

@media (max-width: 38rem) {
    .template-gallery {
        padding-top: var(--space-10);
    }

    .template-gallery__heading-copy {
        align-items: flex-start;
        flex-direction: column;
    }

    .template-card {
        min-height: 30rem;
        padding: var(--space-5);
    }

    .template-card__header > span {
        display: none;
    }

    .template-preview {
        padding-top: var(--space-4);
    }

    .template-preview__window {
        width: 100%;
    }

    .template-preview__layout {
        min-height: 21rem;
        padding: var(--space-5);
    }

    .template-preview__layout--split {
        grid-template-columns: 1fr;
    }

    .template-preview__layout--reverse .template-preview__copy {
        order: initial;
    }

    .template-preview__media {
        min-height: 8rem;
    }
}

/* ==================== END TEMPLATE GALLERY ==================== */
