/* ============================================================
   TBSTech 공통 스타일시트  |  common.css
   이 파일 하나로 전체 페이지의 공통 스타일을 관리합니다.
   ============================================================ */

/* ── 1. Design Tokens (CSS Variables) ─────────────────────── */
:root {
    /* Brand Colors */
    --c-primary:        #0052CC;
    --c-primary-dark:   #003d99;
    --c-primary-deeper: #002B5B;
    --c-secondary:      #4C9AFF;
    --c-accent:         #00C7E6;

    /* Text */
    --c-text-dark:   #1a202c;
    --c-text-body:   #333333;
    --c-text-light:  #555555;
    --c-text-muted:  #888888;

    /* Backgrounds */
    --c-white:       #FFFFFF;
    --c-bg-light:    #F4F7FA;
    --c-bg-subtle:   #f0f4f9;
    --c-border:      #e1e7ee;

    /* Shadows */
    --shadow-xs: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.07);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.09);
    --shadow-lg: 0 12px 48px rgba(0,82,204,0.12);

    /* Border Radius */
    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 20px;

    /* Layout */
    --header-height: 72px;

    /* Transitions */
    --ease: 0.25s ease;

    /* Typography */
    --font: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
}

/* ── 2. Base Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    line-height: 1.7;
    color: var(--c-text-body);
    background: var(--c-white);
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }

/* ── 3. Layout Helpers ─────────────────────────────────────── */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.page-body {
    padding-top: var(--header-height);
}

/* ── 4. Header ─────────────────────────────────────────────── */
#site-header header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: var(--header-height);
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--ease);
}

#site-header header.scrolled {
    box-shadow: var(--shadow-md);
}

/* Logo */
.logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--c-primary);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

/* Desktop GNB */
.gnb ul {
    display: flex;
    gap: 36px;
    align-items: center;
}

.gnb a {
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text-body);
    padding-bottom: 3px;
    transition: color var(--ease);
}

.gnb a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--c-primary);
    border-radius: 2px;
    transition: width var(--ease);
}

.gnb a:hover,
.gnb a.active {
    color: var(--c-primary);
}

.gnb a:hover::after,
.gnb a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--r-sm);
    transition: background var(--ease);
}

.menu-toggle:hover { background: var(--c-bg-light); }

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--c-primary);
    border-radius: 2px;
    transition: all var(--ease);
}

.menu-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.menu-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Nav Drawer */
.mobile-nav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--c-white);
    border-bottom: 2px solid var(--c-primary);
    padding: 8px 5% 24px;
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
    padding: 14px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--c-text-body);
    border-bottom: 1px solid var(--c-border);
    transition: color var(--ease), padding-left var(--ease);
}

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

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--c-primary);
    padding-left: 8px;
}

/* ── 5. Sub-page Banner ────────────────────────────────────── */
.sub-header {
    background: linear-gradient(135deg, var(--c-primary-deeper) 0%, var(--c-primary) 60%, var(--c-secondary) 100%);
    padding: 72px 0 64px;
    color: var(--c-white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sub-header::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.sub-header .container { position: relative; z-index: 1; }

.sub-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.sub-header p {
    font-size: 1.05rem;
    opacity: 0.85;
}

/* ── 6. Section Utilities ──────────────────────────────────── */
.section       { padding: 90px 0; }
.section-alt   { background: var(--c-bg-light); }

.section-title { text-align: center; margin-bottom: 56px; }

.section-title .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--c-secondary);
    margin-bottom: 10px;
}

.section-title h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--c-text-dark);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-title p {
    color: var(--c-text-light);
    font-size: 1.02rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ── 7. Common Card ────────────────────────────────────────── */
.card {
    background: var(--c-white);
    border-radius: var(--r-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--c-secondary);
}

/* ── 8. Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 13px 36px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--ease);
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: var(--c-secondary);
    color: var(--c-white);
    border-color: var(--c-secondary);
}

.btn-primary:hover {
    background: var(--c-primary);
    border-color: var(--c-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--c-white);
    border-color: rgba(255,255,255,0.6);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--c-white);
}

/* ── 9. Footer ─────────────────────────────────────────────── */
#site-footer footer {
    background: #111827;
    color: #9ca3af;
    padding: 60px 5% 32px;
    font-size: 0.88rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto 48px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--c-white);
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.footer-brand p {
    line-height: 1.9;
    color: #9ca3af;
}

.footer-col h4 {
    color: var(--c-white);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.footer-col p,
.footer-col a {
    display: block;
    color: #9ca3af;
    margin-bottom: 10px;
    transition: color var(--ease);
    line-height: 1.6;
}

.footer-col a:hover { color: var(--c-white); }

.footer-divider {
    border: none;
    border-top: 1px solid #1f2937;
    max-width: 1200px;
    margin: 0 auto 24px;
}

.copyright {
    text-align: center;
    font-size: 0.82rem;
    color: #4b5563;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── 10. Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    :root { --header-height: 60px; }

    .gnb { display: none; }
    .menu-toggle { display: flex; }

    .section { padding: 60px 0; }
    .section-title { margin-bottom: 40px; }

    .sub-header { padding: 54px 0 48px; }
    .sub-header h1 { font-size: 2rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    #site-footer footer { padding: 48px 5% 28px; }
}

@media (max-width: 480px) {
    .container { width: 92%; }
    .btn { padding: 11px 28px; font-size: 0.9rem; }
}
