/* ==========================================================================
   TOPIC PAGES — 토픽 클러스터 페이지 (Phase 2 / GEO 자산)
   /topics/geo/  /topics/b2b-website/  /topics/technical-seo/
   /topics/schema-markup/  /topics/ai-citation/
   ========================================================================== */

.topic {
    --tp-bg:           #FFFFFF;
    --tp-bg-soft:      #F8FAFC;
    --tp-ink:          #0F172A;
    --tp-ink-2:        #475569;
    --tp-ink-3:        #64748B;
    --tp-rule:         #E2E8F0;
    --tp-rule-soft:    #F1F5F9;
    --tp-accent:       #2563EB;
    --tp-accent-soft:  rgba(37, 99, 235, 0.08);
    background: var(--tp-bg);
    color: var(--tp-ink);
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
}

.topic__container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 80px);
}


/* ━━━ HERO ━━━ */
.topic-hero {
    padding: clamp(100px, 14vh, 160px) 0 clamp(60px, 8vh, 100px);
    border-bottom: 1px solid var(--tp-rule);
}

.topic-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    color: var(--tp-ink-3);
    margin-bottom: 32px;
    letter-spacing: 0.02em;
}

.topic-hero__breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: color 160ms ease;
}

.topic-hero__breadcrumb a:hover {
    color: var(--tp-accent);
}

.topic-hero__breadcrumb svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.5;
}

.topic-hero__eyebrow {
    display: inline-block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.topic-hero__title {
    font-family: 'Pretendard Variable', sans-serif;
    font-size: clamp(40px, 6vw, 76px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.045em;
    color: var(--tp-ink);
    margin: 0 0 28px;
    max-width: 18ch;
    text-wrap: balance;
}

.topic-hero__title em {
    font-style: normal;
    color: var(--tp-accent);
}

.topic-hero__lead {
    font-size: clamp(16px, 1.4vw, 19px);
    font-weight: 400;
    color: var(--tp-ink-2);
    line-height: 1.7;
    max-width: 60ch;
    margin: 0 0 36px;
    letter-spacing: -0.005em;
}

.topic-hero__lead strong {
    color: var(--tp-ink);
    font-weight: 700;
}

.topic-hero__meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 28px;
    border-top: 1px dashed var(--tp-rule);
}

.topic-hero__meta-item {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.topic-hero__meta-label {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--tp-ink-3);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.topic-hero__meta-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--tp-ink);
    letter-spacing: -0.01em;
}

.topic-hero__meta-value--num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--tp-accent);
    line-height: 1;
}


/* ━━━ DEFINITION ━━━ */
.topic-def {
    padding: clamp(72px, 10vh, 120px) 0;
    background: var(--tp-bg-soft);
    border-bottom: 1px solid var(--tp-rule);
}

.topic-def__grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
}

.topic-def__sticky {
    position: sticky;
    top: 100px;
}

.topic-def__eyebrow {
    display: block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.topic-def__eyebrow-note {
    font-size: 13px;
    color: var(--tp-ink-3);
    margin: 0;
}

.topic-def__items {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.topic-def__item {
    padding: 32px 0;
    border-bottom: 1px solid var(--tp-rule);
}

.topic-def__item:first-child { padding-top: 0; }
.topic-def__item:last-child  { border-bottom: 0; padding-bottom: 0; }

.topic-def__term {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.topic-def__term-key {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 400;
    color: var(--tp-ink);
    letter-spacing: -0.01em;
    line-height: 1;
}

.topic-def__term-trans {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tp-ink-3);
    letter-spacing: -0.005em;
}

.topic-def__desc {
    font-size: 15.5px;
    color: var(--tp-ink-2);
    line-height: 1.75;
    margin: 0;
}

.topic-def__desc strong {
    color: var(--tp-ink);
    font-weight: 700;
}


/* ━━━ ARTICLES (관련 글 그리드) ━━━ */
.topic-articles {
    padding: clamp(72px, 10vh, 120px) 0;
}

.topic-articles__header {
    margin-bottom: clamp(40px, 5vh, 64px);
}

.topic-articles__eyebrow {
    display: inline-block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.topic-articles__title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 800;
    color: var(--tp-ink);
    letter-spacing: -0.035em;
    margin: 0 0 12px;
    line-height: 1.2;
}

.topic-articles__sub {
    font-size: 15px;
    color: var(--tp-ink-2);
    line-height: 1.65;
    max-width: 56ch;
    margin: 0;
}

.topic-articles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
}

.topic-article-card {
    display: flex;
    flex-direction: column;
    padding: 28px 28px 24px;
    background: var(--tp-bg);
    border: 1px solid var(--tp-rule);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 240ms ease, border-color 240ms ease;
}

.topic-article-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.30);
    box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.10);
}

.topic-article-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.topic-article-card__cat {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--tp-accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.topic-article-card__date {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11px;
    color: var(--tp-ink-3);
    letter-spacing: 0.01em;
}

.topic-article-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--tp-ink);
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin: 0 0 12px;
    text-wrap: balance;
}

.topic-article-card__desc {
    font-size: 13.5px;
    color: var(--tp-ink-2);
    line-height: 1.65;
    margin: 0 0 18px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-article-card__arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-ink-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: auto;
}

.topic-article-card:hover .topic-article-card__arrow {
    color: var(--tp-accent);
}

.topic-article-card__arrow svg {
    transition: transform 200ms ease;
}

.topic-article-card:hover .topic-article-card__arrow svg {
    transform: translateX(3px);
}


/* ━━━ FAQ ━━━ */
.topic-faq {
    padding: clamp(72px, 10vh, 120px) 0;
    background: var(--tp-bg-soft);
    border-top: 1px solid var(--tp-rule);
    border-bottom: 1px solid var(--tp-rule);
}

.topic-faq__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
}

.topic-faq__sticky {
    position: sticky;
    top: 100px;
}

.topic-faq__eyebrow {
    display: block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.topic-faq__title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 800;
    color: var(--tp-ink);
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin: 0;
    text-wrap: balance;
}

.topic-faq__items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.topic-faq__item {
    border-bottom: 1px solid var(--tp-rule);
    padding: 24px 0;
}

.topic-faq__item:first-child { padding-top: 0; }
.topic-faq__item:last-child  { border-bottom: 0; padding-bottom: 0; }

.topic-faq__q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    color: var(--tp-ink);
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.topic-faq__q-icon {
    flex-shrink: 0;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 18px;
    color: var(--tp-accent);
    font-weight: 700;
    transition: transform 200ms ease;
    width: 16px;
    text-align: center;
}

.topic-faq__item[open] .topic-faq__q-icon {
    transform: rotate(45deg);
}

.topic-faq__a {
    padding-top: 14px;
    font-size: 15px;
    color: var(--tp-ink-2);
    line-height: 1.75;
    margin: 0;
}

.topic-faq__a strong {
    color: var(--tp-ink);
    font-weight: 600;
}

.topic-faq__a a {
    color: var(--tp-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}


/* ━━━ CTA ━━━ */
.topic-cta {
    padding: clamp(72px, 10vh, 120px) 0;
    text-align: center;
}

.topic-cta__title {
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 800;
    color: var(--tp-ink);
    letter-spacing: -0.045em;
    line-height: 1.15;
    margin: 0 0 18px;
    text-wrap: balance;
}

.topic-cta__sub {
    font-size: 15.5px;
    color: var(--tp-ink-2);
    line-height: 1.7;
    max-width: 48ch;
    margin: 0 auto 36px;
}

.topic-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--tp-ink);
    border: 0;
    border-radius: 999px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.005em;
    transition: background 200ms ease, gap 200ms ease;
}

.topic-cta__btn:hover {
    background: var(--tp-accent);
    gap: 14px;
}


/* ━━━ RELATED TOPICS (다른 토픽 인터링킹) ━━━ */
.topic-related {
    padding: 64px 0 100px;
    border-top: 1px solid var(--tp-rule);
}

.topic-related__eyebrow {
    display: block;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tp-ink-3);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.topic-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.topic-related__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: var(--tp-bg);
    border: 1px solid var(--tp-rule);
    border-radius: 8px;
    text-decoration: none;
    color: var(--tp-ink);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.topic-related__link:hover {
    border-color: var(--tp-accent);
    color: var(--tp-accent);
    background: var(--tp-accent-soft);
}

.topic-related__link svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 200ms ease, opacity 200ms ease;
}

.topic-related__link:hover svg {
    opacity: 1;
    transform: translateX(3px);
}


/* ━━━ Tablet ━━━ */
@media (max-width: 980px) {
    .topic-def__grid,
    .topic-faq__layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .topic-def__sticky,
    .topic-faq__sticky {
        position: relative;
        top: auto;
    }
}

@media (max-width: 600px) {
    .topic-articles__grid {
        grid-template-columns: 1fr;
    }
    .topic-hero__meta {
        gap: 18px;
    }
}


/* ━━━ Reduced motion ━━━ */
@media (prefers-reduced-motion: reduce) {
    .topic-article-card,
    .topic-article-card__arrow svg,
    .topic-related__link svg { transition: none; }
    .topic-article-card:hover { transform: none; }
}
