.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    background: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 min(3.125vw, 60px);
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: min(14.89vw, 286px);
    aspect-ratio: 286 / 30;
}

.logo picture {
    display: contents;
}

.logo-mark {
    width: 100%;
    height: 100%;
}

.gnb-list {
    display: flex;
    align-items: center;
    gap: min(4.166vw, 80px);
    height: 100px;
}

.gnb-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.gnb-link {
    display: block;
    padding: 0 10px;
    font-size: var(--font-20);
    line-height: 1.6;
    letter-spacing: -0.4px;
    text-align: center;
    color: var(--brand-500);
    white-space: nowrap;
    transition: color 0.2s ease;
}

/* 지금 보고 있는 페이지의 메뉴 — layout/header.php 가 getSubTop() 으로 판정해 .is-active 를 붙인다.
   상세 페이지(view.php 등)처럼 2뎁스가 안 잡혀도 같은 폴더면 1뎁스는 켜진다.
   활성 색은 사이트 공통 관용구(서브탑 브레드크럼 등)와 같은 포인트 하늘색. */
.gnb-link.is-active {
    font-weight: 600;
    color: var(--brand-point-sky-blue);
}

.gnb-dropdown {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: absolute;
    top: 100%;
    left: 0;
    padding: 20px;
    background: #fff;
    z-index: 10;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.3s ease;
}

.gnb-item-has-dropdown:hover .gnb-dropdown,
.gnb-item-has-dropdown:focus-within .gnb-dropdown {
    clip-path: inset(0 0 0 0);
}

.gnb-dropdown-link {
    font-size: var(--font-18);
    line-height: 1.6;
    letter-spacing: -0.36px;
    color: var(--brand-500);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.gnb-dropdown-link:hover {
    color: var(--brand-100);
}

.gnb-dropdown-link.is-active {
    font-weight: 600;
    color: var(--brand-point-sky-blue);
}

.gnb-dropdown-divider {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--brand-200);
}

.login {
    padding: 0 10px;
    font-size: var(--font-20);
    line-height: 1.6;
    letter-spacing: -0.4px;
    color: var(--brand-500);
    flex-shrink: 0;
}

.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-user-btn img {
    width: 22px;
    height: 22px;
}

.mobile-menu-toggle {
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-menu-toggle-line {
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    border-radius: 1px;
    background: var(--brand-500);
    transition:
        top 0.3s ease,
        transform 0.3s ease,
        opacity 0.3s ease;
}

.mobile-menu-toggle-line-top {
    top: 4px;
}

.mobile-menu-toggle-line-mid {
    top: 11px;
}

.mobile-menu-toggle-line-bottom {
    top: 18px;
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line-top {
    top: 11px;
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line-mid {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line-bottom {
    top: 11px;
    transform: rotate(-45deg);
}

.mobile-nav {
    display: none;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 60px;
    padding: 0 24px;
    background: var(--white);
    border: none;
    border-bottom: 1px solid #dedede;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    text-align: left;
    color: var(--brand-500);
    cursor: pointer;
}

.mobile-nav-link.is-active {
    font-weight: 600;
    color: var(--brand-point-sky-blue);
}

.mobile-nav-link-plain {
    text-decoration: none;
}

.mobile-nav-chevron {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.mobile-nav-link[aria-expanded="true"] .mobile-nav-chevron {
    transform: rotate(-90deg);
}

.mobile-nav-sub {
    max-height: 0;
    overflow: hidden;
    background: #f6f6f6;
    transition: max-height 0.3s ease;
}

.mobile-nav-sub-link {
    display: block;
    padding: 15px 23px;
    border-bottom: 1px solid #dedede;
    font-size: 15px;
    font-weight: 300;
    color: #0b3a5a;
    text-decoration: none;
}

.mobile-nav-sub-link.is-active {
    font-weight: 600;
    color: var(--brand-point-sky-blue);
}

.mobile-nav-sub-link:last-child {
    border-bottom: none;
}

.footer {
    background: var(--brand-500);
    padding: 80px min(3.125vw, 60px) 40px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 80px;
    max-width: 1920px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 14.667px;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 0.6;
}

.footer-logo-mark {
    width: 419px;
    height: 44px;
}

.footer-logo-text {
    font-family: "Pretendard Variable", sans-serif;
    font-weight: 700;
    font-size: var(--font-44);
    line-height: normal;
    text-transform: uppercase;
    color: var(--white);
    white-space: nowrap;
}

.footer-tagline {
    font-weight: 600;
    font-size: var(--font-20);
    line-height: 1.6;
    letter-spacing: -0.4px;
    color: var(--brand-300);
}

.footer-sns {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.footer-sns-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

/* 아이콘이 <img> 라 색을 바꿀 수 없다 — 사이트 공통 아이콘 hover 와 같은 opacity 로 맞춘다.
   블로그는 동그라미 배경이 svg 안에 들어 있어 background 로는 셋을 똑같이 다룰 수 없다. */
.footer-sns-link:hover {
    opacity: 0.6;
}

.footer-sns-link-youtube,
.footer-sns-link-instagram {
    background: var(--brand-300);
}

.footer-sns-link-youtube img {
    width: 22.4px;
    height: 15.681px;
}

.footer-sns-link-instagram img {
    width: 24px;
    height: 24px;
}

.footer-sns-link-blog img {
    width: 40px;
    height: 40px;
}

.footer-nav {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    width: 100%;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
    padding-right: 20px;
    white-space: nowrap;
}

.footer-col-title {
    font-weight: 600;
    font-size: var(--font-20);
    line-height: 1.6;
    letter-spacing: -0.4px;
    color: var(--white);
}

.footer-col-link {
    font-size: var(--font-18);
    line-height: 1.6;
    letter-spacing: -0.36px;
    color: var(--brand-bg);
    transition: color 0.2s ease;
}

.footer-col-link:hover {
    color: var(--brand-point-sky-blue);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1920px;
    margin: 90px auto 0;
    padding-top: 12px;
    border-top: 1px solid var(--gray-mid);
}

.footer-copyright {
    max-width: 502px;
    font-size: var(--font-16);
    line-height: 1.5;
    letter-spacing: -0.4px;
    color: var(--gray-mid);
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.footer-legal-link {
    font-size: var(--font-16);
    line-height: 1.5;
    letter-spacing: -0.4px;
    color: var(--white);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.footer-legal-link:hover {
    color: var(--brand-point-sky-blue);
}

.footer-divider {
    display: block;
    width: 1px;
    height: 15px;
    background: var(--gray-mid);
}

@media (max-width: 1024px) {
    .header-inner {
        height: 80px;
        padding: 0 20px;
    }

    .logo {
        width: 191px;
        aspect-ratio: 191 / 30;
    }

    .logo-mark {
        width: auto;
        height: 24px;
    }

    .gnb,
    .login {
        display: none;
    }

    .header-mobile-actions {
        display: flex;
    }

    .mobile-nav {
        display: block;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        background: var(--white);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0.25s ease;
    }

    .mobile-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .footer {
        padding: 80px 20px 40px;
    }

    .footer-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-brand {
        gap: 20px;
    }

    .footer-logo {
        width: 267px;
        height: 28px;
    }

    .footer-logo-mark {
        width: auto;
        height: 32px;
    }

    .footer-tagline {
        font-size: 17px;
        letter-spacing: -0.02em;
    }

    .footer-nav {
        display: none;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 10px;
        margin-top: 160px;
    }

    .footer-copyright {
        max-width: none;
        font-size: 16px;
        line-height: 150%;
        letter-spacing: -0.4px;
    }

    .footer-legal-link {
        font-size: 16px;
        line-height: 150%;
        letter-spacing: -0.4px;
    }
}


/* ---------- 모달 공통 (layout/modal-login.php 등) — Figma 112:943 / 딤 112:938 ----------
   열기/닫기는 js/common.js 모달 공통 처리: hidden 속성 제거 → .is-open 으로 페이드인, 닫을 땐 역순 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;                      /* 헤더(999) · 모바일 메뉴(998) 위 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s;
}

.modal[hidden] {
    display: none;
}

.modal.is-open {
    opacity: 1;
}

.modal-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 400px;
    max-width: 100%;
    padding: 20px 45px 40px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    outline: none;
    transform: translateY(12px);
    transition: transform 0.25s;
}

.modal.is-open .modal-card {
    transform: none;
}

.modal-close {
    display: flex;
    align-self: flex-end;
    width: 24px;
    height: 24px;
}

.modal-close img {
    width: 100%;
    height: 100%;
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.modal-title {
    font-weight: 700;
    font-size: 28px;
    line-height: 1.4;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--black);
    word-break: keep-all;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 260px;
    max-width: 100%;
    height: 60px;
    border-radius: 10px;
    background: var(--brand-point-sky-blue);
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    color: var(--white);
    transition: background-color 0.3s;
}

.modal-btn:hover {
    background: var(--brand-100);
}

/* ============================================
   유튜브 영상 모달 (layout/modal-video.php) — Figma 540:8555(PC) · 701:6233(MO)
   PC : 카드 1440 / padding 80 · 좌 플레이어 852 + 우 관련 영상 408 (gap 20)
   MO : 카드 353 / padding 60 12 40 · 세로 스택, 관련 영상은 가로 스크롤
   ============================================ */

.modal-video .modal-card {
    width: 1440px;
    align-items: stretch;
    gap: 0;
    /* 시안 80px — 뷰포트가 좁아지면 같은 비율(80/1440)로 줄인다 */
    padding: clamp(40px, 5.56vw, 80px);
    border: 0;
    border-radius: 20px;
    background: var(--white);
    backdrop-filter: none;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.modal-video .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 48px;
    height: 48px;
    padding: 6px;
}

.video-modal-body {
    display: flex;
    align-items: stretch;
    gap: 20px;
    width: 100%;
}

/* ---------- 왼쪽: 플레이어 ---------- */

/* 좌:우 = 852:408 (시안). 카드가 좁아져도 같은 비율로 함께 줄어든다 */
.video-modal-main {
    display: flex;
    flex: 852 1 0;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.video-modal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-modal-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-title {
    overflow: hidden;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--gray-mid-1);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-modal-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.video-modal-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.video-modal-avatar {
    flex: none;
    width: 40px;
    height: 40px;
}

.video-modal-avatar img {
    width: 100%;
    height: 100%;
}

.video-modal-channel-name {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    color: var(--gray-mid-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 유튜브에서 보기 (빨강 필 버튼) */
.video-modal-youtube {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    background: #ff0000;
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.05em;
    color: var(--white);
    white-space: nowrap;
    transition: background 0.2s ease;
}

.video-modal-youtube:hover {
    background: #d90000;
}

.video-modal-youtube-icon {
    display: flex;
    flex: none;
    width: 16px;
    height: 16px;
}

.video-modal-youtube-icon img {
    width: 100%;
    height: 100%;
}

/* ---------- 오른쪽: 같은 주제의 다른 영상 ---------- */

.video-modal-side {
    display: flex;
    flex: 408 1 0;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
    overflow: hidden;
}

.video-modal-side-title {
    font-weight: 600;
    font-size: 20px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    color: var(--gray-mid-1);
}

.video-modal-related {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.video-modal-related-link {
    display: flex;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.video-modal-related-thumb {
    position: relative;
    flex: none;
    width: 54.9%;        /* 224 / 408 (시안) — 사이드바 폭에 비례 */
    height: auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid #d7dce5;
    border-radius: 8px;
    background: #cfcfcf;
}

.video-modal-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.video-modal-related-link:hover .video-modal-related-thumb img {
    transform: scale(1.04);
}

.video-modal-related-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}

.video-modal-related-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: -0.02em;
    color: var(--black);
    transition: color 0.2s ease;
}

.video-modal-related-link:hover .video-modal-related-title {
    color: var(--brand-point-sky-blue);
}

.video-modal-related-channel {
    overflow: hidden;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--gray-mid-4);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 1440 미만에서는 카드가 줄어든 만큼 관련 영상 글자도 한 단계 내린다 */
@media (max-width: 1280px) {
    .video-modal-title {
        font-size: 22px;
    }

    .video-modal-side-title {
        font-size: 18px;
    }

    .video-modal-related-title {
        font-size: 16px;
    }

    .video-modal-related-channel {
        font-size: 14px;
    }

    .video-modal-youtube {
        padding: 10px 22px;
        font-size: 18px;
    }
}

/* ---------- 모바일 ---------- */
@media (max-width: 1024px) {
    .modal-video .modal-card {
        width: 100%;
        max-width: 353px;
        padding: 60px 12px 40px;
        max-height: calc(100vh - 40px);
    }

    .modal-video .modal-close {
        top: 20px;
        right: 20px;
        width: 24px;
        height: 24px;
        padding: 0;
    }

    .video-modal-body {
        flex-direction: column;
        gap: 30px;
    }

    /* 세로 배치에서는 PC 의 852:408 비율(flex-basis)이 "높이" 로 잡혀 영역이 접힌다 — 내용 높이로 되돌린다 */
    .video-modal-main,
    .video-modal-side {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }

    .video-modal-main {
        gap: 16px;
    }

    .video-modal-frame {
        border-radius: 16px;
    }

    .video-modal-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 20px;
        white-space: normal;
    }

    .video-modal-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .video-modal-channel-name {
        font-size: 17px;
    }

    .video-modal-youtube {
        padding: 9px 22px;
        font-size: 16px;
        letter-spacing: -0.02em;
    }

    .video-modal-youtube-icon {
        width: 12px;
        height: 12px;
    }

    .video-modal-side {
        width: 100%;
        gap: 12px;
    }

    .video-modal-side-title {
        font-size: 17px;
    }

    /* 관련 영상: 가로 스크롤 (시안의 얇은 스크롤바 포함) */
    .video-modal-related {
        flex-direction: row;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 12px;
        scrollbar-width: thin;
        scrollbar-color: var(--gray-mid-2) #e6e6e6;
    }

    .video-modal-related::-webkit-scrollbar {
        height: 3px;
    }

    .video-modal-related::-webkit-scrollbar-track {
        border-radius: 6px;
        background: #e6e6e6;
    }

    .video-modal-related::-webkit-scrollbar-thumb {
        border-radius: 6px;
        background: var(--gray-mid-2);
    }

    .video-modal-related-item {
        flex: none;
        width: 142px;
    }

    .video-modal-related-link {
        flex-direction: column;
        gap: 8px;
    }

    .video-modal-related-thumb {
        width: 142px;
        height: 80px;
    }

    .video-modal-related-title {
        -webkit-line-clamp: 2;
        font-size: 16px;
    }

    .video-modal-related-channel {
        font-weight: 400;
        font-size: 13px;
        line-height: 1.6;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal-card {
        transition: none;
    }
}

@media (max-width: 640px) {
    .modal-card {
        padding: 16px 24px 32px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-btn {
        height: 52px;
        font-size: 16px;
    }
}
