/* === Gallery home (index.html) specific styles ===
 * Layered on top of gallery.css. Only contains what the gallery page itself
 * does not provide: the combined header user-controls, the compact quick-nav
 * chip strip, the credit-purchase grid, the intro card and the footer.
 *
 * 반응형: 모바일(<=600px)에서 카드 선택(quick-nav)이 한 줄 가로 스크롤로
 * 압축되어 세로 공간을 거의 차지하지 않도록 설계.
 */

/* ------------------------------------------------------------------ */
/* Header right cluster: gallery nav + user controls                   */
/* ------------------------------------------------------------------ */

/* Positioning context for the hamburger dropdown: anchor it to the white
   header box (not the vertically-centered .header-user) so it opens cleanly
   BELOW the box instead of spilling out of it on mobile. */
.gallery-header {
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Login / purchase buttons reuse the brand image button, sized for the
   compact white gallery header. */
#header-login-btn,
#purchase-btn {
    width: auto;
    padding: 0 16px;
    height: 34px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-image: url('../images/ct_button3.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
}

#menu-btn {
    width: auto;
    padding: 0 14px;
    height: 34px;
    font-size: 14px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #6c757d;
    transition: background-color 0.2s;
}

#menu-btn:hover {
    background-color: #5a6268;
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-width: calc(100vw - 24px); /* never overflow the viewport on mobile */
    z-index: 1000;
}

.menu-item {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    border: none;
    background: white;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: normal;
}

.menu-item:hover {
    background-color: #f0f2f5;
}

.menu-item-top {
    border-radius: 4px 4px 0 0;
}

.menu-item-bottom {
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #eee;
}

/* ------------------------------------------------------------------ */
/* Compact quick-nav chips (replaces the old big dashboard card grid)  */
/* ------------------------------------------------------------------ */
.quick-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.quick-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.quick-chip i {
    color: #007bff;
    font-size: 16px;
}

.quick-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #f8faff;
}

.quick-chip.active {
    background-color: #f0edff;
    color: #6c5ce7;
}

.quick-chip.active i {
    color: #6c5ce7;
}

/* ------------------------------------------------------------------ */
/* Credit purchase grid                                                */
/* ------------------------------------------------------------------ */
.purchase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.purchase-item {
    width: 100%;
    background-color: #007bff;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.purchase-item:hover {
    background-color: #0056b3;
}

#purchase-menu {
    margin-bottom: 20px;
}

#purchase-menu .card {
    padding: 16px;
}

/* ------------------------------------------------------------------ */
/* Intro / About card (SEO copy, below the gallery)                    */
/* ------------------------------------------------------------------ */
.intro-card {
    padding: 20px;
    margin-top: 24px;
}

.intro-title {
    margin: 0 0 12px 0;
    font-size: clamp(18px, 4.5vw, 22px);
    line-height: 1.4;
}

.intro-text {
    margin: 0 0 10px 0;
    color: #444;
    line-height: 1.7;
}

.intro-cta {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.footer-links {
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
}

.footer-sep {
    color: #ccc;
}

.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

/* ================================================================== */
/* 모바일(Mobile): 600px 이하 — 카드 선택을 작게 압축                  */
/* ================================================================== */
@media (max-width: 600px) {
    .quick-nav {
        gap: 6px;
        padding-bottom: 8px;
    }

    .quick-chip {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .quick-chip i {
        font-size: 14px;
    }

    /* Keep logo + nav + language + login on ONE line beside the logo. */
    .gallery-header {
        gap: 8px;
    }

    .header-right {
        gap: 6px;
    }

    .gallery-nav {
        flex-wrap: nowrap;
    }

    .gallery-nav .nav-link {
        padding: 4px 8px;
        font-size: 13px;
    }

    .header-user {
        gap: 6px;
    }

    #header-login-btn,
    #purchase-btn,
    #menu-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    .site-footer {
        font-size: 12px;
    }

    .footer-links a {
        margin: 0 8px;
        font-size: 13px;
    }
}

/* ================================================================== */
/* 초소형 폰: 380px 이하 — 크레딧 구매 타일 1열로 전환해 넘침 방지        */
/* ================================================================== */
@media (max-width: 380px) {
    .purchase-grid {
        grid-template-columns: 1fr;
    }
}
