/* ============================================================
   WealthFile — Global Header + Ticker Tape Styles
   기존 front-page.php / single.php 등 인라인에만 있던 CSS를 전역화.
   PMP, search.php 등 모든 페이지에서 일관된 헤더 렌더링.
============================================================ */

/* ===== Reset essentials (shared across all pages) ===== */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gold: #c9a84c;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green: #000000;
  --red: #9ca3af;
  --transition: 0.15s ease;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ===== HEADER — alpha-forecast 기준 1:1 동일 ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 48px;
}
/* Logo — Playfair Display, text-2xl */
.site-header .logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-header .logo:hover { color: #000; }

/* Center search */
.site-header .header-search { display: flex; justify-content: center; }
.header-search-wrap { position: relative; width: 480px; }
.header-search-input {
  width: 100%;
  height: 44px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 99px;
  padding: 0 24px 0 24px;
  color: #000;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.header-search-input::placeholder { color: rgba(0,0,0,0.6); }
.header-search-input:focus { border-color: #000; }
.header-search-wrap > svg { display: none; }

/* Right nav */
.site-header .header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 40px;
}
.site-header nav { display: flex; align-items: center; gap: 32px; }
.site-header nav a {
  color: #000;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.15s;
}
.site-header nav a:hover { opacity: 0.6; }
.site-header nav a.nav-active { text-decoration: underline; text-underline-offset: 4px; }

/* Profile button */
.nav-profile-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-profile-btn:hover { background: #000; color: #fff; }

.nav-divider { width: 1px; height: 16px; background: #e5e7eb; margin: 0 4px; }
.nav-login { display: flex; align-items: center; gap: 6px; color: #000; font-weight: 400; }
.nav-cta {
  background: #000 !important;
  color: #fff !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  padding: 6px 16px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ===== TICKER TAPE (.ticker-tape) ===== */
.ticker-tape {
  position: fixed;
  top: 56px; left: 0; right: 0;
  height: 56px;
  background: #fff;
  z-index: 199;
  border-bottom: 1px solid #e5e7eb;
  overflow: hidden;
}
.tt-row { height: 28px; overflow: hidden; position: relative; }
.tt-row.tt-row-stocks  { border-bottom: 1px solid #f3f4f6; }
.tt-row.tt-row-indices { background: #fafafa; }
.tt-track {
  display: inline-flex;
  white-space: nowrap;
  animation: tt-scroll 90s linear infinite;
  will-change: transform;
}
.tt-track-reverse { animation: tt-scroll 120s linear infinite; }
.tt-row:hover .tt-track { animation-play-state: paused; }
@keyframes tt-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tt-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 28px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #374151;
  text-decoration: none;
  border-right: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.tt-item:hover { background: #f9fafb; color: #000; }
.tt-symbol { font-weight: 700; letter-spacing: 0.04em; color: #000; }
.tt-price  { font-weight: 600; color: #000; }
.tt-change {
  font-weight: 600;
  font-size: 0.68rem;
  padding: 2px 5px;
  border-radius: 2px;
  transition: background 0.5s ease-out, color 0.15s;
}
.tt-change.up   { color: #000; }
.tt-change.down { color: #9ca3af; }
.tt-change.flash-up   { background: rgba(0,0,0,0.06); color: #000; }
.tt-change.flash-down { background: rgba(156,163,175,0.15); color: #9ca3af; }
.tt-item-index .tt-symbol { color: #000; }

/* ===== Ticker tape hidden ===== */
.ticker-tape { display: none !important; }

/* ===== Body/HTML background 통일 ===== */
html, body { background: #ffffff !important; }

/* ===== Mobile hamburger ===== */
.mobile-nav-toggle {
  display: none;
  width: 36px; height: 36px;
  background: transparent; border: none; padding: 0;
  color: #fff; cursor: pointer;
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: auto auto auto; padding: 0 16px; }
  .site-header .header-search { display: none; }
  .site-header nav { display: none; }
  .site-header nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: #0a0a0a;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .ticker-tape { top: 56px; }
}

/* ===== Container helper for PMP and other content pages ===== */
.wf-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
