/* ===== Base styles ===== */
:root {
  --font-main: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --color-bg-light: #ffffff;
  --color-bg-dark: #181a1b;
  --color-text-light: #000000;
  --color-text-dark: #f1f1f1;
  --color-accent: #007acc;
  --color-muted-light: #f5f5f5;
  --color-muted-dark: #2a2a2a;
}

[data-theme="light"] {
  --color-bg: var(--color-bg-light);
  --color-text: var(--color-text-light);
  --color-muted: var(--color-muted-light);
}

[data-theme="dark"] {
  --color-bg: var(--color-bg-dark);
  --color-text: var(--color-text-dark);
  --color-muted: var(--color-muted-dark);
}

html {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

body {
  margin: 0;
  padding: 0;
}

/* ===== Header ===== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-muted);
  padding: 0.8rem 1rem;
}

.site-header .brand {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
}

.nav a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}

.nav a.active {
  color: var(--color-accent);
  font-weight: bold;
}

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

.theme-toggle {
  border: none;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ===== Layout ===== */
.container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
}

.sidebar {
  flex: 1 1 250px;
  max-width: 250px;
  padding: 1rem;
  background-color: var(--color-muted);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.content {
  flex: 3 1 600px;
  padding: 1rem;
}

/* ===== Sidebar elements ===== */
.avatar {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.quick p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}

/* ===== Links ===== */
a {
  color: var(--color-accent);
}

a:hover {
  opacity: 0.8;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  background-color: var(--color-muted);
}

.social-icons a {
  margin: 0 0.4rem;
  color: var(--color-text);
  font-size: 1.2rem;
}

.social-icons a:hover {
  color: var(--color-accent);
}

/* ===== Lists ===== */
.list {
  padding-left: 1.2rem;
}

.list li {
  margin-bottom: 0.4rem;
}

/* ===== Forms ===== */
form input,
form textarea {
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font-main);
}

form button {
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

form button:hover {
  opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    max-width: 100%;
  }
}

/* === Theme & toggle enhancements === */

/* Smooth theme transitions */
body,
.site-header,
.site-footer,
.sidebar,
.content,
.theme-toggle,
.nav a,
a {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease,
              box-shadow 180ms ease, opacity 180ms ease;
}

/* Nicer theme-toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: var(--card, rgba(0,0,0,.04));
  box-shadow: var(--shadow, 0 1px 2px rgba(0,0,0,.08));
  cursor: pointer;
  line-height: 1;
  user-select: none;
}

.theme-toggle .icon {
  font-size: 18px;
  transform: translateY(1px); /* optical centering */
}

/* Hover/active/focus states */
.theme-toggle:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,.12) inset;
}

/* Accessible focus ring */
.theme-toggle:focus-visible,
.nav a:focus-visible,
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Subtle link hover polish */
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

