/**
 * 서비스 소개 정책·RSS 풀페이지 — 퍼블 custom.css(.policy_pop / .rss_pop) 재사용.
 * 이력 셀렉트·iframe 스타일은 pub sync 시 custom.css 에서 빠질 수 있어 여기(프로젝트 CSS)에 둔다.
 * (백업: _pub_sync_backup_20260728_125120/css/custom.css)
 */

#contents:has(> .intro-policy) {
    padding-bottom: var(--row-gap-md, 2rem);
}

/* 풀페이지: 팝업 오버레이(.ly_pop) 없이 .policy_pop / .rss_pop 토큰만 사용 */
.intro-policy > .policy_pop,
.intro-policy > .rss_pop {
    position: static;
    display: block;
    width: 100%;
    max-width: 960px;
    margin: 0;
    padding: 0;
    background: transparent;
    inset: auto;
}

.intro-policy > .policy_pop .pop_content_box,
.intro-policy > .rss_pop .rss_page_body {
    display: flex;
    flex-direction: column;
    gap: var(--row-gap-sl, 1.5rem);
}

/* ── 이력 HTML / 커스텀 셀렉트 (이전 수정 복구) ── */
.policy_pop .policy_history_view {
    flex: 1;
    width: 100%;
    min-height: 15rem;
    background: var(--gray-0, #fff);
}

.policy_pop .policy_history_frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 15rem;
    border: 1px solid var(--alpha-g30, #d0d5dd);
    border-radius: var(--radius-04, 4px);
    background: var(--gray-0, #fff);
}

/* 풀페이지는 이력 iframe 높이를 더 확보 */
.intro-policy > .policy_pop .policy_history_frame {
    min-height: 70vh;
}

.policy_pop .policy_history_control {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-top: var(--row-gap-sl, 1.5rem);
}

.policy_pop .policy_select_wrap {
    position: relative;
    width: 100%;
}

.policy_pop .policy_select_trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.625rem 1rem;
    border: 1px solid var(--alpha-g30, #d0d5dd);
    border-radius: var(--radius-04, 4px);
    background: var(--gray-0, #fff);
    color: var(--gray-80, #344054);
    font-size: var(--text-15, 0.9375rem);
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.policy_pop .policy_select_trigger:focus {
    border-color: var(--primary-50, #2e90fa);
    outline: 2px solid var(--primary-50, #2e90fa);
    outline-offset: 1px;
}

.policy_pop .policy_select_arrow {
    width: 0.625rem;
    height: 0.625rem;
    border: 1px solid var(--gray-80, #344054);
    border-width: 0 1px 1px 0;
    rotate: 45deg;
    transition: rotate 0.2s ease;
    flex-shrink: 0;
    translate: 0 -2px;
}

.policy_pop .policy_select_trigger[aria-expanded="true"] .policy_select_arrow {
    rotate: 225deg;
    translate: 0 3px;
}

.policy_pop .policy_select_options {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    left: 0;
    z-index: 30;
    max-height: min(17rem, 45vh);
    padding: 0.375rem;
    overflow-y: auto;
    border: 1px solid var(--alpha-g30, #d0d5dd);
    border-radius: var(--radius-08, 8px);
    background: var(--gray-0, #fff);
    box-shadow: var(--shadow-05, 0 4px 16px rgba(16, 24, 40, 0.12));
    list-style: none;
    margin: 0;
}

.policy_pop .policy_select_options[hidden] {
    display: none;
}

.policy_pop .policy_select_option {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: var(--radius-04, 4px);
    background: transparent;
    color: var(--gray-80, #344054);
    font-size: var(--text-15, 0.9375rem);
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.policy_pop .policy_select_option:hover,
.policy_pop .policy_select_option:focus {
    background: var(--primary-10, #eff8ff);
    outline: none;
}

.policy_pop .policy_select_option[aria-selected="true"] {
    background: var(--primary-20, #d1e9ff);
    color: var(--primary-70, #175cd3);
    font-weight: 700;
}

/* 저작권 관계법령 (풀페이지) */
.intro-policy-laws {
    margin-top: 1.25rem;
    font-size: var(--text-15, 0.9375rem);
    line-height: 1.6;
}

.intro-policy-laws a {
    color: var(--primary-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* 메인·메가메뉴 축소 비율에 맞춘 정책·RSS 본문 밀도 */
#container:has(> #contents > .intro-policy) {
    padding-bottom: 0;
}

#contents:has(> .intro-policy) {
    padding-bottom: 36px;
}

.intro-policy > .policy_pop .pop_content_box,
.intro-policy > .rss_pop .rss_page_body {
    gap: 20px;
}

.intro-policy > .policy_pop .policy_cont h4,
.intro-policy > .rss_pop h4 {
    font-size: var(--text-20);
}

.intro-policy > .policy_pop .policy_section h5 {
    font-size: var(--text-17);
}

/* 풀페이지 목차만. 이 스타일은 팝업 페이지에 로드되지 않는다.
   스크립트가 헤더 높이를 재고, 스크립트 전 해시 이동은 이 여백으로 제목이 헤더에 가리지 않게 한다. */
#introPrivacyRoot .policy_section :is(h4, h5)[id] {
    scroll-margin-top: 11rem;
}

.intro-policy > .policy_pop .policy_history_control {
    margin-top: 20px;
}

@media (max-width: 640px) {
    #contents:has(> .intro-policy) {
        padding-bottom: 28px;
    }

    .intro-policy > .policy_pop .pop_content_box,
    .intro-policy > .rss_pop .rss_page_body {
        gap: 16px;
    }
}

/* 직접 연 RSS 페이지에도 Footer 팝업과 같은 콘텐츠 박스·타이포그래피를 적용한다. */
#rssGuidePage > .rss_pop {
    max-width: 1280px;
    margin-inline: auto;
    border-radius: var(--radius-24);
    background: var(--gray-0);
    box-shadow: var(--shadow-06);
}
#rssGuidePage .rss_page_body {
    padding: clamp(12px, 2vw, 24px) clamp(20px, 3vw, 32px);
}
#rssGuidePage .rss_cont {
    padding: clamp(12px, 2.2vw, 24px);
    border-radius: var(--radius-08);
    background: var(--gray-5);
}
#rssGuidePage h4 {
    font-size: var(--text-22);
}

/*
 * 본문 제목 단계 보정(2026-10-26): 화면 본문 대주제를 왼쪽 메뉴 제목(h3)과 같은 단계로 h4→h3, 하위 항목 h5→h4.
 * 공통 팝업(.ly_pop) 안의 같은 내용은 h4/h5 그대로라 기존 규칙을 쓰고, 화면(#contents)에서만 같은 모양을 h3/h4 에 준다.
 */
#contents .policy_pop .policy_cont h3 { font-size: var(--text-20); color: var(--gray-80); font-weight: 700; }
/* 목차 링크로 이동한 제목이 sticky 헤더에 가려지지 않도록(--header-h 는 header.js 가 갱신) */
#contents .policy_pop .policy_cont h3[id] { scroll-margin-top: calc(var(--header-h, 150px) + 1rem); }
#contents .policy_pop .policy_section h4.policy_h6 { font-size: var(--text-17); color: var(--gray-80); font-weight: 700; line-height: inherit; scroll-margin-top: 0; }
#contents .rss_pop h3 { font-size: var(--text-22); color: var(--gray-90); font-weight: 700; line-height: 1.35; }
#contents .policy_pop .policy_history_control > h3 { font-size: 1em; }
