/* ==========================================================================
   Components — Nav, Cards, Callouts, Buttons, Footer
   Import after base.css. Uses custom properties defined there.
   ========================================================================== */

/* --- Navigation --- */

.nav {
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
}

.nav__brand {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__brand img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.nav__brand--accent {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav__link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.nav__link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav__link--active {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Theme Toggle --- */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.theme-toggle img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

/* Show/hide sun/moon based on theme */
.theme-toggle__sun {
  display: block;
}

.theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle__moon {
    display: block;
  }
}

/* --- Content Card --- */

.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 10px;
}

.card__title {
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card__body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card__body p + p {
  margin-top: 8px;
}

/* Accent card — left border tinted with project colour */
.card--accent {
  border-left: 4px solid var(--accent);
}

.card--accent .card__title {
  color: var(--accent);
}

/* --- Project Card (for gallery on landing page) --- */

.project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.project-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  flex-shrink: 0;
  image-rendering: pixelated;
}

.project-card__name {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
}

.project-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.project-card__arrow {
  margin-left: auto;
  color: var(--border);
  font-size: 18px;
}

.project-card__arrow img {
  transform: rotate(-90deg);
}

/* --- Callout --- */

.callout {
  background: var(--callout-bg);
  border: 2px solid var(--callout-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--callout-text);
  margin-bottom: 12px;
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

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

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--accent {
  background: var(--accent);
  color: #ffffff;
}

/* --- Footer --- */

.footer {
  margin-top: 48px;
  padding: 20px 24px;
  border-top: 2px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Section Label --- */

.section-label {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* --- Decorative Divider --- */

.divider {
  width: 100%;
  height: 6px;
  background-image: url('/shared/img/divider.png');
  background-repeat: repeat-x;
  background-size: auto 6px;
  image-rendering: pixelated;
  margin: 24px 0;
}

/* --- Utility --- */

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

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
