/* =============================================
   PRODUCT PLAYBOOK — SHARED STYLESHEET
   Extends the 10xProducts design system
   ============================================= */

/* ---- Design Tokens ---- */
:root {
  --gold: #FFC70A;
  --gold-light: #FFD84D;
  --gold-subtle: rgba(255,199,10,0.07);
  --gold-border: rgba(255,199,10,0.22);
  --dark: #1A2332;
  --dark-card: #212D3B;
  --dark-sidebar: #141d2a;
  --dark-lighter: #2D3A48;
  --dark-border: rgba(255,255,255,0.08);
  --text: #C8CED6;
  --text-light: #8A94A0;
  --text-bright: #E8ECF0;
  --white: #FFFFFF;
  --sidebar-w: 280px;
  --header-h: 86px;
  --content-max: 780px;
  --radius: 8px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* =============================================
   SITE HEADER (matches main site compact style)
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(26, 35, 50, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px 0;
  border-bottom: 1px solid var(--dark-border);
}

.nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo svg { height: 30px; width: auto; }

.nav-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  margin-left: auto;
  margin-top: -3px;
  white-space: nowrap;
}
.nav-back:hover { color: var(--white); opacity: 1; }
.nav-back svg { flex-shrink: 0; }
.nav-back-short { display: none; }
@media (max-width: 768px) {
  .nav-back-long { display: none; }
  .nav-back-short { display: inline; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); opacity: 1; }

.nav-cta {
  background: var(--gold) !important;
  color: var(--dark) !important;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,199,10,0.3);
  opacity: 1 !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px 9px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s;
}

/* =============================================
   PLAYBOOK LAYOUT
   ============================================= */
.playbook-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
}

/* =============================================
   SIDEBAR
   ============================================= */
.playbook-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--dark-sidebar);
  border-right: 1px solid var(--dark-border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  transition: transform 0.3s ease;
}
.playbook-sidebar::-webkit-scrollbar { width: 4px; }
.playbook-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-inner { padding: 0 0 40px; }

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--dark-border);
  margin-bottom: 8px;
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.sidebar-title:hover { color: var(--gold); opacity: 1; }
.sidebar-title svg { flex-shrink: 0; }

/* ---- Nav Items ---- */
.nav-list { list-style: none; }

/* Top-level flat items (Introduction, Resources) */
.nav-flat-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--text-light);
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.nav-flat-item a:hover { color: var(--text-bright); background: rgba(255,255,255,0.03); opacity: 1; }
.nav-flat-item.active a {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-subtle);
}

/* Section items (collapsible parents) */
.nav-section { border-left: 2px solid transparent; }
.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px 9px 14px;
  cursor: default;
}
.nav-section-link {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.nav-section-link:hover { color: var(--text-bright); opacity: 1; }
.nav-section.active-parent { border-left-color: rgba(255,199,10,0.3); }
.nav-section.active-parent .nav-section-link { color: var(--text-bright); }

.nav-section-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}
.nav-section-toggle:hover { color: var(--text-bright); }
.nav-section-toggle .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.nav-section.open .nav-section-toggle .chevron { transform: rotate(180deg); }

/* Children (collapsed by default) */
.nav-children {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-section.open .nav-children { max-height: 800px; }

.nav-child-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px 7px 28px;
  font-size: 13px;
  color: var(--text-light);
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  margin-left: -2px;
}
.nav-child-item:hover { color: var(--text-bright); background: rgba(255,255,255,0.03); opacity: 1; }
.nav-child-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-subtle);
}

.nav-lock {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.45;
}

/* Sub-section anchor links */
.nav-subsections {
  list-style: none;
  padding-bottom: 4px;
}
.nav-sub-item {
  display: block;
  padding: 5px 16px 5px 44px;
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.8;
  transition: color 0.15s, opacity 0.15s;
}
.nav-sub-item:hover { color: var(--gold); opacity: 1; }

/* Section divider */
.nav-divider {
  height: 1px;
  background: var(--dark-border);
  margin: 8px 0;
}

/* =============================================
   MOBILE SIDEBAR TOGGLE
   ============================================= */
.sidebar-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 16px 20px;
  padding: 10px 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: calc(100% - 40px);
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.playbook-main {
  flex: 1;
  min-width: 0;
}

.playbook-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 56px 80px;
}

/* =============================================
   CONTENT TYPOGRAPHY
   ============================================= */
.content-body { line-height: 1.75; }

.content-body h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.content-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--white);
  margin: 3rem 0 1rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--dark-border);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.content-body h2:first-of-type { margin-top: 2rem; }

.content-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.content-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--gold);
}

.content-body p { margin-bottom: 1.2rem; color: var(--text); }
.content-body p:last-child { margin-bottom: 0; }

.content-body ul,
.content-body ol {
  margin: 0.5rem 0 1.25rem 1.5rem;
}
.content-body li { margin-bottom: 0.5rem; color: var(--text); }
.content-body li::marker { color: var(--gold); }

.content-body strong { color: var(--text-bright); font-weight: 600; }
.content-body em { color: var(--text-bright); font-style: italic; }

.content-body a { color: var(--gold); font-weight: 500; }
.content-body a:hover { text-decoration: underline; opacity: 0.8; }

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.75rem 0;
  border: 1px solid var(--dark-border);
  display: block;
}

.content-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem;
  background: rgba(255,199,10,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  color: var(--text-bright);
  font-style: italic;
}

/* Info / tip box */
.tip-box {
  background: rgba(255,199,10,0.06);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.tip-box-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* Password note */
.password-note {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 14px;
  color: var(--text-light);
  margin-top: 2rem;
}

/* =============================================
   PASSWORD GATE
   ============================================= */
.password-gate {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: 48px 24px;
}

.password-gate-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.lock-icon-wrap {
  width: 64px;
  height: 64px;
  background: rgba(255,199,10,0.08);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.lock-icon-wrap svg { width: 28px; height: 28px; color: var(--gold); }

.password-gate-card h2 {
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.password-gate-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.pw-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pw-input {
  flex: 1;
  background: var(--dark);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--white);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.pw-input:focus { border-color: var(--gold); }
.pw-input.shake {
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
}

.pw-btn {
  background: var(--gold);
  color: var(--dark);
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.pw-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,199,10,0.3); }
.pw-btn:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

.pw-error {
  font-size: 13px;
  color: #FC8181;
  margin-top: 8px;
  display: none;
}
.pw-error a { color: #FC8181; text-decoration: underline; }

.pw-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 16px;
}
.pw-hint a { color: var(--gold); }

/* =============================================
   SOCIAL SHARE BUTTONS
   ============================================= */
.share-section {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--dark-border);
}

.share-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 12px;
}

.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.share-btn:hover { border-color: rgba(255,255,255,0.25); color: var(--text-bright); background: rgba(255,255,255,0.03); opacity: 1; }
.share-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.share-btn.copied { border-color: var(--gold); color: var(--gold); }

/* =============================================
   CHAPTER NAVIGATION
   ============================================= */
.chapter-nav {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  justify-content: flex-end;
}

.chapter-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}
.chapter-nav-link:hover {
  background: var(--gold-subtle);
  transform: translateX(4px);
  opacity: 1;
}
.chapter-nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  display: block;
  margin-bottom: 2px;
}

/* =============================================
   PAGE INTRO META
   ============================================= */
.page-intro-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.meta-dot { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--dark-border);
  padding: 40px 0;
}
.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
}
.footer-brand span { color: var(--gold); }

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.footer-links a {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
}
.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 13px;
  color: var(--text-light);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .playbook-content { padding: 40px 40px 60px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--dark-sidebar);
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--dark-border);
    z-index: 199;
  }
  .nav-toggle { display: flex; }

  .playbook-layout { flex-direction: column; }

  .playbook-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%);
    z-index: 150;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  .playbook-sidebar.mobile-open { transform: translateX(0); }
  .playbook-sidebar .sidebar-inner { padding-top: 16px; }

  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 149;
  }
  #sidebar-overlay.active { display: block; }

  .sidebar-mobile-toggle { display: flex; }

  .playbook-content { padding: 24px 20px 60px; }

  .pw-form { flex-direction: column; }
  .pw-btn { width: 100%; justify-content: center; }

  .footer .container { flex-wrap: wrap; gap: 12px; }
  .footer-copy { font-size: 12px; }
}

/* =============================================
   UTILITIES
   ============================================= */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
