/**
 * 파일명: common.css
 * 파일경로: /home/urlkr/public_html/webzine/assets/css/
 * 기능: 프론트 공통 스타일 (변수, 리셋, 헤더, 푸터, 스크롤버튼)
 * 작성일: 2026-03-30
 * 수정일: 2026-03-30
 */

/* ===== CSS 변수 ===== */
:root {
    /* 메인 컬러 */
    --color-primary: #50586C;
    --color-accent: #50586C;
    --color-accent-light: #8E95A9;
    --color-accent-lighter: #DCE2F0;
    --color-accent-dark: #3D4456;

    /* 배경 */
    --bg-body: #F4F5F9;
    --bg-surface: #FFFFFF;
    --bg-muted: #ECEEF4;

    /* 텍스트 */
    --text-primary: #2C3040;
    --text-secondary: #5A5F72;
    --text-muted: #9096A8;
    --text-inverse: #FFFFFF;

    /* 보더 */
    --border-color: #D8DBE6;
    --border-light: #E8EAF2;

    /* 타이포그래피 */
    --font-sans: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    --font-serif: 'DM Serif Display', 'Georgia', 'Noto Serif KR', serif;

    /* 레이아웃 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(30, 30, 46, 0.04);
    --shadow-md: 0 4px 14px rgba(30, 30, 46, 0.06);
    --shadow-lg: 0 8px 30px rgba(30, 30, 46, 0.08);
    --transition: 0.2s ease;
    --header-height: 64px;
}


/* ===== 리셋 & 기본 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
}

/* ===== 헤더 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(250, 250, 247, 0.97);
    border-bottom-color: var(--border-color);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.logo:hover .logo-text {
    color: var(--color-accent-dark);
}

.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: calc(100% - 24px);
}

.nav-link.active {
    color: var(--color-accent-dark);
    font-weight: 600;
}

.nav-link.active::after {
    width: calc(100% - 24px);
    background: var(--color-accent);
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s ease;
}

.icon-btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-lighter);
    transform: scale(1.08);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
}

.icon-btn:hover svg {
    transform: rotate(8deg);
}


.btn-write {
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--color-accent);
    color: var(--text-inverse);
    border-radius: var(--radius-xl);
    letter-spacing: 0.04em;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.btn-write::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-write:hover {
    background: var(--color-accent-dark);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(80, 88, 108, 0.3);

}

.btn-write:hover::before {
    left: 100%;
}


.mobile-menu-toggle {
    display: none;
}

/* 검색 드롭다운 */
.search-dropdown {
    max-height: 0;
    overflow: hidden;
    background: var(--bg-surface);
    border-bottom: 1px solid transparent;
    transition: max-height 0.3s ease, border-color 0.3s ease;
}

.search-dropdown.open {
    max-height: 80px;
    border-bottom-color: var(--border-color);
}

.search-dropdown-inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 12px 24px;
}

.search-form {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--bg-muted);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--color-accent);
    background: var(--bg-surface);
}

.search-submit {
    padding: 10px 16px;
    background: var(--text-primary);
    color: var(--text-inverse);
    border: 1px solid var(--text-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background var(--transition);
}

.search-submit:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

.search-submit svg {
    width: 18px;
    height: 18px;
}

/* 모바일 메뉴 */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    background: var(--bg-surface);
    transition: max-height 0.3s ease;
}

.mobile-menu.open {
    max-height: 400px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-link {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.25s ease;
    position: relative;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--color-accent);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--color-accent-dark);
    background: var(--color-accent-lighter);
    padding-left: 28px;
    font-weight: 600;
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    transform: scaleY(1);
}


/* ===== 푸터 ===== */
.site-footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 24px 36px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
}

.footer-heading {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 400;
    color: #FFFFFF;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}


.footer-desc {
    font-size: 14px;
    line-height: 1.6;
}

.footer-desc a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-desc a:hover {
    color: #fff;
}


.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--color-accent-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== Scroll Progress Button ===== */
.scroll-progress-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-progress-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-progress-btn svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: var(--bg-surface);
    stroke: var(--border-color);
    stroke-width: 1;
}

.progress-circle-bar {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease-out;
}

.progress-circle-track {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 3;
}

.scroll-progress-btn .btn-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scroll-progress-btn .progress-arrow {
    color: var(--color-accent);
    font-size: 16px;
    line-height: 1;
    margin-top: -1px;
}

.scroll-progress-btn .progress-percent {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}


/* ===== 공통 유틸리티 ===== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===== 반응형: 태블릿 ===== */
@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-inner .footer-col:first-child {
        grid-column: 1 / -1;
    }
}

/* ===== 반응형: 모바일 ===== */
@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    body {
        font-size: 15px;
    }

    .header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        padding: 40px 20px 24px;
        gap: 24px;
    }

    .footer-inner .footer-col:first-child {
        grid-column: auto;
    }

    .footer-bottom {
        padding: 16px 20px;
        font-size: 12px;
    }

    .scroll-progress-btn {
        bottom: 20px;
        right: 20px;
        width: 46px;
        height: 46px;
    }

    .scroll-progress-btn .progress-percent {
        font-size: 9px;
    }

    .scroll-progress-btn .progress-arrow {
        font-size: 14px;
    }
}

/* ===== 반응형: 작은 모바일 ===== */
@media (max-width: 380px) {
    .header-inner {
        padding: 0 12px;
    }
}
