/* Homepage SEO text (inc/sections/seo-content.php) and curated FAQ answers. */

.home-seo {
    margin-bottom: 100px;
    /* A #hair-transplant-turkey-guide link lands with the heading below the sticky header. */
    scroll-margin-top: 90px;
}

/* Stacked layout (phones, tablets, no JS) keeps a readable width; the desktop tab layout uses the full wrapper. */
.home-seo:not(.is-tabs) .wrapper {
    max-width: 960px;
}

.home-seo .title-center {
    margin-bottom: 40px;
}

.home-seo__card {
    position: relative;
    padding: 56px 64px 40px;
    border-radius: 40px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(41, 49, 54, 0.07);
}

.home-seo__body {
    position: relative;
    overflow: hidden;
    color: #4e5a65;
    font-size: 17px;
    line-height: 1.7;
    counter-reset: home-seo-part;
    transition: max-height 0.45s ease;
}

/* Each part: a numbered H3, then its paragraph(s). Parts after the first get a thin divider. */
.home-seo__body h3 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 16px;
    color: #1a1c1e;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    counter-increment: home-seo-part;
}

.home-seo__body h3::before {
    content: counter(home-seo-part, decimal-leading-zero);
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(45, 168, 231, 0.1);
    color: #2da8e7;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.home-seo__body > * + h3,
.home-seo__panel + .home-seo__panel {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #edf0f3;
}

.home-seo__body p + p,
.home-seo__body p + ul,
.home-seo__body p + ol,
.home-seo__body ul + p,
.home-seo__body ol + p {
    margin-top: 20px;
}

.home-seo__body strong,
.home-seo__body b {
    font-weight: 600;
    color: #1a1c1e;
}

.home-seo__body a,
.faq__item dd a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.home-seo__body a {
    color: #2da8e7;
}

.home-seo__body a:hover {
    color: #1a8fcc;
}

/* Collapsed: fade the end of the visible text into the card. */
.home-seo.is-collapsible .home-seo__body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    /* About the last two of the lines left showing (LINES in home-seo.js). */
    height: 64px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), #fff);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.home-seo.is-collapsible.is-open .home-seo__body::after {
    opacity: 0;
}

.home-seo__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px auto 0;
    padding: 13px 28px;
    border: 1px solid #2da8e7;
    border-radius: 90px;
    background: #fff;
    color: #2da8e7;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover only where a mouse is used: on phones a tap would leave the button stuck in its filled state. */
@media (hover: hover) {
    .home-seo__toggle:hover {
        background: #2da8e7;
        color: #fff;
    }
}

.home-seo__toggle:focus-visible {
    outline: 2px solid #2da8e7;
    outline-offset: 3px;
}

.home-seo__toggle[hidden] {
    display: none;
}

/* Chevron: points down, flips up when open. */
.home-seo__toggle-icon {
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease, margin 0.3s ease;
}

.home-seo__toggle[aria-expanded="true"] .home-seo__toggle-icon {
    margin-top: 4px;
    transform: rotate(-135deg);
}

/* ---- Desktop: topic list on the left, the chosen topic's text on the right (built by home-seo.js). ---- */
.home-seo__nav {
    display: none;
}

@media (min-width: 1024px) {
    /* Same width as the Contact Us block right above (.contact-us > .wrapper). */
    .home-seo.is-tabs .wrapper {
        max-width: 1380px;
    }

    .home-seo.is-tabs .home-seo__card {
        display: grid;
        grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
        align-items: center;
        padding: 56px;
    }

    .home-seo.is-tabs .home-seo__nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-inline-end: 48px;
    }

    .home-seo__tab {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
        padding: 16px 20px;
        border: 0;
        border-radius: 20px;
        background: transparent;
        color: #4e5a65;
        font: inherit;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.3;
        text-align: start;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .home-seo__tab-num {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(45, 168, 231, 0.1);
        color: #2da8e7;
        font-size: 15px;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .home-seo__tab.is-active {
        background: rgba(45, 168, 231, 0.08);
        color: #1a1c1e;
    }

    .home-seo__tab.is-active .home-seo__tab-num {
        background: #2da8e7;
        color: #fff;
    }

    .home-seo__tab:focus-visible {
        outline: 2px solid #2da8e7;
        outline-offset: 2px;
    }

    /* All panels share one grid cell, so the box is as tall as the longest part and never jumps. */
    .home-seo.is-tabs .home-seo__body {
        display: grid;
        overflow: visible;
        padding-inline-start: 56px;
        border-inline-start: 1px solid #edf0f3;
        font-size: 18px;
        line-height: 1.75;
    }

    .home-seo.is-tabs .home-seo__panel {
        grid-area: 1 / 1;
        /* Every part starts on the same line, so switching topics doesn't make the text jump. */
        align-self: start;
        margin: 0;
        padding: 0;
        border: 0;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    }

    .home-seo.is-tabs .home-seo__panel.is-active {
        visibility: visible;
        opacity: 1;
        transition: opacity 0.25s ease;
    }

    /* The tab already shows the part's title: keep the H3 for search engines and screen readers only. */
    .home-seo.is-tabs .home-seo__panel h3 {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (min-width: 1024px) and (hover: hover) {
    .home-seo__tab:not(.is-active):hover {
        background: #f4f7fa;
        color: #1a1c1e;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .home-seo.is-tabs .home-seo__card {
        grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
        padding: 44px 40px;
    }

    .home-seo.is-tabs .home-seo__nav {
        padding-inline-end: 32px;
    }

    .home-seo.is-tabs .home-seo__body {
        padding-inline-start: 40px;
        font-size: 17px;
    }
}

/* Curated FAQ answers can hold paragraphs and lists; the reset strips list markers. */
.faq__item dd p + p,
.faq__item dd p + ul,
.faq__item dd p + ol,
.faq__item dd ul + p,
.faq__item dd ol + p {
    margin-top: 14px;
}

.faq__item dd ul,
.faq__item dd ol,
.home-seo__body ul,
.home-seo__body ol {
    margin-top: 14px;
    padding-left: 24px;
}

.faq__item dd ul,
.home-seo__body ul {
    list-style: disc;
}

.faq__item dd ol,
.home-seo__body ol {
    list-style: decimal;
}

.faq__item dd li + li,
.home-seo__body li + li {
    margin-top: 8px;
}

.faq__item dd strong,
.faq__item dd b {
    font-weight: 600;
    color: #1a1c1e;
}

[dir="rtl"] .faq__item dd ul,
[dir="rtl"] .faq__item dd ol,
[dir="rtl"] .home-seo__body ul,
[dir="rtl"] .home-seo__body ol {
    padding-left: 0;
    padding-right: 24px;
}

@media (max-width: 1023px) {
    .home-seo {
        margin-bottom: 80px;
    }

    .home-seo .title-center {
        margin-bottom: 30px;
    }

    .home-seo__card {
        padding: 44px 40px 32px;
        border-radius: 32px;
    }
}

@media (max-width: 767px) {
    .home-seo {
        margin-bottom: 60px;
    }

    .home-seo .title-center {
        margin-bottom: 20px;
        padding: 0;
    }

    .home-seo__card {
        padding: 28px 20px 20px;
        border-radius: 24px;
    }

    .home-seo__body {
        font-size: 16px;
        line-height: 1.65;
    }

    .home-seo__body h3 {
        gap: 12px;
        margin-bottom: 12px;
        font-size: 19px;
    }

    .home-seo__body h3::before {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .home-seo__body > * + h3,
    .home-seo__panel + .home-seo__panel {
        margin-top: 28px;
        padding-top: 28px;
    }

    .home-seo__toggle {
        width: 100%;
        justify-content: center;
        margin-top: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-seo__body,
    .home-seo__body::after,
    .home-seo__toggle,
    .home-seo__toggle-icon,
    .home-seo__tab,
    .home-seo__tab-num,
    .home-seo__panel {
        transition: none !important;
    }
}
