:root {
  /* Typography */
  --spacing-base: 1.5em;
  --font-family-mono: Century Gothic,CenturyGothic,AppleGothic,sans-serif; 
  --font-size-base: 1em;
  --font-size-small: 0.9em;

  /* Spacing */
  --spacing-xs: calc(var(--spacing-base) * 0.25);
  --spacing-sm: calc(var(--spacing-base) * 0.5);
  --spacing-md: var(--spacing-base);
  --spacing-lg: calc(var(--spacing-base) * 2);

  /* Colors */
  --color-bg-primary: #e9eaecf7;
  --color-bg-secondary: #DEE0E3;
  --color-border: #D9DADD;
  --color-text-primary: #000;
  --color-text-muted: #878787;
  --color-selection-bg: #D9DADD;
  --color-selection-code-bg: #BDC1C7;

  /* Layout */
  --container-width: 54ch;
  --border-radius: 3px;
  --gap-base: 1em;
  --gap-small: 0.5em;

  /* Breakpoints */
  --breakpoint-mobile: 600px;
}

/* Common component styles */
.no-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.no-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.list-unstyled {
  list-style: none;
  margin-left: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

.no-underline {
  text-decoration: none;
  border-bottom: none;
}

::selection {
  background: var(--color-selection-bg);
  color: var(--color-text-primary);
}

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

ul {
  list-style-type: disc;
  margin-left: 1.5rem;
}

ol {
  list-style-type: decimal;
  margin-left: 1.5rem;
}

html {
  margin: 0 0 0 calc(100vw - 100%);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font: var(--font-size-base) / var(--spacing-base) var(--font-family-mono);
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(auto, var(--container-width));
  justify-content: center;
  padding: var(--spacing-lg);
  gap: var(--spacing-lg);
  position: relative;
  z-index: 1;
}

.content {
  position: relative;
  z-index: 2;
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgb(50, 2, 2) url('https://gitlab.com/aaaxxxeee/ressources/-/raw/main/IMG_4486.JPG?ref_type=heads');
  background-blend-mode: difference;
  background-position: tiled;
  opacity: 0.5; /* Adjust for desired opacity */
  pointer-events: none;
}


a {
  display: display-block;
  margin-left: -0.16666em;
  text-decoration: none;
  border-bottom: 1px dotted;
}

p,
pre {
  margin: var(--spacing-base) 0;
}

h1,
h2,
h3,
h4,
h5 {
  margin: var(--spacing-base) 0;
  font-weight: bold;
}

h2 {
  counter-increment: h2;
  counter-reset: h3;
}

h3 {
  counter-increment: h3;
  counter-reset: h4;
}

h4 {
  counter-increment: h4;
  counter-reset: h5;
}

h5 {
  counter-increment: h5;
}

/* nested counters */
h2::before {
  content: counter(h2) ". ";
}

h3::before {
  content: counter(h2) "." counter(h3) ". ";
}

h4::before {
  content: counter(h2) "." counter(h3) "." counter(h4) ". ";
}

h5::before {
  content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". ";
}

.highlight {
  background: var(--color-border);
  padding: 0 3px;
}

time {
  color: var(--color-text-muted);
}

footer {
  padding: calc(var(--spacing-base) * 2) 0;
  text-align: right;
}
footer p {
  margin-bottom: 0;
}

pre {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre ::selection {
  background: var(--color-selection-code-bg);
  color: var(--color-text-primary);
}

p > code {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  white-space: pre-wrap;
  word-wrap: break-word;
}

p > code ::selection {
  background: var(--color-selection-code-bg);
  color: var(--color-text-primary);
}

.terms-list {
  padding-bottom: var(--spacing-base);
}

.terms-list ul {
  list-style-type: none;
  margin-left: 0;
}

.terms-list ul li {
  display: inline-block;
}

/* Path navigation styles */
.path-nav {
  font-family: var(--font-family-mono);
  padding: 0px;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  width: 100%;
}

.path-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.path-nav ol {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.path-nav li {
  display: flex;
  align-items: center;
  color: #888;
  flex-shrink: 0;
  max-width: 200px; /* Limit maximum width on small screens */
}

.path-nav li.current {
  max-width: none; /* Allow full width for current page */
}

.path-nav li a {
  text-decoration: none;
  border-bottom: none;
  padding: 0 0.25em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-nav li.current a {
  color: #000;
}

.path-nav a:hover {
  text-decoration: underline;
}

.back-nav {
  margin-bottom: var(--spacing-base);
}

.back-link {
  color: #878787;
  border-bottom: none;
}

.back-link:hover {
  color: #000;
  text-decoration: none;
}

/* Time list */
.time-list ul {
  list-style: none;
  margin-left: 0;
}

.time-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gap-base);
  align-items: start;
  padding: var(--spacing-sm) 0;
}

@media (max-width: var(--breakpoint-mobile)) {
  .time-list li {
    grid-template-columns: 1fr;
    gap: var(--gap-small);
  }

  .time-list time {
    font-size: var(--font-size-small);
  }
}

/* Main menu navigation styles */
.terminal-nav {
  font-family: var(--font-family-mono);
  border-top: 1px solid var(--color-border);
  margin-top: calc(var(--spacing-base) * 2);
  padding-top: var(--spacing-base);
}

.terminal-nav nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1em;
}

.terminal-nav nav ul li {
  display: inline-block;
}

.terminal-nav nav ul li a,
.terminal-nav .back-link {
  color: var(--color-text-muted);
  border-bottom: none;
  text-decoration: none;
}

.terminal-nav nav ul li a:hover,
.terminal-nav .back-link:hover {
  color: var(--color-text-primary);
}

.terminal-nav nav ul li a.active {
  color: var(--color-text-primary);
  font-weight: bold;
}

.terminal-nav .back-nav {
  margin: calc(var(--spacing-base) * 0.5) 0;
}

/* Image styles */
img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--spacing-base) auto;
  border-radius: var(--border-radius);
}

figure {
  margin: var(--spacing-base) 0;
  text-align: center;
}

figure img {
  margin: 0 auto;
}

figcaption {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  margin-top: calc(var(--spacing-base) / 2);
}

/* Table styles */
table {
  width: 100%;
  margin: var(--spacing-base) 0;
  border-collapse: collapse;
}

thead th,
th {
  font-weight: bold;
  text-align: center;
  border-bottom: 2px solid var(--color-border);
  padding: var(--spacing-sm);
}

td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

/* Typography emphasis */
strong {
  font-weight: bold;
}

em {
  font-style: italic;
}

/* Blockquote styles */
blockquote {
  margin: var(--spacing-base) 0;
  padding: var(--spacing-sm) var(--spacing-base);
  border-left: 3px solid var(--color-border);
  background: var(--color-bg-secondary);
  font-style: italic;
}

blockquote > :first-child {
  margin-top: 0;
}

blockquote > :last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .path-nav li {
    max-width: 100px; /* More aggressive truncation on mobile */
  }

  .path-nav li:first-child {
    max-width: none; /* Don't truncate site title */
  }

  .path-nav li.current {
    max-width: 150px; /* Allow slightly more width for current page on mobile */
  }
}

@media (max-device-width: 600px) {
  body {
    padding-top: 2em;
  }

  pre {
    max-width: calc(100vw - 4em);
  }
}

.no-underline-media {
  border-bottom: none;
  margin-left: 0;
}
