/* Anti-FOUC: page is hidden until this stylesheet loads */
html {
  visibility: visible;
}

/* Marquee Styles */
.onis-marquee-banner-overlay,
.onis-marquee-banner-overlay * {
  font-weight: 700 !important;
}

.onis-marquee {
    display: flex;
    align-items: center;
    animation: onis-marquee 15s linear infinite;
}

.onis-marquee span {
    padding-right: 50px;
}

.onis-marquee span p {
    margin-block: 0.2em;
}

.onis-marquee-wrapper:hover .onis-marquee,
.onis-marquee-wrapper:active .onis-marquee {
    animation-play-state: paused;
}

@keyframes onis-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-10%);
    }
}

/* Banner */
.banner {
    width: 100%;
    aspect-ratio: 3 / 1; 
    background-color: var(--black);
    position: relative;
    display: flex;
}

.banner-item {
    flex: 1;
    position: relative;
}

.banner-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 5%;
    width: 90%;
    height: 60%;
    color: rgba(250, 247, 242, 0.6);
    font-weight: 800;
    line-height: 1.0;
    overflow: hidden;
    display: flex;
    align-items: center;
    animation: type 2.5s steps(22) forwards;
}

.banner-overlay-text {
    display: inline-block;
    white-space: normal; 
}

/* Banner title fade-out (homepage) — driven by a CMS `data-duration` attribute
   on the title (e.g. <span data-duration="5">Title</span>). JS adds
   .banner-title-fade, then .is-banner-title-faded after the configured delay.
   `--banner-title-fade-duration` controls the fade length (~1s by default). */
.banner-title-fade {
    opacity: 1;
    transition: opacity var(--banner-title-fade-duration, 1s) ease;
}

.banner-title-fade.is-banner-title-faded {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .banner-title-fade {
        transition: none;
    }
}

/* CTA aligned with overlay */
.banner-cta {
    position: absolute;
    left: 5%;
    bottom: var(--spacing-md);
    width: 35%;
    display: flex;
    align-items: center;
    z-index: 15;
}

.banner-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 247, 242, 0.6);
    color: var(--black);
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    font-weight: 500;
}

/* The CMS subtitle usually wraps the link in a <p>. Kill its default margins so
   the CTA block hugs the button instead of growing upward over the title. */
.banner-cta p {
    margin: 0;
}

/* Numbers Section */
.numbers-section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
}

.numbers-section,
.numbers-section * {
  text-align: center;
}

.numbers-title {
    font-weight: 800;
}

.numbers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: stretch;
    gap: var(--spacing-lg) var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.numbers-grid .number-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 calc((100% - 3 * var(--spacing-xl)) / 4);
    position: relative;
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-md);
}

/* Interior dividers: one centered in each column gap (3 total on 4-across) */
.numbers-grid .number-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(-1 * var(--spacing-xl) / 2 - 0.5px);
    width: 1px;
    background-color: var(--black);
}

.number {
    font-weight: 800;
}

.number p {
    margin-bottom: 0;
}

.number-label {
    margin-top: var(--spacing-xs);
    background-color: var(--black);
    color: var(--off-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    width: 90%;
    box-sizing: border-box;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-label p {
    margin-bottom: 0;
    margin-top: 0;
}

/* Featured Products Section */
.featured-products-section {
    width: var(--content-width);
    margin: 0 auto;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--black);
}

.featured-title {
    font-weight: 800;
}

.featured-products-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--spacing-lg);
    align-items: start;
    margin-top: var(--spacing-lg);
}

.featured-products-right-side {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.featured-products-right-card:nth-child(1) {
    border-bottom: 1px solid var(--black);
}

.featured-products-left-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.featured-products-left-image img,
.featured-products-left-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-products-right-image {        
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.featured-products-right-image img,
.featured-products-right-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-products-left-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.featured-products-right-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.featured-product-info {
    display: flex;
    flex-direction: column;
}

.featured-product-info p {
    margin-bottom: 0;
}

.featured-card-btn {
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--black);
    color: var(--off-white);
    flex-shrink: 0;
    margin-left: var(--spacing-sm);
    align-self: center;
}

.featured-product-title {
    font-weight: 700;
}

.featured-product-title p {
    margin-top: 0;
}

.featured-product-subtitle p {
    margin-top: 0;
}

/* Catalogue */
.catalogue-section {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
}

.catalogue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--black);
}

.catalogue-title {
    font-weight: 800;
}

.catalogue-text p {
    margin-top: 0;
}

.catalogue-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.catalogue-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.catalogue-right-title {
    font-weight: 700;
}

.catalogue-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.catalogue-image img,
.catalogue-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.catalogue-btn {
    text-decoration: none;
    font-weight: 500;
    white-space: normal;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--black);
    color: var(--off-white);
    flex-shrink: 0;
    align-self: flex-start;
}

/* Events Section */
.events-section {
    width: 100%;
    background-color: var(--black);
    color: var(--off-white);
}

.events-wrapper {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
}

.events-title {
    font-weight: 800;
}

.events-content-row {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-lg);
}

.events-content {
    flex: 1;
    min-width: 0;
    border-top: 1px solid var(--light-grey);
    padding-top: var(--spacing-lg);
}

.events-date {
    font-weight: 800;
    color: var(--light-grey);
}

.events-content-title {
    margin-top: var(--spacing-xs);
    font-weight: 800;
}

.events-description {
    margin-top: var(--spacing-md);
    color: var(--light-grey);
}

/* Glassology Section */
.glassology-section {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-3xl);
}

.glassology-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--black);
}

.glassology-title {
    font-weight: 800;
}

.glassology-content-title {
    font-weight: 700;
}

.glassology-text p {
    margin-top: 0;

}

.glassology-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.glassology-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.glassology-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.glassology-image img,
.glassology-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.glassology-btn {
    text-decoration: none;
    font-weight: 500;
    white-space: normal;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--black);
    color: var(--off-white);
    flex-shrink: 0;
    align-self: flex-start;
}

/* Instagram Section */
.instagram-section {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-3xl);
}

.instagram-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--black);
}

.instagram-title {
    font-weight: 800;
}

.swiper {
    margin-top: var(--spacing-lg);
}

#behold-feed .swiper-slide {
    /* Override Swiper's default `height: 100%` (its `height:auto` only applies
       in autoHeight mode). Letting the aspect-ratio define the height makes every
       card a definite square from its width — independent of when each image
       loads — so cards stay the same height on real devices. */
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

#behold-feed .swiper-slide img,
#behold-feed .swiper-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#behold-feed .swiper-pagination {
    display: none;
}

.behold-caption {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--off-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.behold-caption-text {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.4;
}

#behold-feed .swiper-slide:hover .behold-caption {
    opacity: 1;
}

/* Newsletter Section */
.newsletter-section {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: var(--spacing-6xl);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--spacing-3xl);
}

.newsletter-title {
    display: flex;
    align-items: center;
    font-weight: 800;
    text-align: left;
    flex: 1 1 50%;
    min-width: 0;
}

/* Form takes ~half the section, title takes the other half — side by side */
.newsletter-section .newsletter-form {
    order: -1;
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--spacing-sm);
    /* Keeps the form and its 100%-width inputs a usable size, but never wider
       than its container (90% of the viewport on mobile), so it fits small phones. */
    min-width: min(350px, 100%);
    max-width: 500px;
    margin: 0;
}

/* Expose the controls to the form's flex layout so both vertical gaps grow
   equally when the title makes the form taller. */
.newsletter-section .newsletter-fields {
    display: contents;
}

.newsletter-section .newsletter-btn {
    margin-top: 0;
}

/* Responsive styles */

/* For laptops */
@media (min-width: 1025px) and (max-width: 1200px) {
    .numbers-grid .number-item {
        flex: 1 1 40%;
    }
    /* 3 dividers: vertical between each row's pair (items 1 & 3), horizontal between the rows */
    .numbers-grid .number-item:nth-child(even)::after {
        display: none;
    }
    /* Horizontal row separator drawn by items 1 & 2 (top row) via ::before */
    .numbers-grid .number-item:nth-child(-n+2)::before {
        content: "";
        position: absolute;
        top: auto;
        bottom: calc(-1 * var(--spacing-lg) / 2 - 0.5px);
        width: auto;
        height: 1px;
        background-color: var(--black);
    }
    .numbers-grid .number-item:nth-child(1)::before {
        left: 0;
        right: calc(-1 * var(--spacing-xl) / 2);
    }
    .numbers-grid .number-item:nth-child(2)::before {
        left: calc(-1 * var(--spacing-xl) / 2);
        right: 0;
    }
}

/* For tablets */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Banner */
    .banner {
        aspect-ratio: 4 / 3;
    }

    /* Numbers section */
    .numbers-section {
    max-width: var(--content-width);
    }
    .numbers-grid .number-item {
        flex: 1 1 40%;
    }
    /* 3 dividers: vertical between each row's pair (items 1 & 3), horizontal between the rows */
    .numbers-grid .number-item:nth-child(even)::after {
        display: none;
    }
    /* Horizontal row separator drawn by items 1 & 2 (top row) via ::before */
    .numbers-grid .number-item:nth-child(-n+2)::before {
        content: "";
        position: absolute;
        top: auto;
        bottom: calc(-1 * var(--spacing-lg) / 2 - 0.5px);
        width: auto;
        height: 1px;
        background-color: var(--black);
    }
    .numbers-grid .number-item:nth-child(1)::before {
        left: 0;
        right: calc(-1 * var(--spacing-xl) / 2);
    }
    .numbers-grid .number-item:nth-child(2)::before {
        left: calc(-1 * var(--spacing-xl) / 2);
        right: 0;
    }

    /* Featured Products Section */
    .featured-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Catalogue Section */
    .catalogue-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Glassology Section */
    .glassology-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Instagram Section */
    .instagram-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Newsletter Section */
    .newsletter-section {
        width: var(--content-width);
    }

    /* Form 60%, title 40% on tablet */
    .newsletter-section .newsletter-form {
        flex: 1 1 60%;
    }

    .newsletter-title {
        flex: 1 1 40%;
    }
}

/* For mobile devices */
@media (max-width: 768px) {

    /* Banner */
    .banner {
        aspect-ratio: 4 / 3;
    }

    .banner-overlay {
        width: 90%;
    }

    .banner-cta { 
        width: auto;
        bottom: var(--spacing-xs);
        display: flex;
        justify-content: center;
    }

    .banner-cta a {
        max-width: 90vw;
        width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Numbers section */
    .numbers-section {
        max-width: var(--content-width);
    }

    .numbers-grid {
        gap: var(--spacing-xl);
    }

    .numbers-grid .number-item {
        flex: 1 1 100%;
    }
    /* Horizontal dividers between stacked items */
    .numbers-grid .number-item:not(:last-child)::after {
        top: auto;
        bottom: calc(-1 * var(--spacing-xl) / 2 - 0.5px);
        left: 0;
        right: 0;
        width: auto;
        height: 1px;
    }

    .number-label {
        width: 100%;
    }

    /* Featured Products Section */
    .featured-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .featured-products-grid {
        grid-template-columns: 1fr;
    }

    .featured-products-left-card-footer,
    .featured-products-right-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .featured-card-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
        margin-left: 0;
        align-self: stretch;
    }

    .featured-products-right-card:nth-child(1) {
    border-bottom:  0;
}
    
    
    /* Catalogue Section */
    .catalogue-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .catalogue-grid {
        grid-template-columns: 1fr;
    }

    .events-content-row {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    /* Glassology Section */
    .glassology-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Instagram Section */
    .instagram-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .glassology-grid {
        grid-template-columns: 1fr;
    }
    
    .glassology-right {
        order: -1;
    }

    /* Newsletter Section */
    .newsletter-section {
        width: 100%;
        max-width: var(--content-width);
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-lg);
    }

    .newsletter-section .newsletter-form {
        order: 0;
        flex: 0 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .newsletter-title {
        flex: 0 1 auto;
    }

    .newsletter-section .newsletter-title br {
        display: none;
    }
}
