/**
 * Clinic Promo Framework — styles for sticky / mid / end placements.
 *
 * Visual posture is uniform across verticals — no per-vertical color
 * overrides (architecture.md "out of scope"). Approved CIHOS palette
 * from CLAUDE.md.
 *
 * Sticky bar: ≤64px, position:fixed declared here (NOT in JS) so the
 * bar is in its final position from initial paint — zero CLS for
 * Core Web Vitals (ivf.md §SEO guardrails risk #3).
 */

:root {
    --cihos-promo-blue: #2B7ACC;
    --cihos-promo-blue-dark: #1F5FA0;
    --cihos-promo-blue-darker: #18497C;
    /* Warmed pale blue (vs #E8F1FA in CLAUDE.md) — less cyan, sits more
       comfortably next to the body type on long-form articles. */
    --cihos-promo-pale: #EEF4FA;
    --cihos-promo-pale-strong: #E3EEF8;
    --cihos-promo-ring: #D6E3F0;
    --cihos-promo-heading: #3F4153;
    --cihos-promo-body: #111111;
    --cihos-promo-muted: #6B6D7D;
    --cihos-promo-border: #D5D5D5;
}

.cihos-clinic-promo {
    font-family: inherit;
    box-sizing: border-box;
}
.cihos-clinic-promo *,
.cihos-clinic-promo *::before,
.cihos-clinic-promo *::after {
    box-sizing: border-box;
}

/* ---------- Shared element styles ---------- */

.cihos-clinic-promo__attribution {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 4px 10px 4px 8px;
    background: rgba(43, 122, 204, 0.08);
    color: var(--cihos-promo-blue-dark);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    border-radius: 999px;
}
.cihos-clinic-promo__cred-icon {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    color: var(--cihos-promo-blue);
}

p.cihos-clinic-promo__headline {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--cihos-promo-heading);
    font-size: 20px;
}

.cihos-clinic-promo__subhead {
    margin: 0 0 16px;
    line-height: 1.5;
    color: var(--cihos-promo-body);
    font-size: 15px;
}

/* CTA pill — uses inline SVG arrow that translates on hover. */
.cihos-clinic-promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cihos-promo-blue);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 22px;
    border-radius: 999px;
    line-height: 1.2;
    transition: background-color 0.18s ease, transform 0.05s ease, box-shadow 0.18s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(24, 73, 124, 0.18);
}
.cihos-clinic-promo__cta:hover,
.cihos-clinic-promo__cta:focus {
    background: var(--cihos-promo-blue-dark);
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 3px 14px rgba(24, 73, 124, 0.24);
}
.cihos-clinic-promo__cta:active {
    transform: translateY(1px);
}
.cihos-clinic-promo__arrow {
    width: 14px;
    height: 12px;
    flex: 0 0 14px;
    transition: transform 0.18s ease;
}
.cihos-clinic-promo__cta:hover .cihos-clinic-promo__arrow,
.cihos-clinic-promo__cta:focus .cihos-clinic-promo__arrow {
    transform: translateX(3px);
}

/* ---------- Mid-article card (BOFU only via mid_card_stages) ---------- */

.cihos-clinic-promo--mid {
    position: relative;
    background: var(--cihos-promo-pale);
    border-radius: 10px;
    padding: 22px 24px 24px;
    margin: 32px 0;
    box-shadow: inset 0 0 0 1px var(--cihos-promo-ring);
    animation: cihos-promo-rise 480ms cubic-bezier(0.2, 0.7, 0.2, 1) 180ms both;
}
.cihos-clinic-promo--mid::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    background: var(--cihos-promo-blue);
    border-radius: 0 3px 3px 0;
}
.cihos-clinic-promo--mid p.cihos-clinic-promo__headline {
    font-size: 20px;
}

@keyframes cihos-promo-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .cihos-clinic-promo--mid { animation: none; }
    .cihos-clinic-promo__arrow { transition: none; }
}

/* Chips — visibly tappable. Subtle under-shadow to lift off the card,
   right-side chevron via ::after to signal "this leads somewhere." */
.cihos-clinic-promo__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}
.cihos-clinic-promo__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #C4DCF1;
    color: var(--cihos-promo-heading) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    line-height: 1.3;
    box-shadow: 0 1px 0 rgba(108, 142, 178, 0.12);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.cihos-clinic-promo__chip::after {
    content: '›';
    font-weight: 600;
    color: var(--cihos-promo-blue);
    transition: transform 0.15s ease, color 0.15s ease;
    font-size: 15px;
    line-height: 1;
}
.cihos-clinic-promo__chip:hover,
.cihos-clinic-promo__chip:focus {
    background: var(--cihos-promo-blue);
    border-color: var(--cihos-promo-blue);
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(24, 73, 124, 0.16);
}
.cihos-clinic-promo__chip:hover::after,
.cihos-clinic-promo__chip:focus::after {
    color: #fff;
    transform: translateX(2px);
}

/* ---------- End-of-article block (after byline, before related posts) ----------
 *
 * Uses the same pale-blue + accent-rail pattern as the mid card so the
 * unit reads as one editorial family instead of two competing CTAs.
 * Differentiated from mid by:
 *   - Thicker accent rail in a darker blue
 *   - Larger headline (22px vs 20px) with more breathing room
 *   - Full-width CTA bar on mobile (commits the reader)
 */

.cihos-clinic-promo--end {
    position: relative;
    background: var(--cihos-promo-pale-strong);
    border-radius: 12px;
    padding: 26px 28px 28px;
    margin: 40px 0 28px;
    box-shadow: inset 0 0 0 1px var(--cihos-promo-ring);
}
.cihos-clinic-promo--end::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 4px;
    background: var(--cihos-promo-blue-dark);
    border-radius: 0 4px 4px 0;
}
.cihos-clinic-promo--end p.cihos-clinic-promo__headline {
    font-size: 22px;
    margin-bottom: 10px;
}
.cihos-clinic-promo--end .cihos-clinic-promo__subhead {
    color: #2b2c39;
    max-width: 540px;
    margin-bottom: 20px;
}

/* ---------- Editorial disclosure (above end card) ----------
 *
 * Small italic note for comparison/objective articles where Ciputra is
 * listed alongside competitors. Renders only when the per-post
 * `_clinic_promo_disclosure` meta is set. Muted styling — readable but
 * not competing with the end CTA visually. The icon anchors it as a
 * formal disclosure, not body copy.
 */

.cihos-clinic-promo-disclosure {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 40px 0 -12px; /* pulls into the end card's top margin */
    padding: 12px 16px;
    border-left: 3px solid var(--cihos-promo-ring, #d5d5d5);
    background: #f9f9f9;
    color: #5b5c66;
    font-size: 13px;
    font-style: italic;
    line-height: 1.55;
    border-radius: 0 6px 6px 0;
}
.cihos-clinic-promo-disclosure__icon {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    color: #8b8c8d;
}
.cihos-clinic-promo-disclosure p {
    margin: 0;
}

/* ---------- Sticky bottom CTA (mobile only) ----------
 *
 * Single line, ellipsized. No subhead — illegible at 11px on small
 * phones. Min-width on CTA so it doesn't get crushed by long headlines.
 */

.cihos-clinic-promo--sticky {
    display: none; /* hidden on desktop — shown on mobile via @media */
}

@media (max-width: 767px) {
    .cihos-clinic-promo--sticky {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        background: #fff;
        border-top: 1px solid var(--cihos-promo-border);
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        max-height: 64px;
    }
    .cihos-clinic-promo--sticky .cihos-clinic-promo__body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .cihos-clinic-promo--sticky p.cihos-clinic-promo__headline {
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.25;
        letter-spacing: 0;
        margin: 0;
        color: var(--cihos-promo-heading);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .cihos-clinic-promo--sticky .cihos-clinic-promo__cta {
        flex: 0 0 auto;
        min-width: 132px;
        justify-content: center;
        font-size: 13px;
        padding: 9px 14px;
        white-space: nowrap;
        box-shadow: 0 2px 6px rgba(24, 73, 124, 0.18);
    }
    .cihos-clinic-promo--sticky .cihos-clinic-promo__close {
        background: transparent;
        border: none;
        color: var(--cihos-promo-muted);
        font-size: 22px;
        line-height: 1;
        padding: 6px 4px;
        margin: 0;
        cursor: pointer;
        flex: 0 0 auto;
    }
    .cihos-clinic-promo--sticky .cihos-clinic-promo__close:hover {
        color: var(--cihos-promo-body);
    }
    /* Give the body some bottom space so sticky doesn't cover article tail. */
    body.single-post {
        padding-bottom: 64px;
    }
}

/* ---------- Small-screen tweaks for in-content units ---------- */

@media (max-width: 480px) {
    .cihos-clinic-promo--mid {
        padding: 20px 18px 22px;
        margin: 26px 0;
        border-radius: 8px;
    }
    .cihos-clinic-promo--mid p.cihos-clinic-promo__headline {
        font-size: 18px;
    }
    .cihos-clinic-promo--end {
        padding: 22px 18px 24px;
        margin: 32px 0 22px;
        border-radius: 10px;
    }
    .cihos-clinic-promo--end p.cihos-clinic-promo__headline {
        font-size: 20px;
    }
    /* End-block CTA goes full-width on mobile — committing finger-friendly
       target after a long read. */
    .cihos-clinic-promo--end .cihos-clinic-promo__cta {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 14px 22px;
        font-size: 15px;
    }
}
