/* ===================================================================
   Service packages page: social media (pages/social-media.php)

   Loaded only on /services/social-media-packages/, after service-packages.css.
   - Hero variant `calendar` (sections/hero/calendar.php): .pp-sm-cal, .pp-sm-post
   - Custom section `sm-calendar` (sections/custom/sm-calendar.php): .pp-sm-month, .pp-sm-tier
   - Shared chips/legend: .pp-sm-chip, .pp-sm-legend
   =================================================================== */

/* ---------- Chips + legend ---------- */

.pp-sm-chip {
    display: inline-block;
    flex-shrink: 0;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: var(--brand-primary-bright);
}

.pp-sm-chip--reel {
    background: var(--brand-gold);
}

.pp-sm-chip--report {
    background: var(--brand-success);
}

.pp-sm-chip--platform {
    background: var(--brand-ink);
}

.pp-sm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    color: var(--white-80);
}

.pp-sm-legend li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pp-sm-legend .pp-sm-chip,
.pp-sm-tier__counts .pp-sm-chip {
    width: 16px;
    height: 8px;
}

.pp-sm-legend--light {
    justify-content: center;
    margin: -16px auto 28px;
    font-size: 0.88rem;
    color: var(--text-muted-2);
}

/* ---------- Hero variant: calendar ---------- */

/* Frame, tilt and stacking come from the shared .pp-hero-card / .pp-hero-card--tilt; only the
   room left for the floating post card is set here. */
.pp-sm-cal {
    margin: 0 0 28px;
    color: var(--white);
}

.pp-sm-cal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--white-10);
}

.pp-sm-cal__title {
    font-weight: 800;
    font-size: 1rem;
}

.pp-sm-cal__badge {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed var(--white-30);
    color: var(--brand-gold);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.pp-sm-cal__counters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.pp-sm-cal__counter {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--white-10);
    border-top: 3px solid var(--brand-primary-bright);
}

.pp-sm-cal__counter--reel {
    border-top-color: var(--brand-gold);
}

.pp-sm-cal__counter--platform {
    border-top-color: var(--white-50);
}

.pp-sm-cal__counter strong {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.pp-sm-cal__counter span {
    font-size: 0.76rem;
    color: var(--white-60);
    line-height: 1.3;
}

.pp-sm-cal__month {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--white-10);
}

.pp-sm-cal__weekdays,
.pp-sm-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pp-sm-cal__weekdays {
    margin-bottom: 6px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white-50);
}

.pp-sm-cal__day {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3px;
    min-height: 46px;
    padding: 5px 5px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.pp-sm-cal__day--empty {
    background: transparent;
}

.pp-sm-cal__day.is-focus {
    background: var(--primary-bright-alpha-25);
    box-shadow: inset 0 0 0 1.5px var(--brand-primary-bright);
}

.pp-sm-cal__num {
    font-size: 0.66rem;
    line-height: 1;
    color: var(--white-60);
    font-variant-numeric: tabular-nums;
}

.pp-sm-cal__chips {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pp-sm-cal__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 12px;
    /* Keeps the legend clear of the floating post card on the end (left) side. */
    padding-inline-end: 200px;
}

/* White 80% on the calendar's dark glass: 8.3:1 (50% was 4.24:1). */
.pp-sm-cal__caption {
    font-size: 0.74rem;
    color: var(--white-80);
}

/* Floating post card: status flips once from the first state to the second. */
.pp-sm-post {
    position: absolute;
    bottom: -30px;
    left: -34px;
    display: flex;
    gap: 10px;
    width: 230px;
    padding: 10px;
    border-radius: 14px;
    background: var(--white);
    color: var(--brand-ink);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
    text-align: start;
}

.pp-sm-post__art {
    flex-shrink: 0;
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-primary-bright), var(--brand-ink-2));
}

.pp-sm-post__art span {
    position: absolute;
    inset-inline-start: 10px;
    bottom: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-gold);
}

.pp-sm-post__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.pp-sm-post__body strong {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.pp-sm-post__line {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: var(--border-soft);
}

.pp-sm-post__line--short {
    width: 60%;
}

.pp-sm-post__status {
    position: relative;
    display: inline-grid;
    align-self: flex-start;
    margin-top: 2px;
}

.pp-sm-post__state {
    grid-area: 1 / 1;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--primary-bright-alpha-15);
    color: var(--pp-accent-text);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.pp-sm-post__state--done {
    background: rgba(34, 197, 94, 0.14);
    color: #15803D;
    opacity: 0;
}

/* ---------- Motion (hero). Starts hidden only when JS has marked the page. ---------- */

.pp-js .pp-sm-cal__chips .pp-sm-chip {
    transform-origin: right center;
    animation: pp-sm-chip-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(0.25s + var(--pp-sm-i, 0) * 35ms);
}

.pp-js .pp-sm-post__state:first-child {
    animation: pp-sm-state-out 0.35s ease 2.6s both;
}

.pp-js .pp-sm-post__state--done {
    animation: pp-sm-state-in 0.35s ease 2.8s both;
}

@keyframes pp-sm-chip-in {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: 1; }
}

@keyframes pp-sm-state-out {
    to { opacity: 0; transform: translateY(-4px); }
}

@keyframes pp-sm-state-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Section: the month in every package ---------- */

.pp-sm-month {
    padding: 80px 0;
    background: var(--white);
}

.pp-sm-month__grid {
    display: grid;
    grid-template-columns: repeat(var(--pp-cols, 3), minmax(0, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pp-sm-tier {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 22px 20px;
    border-radius: 16px;
    background: var(--surface-5);
    border: 1px solid var(--border-soft);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.pp-sm-tier:hover {
    transform: translateY(-4px);
    border-color: var(--primary-bright-alpha-40);
    box-shadow: 0 16px 36px var(--shadow-08);
}

.pp-sm-tier--popular {
    background: var(--white);
    border-color: var(--brand-primary-bright);
    box-shadow: 0 16px 36px var(--primary-bright-alpha-15);
}

.pp-sm-tier__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.pp-sm-tier__name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-ink);
}

.pp-sm-tier__price {
    font-size: 0.875rem;
    color: var(--text-muted-3);
}

.pp-sm-tier__price small {
    font-size: 0.875rem;
}

.pp-sm-tier__price strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-ink);
}

.pp-sm-tier__days {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pp-sm-tier__day {
    aspect-ratio: 1;
    border-radius: 5px;
    background: var(--border-soft);
}

.pp-sm-tier__day--post {
    background: var(--brand-primary-bright);
}

.pp-sm-tier__day--reel {
    background: var(--brand-gold);
}

.pp-sm-tier__day--both {
    background: linear-gradient(135deg, var(--brand-primary-bright) 50%, var(--brand-gold) 50%);
}

.pp-sm-tier__counts {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--border-strong);
}

.pp-sm-tier__counts li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted-2);
}

/* 44px tall hit area (was 24px) without changing how the link reads. */
.pp-sm-tier__cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 44px;
    margin-top: auto;
    margin-bottom: -10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--pp-accent-text);
    text-decoration: none;
}

.pp-sm-tier__cta:hover {
    color: var(--pp-accent-text-hover);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pp-sm-month__note {
    margin: 22px auto 0;
    max-width: 640px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted-3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .pp-sm-cal {
        margin: 0 auto 28px;
    }

    .pp-sm-post {
        left: -16px;
    }

    .pp-sm-month__grid {
        gap: 14px;
    }

    .pp-sm-tier {
        padding: 20px 16px 18px;
    }
}

@media (max-width: 768px) {
    .pp-sm-cal {
        margin-bottom: 0;
    }

    .pp-sm-cal__bar {
        flex-wrap: wrap;
    }

    .pp-sm-cal__counters {
        gap: 6px;
    }

    .pp-sm-cal__counter {
        flex-direction: column;
        gap: 2px;
        padding: 8px;
    }

    .pp-sm-cal__counter strong {
        font-size: 1.15rem;
    }

    .pp-sm-cal__month {
        padding: 8px;
    }

    .pp-sm-cal__foot {
        padding-inline-end: 0;
    }

    .pp-sm-cal__weekdays,
    .pp-sm-cal__grid {
        gap: 4px;
    }

    .pp-sm-cal__day {
        min-height: 36px;
        padding: 4px 3px 4px;
        border-radius: 6px;
    }

    .pp-sm-cal__num {
        font-size: 0.6rem;
    }

    .pp-sm-chip {
        height: 4px;
    }

    /* The post card sits under the calendar instead of floating outside it. */
    .pp-sm-post {
        position: relative;
        bottom: auto;
        left: auto;
        width: auto;
        margin-top: 12px;
    }

    .pp-sm-post__art {
        width: 48px;
        height: 48px;
    }

    .pp-sm-month {
        padding: 48px 0;
    }

    .pp-sm-legend--light {
        margin: -8px auto 20px;
    }

    .pp-sm-month__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pp-sm-tier:hover {
        transform: none;
    }

    .pp-sm-tier__days {
        grid-template-columns: repeat(15, minmax(0, 1fr));
        gap: 4px;
    }

    .pp-sm-tier__day {
        border-radius: 3px;
    }

    .pp-sm-tier__counts {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 16px;
        padding-top: 12px;
    }

    .pp-sm-tier__counts li {
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pp-js .pp-sm-cal__chips .pp-sm-chip,
    .pp-js .pp-sm-post__state:first-child,
    .pp-js .pp-sm-post__state--done {
        animation: none;
    }

    .pp-sm-tier {
        transition: none;
    }

    .pp-sm-tier:hover {
        transform: none;
    }
}
