/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto Mono', monospace;
  line-height: 1.6;
  color: #000;
  background-color: #fff;
  margin: 0;
  padding: 0;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: white;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #000;
  text-decoration: none;
}

.site-title:hover {
  color: #333;
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: white;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  width: fit-content;
  box-shadow: 0 0 30px 30px rgba(0, 0, 0, 0.1), 0 0 20px 5px inset rgba(0, 0, 0, 0.1);
}

.nav-items {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.nav-item {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #666;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-weight: 400;
  font-size: 0.85rem;
}

.nav-item:hover {
  color: #333;
}

.nav-item.active {
  color: #000;
  text-decoration: underline;
}

.nav-item.external::after {
  content: " ↗";
  font-size: 0.7rem;
}

.nav-text {
  font-weight: 400;
}

/* Main content */
.site-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 10rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #000;
}

/* Content article styles */
.content-article {
  font-size: 0.9rem;
  line-height: 1.7;
}

.content-article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #000;
}

.content-article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #000;
}

.content-article h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #000;
}

.content-article p {
  margin-bottom: 1rem;
}

.content-article ul,
.content-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-article li {
  margin-bottom: 0.5rem;
}

.content-article a {
  color: #000;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.content-article a:hover {
  color: #666;
}

/* Images */
.content-article img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

/* Image attribute styles (from #img-full, #img-right, etc.) */
.content-article img[src*="#img-full"] {
  width: 100%;
  max-width: 100%;
}

.content-article img[src*="#img-right"] {
  float: right;
  max-width: 300px;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-article img[src*="#img-left"] {
  float: left;
  max-width: 300px;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

/* Clear floats after images */
.content-article p::after {
  content: "";
  display: table;
  clear: both;
}

/* Code blocks */
pre {
  background-color: #f5f5f5;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
}

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

/* Syntax highlighting (Prism-based) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a9955;
}

.token.punctuation {
  color: #000;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #b5cea8;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #ce9178;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #d4d4d4;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #569cd6;
}

.token.function,
.token.class-name {
  color: #dcdcaa;
}

.token.regex,
.token.important,
.token.variable {
  color: #d16969;
}

/* Tables */
.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

.content-article th,
.content-article td {
  border: 1px solid #eee;
  padding: 0.75rem;
  text-align: left;
}

.content-article th {
  background-color: #f5f5f5;
  font-weight: 700;
}

.content-article tr:nth-child(even) {
  background-color: #fafafa;
}

/* Blockquotes */
.content-article blockquote {
  border-left: 3px solid #000;
  margin: 1.5rem 0;
  padding-left: 1rem;
  font-style: italic;
  color: #666;
}

/* List pages (tutorials, assignments, resources) */
.content-list {
  list-style: none;
  padding: 0;
}

.content-list-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.content-list-item:last-child {
  border-bottom: none;
}

.content-list-item a {
  color: #000;
  text-decoration: none;
  font-size: 1rem;
  display: block;
  transition: color 0.3s ease;
}

.content-list-item a:hover {
  color: #666;
}

.content-list-item .sequence {
  color: #999;
  margin-right: 0.5rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }

  .main-nav {
    top: 3.5rem;
    padding: 0.4rem 0.75rem;
    max-width: 95vw;
  }

  .nav-items {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .nav-item {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .site-main {
    padding: 1.5rem;
    padding-top: 9rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .content-article img[src*="#img-right"],
  .content-article img[src*="#img-left"] {
    float: none;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .main-nav {
    border-radius: 20px;
  }

  .nav-item {
    padding: 0.35rem 0.4rem;
    font-size: 0.7rem;
  }

  .site-main {
    padding-top: 10rem;
  }
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
