/* ============================================
   Octane Guides - Design System
   Matches PDF stylesheet (Ulysses ULSS)
   Fonts: Switzer (body), Sentient (headings)
   ============================================ */

/* Web Fonts */
@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Switzer";
  src: url("/assets/fonts/Switzer-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sentient";
  src: url("/assets/fonts/Sentient-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sentient";
  src: url("/assets/fonts/Sentient-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sentient";
  src: url("/assets/fonts/Sentient-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}


/* ============================================
   Global Reset & Base
   ============================================ */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-gray: #f8f8f8;
  --color-border: #e8e8e8;
  --color-link: #468BDF;

  /* Series colors */
  --color-rendering: #a4de6c;
  --color-materials: #00d4d4;
  --color-camera: #ff6b6b;
  --color-lighting: #ffd93d;
  --color-ui: #d946ef;
  --color-study: #ff9f1c;
  --color-shorty: #7366ff;
  --color-rando: #666666;

  --font-serif: "Sentient", Georgia, serif;
  --font-sans: "Switzer", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 750px;
  --transition: 0.3s ease-out;
}

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

body {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 150%;
  color: var(--color-text);
  background-color: var(--color-bg);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ============================================
   Typography - Matched to PDF
   ============================================ */

/* Paragraphs: 18pt spacing between consecutive paragraphs */
p {
  margin-top: 0;
  margin-bottom: 0;
}

p + p {
  margin-top: 2.125rem;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:hover {
  color: #2d5aa3;
}

/* All headings: Sentient, black, left-aligned, no link styling */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: #000;
  text-align: left;
  line-height: 120%;
}

/* H6 uses Switzer */
h6 {
  font-family: var(--font-sans);
  color: #000;
  text-align: left;
}

/* Remove link styling from ALL heading anchors */
h1 a, h1 a:visited, h1 a:hover, h1 a:active,
h2 a, h2 a:visited, h2 a:hover, h2 a:active,
h3 a, h3 a:visited, h3 a:hover, h3 a:active,
h4 a, h4 a:visited, h4 a:hover, h4 a:active,
h5 a, h5 a:visited, h5 a:hover, h5 a:active,
h6 a, h6 a:visited, h6 a:hover, h6 a:active {
  color: #000 !important;
  text-decoration: none !important;
  cursor: text;
}

/* H1: Part titles (30pt in PDF) - "Upfront Stuff", "Context" */
h1 {
  font-size: 2.3rem;
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 0;
}

/* H2: Section headings (26pt in PDF) - "Introduction", "Definition" */
h2 {
  font-size: 2rem;
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 0.875rem;
}

/* H3: Sub-sections (20pt in PDF) - "Our Brains", "Our Displays" */
h3 {
  font-size: 1.55rem;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* H4: Sub-sub-sections (16pt in PDF) - "Encoding", "Integers" */
h4 {
  font-size: 1.23rem;
  font-weight: bold;
  line-height: 125%;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* H5: Part labels (14pt Sentient bold in PDF) - "Part I", "Part II" */
h5 {
  font-size: 1.08rem;
  font-weight: bold;
  margin-top: 4rem;
  margin-bottom: 0.375rem;
}

/* H6: Utility label (10pt Switzer in PDF) */
h6 {
  font-size: 0.625rem;
  line-height: 150%;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* Spacing: paragraph to heading (36pt in PDF) */
p + h2, p + h3, p + h4 {
  margin-top: 4.25rem;
}

/* Spacing: paragraph to part label */
p + h5 {
  margin-top: 8rem;
}

/* Images: centered, 14pt spacing from paragraphs */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.875rem auto;
  text-align: center;
}

/* Image spacing from paragraphs (14pt in PDF) */
p + img, p + .guide-content img {
  margin-top: 0.875rem;
}

/* Lists: 12pt (0.92× body), line-height 150%, margin-left 1em */
ul, ol {
  margin-left: 1em;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.92em;
  line-height: 150%;
}

li {
  margin-bottom: 0.5rem;
}

li + li {
  margin-top: 0;
}

/* Nested list spacing */
li > ul, li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Blockquote */
blockquote {
  margin: 1rem 0 1rem 2rem;
  font-style: italic;
}

/* Code */
code {
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--color-gray);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Tables - match PDF (top/bottom borders, header separator) */
table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid #000;
  border-bottom: 1.5px solid #000;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.5rem;
  line-height: 1.35;
  text-align: left;
}

th {
  font-weight: bold;
  border-bottom: 1px solid #929292;
}

/* Horizontal rules = part dividers with series image */
hr {
  border: none;
  height: 20px;
  max-width: 100%;
  margin: 2rem 0;
  margin-bottom: 8rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("/images/Rendering Divider.png");
}

/* Divider images by series category - use parent context */
.guide {
  --divider-image: url("/images/Rendering Divider.png");
}

.series-header.rendering ~ .guide-content hr,
.guide.rendering hr {
  background-image: url("/images/Rendering Divider.png");
}

.series-header.materials ~ .guide-content hr,
.guide.materials hr {
  background-image: url("/images/Material Divider.png");
}

.series-header.camera ~ .guide-content hr,
.guide.camera hr {
  background-image: url("/images/Camera Divider.png");
}

.series-header.lighting ~ .guide-content hr,
.guide.lighting hr {
  background-image: url("/images/Lighting Divider.png");
}

.series-header.ui ~ .guide-content hr,
.guide.ui hr {
  background-image: url("/images/UI Divider.png");
}

.series-header.study ~ .guide-content hr,
.guide.study hr {
  background-image: url("/images/Study Divider.png");
}

.series-header.shorty ~ .guide-content hr,
.guide.shorty hr {
  background-image: url("/images/Shorty Divider.png");
}

.series-header.rando ~ .guide-content hr,
.guide.rando hr {
  background-image: url("/images/Rando Divider.png");
}


/* ============================================
   Layout
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}


/* ============================================
   Site Header
   ============================================ */

header {
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

header h1 a {
  color: #000 !important;
  text-decoration: none !important;
}


/* ============================================
   Guide Page - Series Header (LEFT-aligned per PDF)
   ============================================ */

.series-header {
  padding: 0 0 0.5rem 0;
  margin-bottom: 2rem;
  text-align: left;
}

.series-header .series-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.series-header .series-icon {
  display: none;
}

.series-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.3rem;
  font-weight: normal;
  color: #000;
}

.series-header .series-divider {
  display: none;
}

/* Series divider colors (used in hr) */
.series-divider.rendering { color: var(--color-rendering); }
.series-divider.materials { color: var(--color-materials); }
.series-divider.camera { color: var(--color-camera); }
.series-divider.lighting { color: var(--color-lighting); }
.series-divider.ui { color: var(--color-ui); }
.series-divider.study { color: var(--color-study); }
.series-divider.shorty { color: var(--color-shorty); }
.series-divider.rando { color: var(--color-rando); }


/* ============================================
   Guide Page - Featured Image
   ============================================ */

.guide-featured-image {
  width: 100%;
  margin-bottom: 2rem;
}

.guide-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}


/* ============================================
   Guide Page - Navigation
   ============================================ */

.guide-nav-breadcrumb {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.guide-back-link {
  font-size: 0.85rem;
  color: var(--color-link);
  text-decoration: none;
}

.guide-back-link:hover {
  text-decoration: underline;
}


/* ============================================
   Guide Page - Content Area
   ============================================ */

.guide-content {
  max-width: 100%;
}

/* Guide version/meta line (first paragraph) */
.guide-content > p:first-child {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0;
}


/* ============================================
   Gallery Page
   ============================================ */

.guides-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
  margin: 2rem 0;
  align-items: stretch;
}

.guide-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.guide-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.guide-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  margin: 0;
  display: block;
}

.guide-card-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.guide-card-category {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: #666;
}

.guide-card-category-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.guide-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  flex-grow: 1;
}

.guide-card-number {
  font-size: 0.75rem;
  color: #ccc;
  font-weight: 500;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border);
}


/* ============================================
   Filters
   ============================================ */

.filters {
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-text);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: #999;
}

.filter-btn.active {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}


/* ============================================
   Footer
   ============================================ */

footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }
  .series-header h1 { font-size: 1.8rem; }
  .container { padding: 0 1rem; }
  .guides-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}
