/* ============================================================
   Global GNB & Footer Styles — Purme Foundation Redesign
   Applied to ALL pages via layout-base.php
   ============================================================ */

/* ---------- Base font ---------- */
body._new {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   GNB — .gnb-new
   ============================================================ */
.gnb-new {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    z-index: 2000;
    background: #fff;
    box-shadow: none !important;
    border: none !important;
    padding: 0;
}

/* 서브페이지 배경 */
body:not(.home-new) .site-main {
    background: #e9f1f5;
}

.gnb-new *::before,
.gnb-new *::after {
    border: none !important;
    box-shadow: none !important;
}

.gnb-new.is-sticky {
    box-shadow: none;
}

/* GNB uses wider container to match 1840px slide + 40px margins = 1920px */
.gnb-new .container {
    max-width: 1920px;
    padding-left: 40px;
    padding-right: 40px;
}

/* --- Top bar (SNS + Login/FAQ) — absolute overlay at top --- */
.gnb-new__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.gnb-new__top-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 32px;
    gap: 64px;
    padding-top: 12px;
}

.gnb-new__sns {
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.gnb-new__sns::after {
    content: '';
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: #d9d9d9;
}

.gnb-new__sns li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #767575;
    transition: color 0.2s;
    text-decoration: none;
}

.gnb-new__sns li a:hover {
    color: #0071BC;
}

.gnb-new__sns li a svg {
    width: 22px;
    height: 22px;
}

.gnb-new__member {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gnb-new__member a {
    font-size: 15px;
    font-weight: 600;
    color: #767575;
    text-decoration: none;
    transition: color 0.2s;
}

.gnb-new__member a:hover {
    color: #0071BC;
}

.gnb-new__divider {
    width: 1px;
    height: 12px;
    background: #ccc;
}

/* --- Main navigation bar — fills full GNB height so logo/menu center over full header --- */
.gnb-new__main {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
}

.gnb-new__main > .container {
    width: 100%;
}

.gnb-new__main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding-top: 0;
    position: relative;
}

.gnb-new__logo {
    align-self: center;
    margin: 0;
}

/* Logo */
.gnb-new__logo {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

.gnb-new__logo a {
    display: block;
    text-indent: -9999px;
    width: 164px;
    height: 53px;
    background-image: url(../images/main/logo-blue.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Navigation menu — centered, aligned with mega menu columns */
.gnb-new__nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: 780px;
    max-width: 100%;
    padding: 0 40px;
}

.gnb-new__menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gnb-new__menu > li {
    position: relative;
    display: flex;
    justify-content: flex-start;
}

.gnb-new__menu > li > a {
    display: block;
    font-size: 21px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
}

.gnb-new__menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #0071BC;
    transition: width 0.25s ease;
}

.gnb-new__menu > li:hover > a,
.gnb-new__menu > li.is-active > a,
.gnb-new__menu > li.is-hover > a {
    color: #0071BC;
}

.gnb-new__menu > li:hover > a::after,
.gnb-new__menu > li.is-hover > a::after {
    width: 100%;
}
.gnb-new__menu > li.is-active > a::after {
    width: 0;
}

/* ============================================================
   Mega Menu — all submenus open together
   ============================================================ */

/* Hide original individual submenus */
.gnb-new__submenu {
    display: none !important;
    border-radius: 0 0 8px 8px;
    padding: 16px 0;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    z-index: 100;
}

/* Mega menu panel */
.gnb-new__mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0071BC;
    box-shadow: 0 10px 40px rgba(0, 113, 187, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
    overflow: hidden;
    pointer-events: none;
}

/* Decorative shapes — removed */
.gnb-new__mega-shape { display: none !important; }

/* Show on GNB hover (menu area) */
.gnb-new:hover .gnb-new__mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gnb-new__mega-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 40px 36px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Each column */
.gnb-new__mega-col {}

/* Column titles — same as top menu name, so hidden */
.gnb-new__mega-col-title {
    display: none !important;
}

.gnb-new__mega-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gnb-new__mega-col ul li a {
    display: block;
    padding: 3px 0;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.gnb-new__mega-col ul li a:hover {
    color: #fff;
}

/* Actions (donate + search) — pinned to right, below top bar so they don't
   overlap with the SNS / login / FAQ row on the 90px-tall header */
.gnb-new__actions {
    position: absolute;
    right: 0;
    top: 41px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 0;
}

.gnb-new .gnb-new__donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0071BC !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700;
    border: none !important;
    border-radius: 24px !important;
    padding: 10px 22px !important;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.gnb-new__donate-btn:hover {
    background: #005a96;
    color: #fff;
}

/* Blog label in SNS list */
.gnb-new__sns-blog {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #767575 !important;
}

.gnb-new__sns-blog img {
    width: auto !important;
    height: 10px !important;
}

.gnb-new__search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #222;
    transition: color 0.2s;
}

.gnb-new__search-btn:hover {
    color: #0071BC;
}

.gnb-new__search-btn svg {
    display: block;
    width: 26px;
    height: 26px;
    pointer-events: none;
}
.gnb-new__search-btn svg * {
    pointer-events: none;
}
/* 검색 버튼은 열림/닫힘 상태와 무관하게 항상 돋보기 아이콘 유지 */
.gnb-new__search-btn .icon-close { display: none !important; }
.gnb-new__search-btn .icon-search { display: block !important; }

/* Search form */
.gnb-new__search-form {
    display: none;
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    width: 100vw;
    background: #fff;
    padding: 24px 0;
    border-bottom: 1px solid #e3e3e3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2100;
}

/* 검색창 열려있을 때 메가메뉴 + 호버 효과 완전 차단 */
.gnb-new.search-active .gnb-new__mega {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.gnb-new__search-form.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gnb-new__search-form > label {
    margin: 0;
    display: inline-flex;
}

.gnb-new__search-input {
    width: 560px;
    max-width: 70vw;
    height: 48px;
    border: 2px solid #0071BC;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
}

.gnb-new__search-submit {
    background: #0071BC;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 24px;
    height: 48px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
}

/* 검색창 옆 닫기(X) 버튼 */
.gnb-new__search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 48px;
    margin-left: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #222;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.gnb-new__search-close:hover {
    color: #0071BC;
}

/* Main content offset for fixed GNB */
._new .site-main {
    padding-top: 90px;
    background: #fff;
}

/* Hide old header styles */
.site-header.site-header_new {
    display: none !important;
}

/* Hide legacy WP edit links on frontend */
.edit-link,
.post-edit-link {
    display: none !important;
}

/* ============================================================
   FOOTER — .footer-new
   ============================================================ */
.footer-new {
    background: #3E464C;
    color: #ACB9C1;
    padding: 25px 0 30px;
    font-size: 14px;
    font-family: 'Pretendard', sans-serif;
}

.footer-new a {
    color: #ACB9C1;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-new a:hover {
    color: #fff;
}

/* Top area: logo + links + buttons */
.footer-new__top {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-new__logo {
    margin-bottom: 16px;
}

.footer-new__logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-new__links {
    flex: 1;
}

.footer-new__links ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer-new__links ul li:not(:last-child)::after {
    content: '|';
    margin-left: 8px;
    color: #65767B;
    font-size: 12px;
}

.footer-new__links a {
    font-size: 15px;
    font-weight: 400;
    color: #fff;
}

.footer-new__privacy a {
    color: #23AFE2 !important;
    font-weight: 500;
}

.footer-new__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-new__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    padding: 8px 20px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    transition: border-color 0.2s;
}

.footer-new__btn:hover {
    border-color: #fff;
    color: #fff;
}

.footer-new__familysite {
    position: relative;
}

.footer-new__familylist {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 0;
    min-width: 280px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0 0 8px 0;
    z-index: 100;
}

.footer-new__familysite.is-open .footer-new__familylist {
    display: block;
}

.footer-new__familysite #btn-familysite svg {
    transition: transform 0.25s ease;
}

.footer-new__familysite.is-open #btn-familysite svg {
    transform: rotate(180deg);
}

.footer-new__familylist li a {
    display: block;
    padding: 8px 20px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.footer-new__familylist li a:hover {
    background: #f5f5f5;
    color: #0071BC;
}

.footer-new__familylist-close-item {
    position: sticky;
    top: -12px;
    margin: -12px 0 0;
    background: #fff;
    text-align: right;
    padding: 8px 8px 8px;
    z-index: 10;
    border-bottom: 1px solid #eee;
    display: block;
}

.footer-new__familylist-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 4px 10px;
}

/* Divider */
.footer-new__divider {
    height: 1px;
    background: #556069;
    margin: 24px 0;
}

/* Bottom area */
.footer-new__bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-new__account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-new__account-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0071BC;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 40px;
}

.footer-new__account span {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.footer-new__dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #65767B;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 4px;
}

.footer-new__address {
    font-style: normal;
}

.footer-new__address p {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 500;
    color: #ACB9C1;
    line-height: 1.5;
}

p.footer-new__copy,
.footer-new__address .footer-new__copy {
    font-size: 12px;
    color: #9fa7ab !important;
    font-weight: 400 !important;
    margin-top: 12px !important;
}

/* Hide old footer */
.site-footer:not(.footer-new):not(.mobile-only) {
    display: none !important;
}

/* ============================================================
   Floating Donation Button
   - Initially: absolute, positioned at hero bottom-right
   - After scroll: fixed to viewport bottom-right
   ============================================================ */
.floating-donate {
    position: fixed;
    z-index: 1500;
    right: 40px;
    bottom: -160px;
    transition: bottom 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.floating-donate.is-visible {
    bottom: 40px;
    opacity: 1;
}

.floating-donate a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: #0071BC;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0,113,188,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-donate a:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0,113,188,0.5);
}

.floating-donate img {
    width: 42px;
    height: 48px;
    margin-bottom: 2px;
}

.floating-donate span {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
}

/* ============================================================
   Responsive — Mobile (max-width: 550px)
   Hide new GNB on mobile; mobile has its own #masthead_mobile
   ============================================================ */
@media (max-width: 550px) {
    /* Hide desktop GNB entirely — mobile uses #masthead_mobile */
    .gnb-new {
        display: none !important;
    }

    /* Adjust site-main padding for mobile header instead of GNB */
    ._new .site-main {
        padding-top: 35px;
    }
    body.home-new .site-main {
        padding-top: 0;
    }

    /* Footer: stack vertically */
    .footer-new {
        padding: 20px 0 24px;
    }

    .footer-new .container {
        padding: 0 16px;
    }

    .footer-new__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .footer-new__links ul {
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .footer-new__links a {
        font-size: 13px;
    }

    .footer-new__buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .footer-new__btn {
        font-size: 12px;
        padding: 6px 14px;
    }

    .footer-new__familylist {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 72px;
        top: auto;
        min-width: 0;
        width: auto;
        max-width: none;
        max-height: 60vh;
    }

    .footer-new__familylist li a {
        white-space: normal;
        word-break: keep-all;
    }

    .footer-new__bottom {
        flex-direction: column;
    }

    .footer-new__account {
        flex-wrap: wrap;
        gap: 6px;
    }

    .footer-new__address p {
        font-size: 12px;
    }

    /* Floating donate: smaller on mobile */
    .floating-donate {
        right: 16px;
    }

    .floating-donate.is-visible {
        bottom: 20px;
    }

    .floating-donate a {
        width: 90px;
        height: 90px;
    }

    .floating-donate img {
        width: 30px;
        height: 34px;
    }

    .floating-donate span {
        font-size: 14px;
    }
}

/* Tablet adjustments for GNB/Footer */
@media (max-width: 768px) {
    .gnb-new__top {
        display: none;
    }

    .gnb-new__menu {
        gap: 24px;
    }

    .gnb-new__menu > li > a {
        font-size: 18px;
    }

    .gnb-new__actions {
        margin-left: 16px;
    }

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

    .footer-new__bottom {
        flex-direction: column;
    }
}
