/* ═══════════════════════════════════════════════
   CC Masters & Invitational — Portal CSS
   Alle sider deler disse stilene
═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bg:        #0a0f0d;
  --surface:   #121a15;
  --surface2:  #182010;
  --surface3:  #1e2a1a;
  --border:    #2a3828;
  --border2:   #3a4e36;
  --text:      #e8ede6;
  --muted:     #7a9070;
  --faint:     #3d5038;
  --gold:      #c9a84c;
  --gold-dim:  #7a6030;
  --green:     #5aaf6e;
  --accent:    #4a8f5a;
  --red:       #f85149;
  --nav-h:     64px;
  --nav-h-mob: 56px;
  --radius:    10px;
  --radius-lg: 16px;
  --serif:     'Playfair Display', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;
  --shadow:    0 4px 32px rgba(0,0,0,0.5);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  /* ✅ Rettet: padding-bottom kun én gang (var duplikert) */
  padding-bottom: 3rem;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--text); }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,15,13,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex; align-items: center;
  padding: 0 1.5rem;
}

/* Innhold i navbar begrenset til samme bredde som sideinnholdet */
.navbar-inner {
  display: flex; align-items: center; gap: 2rem;
  width: 100%; max-width: 1300px;
  margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0; text-decoration: none;
}
.nav-logo {
  height: 36px; width: auto; object-fit: contain; flex-shrink: 0;
  mix-blend-mode: screen;
}
.nav-logo-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1; }
.nav-brand-main {
  font-family: var(--serif); font-size: 1rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.01em; white-space: nowrap;
}
.nav-brand-sub {
  font-size: 0.65rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px;
}
.nav-links {
  display: flex; align-items: center; justify-content: center;
  gap: 0.15rem; flex: 1; list-style: none;
}
.nav-links a {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.75rem; border-radius: 6px;
  font-size: 0.875rem; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: color 0.15s, background 0.15s; white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--gold); background: var(--surface2); }

/* Dropdown — klikk-styrt via JS .open-klasse */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle::after { content: '▾'; font-size: 0.7rem; margin-left: 0.2rem; opacity: 0.6; }
.nav-dropdown-menu {
  visibility: hidden;
  opacity: 0;
  position: absolute; top: 100%; left: 0;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 0.4rem;
  min-width: 180px; box-shadow: var(--shadow); z-index: 2000;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
}
/* Dropdown styres kun av JS .open-klasse — se index.php */
.nav-dropdown.open .nav-dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.nav-dropdown-menu a {
  display: block; padding: 0.45rem 0.75rem; font-size: 0.85rem;
  color: var(--muted); border-radius: 6px; white-space: nowrap;
  transition: color 0.15s, background 0.15s; text-decoration: none;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active { color: var(--text); background: var(--surface2); }

/* Hamburgermeny */
.nav-hamburger {
  display: none; margin-left: auto; flex-direction: column;
  gap: 5px; cursor: pointer; padding: 8px; border: none; background: none;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobil overlay */
.nav-mobile-overlay {
  display: none; position: fixed;
  inset: var(--nav-h-mob) 0 0 0;
  background: rgba(10,15,13,0.98); backdrop-filter: blur(12px);
  z-index: 999; padding: 1.5rem; flex-direction: column; gap: 0.25rem; overflow-y: auto;
}
.nav-mobile-overlay.open { display: flex; }
.nav-mobile-overlay a {
  display: block; padding: 0.85rem 1rem; border-radius: var(--radius);
  font-size: 1.05rem; font-weight: 500; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid var(--border);
}
.nav-mobile-overlay a:hover,
.nav-mobile-overlay a.active { color: var(--gold); background: var(--surface2); }
.nav-mobile-submenu { padding-left: 1.5rem; }
.nav-mobile-submenu a { font-size: 0.95rem; }
.nav-mobile-section-label {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); padding: 0.75rem 1rem 0.25rem;
}

/* ── Layout Helpers ── */
/* ✅ Rettet: fjernet duplikat .container (var identisk med .container-wide) */
.container-wide    { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }
.container         { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 900px;  margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
}
.card + .card { margin-top: 1rem; }

.badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.badge--masters { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid var(--gold-dim); }
.badge--inv     { background: rgba(90,175,110,0.12); color: var(--green); border: 1px solid rgba(90,175,110,0.3); }

.page-hero {
  background: linear-gradient(180deg, var(--surface2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 3rem;
}
.page-hero__eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.page-hero__title   { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 900; margin-bottom: 0.75rem; line-height: 1.1; }
.page-hero__lead    { font-size: 1.05rem; color: var(--muted); max-width: 560px; line-height: 1.7; }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.4rem; border-radius: 8px; font-family: var(--sans); font-size: 0.9rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all 0.15s; }
.btn--primary   { background: var(--surface3); color: var(--green); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--text); text-decoration: none; }
.btn--accent    { background: var(--surface2); color: var(--green); border-color: var(--accent); }
.btn--accent:hover  { background: var(--accent); border-color: var(--accent); color: var(--text); text-decoration: none; }
.btn--secondary { background: var(--surface2); color: var(--muted); border-color: var(--border2); }
.btn--secondary:hover { border-color: var(--muted); color: var(--text); text-decoration: none; }
.btn-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.65rem 1rem;
  color: var(--text); font-family: var(--sans); font-size: 0.9rem;
  outline: none; transition: border-color 0.15s; width: 100%;
}
.input:focus { border-color: var(--border2); }
.input::placeholder { color: var(--faint); }

/* ── Footer ── */
footer {
  margin-top: 0;
  padding: 2rem 0; text-align: center; font-size: 0.8rem; color: var(--faint);
}

/* ── Responsivt ── */
@media (max-width: 860px) {
  body { padding-top: var(--nav-h-mob); }
  .navbar { height: var(--nav-h-mob); gap: 1rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
