/* =====================================================
   CODEWORD - SOCIAL MEDIA PAGE STYLES
   File: assets/css/social-media.css
   Used by: social-media.html
   All classes are prefixed cw-sm (no conflicts).
   Load this AFTER bootstrap, templatemo and about.css.
===================================================== */

:root {
    --cw-sm-ink: #14122b;
    --cw-sm-text: #3d3b54;
    --cw-sm-muted: #6b6985;
    --cw-sm-bg: #f6f5fc;
    --cw-sm-card: #ffffff;
    --cw-sm-line: #e4e1f3;
    --cw-sm-brand: #6d28d9;
    --cw-sm-brand-dark: #4c1d95;
    --cw-sm-insta: linear-gradient(45deg, #f9a03f 0%, #e1306c 50%, #833ab4 100%);
    --cw-sm-fb: #1877f2;
    color-scheme: light;
}

.cw-sm-page {
    background: var(--cw-sm-bg);
    color: var(--cw-sm-text);
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
}

.cw-sm-page *,
.cw-sm-page *::before,
.cw-sm-page *::after {
    box-sizing: border-box;
}

.cw-sm-wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.cw-sm-section {
    padding: 72px 0;
}

.cw-sm-page h1,
.cw-sm-page h2,
.cw-sm-page h3 {
    color: var(--cw-sm-ink);
    line-height: 1.25;
    margin: 0;
}

.cw-sm-page h2 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 14px;
}

.cw-sm-page h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cw-sm-page p {
    margin: 0 0 14px;
}

.cw-sm-lead {
    max-width: 680px;
    color: var(--cw-sm-muted);
    font-size: 17px;
}

.cw-sm-page a:focus-visible,
.cw-sm-page summary:focus-visible {
    outline: 3px solid var(--cw-sm-brand);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- Hero (keeps site hero look, adds readable text) ---------- */
/* Banner image: ../images/social-media-banner.jpg (relative to this CSS file) (SVG/PNG versions are also provided).
   The gradient after the image is a fallback if the file is missing. */
.codingpage.cw-sm-hero {
    background:
        url("../images/social-media-banner.jpg") center / cover no-repeat,
        linear-gradient(135deg, #4c1d95, #7c3aed 55%, #d946ef);
    min-height: 360px;
    display: flex;
    align-items: center;
    padding: 130px 0 110px;
    text-align: center;
}

.cw-sm-hero h1,
.cw-sm-hero p {
    color: #fff;
    text-shadow: 0 2px 14px rgba(30, 27, 75, .45);
}

@media (max-width: 700px) {
    .codingpage.cw-sm-hero {
        min-height: 300px;
        padding: 110px 0 90px;
        background-position: 35% center;
    }
}

.cw-sm-hero h1 {
    font-size: clamp(28px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.2;
}

.cw-sm-hero p {
    max-width: 720px;
    margin: 16px auto 0;
    font-size: clamp(15px, 2.2vw, 18px);
    line-height: 1.7;
}

/* ---------- Breadcrumb ---------- */
.cw-sm-crumbs {
    padding: 16px 0 0;
    font-size: 14px;
    color: var(--cw-sm-muted);
}

.cw-sm-crumbs a {
    color: var(--cw-sm-brand);
    text-decoration: none;
}

.cw-sm-crumbs a:hover {
    text-decoration: underline;
}

/* ---------- Quick answer (AEO) ---------- */
.cw-sm-answer {
    margin-top: 28px;
    background: var(--cw-sm-card);
    border: 1px solid var(--cw-sm-line);
    border-left: 5px solid var(--cw-sm-brand);
    border-radius: 14px;
    padding: 24px 26px;
}

.cw-sm-answer h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.cw-sm-answer p:last-child {
    margin-bottom: 0;
}

/* ---------- Join cards ---------- */
.cw-sm-join {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 34px;
}

.cw-sm-platform {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    padding: 32px 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cw-sm-platform--insta {
    background: var(--cw-sm-insta);
}

.cw-sm-platform--fb {
    background: linear-gradient(145deg, #1877f2, #0c4aa6);
}

.cw-sm-platform > i {
    font-size: 44px;
    margin-bottom: 14px;
}

.cw-sm-platform h3 {
    color: #fff;
    font-size: 24px;
}

.cw-sm-platform p {
    color: rgba(255, 255, 255, .92);
}

.cw-sm-handle {
    display: inline-block;
    align-self: flex-start;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, .2);
    border-radius: 999px;
    word-break: break-all;
}

.cw-sm-platform ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 24px;
}

.cw-sm-platform li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.55;
}

.cw-sm-platform li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    font-size: 13px;
}

.cw-sm-btn {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 999px;
    background: #fff;
    color: #14122b !important;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
    transition: transform .2s ease, box-shadow .2s ease;
}

.cw-sm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}

/* ---------- What you get ---------- */
.cw-sm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 32px;
}

.cw-sm-card {
    background: var(--cw-sm-card);
    border: 1px solid var(--cw-sm-line);
    border-radius: 16px;
    padding: 26px 24px;
}

.cw-sm-card > i {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(109, 40, 217, .12);
    color: var(--cw-sm-brand);
    font-size: 19px;
    margin-bottom: 14px;
}

.cw-sm-card p {
    margin: 0;
    font-size: 15px;
}

/* ---------- Steps ---------- */
.cw-sm-steps {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    counter-reset: cwstep;
}

.cw-sm-steps li {
    counter-increment: cwstep;
    background: var(--cw-sm-card);
    border: 1px solid var(--cw-sm-line);
    border-radius: 16px;
    padding: 22px 20px;
}

.cw-sm-steps li::before {
    content: counter(cwstep);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cw-sm-brand);
    color: #fff;
    font-weight: 800;
    margin-bottom: 12px;
}

.cw-sm-steps strong {
    display: block;
    color: var(--cw-sm-ink);
    margin-bottom: 4px;
}

.cw-sm-steps span {
    font-size: 14.5px;
    line-height: 1.6;
    display: block;
}

/* ---------- Audience ---------- */
.cw-sm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.cw-sm-chips span {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--cw-sm-card);
    border: 1px solid var(--cw-sm-line);
    font-weight: 600;
    font-size: 15px;
    color: var(--cw-sm-ink);
}

.cw-sm-chips i {
    color: var(--cw-sm-brand);
    margin-right: 8px;
}

/* ---------- FAQ ---------- */
.cw-sm-faq {
    margin-top: 30px;
    max-width: 860px;
}

.cw-sm-faq details {
    background: var(--cw-sm-card);
    border: 1px solid var(--cw-sm-line);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 0 22px;
}

.cw-sm-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 28px 18px 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
    color: var(--cw-sm-ink);
    position: relative;
}

.cw-sm-faq summary::-webkit-details-marker {
    display: none;
}

.cw-sm-faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--cw-sm-brand);
    font-weight: 500;
}

.cw-sm-faq details[open] summary::after {
    content: "\2212";
}

.cw-sm-faq details p {
    padding-bottom: 18px;
    margin: 0;
}

.cw-sm-faq a {
    color: var(--cw-sm-brand);
    font-weight: 600;
    word-break: break-word;
}

/* ---------- Final CTA ---------- */
.cw-sm-cta {
    background: linear-gradient(120deg, #7c3aed, #a855f7, #ec4899, #7c3aed);
    background-size: 300% 300%;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 52px 30px;
    text-align: center;
    color: #f5f0ff;
}

.cw-sm-cta h2 {
    color: #fff;
}

.cw-sm-cta p {
    max-width: 560px;
    margin: 0 auto 26px;
}

.cw-sm-cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.cw-sm-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    transition: transform .2s ease;
}

.cw-sm-pill:hover {
    transform: translateY(-2px);
}

.cw-sm-pill--insta {
    background: var(--cw-sm-insta);
}

.cw-sm-pill--fb {
    background: var(--cw-sm-fb);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .cw-sm-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cw-sm-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .cw-sm-section {
        padding: 52px 0;
    }

    .cw-sm-join {
        grid-template-columns: 1fr;
    }

    .cw-sm-platform {
        padding: 26px 22px;
    }

    .cw-sm-cta {
        padding: 40px 20px;
        border-radius: 18px;
    }
}

@media (max-width: 560px) {
    .cw-sm-grid,
    .cw-sm-steps {
        grid-template-columns: 1fr;
    }

    .cw-sm-answer {
        padding: 20px 18px;
    }

    .cw-sm-btn,
    .cw-sm-pill {
        width: 100%;
        justify-content: center;
    }

    .cw-sm-cta-row {
        flex-direction: column;
    }

    .cw-sm-faq summary {
        font-size: 16px;
    }
}


/* =====================================================
   ANIMATIONS
===================================================== */
@keyframes cwSmUp      { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes cwSmLeft    { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes cwSmRight   { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes cwSmPop     { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes cwSmFloat   { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(-5deg); } }
@keyframes cwSmDrift   { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, 34px) scale(1.18); } }
@keyframes cwSmGrad    { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes cwSmGradCta { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes cwSmPulse   { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 70% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
@keyframes cwSmOpen    { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes cwSmLine    { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cwSmWiggle  { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* Scroll progress bar */
.cw-sm-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, #f9a03f, #e1306c, #6d28d9);
    z-index: 99999;
    pointer-events: none;
}

/* Hero text entrance on page load */
.cw-sm-hero h1 { animation: cwSmUp .9s cubic-bezier(.2, .7, .2, 1) .1s backwards; }
.cw-sm-hero p  { animation: cwSmUp .9s cubic-bezier(.2, .7, .2, 1) .35s backwards; }

/* Scroll reveal (classes are added by the script at the bottom) */
.cw-sm-reveal:not(.cw-sm-in) { opacity: 0; }
.cw-sm-in                    { animation: cwSmUp .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
.cw-sm-in.cw-sm-from-left    { animation-name: cwSmLeft; }
.cw-sm-in.cw-sm-from-right   { animation-name: cwSmRight; }
.cw-sm-in.cw-sm-pop          { animation-name: cwSmPop; }

/* Platform cards: moving gradient, drifting bubble, floating icon, lift */
.cw-sm-platform {
    transition: transform .35s ease, box-shadow .35s ease;
    box-shadow: 0 14px 34px rgba(109, 40, 217, .16);
}

.cw-sm-platform:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(109, 40, 217, .28);
}

.cw-sm-platform--insta {
    background-size: 200% 200%;
    animation: cwSmGrad 7s ease-in-out infinite alternate;
}

.cw-sm-platform::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -70px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    animation: cwSmDrift 7s ease-in-out infinite alternate;
    pointer-events: none;
}

.cw-sm-platform > * { position: relative; z-index: 1; }
.cw-sm-platform > i { animation: cwSmFloat 3.8s ease-in-out infinite; transform-origin: center; }

/* Buttons: shine sweep + icon wiggle */
.cw-sm-btn,
.cw-sm-pill { position: relative; overflow: hidden; }

.cw-sm-btn::after,
.cw-sm-pill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}

.cw-sm-btn:hover::after,
.cw-sm-pill:hover::after { left: 130%; }

.cw-sm-btn:hover i,
.cw-sm-pill:hover i { animation: cwSmWiggle .6s ease; }

.cw-sm-pill { animation: cwSmPulse 2.6s ease-out infinite; }
.cw-sm-pill--fb { animation-delay: 1.3s; }

/* Benefit cards */
.cw-sm-card {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.cw-sm-card:hover {
    transform: translateY(-7px);
    border-color: var(--cw-sm-brand);
    box-shadow: 0 18px 36px rgba(109, 40, 217, .16);
}

.cw-sm-card > i { transition: transform .35s ease, background .35s ease, color .35s ease; }

.cw-sm-card:hover > i {
    transform: rotate(-8deg) scale(1.12);
    background: var(--cw-sm-brand);
    color: #fff;
}

/* Steps: connector line draws in, card lifts */
.cw-sm-steps li {
    position: relative;
    transition: transform .3s ease, box-shadow .3s ease;
}

.cw-sm-steps li:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 30px rgba(109, 40, 217, .14);
}

@media (min-width: 992px) {
    .cw-sm-steps li:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 40px;
        left: 58px;
        width: calc(100% - 22px);
        height: 3px;
        border-radius: 3px;
        background: linear-gradient(90deg, var(--cw-sm-brand), #e1306c);
        transform-origin: left;
        transform: scaleX(0);
        z-index: 0;
    }

    .cw-sm-steps li.cw-sm-in:not(:last-child)::after {
        animation: cwSmLine .8s ease calc(var(--d, 0s) + .5s) forwards;
    }

    .cw-sm-steps li::before { position: relative; z-index: 1; }
}

/* Chips */
.cw-sm-chips span {
    transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}

.cw-sm-chips span:hover {
    transform: translateY(-4px) scale(1.04);
    background: var(--cw-sm-brand);
    border-color: var(--cw-sm-brand);
    color: #fff;
}

.cw-sm-chips span:hover i { color: #fff; animation: cwSmWiggle .6s ease; }

/* FAQ */
.cw-sm-faq details { transition: box-shadow .3s ease, border-color .3s ease; }

.cw-sm-faq details:hover,
.cw-sm-faq details[open] {
    border-color: var(--cw-sm-brand);
    box-shadow: 0 10px 24px rgba(109, 40, 217, .1);
}

.cw-sm-faq summary::after { transition: transform .3s ease; }
.cw-sm-faq details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.cw-sm-faq details[open] p { animation: cwSmOpen .4s ease; }

/* Final CTA: flowing gradient + floating bubbles */
.cw-sm-cta {
    animation: cwSmGradCta 12s ease infinite;
    box-shadow: 0 24px 50px rgba(124, 58, 237, .3);
}

.cw-sm-cta::before,
.cw-sm-cta::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    pointer-events: none;
}

.cw-sm-cta::before { width: 220px; height: 220px; left: -70px; bottom: -90px; animation: cwSmDrift 8s ease-in-out infinite alternate; }
.cw-sm-cta::after  { width: 160px; height: 160px; right: -40px; top: -50px;  animation: cwSmDrift 6s ease-in-out infinite alternate-reverse; }
.cw-sm-cta > * { position: relative; z-index: 1; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }

    .cw-sm-reveal:not(.cw-sm-in) { opacity: 1; }
    .cw-sm-steps li:not(:last-child)::after { transform: scaleX(1); }
}
