/* ===========================
   RESET & BASE
=========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body, "Inter", sans-serif);
  background: var(--color-bg, #f9f9fb);
  color: var(--color-text, #222);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Light / Dark Themes */
body[data-theme="dark"] {
  --color-bg: #181818;
  --color-surface: #222;
  --color-text: #f4f4f4;
  --color-link: #99ccff;
}
body[data-theme="light"] {
  --color-bg: #f9f9fb;
  --color-surface: #fff;
  --color-text: #222;
  --color-link: #005b99;
}

/* ===========================
   GLOBAL ELEMENTS
=========================== */
a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-weight: 600;
  margin-bottom: 0.5em;
}

ul { list-style: none; }

/* ===========================
   TOOLBAR
=========================== */
.toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--color-surface);
  padding: 0.3rem 0.8rem;
  border-bottom: 1px solid #ccc;
}

.tool {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.2rem;
}

/* ===========================
   HEADER
=========================== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid #ccc;
  padding: 1rem;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-title {
  font-size: 1.5rem;
  font-weight: bold;
}

/* ===========================
   NAVIGATION
=========================== */
.nav {
  background: var(--color-surface);
  border-bottom: 1px solid #ccc;
}
.nav--primary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.8rem 1rem;
}

.menu__item--group > .submenu {
  display: none;
  position: absolute;
  background: var(--color-surface);
  border: 1px solid #ccc;
  padding: 0.5rem;
}
.menu__item--group:hover > .submenu {
  display: block;
}

.nav--mobile {
  display: none;
}

.tool--menu {
  display: none;
}

/* ===========================
   MAIN LAYOUT
=========================== */
.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  padding: 2rem;
  flex-grow: 1;
}

.content {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: 8px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget {
  background: var(--color-surface);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.widget__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* ===========================
   FOOTER
=========================== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid #ccc;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .tool--menu {
    display: inline;
  }

  .nav--primary {
    display: none;
  }

  .nav-drawer[aria-hidden="false"],
  .nav--mobile {
    display: block;
    background: var(--color-surface);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 2rem;
    z-index: 1000;
  }

  .menu__item--group > .submenu {
    position: static;
    border: none;
  }
}

/* ===========================
   UTILITIES
=========================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}
