/* ==========================================================================
   AvoryOS — Clean, Fast, Classic OS Documentation Theme
   ========================================================================== */

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

:root {
  --bg: #ffffff;
  --bg-sidebar: #f8f9fa;
  --text: #212529;
  --text-muted: #555e68;
  --link: #0969da;
  --link-hover: #1f2328;
  --border: #d0d7de;
  --border-muted: #e1e4e8;
  --code-bg: #f6f8fa;
  --header-bg: #24292f;
  --header-text: #f0f6fc;
  --header-link: #d0d7de;
  --header-hover: #ffffff;
  --accent: #0969da;
  --pre-stripe: #0969da;
}

body.dark {
  --bg: #0d1117;
  --bg-sidebar: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --border: #30363d;
  --border-muted: #21262d;
  --code-bg: #161b22;
  --header-bg: #010409;
  --header-text: #f0f6fc;
  --header-link: #8b949e;
  --header-hover: #f0f6fc;
  --accent: #58a6ff;
  --pre-stripe: #58a6ff;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

a:hover {
  text-decoration: underline;
}

/* Header */
#top-bar {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-logo {
  height: 24px;
  width: auto;
  display: block;
}

.brand-name {
  color: var(--header-text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

#nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

#nav a {
  color: var(--header-link);
  font-size: 0.9rem;
  font-weight: 500;
}

#nav a:hover {
  color: var(--header-hover);
  text-decoration: none;
}

#theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--header-text);
  padding: 0.25rem 0.55rem;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}

#theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

/* Layout */
#wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  display: flex;
  gap: 2.5rem;
}

.main-column {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 290px;
  flex-shrink: 0;
}

/* Content Elements */
h1 {
  font-size: 2.1rem;
  margin-bottom: 0.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.45rem;
  margin: 1.75rem 0 0.85rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
}

h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

p {
  margin-bottom: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: 2rem 0;
}

ul {
  margin: 0 0 1rem 1.4rem;
}

li {
  margin-bottom: 0.35rem;
}

strong {
  color: var(--text);
}

/* Buttons / Quick Links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem;
}

.link-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--code-bg);
  color: var(--text);
  text-decoration: none;
}

.link-btn:hover {
  background-color: var(--border-muted);
  text-decoration: none;
}

.link-btn.primary {
  background-color: #2da44e;
  border-color: #2c974b;
  color: #ffffff;
  font-weight: 600;
}

.link-btn.primary:hover {
  background-color: #2c974b;
}

/* Screenshots Gallery */
.screenshot-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.25rem 0 1.5rem;
}

.screenshot-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-sidebar);
}

.screenshot-item a {
  display: block;
  overflow: hidden;
}

.screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.screenshot-item img:hover {
  opacity: 0.92;
}

.screenshot-item figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.screenshot-item figcaption strong {
  color: var(--text);
}

/* Userland Table */
.userland-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.spec-table th,
.spec-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
}

.spec-table th {
  background-color: var(--bg-sidebar);
  color: var(--text);
  font-weight: 600;
}

.spec-table tr:nth-child(even) td {
  background-color: var(--code-bg);
}

/* Code & Pre */
pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pre-stripe);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background-color: var(--code-bg);
  border: 1px solid var(--border-muted);
  border-radius: 3px;
  padding: 0.15em 0.35em;
  color: var(--text);
}

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

/* Sidebar Boxes */
.sidebar .box {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.sidebar .box h3 {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-muted);
}

.clean-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clean-list li {
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.specs-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.specs-mini td {
  padding: 0.3rem 0;
}

.specs-mini td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
}

.specs-mini td:last-child {
  font-weight: 500;
}

.sidebar-thumb {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sidebar-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Footer */
#footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-sidebar);
  padding: 1.5rem 1.25rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.footer-inner a:hover {
  color: var(--link);
}

/* Responsive */
@media (max-width: 820px) {
  #wrapper {
    flex-direction: column;
    padding-top: 1.25rem;
  }
  .sidebar {
    width: 100%;
  }
  .screenshot-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .top-bar-inner {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
  }
  #nav {
    width: 100%;
    order: 3;
    gap: 0.85rem;
    padding-top: 0.4rem;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

