/* Shared layout för alla projekt under studio.mooood.com
 * Pattern: Trolly-design — sidebar (desktop fixed / mobile burger), hero, cards.
 * Per-projekt-färger sätts i :root på sidan som inkluderar denna fil.
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Default-tema — projekt kan override:a dessa på sin egen :root */
  --bg: #0e0e10;
  --panel: #17171a;
  --panel-hover: #1e1e22;
  --border: #2a2a2e;
  --text: #e8e8ea;
  --text-soft: #a4a4aa;
  --text-muted: #68686e;
  --accent: #d4d4d8;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --accent-strong: rgba(255, 255, 255, 0.18);
  --secondary: #8a8a90;
  --hero-grad-1: #1a1a1e;
  --hero-grad-2: #141417;

  --sidebar-width: 280px;
  --content-max: 1300px;
}

html, body { overflow-x: hidden; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; }

/* ============================================================
   STUDIO HEADER — alltid synlig, alla sidor
   ============================================================ */
.studio-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
/* Skapa plats för fixed header på alla sidor */
body { padding-top: 58px; }
@media (max-width: 700px) { body { padding-top: 50px; } }
.studio-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.studio-header .brand img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 50%;
}
.studio-header .brand-text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.studio-header .brand-sep {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0 2px;
}
.studio-header .brand-project {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.studio-header .header-spacer { flex: 1; }
.studio-header .header-links {
  display: flex;
  gap: 4px;
}
.studio-header .header-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 6px 11px;
  border-radius: 5px;
  transition: all 0.15s;
}
.studio-header .header-links a:hover { background: var(--accent-soft); color: var(--accent); }
.studio-header .header-links a.active { color: var(--accent); background: var(--accent-soft); }

@media (max-width: 700px) {
  .studio-header { padding: 10px 16px; }
  .studio-header .brand img { width: 28px; height: 28px; }
  .studio-header .brand-text { font-size: 14px; }
  .studio-header .brand-project { font-size: 11px; }
  .studio-header .header-links { display: none; }
}

/* ============================================================
   TOPNAV (mobile + burger)
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.topnav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.topnav a:hover { background: var(--accent-soft); color: var(--accent); }
.topnav .home-link { color: var(--accent); font-weight: 500; }

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

/* ============================================================
   SIDEBAR
   ============================================================ */
.side-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
.side-overlay.open { opacity: 1; pointer-events: all; }

.side-menu {
  position: fixed; top: 0; right: -360px;
  width: 320px; max-width: 88vw; height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 100;
  transition: right 0.25s ease;
  overflow-y: auto;
  padding: 24px 22px;
}
.side-menu.open { right: 0; box-shadow: -8px 0 30px rgba(0,0,0,0.5); }
.side-menu h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--accent);
  margin-bottom: 24px; padding-right: 30px;
}
.side-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none;
  color: var(--text-muted); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 4px 8px;
}
.side-close:hover { color: var(--accent); }

.side-section { margin-bottom: 22px; }
.side-section h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.side-section a {
  display: block; padding: 8px 10px;
  color: var(--text-soft); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  border-radius: 5px; margin-bottom: 2px;
  transition: all 0.15s;
}
.side-section a:hover { background: var(--accent-soft); color: var(--accent); padding-left: 14px; }
.side-section a.active { background: var(--accent-soft); color: var(--accent); }
.side-section a.ext { color: var(--secondary); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 80px 36px 60px;
  background: linear-gradient(135deg, var(--hero-grad-1) 0%, var(--hero-grad-2) 50%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: var(--content-max); margin: 0 auto; }
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 3px; color: var(--accent);
  margin-bottom: 14px;
}
h1 {
  font-size: 64px; font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--secondary) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin-bottom: 18px; line-height: 1.05;
  letter-spacing: -1px;
}
.tagline {
  font-size: 20px; color: var(--text-soft);
  max-width: 800px;
}
.nav-back {
  display: inline-block; color: var(--accent);
  text-decoration: none; font-size: 14px;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
}
.nav-back:hover { text-decoration: underline; }
.meta-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.meta-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 14px; border-radius: 4px;
  border: 1px solid var(--accent-strong);
}

/* ============================================================
   MAIN + SECTIONS
   ============================================================ */
main { max-width: var(--content-max); margin: 0 auto; padding: 56px 36px 80px; }
section { margin-bottom: 64px; }
.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 2.5px; color: var(--accent);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h2 { font-size: 32px; font-weight: 700; color: var(--text); margin-bottom: 18px; line-height: 1.15; }
h3 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
p  { color: var(--text-soft); font-size: 16px; max-width: 800px; }
p + p { margin-top: 14px; }

/* ============================================================
   CARDS (page-card för hub, anchor-card för innehåll)
   ============================================================ */
.pages-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.page-card {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 26px;
  text-decoration: none; color: var(--text);
  transition: all 0.15s;
  position: relative; overflow: hidden;
}
.page-card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-hover); }
.page-card .pc-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 10px;
}
.page-card .pc-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.page-card .pc-subtitle { font-size: 13px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 12px; }
.page-card .pc-desc { font-size: 14px; color: var(--text-soft); line-height: 1.55; flex: 1; }
.page-card .pc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.page-card .pc-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; background: rgba(255,255,255,0.05);
  color: var(--text-muted); padding: 5px 10px;
  border-radius: 4px; border: 1px solid var(--border);
}

.anchors-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.anchor-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.15s;
  display: flex; flex-direction: column;
}
.anchor-card:hover { border-color: var(--accent); }
.anchor-card .thumb-wrap { background: #0a0805; padding: 14px; display: flex; align-items: center; justify-content: center; }
.anchor-card .thumb { width: 100%; height: 160px; object-fit: contain; display: block; }
.anchor-card .ac-meta { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; flex: 1; gap: 6px; }
.anchor-card .ac-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; }
.anchor-card .ac-title { font-size: 16px; color: var(--text); font-weight: 600; }
.anchor-card .ac-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 4px; flex: 1; }
.anchor-card .ac-button {
  display: inline-block; margin-top: auto;
  padding: 8px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-strong);
  border-radius: 6px; color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-decoration: none;
  text-align: center; transition: all 0.15s;
  letter-spacing: 0.5px;
}
.anchor-card .ac-button:hover { background: var(--accent-strong); border-color: var(--accent); }

/* ============================================================
   CALLOUT + UTILITIES
   ============================================================ */
.callout {
  padding: 22px 28px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
  color: var(--text); font-size: 15px;
  max-width: 1000px; margin-bottom: 40px;
  line-height: 1.7;
}
.callout code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; background: var(--accent-soft);
  padding: 2px 8px; border-radius: 3px;
  color: var(--accent);
}

.divider {
  padding: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--secondary);
  text-transform: uppercase; letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
  margin: 32px 0 18px;
}

.footer {
  text-align: center;
  padding: 40px 36px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   LAYOUTS
   has-sidebar — sidebar fixed på desktop, burger på mobil
   no-sidebar  — hub-page utan sidebar (default)
   ============================================================ */
@media (min-width: 901px) {
  body.has-sidebar .topnav,
  body.has-sidebar .hamburger,
  body.has-sidebar .side-overlay,
  body.has-sidebar .side-close { display: none !important; }

  body.has-sidebar .side-menu {
    position: fixed; top: 58px; left: 0; right: auto;
    width: var(--sidebar-width); max-width: var(--sidebar-width);
    height: calc(100vh - 58px);
    transform: none; transition: none;
    box-shadow: 1px 0 0 var(--border);
    z-index: 30;
    padding-top: 22px;
  }
  body.has-sidebar .side-menu h3 { display: none; }
  /* Push hela body innehållet till höger när sidebar är synlig */
  body.has-sidebar { padding-left: var(--sidebar-width); }
}

@media (max-width: 900px) {
  .hero { padding: 50px 22px 40px; }
  h1 { font-size: 36px; line-height: 1.1; }
  .tagline { font-size: 16px; }
  main { padding: 32px 18px 60px; }
  h2 { font-size: 24px; }
  .pages-grid { grid-template-columns: 1fr; gap: 14px; }
  .anchors-grid { grid-template-columns: 1fr; gap: 14px; }
  .anchor-card .thumb { height: 180px; }
  .callout { padding: 18px 22px; font-size: 14px; }
  .page-card { padding: 22px 20px; }
  .page-card .pc-title { font-size: 19px; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .anchors-grid { grid-template-columns: repeat(2, 1fr); }
}

/* När det INTE finns sidebar (hub-page), göm topnav på desktop också */
@media (min-width: 901px) {
  body:not(.has-sidebar) .topnav { display: none; }
}
