/* Keep padding and borders inside element widths */
#socials,
#socials * {
    box-sizing: border-box;
}

/* Entire section — expands to fit the video */
#socials {
    display: block;
    width: 100%;

    height: auto;
    min-height: 100vh;
    max-height: none;

    margin: 0;
    padding: 80px 6%;

    background-color: #111;
    color: white;

    scroll-margin-top: 85px;
}

/* Text beside the portrait video */
#socials .social-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) minmax(0, 440px);

    align-items: center;
    gap: 45px;

    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

#socials .social-layout > * {
    min-width: 0;
}

/* Main heading */
#socials h2 {
    margin: 0 0 24px;

    color: white;
    font-size: clamp(32px, 4vw, 50px);
    font-weight: bold;
    line-height: 1.15;
}

/* Red line beneath the heading */
#socials h2::after {
    content: "";
    display: block;

    width: 65px;
    height: 4px;
    margin-top: 20px;

    background-color: #ff0000;
    border-radius: 4px;
}

/* Description text */
#socials p {
    margin: 0 0 20px;

    color: #ccc;
    font-size: 17px;
    line-height: 1.8;
}

/* Video — keeps its natural proportions */
#socials .social-layout video {
    display: block;

    width: 100%;
    height: auto;
    max-height: none;

    aspect-ratio: auto;
    object-fit: contain;

    background-color: black;
    border: 1px solid #333;
    border-radius: 16px;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* Social media area underneath */
#socials .social-follow {
    width: 100%;
    max-width: 1100px;

    margin: 55px auto 0;
    padding-top: 35px;

    border-top: 1px solid #333;
    text-align: center;
}

#socials h3 {
    margin: 0 0 15px;

    color: white;
    font-size: 28px;
    line-height: 1.3;
}

#socials .social-follow p {
    margin-bottom: 28px;
}

/* Social media buttons */
.shop-social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.shop-social-links a,
.shop-social-links a:visited {
    box-sizing: border-box;
    display: inline-block;

    min-width: 130px;
    padding: 13px 24px;

    color: white;
    background-color: #1c1c1c;
    border: 1px solid #e00000;
    border-radius: 8px;

    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

/* Mouse hover */
.shop-social-links a:hover {
    color: white;
    background-color: #c90000;
    border-color: #c90000;
}

/* Keyboard navigation */
.shop-social-links a:focus-visible {
    outline: 2px solid white;
    outline-offset: 4px;
}

/* Phones and tablets */
@media screen and (max-width: 768px) {
    #socials {
        min-height: auto;
        padding: 55px 20px;
    }

    #socials .social-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    #socials .social-layout video {
        max-width: 440px;
        justify-self: center;
    }

    #socials p {
        font-size: 16px;
    }

    #socials .social-follow {
        margin-top: 35px;
        padding-top: 30px;
    }

    .shop-social-links {
        gap: 12px;
    }
}

/* Responsive layout for the entire section */
#socials {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(0, 440px);

    grid-template-rows: auto 1fr;

    grid-template-areas:
        "intro  video"
        "follow video";

    column-gap: clamp(24px, 4vw, 60px);
    row-gap: 24px;

    align-items: start;

    /* Center the content on larger screens */
    padding-inline: max(
        20px,
        calc((100% - 1100px) / 2)
    );
}

/* Let the existing text and video share this grid */
#socials .social-layout {
    display: contents;
}

/* Intro text on the left */
#socials .social-intro {
    grid-area: intro;
}

/* Video on the right */
#socials .social-layout video {
    grid-area: video;
    align-self: start;
}

/* Follow links directly underneath the intro */
#socials .social-follow {
    grid-area: follow;
    align-self: start;

    margin: 0;
    padding: 24px 0 0;

    text-align: left;
}

/* Align buttons with the text */
#socials .shop-social-links {
    justify-content: flex-start;
}

/* Stack everything on smaller screens */
@media screen and (max-width: 768px) {
    #socials {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;

        grid-template-areas:
            "intro"
            "follow"
            "video";

        row-gap: 28px;
    }

    #socials .social-layout video {
        justify-self: center;
    }

    /* Buttons resize and wrap as needed */
    #socials .shop-social-links a {
        flex: 1 1 130px;
        min-width: 0;
    }
}

/*animation*/
#socials {
    --social-reveal-distance: 20px;
}

/* Starting position */
#socials.socials-animate .social-intro,
#socials.socials-animate .social-follow,
#socials.socials-animate video {
    opacity: 0;
    transform: translateY(var(--social-reveal-distance));

    transition:
        opacity 600ms ease-out,
        transform 600ms ease-out;
}

/* Video appears slightly after the text */
#socials.socials-animate video {
    transition-delay: 150ms;
}

/* Visible position */
#socials.socials-animate.socials-visible .social-intro,
#socials.socials-animate.socials-visible .social-follow,
#socials.socials-animate.socials-visible video {
    opacity: 1;
    transform: translateY(0);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    #socials.socials-animate .social-intro,
    #socials.socials-animate .social-follow,
    #socials.socials-animate video {
        opacity: 1;
        transform: none;
        transition: none;
    }
}