/* Method pages — Розтяжки / Мануальна терапія / Безконтактний метод.
 * Variant 2 only, same approach as psychosomatics.css: the DB content is
 * untouched, this file re-skins the block markup it outputs. Loaded by page
 * slug so it works before the custom templates are assigned in wp-admin.
 *
 * The three pages share one block structure — dark hero (heading + square
 * artwork), an ivory card section built from two 2-column rows, then the
 * shared CTA appended by astra_child_append_method_cta(). */

html[data-design="2"] {
    --method-ink: #183b31;
    --method-muted: #53665f;
    --method-gold: #b58a37;
    --method-green: #064635;
    --method-cream: #fbf8f1;
    --method-line: rgba(6, 70, 53, 0.18);
}

html[data-design="2"] body #content,
html[data-design="2"] body .site-content,
html[data-design="2"] body #content > .ast-container,
html[data-design="2"] body #primary,
html[data-design="2"] body #main,
html[data-design="2"] body .site-main,
html[data-design="2"] body .ast-article-single,
html[data-design="2"] body .entry-content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* The <h1> duplicates the hero heading — keep it for SEO, hide it visually. */
html[data-design="2"] body .entry-header {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

html[data-design="2"] body .entry-content > .wp-block-spacer {
    display: none;
}

html[data-design="2"] body .entry-content > .alignfull {
    width: 100%;
    max-width: none;
    margin: 0 !important;
}

/* ---------------------------------------------------------------- hero -- */

html[data-design="2"] body .entry-content > .premium-gradient:first-child {
    position: relative;
    overflow: hidden;
    min-height: min(360px, calc(50vh - 48px));
    padding: clamp(36px, 3.75vw, 56px) 24px !important;
    background:
        radial-gradient(circle at 76% 46%, rgba(212, 173, 96, 0.16), transparent 50%),
        linear-gradient(135deg, #04362a 0%, #064635 58%, #0b5944 100%) !important;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child::before {
    content: "";
    display: block;
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    border: 0;
    background: radial-gradient(circle, rgba(212, 173, 96, 0.15) 0%, transparent 60%);
    animation: rotate-aura 25s linear infinite;
    z-index: 0;
    pointer-events: none;
}

/* Concentric gold rings, echoing the hero on the psychosomatics page. */
html[data-design="2"] body .entry-content > .premium-gradient:first-child::after {
    display: none;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
    align-items: center;
    gap: clamp(40px, 6.5vw, 100px);
    width: min(1180px, calc(100% - 48px));
    max-width: 1180px !important;
    margin: 0 auto !important;
    min-height: 260px;
    place-items: center;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div:first-child {
    align-items: flex-start !important;
    text-align: left;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div:first-child::before {
    content: none;
    display: none;
}

/* Gold eyebrow above the hero heading — the pages have no kicker of their
 * own, and the heading alone left the column top-heavy. */
html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div:first-child h2::before {
    content: "Метод БЕСТ";
    display: block;
    margin-bottom: 22px;
    color: var(--gold-muted);
    font-family: var(--sans-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child h2 {
    max-width: 640px;
    margin: 0 0 24px !important;
    color: var(--ivory-bg) !important;
    font-size: clamp(3rem, 5.4vw, 5.4rem) !important;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child p {
    max-width: 600px;
    margin: 0;
    color: #dce7df;
    font-size: clamp(1.04rem, 1.4vw, 1.24rem) !important;
    line-height: 1.7;
}

/* The DB copy hard-wraps with <br> at desktop widths that no longer apply. */
html[data-design="2"] body .entry-content > .premium-gradient:first-child p br {
    display: none;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child figure {
    position: relative;
    width: min(100%, 520px);
    margin: 0 auto !important;
    padding: 0;
    border: 1px solid rgba(212, 173, 96, 0.45);
    border-radius: 2px;
    background: var(--method-cream);
    box-shadow: 0 30px 64px rgba(0, 28, 21, 0.28);
}

/* Inset gold hairline, the same framing device the cards use. */
html[data-design="2"] body .entry-content > .premium-gradient:first-child figure::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(212, 173, 96, 0.35);
    pointer-events: none;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    object-fit: cover;
}

/* The DB points these at the production domain, which does not resolve in
 * local/dev — serve the theme's own copies instead. */
html[data-design="2"] body.page-slug-roztyazhky .entry-content > .premium-gradient:first-child img {
    content: url("assets/images/stretching-hero-glass-gold.png");
    box-sizing: border-box;
    padding: clamp(34px, 5vw, 58px);
    object-fit: contain;
    background:
        radial-gradient(circle at 50% 46%, rgba(220, 241, 228, 0.5), transparent 45%),
        var(--method-cream);
}

/* All three method pages now use a compact, text-led hero. The source image
 * column stays in WordPress content but is removed from the presentation. */
html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns {
    grid-template-columns: minmax(0, 900px);
    justify-content: center;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div:first-child {
    align-items: center !important;
    text-align: center;
    width: min(900px, 100%);
    margin-inline: auto;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns > div:last-child {
    display: none !important;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child h2,
html[data-design="2"] body .entry-content > .premium-gradient:first-child p {
    margin-left: auto !important;
    margin-right: auto !important;
}

html[data-design="2"] body.page-slug-manualna-terapiya .entry-content > .premium-gradient:first-child img {
    content: url("assets/images/approved/method-manual-therapy.jpg");
}

html[data-design="2"] body.page-slug-beskontaktnyj-metod .entry-content > .premium-gradient:first-child img {
    content: url("assets/images/approved/method-noncontact.jpg");
}

/* Безконтактний метод: use the same restrained rotating aura as the homepage
 * instead of a static illustration. The copy becomes the clear focal point. */
@keyframes method-hero-rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child h2::before {
    animation: method-hero-rise 0.8s ease 0.05s both;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child h2 {
    animation: method-hero-rise 0.9s ease 0.16s both;
}

html[data-design="2"] body .entry-content > .premium-gradient:first-child p {
    animation: method-hero-rise 0.9s ease 0.3s both;
}

/* ------------------------------------------------------------- effects -- */

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) {
    position: relative;
    padding: clamp(86px, 9vw, 130px) 24px !important;
    background:
        linear-gradient(rgba(6, 70, 53, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 70, 53, 0.05) 1px, transparent 1px),
        var(--method-cream) !important;
    background-size: 64px 64px !important;
}

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > * {
    width: min(1120px, 100%);
    margin-inline: auto !important;
}

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > .section-divider-gold {
    width: 72px;
    height: 3px;
    margin: 0 auto 26px !important;
    background: var(--method-gold);
}

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > h2 {
    max-width: 760px;
    margin: 0 auto 8px !important;
    color: var(--method-ink) !important;
    font-size: clamp(2.6rem, 4.6vw, 4.2rem) !important;
    line-height: 1;
}

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > .wp-block-columns {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    margin-top: 26px !important;
}

html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > .wp-block-columns:nth-of-type(2) {
    margin-top: 56px !important;
}

html[data-design="2"] body .premium-card-wrapper,
html[data-design="2"] body .premium-card {
    min-width: 0;
}

html[data-design="2"] body .premium-card {
    position: relative;
    display: grid !important;
    grid-template-columns: 124px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: center;
    column-gap: 28px;
    width: 100%;
    height: 100%;
    min-height: 210px;
    padding: 34px 36px !important;
    border: 1px solid var(--method-line) !important;
    border-radius: 2px !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 16px 42px rgba(6, 70, 53, 0.065);
    text-align: left;
    backdrop-filter: none;
    transform: translateY(0) !important;
    transition: transform 0.35s cubic-bezier(0.2, 0.75, 0.25, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

html[data-design="2"] body .premium-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(6, 70, 53, 0.08);
    pointer-events: none;
}

html[data-design="2"] body .premium-card .premium-icon {
    grid-row: 1 / 3;
    overflow: hidden;
    width: 124px;
    height: 124px;
    margin: 0 !important;
    border: 1px solid rgba(181, 138, 55, 0.35);
    border-radius: 50%;
    /* The source icons ship on their own off-white square — the round mask
     * plus a matching backdrop hides the seam instead of showing a tile. */
    background: var(--method-cream);
    transform: translateY(0) scale(1);
    transition: transform 0.42s cubic-bezier(0.2, 0.75, 0.25, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

html[data-design="2"] body .premium-card .premium-icon img {
    width: 100% !important;
    height: 100% !important;
    padding: 3px;
    object-fit: contain;
    box-sizing: border-box;
}

@media (hover: hover) {
    html[data-design="2"] body .premium-card:hover {
        transform: translateY(-7px) !important;
        border-color: rgba(181, 138, 55, 0.58) !important;
        box-shadow: 0 26px 60px rgba(6, 70, 53, 0.14);
    }

    html[data-design="2"] body .premium-card:hover .premium-icon {
        transform: translateY(-3px) scale(1.055);
        border-color: rgba(181, 138, 55, 0.7);
        box-shadow: 0 10px 24px rgba(6, 70, 53, 0.12);
    }
}

@keyframes method-card-reveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@supports (animation-timeline: view()) {
    html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) .premium-card-wrapper {
        animation: method-card-reveal linear both;
        animation-timeline: view();
        animation-range: entry 4% cover 27%;
    }

    html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) .premium-card-wrapper:nth-child(2) {
        animation-range: entry 9% cover 32%;
    }
}

/* Card icons come from the shared line-art set (assets/icons/line), sliced
 * from the 4x4 sheet by design/process-line-icons.py. The DB markup points at
 * the four old 3D icons and repeats them across all three pages, so each card
 * is addressed by position instead: row 1 is the second <div> in the section,
 * row 2 the third. */
html[data-design="2"] body .premium-card .premium-icon img {
    content: url("assets/icons/glass-gold/noncontact.webp");
}

html[data-design="2"] body.page-slug-roztyazhky .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/stretching.webp");
}

html[data-design="2"] body.page-slug-roztyazhky .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/lymph-drainage-hands.png");
}

html[data-design="2"] body.page-slug-roztyazhky .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/relaxation-rest.png");
}

html[data-design="2"] body.page-slug-roztyazhky .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/stagnation-relief.png");
}

html[data-design="2"] body.page-slug-manualna-terapiya .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/neck-shoulders.webp");
}

html[data-design="2"] body.page-slug-manualna-terapiya .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/trigger-points-muscle.png");
}

html[data-design="2"] body.page-slug-manualna-terapiya .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/pelvis.webp");
}

html[data-design="2"] body.page-slug-manualna-terapiya .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/manual-correction.webp");
}

html[data-design="2"] body.page-slug-beskontaktnyj-metod .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/energy-balance-scales.png");
}

html[data-design="2"] body.page-slug-beskontaktnyj-metod .bg-subtle-ivory > .wp-block-columns:nth-of-type(2) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/stress-relief-rest.png");
}

html[data-design="2"] body.page-slug-beskontaktnyj-metod .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:first-child img {
    content: url("assets/icons/glass-gold/subtle-senses-wave.png");
}

html[data-design="2"] body.page-slug-beskontaktnyj-metod .bg-subtle-ivory > .wp-block-columns:nth-of-type(3) .premium-card-wrapper:nth-child(2) img {
    content: url("assets/icons/glass-gold/harmonization-energy.png");
}

html[data-design="2"] body .premium-card h3 {
    align-self: end;
    margin: 0 0 10px !important;
    color: var(--method-ink) !important;
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.08;
}

html[data-design="2"] body .premium-card p {
    align-self: start;
    margin: 0 !important;
    color: var(--method-muted);
    font-size: 0.98rem;
    line-height: 1.62;
}

/* ----------------------------------------------------------------- cta -- */

html[data-design="2"] body .method-cta {
    padding: clamp(72px, 8vw, 110px) 24px !important;
    background: var(--method-green) !important;
}

html[data-design="2"] body .method-cta > * {
    width: min(760px, 100%);
    margin-inline: auto !important;
}

html[data-design="2"] body .method-cta .section-divider-gold {
    width: 54px;
    height: 3px;
    margin: 0 auto 24px !important;
    background: var(--method-gold);
}

html[data-design="2"] body .method-cta h3 {
    color: #fff8ef !important;
    font-size: clamp(2rem, 3.6vw, 3.2rem);
}

html[data-design="2"] body .method-cta p {
    color: #dce7df !important;
    font-size: 1.08rem;
    line-height: 1.7;
}

html[data-design="2"] body .method-cta .wp-block-button__link {
    display: inline-block;
    min-height: 50px;
    padding: 14px 30px;
    border: 1px solid var(--gold-muted);
    background: var(--gold-muted) !important;
    color: #10261f !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}

html[data-design="2"] body .method-cta .wp-block-button__link:hover {
    background: transparent !important;
    color: var(--gold-muted) !important;
}

html[data-design="2"] body .method-cta .wp-block-button__link:focus-visible {
    outline: 3px solid var(--gold-muted);
    outline-offset: 4px;
}

/* -------------------------------------------------------- breakpoints --- */

@media (max-width: 900px) {
    html[data-design="2"] body .entry-content > .premium-gradient:first-child {
        min-height: auto;
        padding: 42px 22px 36px !important;
        background:
            radial-gradient(circle at 50% 74%, rgba(212, 173, 96, 0.16), transparent 46%),
            linear-gradient(160deg, #04362a 0%, #064635 66%, #0b5944 100%) !important;
    }

    html[data-design="2"] body .entry-content > .premium-gradient:first-child::after {
        display: none;
    }

    html[data-design="2"] body .entry-content > .premium-gradient:first-child > .wp-block-columns {
        grid-template-columns: 1fr;
        width: min(680px, 100%);
        gap: 44px;
    }

    html[data-design="2"] body .entry-content > .premium-gradient:first-child h2 {
        font-size: clamp(2.9rem, 10vw, 4.8rem) !important;
    }

    html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > .wp-block-columns {
        grid-template-columns: 1fr;
    }

    html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) > .wp-block-columns:nth-of-type(3) {
        margin-top: 26px !important;
    }
}

@media (max-width: 600px) {
    html[data-design="2"] body .entry-content > .bg-subtle-ivory:not(.method-cta) {
        padding: 72px 16px !important;
    }

    html[data-design="2"] body .premium-card {
        grid-template-columns: 76px minmax(0, 1fr);
        column-gap: 18px;
        min-height: 170px;
        padding: 26px 22px !important;
    }

    html[data-design="2"] body .premium-card .premium-icon {
        width: 76px;
        height: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-design="2"] body .entry-content > .premium-gradient:first-child::before,
    html[data-design="2"] body .entry-content > .premium-gradient:first-child h2::before,
    html[data-design="2"] body .entry-content > .premium-gradient:first-child h2,
    html[data-design="2"] body .entry-content > .premium-gradient:first-child p {
        animation: none !important;
    }

    html[data-design="2"] body .premium-card,
    html[data-design="2"] body .premium-card .premium-icon,
    html[data-design="2"] body .premium-card-wrapper,
    html[data-design="2"] body .method-cta .wp-block-button__link {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
