/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Using rem for font-size base, responsive with clamp() */
body {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  line-height: 1.6;
  color: #2d2d2d;
  background-color: #e8e8e8;
}

/* Typography using rem and em units for scalability */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  line-height: 1.3;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
  line-height: 1.4;
}

p {
  margin-bottom: 1rem;
  color: #3d3d3d;
}

a {
  color: #d97706;
  text-decoration: underline;
  transition: color 0.2s;
}

a:hover {
  color: #b45309;
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

ul, ol {
  margin-left: 1.5em;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  background-color: #f3f4f6;
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

pre {
  background-color: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 0.25rem solid #d97706;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #4b5563;
}

hr {
  border: none;
  border-top: 0.125rem solid #d1d5db;
  margin: 2rem 0;
}

/* Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar using rem and % units */
.sidebar {
  width: clamp(15rem, 20vw, 18rem);
  background-color: #2b2b2b;
  color: #ffffff;
  padding: 2rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-logo img {
  width: 100%;
  height: auto;
}

.sidebar-nav > ul {
  list-style: none;
  margin: 0;
}

.sidebar-nav > ul > li {
  margin-bottom: 0;
}

/* Navigation links using em units for padding */
.sidebar-nav a {
  display: block;
  padding: 0.75em 1.5rem;
  color: #d1d5db;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
  background-color: #3d3d3d;
  color: #ffffff;
}

.sidebar-nav .active {
  color: #ffffff;
  border-left: 0.25rem solid #d97706;
  box-sizing: border-box;
}

.sidebar-nav .has-children > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.sidebar-nav .has-children > a > span {
  color: #ffffff;
  cursor: pointer;
}
  
.sidebar-nav .has-children > a > span::after {
  content: '+';
  font-size: 1.25rem;
  line-height: 1rem;
}

.sidebar-nav .has-children.open > a > span::after {
  content: '−';
}

.sidebar-nav .submenu {
  list-style: none;
  display: none;
}

.sidebar-nav .submenu.open {
  display: block;
}

.sidebar-nav .submenu a {
  padding-left: 2.5rem;
  font-size: 0.95rem;
}

/* Mobile menu toggle using rem units */
.menu-toggle {
  display: none;
  background-color: #2b2b2b;
  color: #ffffff;
  border: 0.125rem solid #ffffff;
  padding: 0.5rem 1rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  cursor: pointer;
  
  > img {
      width: 1.25rem;
      height: auto;
  }
}

.menu-toggle:hover {
  background-color: #3d3d3d;
}

/* Main content using responsive margin */
.main-content {
  flex: 1;
  margin-left: clamp(15rem, 20vw, 18rem);
  transition: margin-left 0.3s ease;
}

.content h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem);
}

/* Patreon bar using responsive padding */
.patreon-bar {
  background-color: #6b7280;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.patreon-text {
  color: #ffffff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: 0.0625em;
}

/* Button using em-based padding */
.support-button {
  background-color: #d97706;
  color: #ffffff;
  padding: 0.5em 1.5em;
  border: none;
  border-radius: 0.25rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.125rem;
  letter-spacing: 0.0625em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.support-button:hover {
  background-color: #b45309;
}

/* Content using responsive padding and max-width */
.content {
  background-color: #e8e8e8;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.content-section {
  background-color: #ffffff;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 0.5rem;
  box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1);
  margin: auto;
  max-width: 75rem;
}

.mobile-header {
  display: none;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 1rem;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
}

.mobile-header-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  letter-spacing: 0.0625em;
  margin: 0;
}

.mobile-header-subtitle {
  font-size: 0.75rem;
  color: #d1d5db;
  font-style: italic;
  margin-top: 0.25rem;
}

.table-actions__atribute {
  border-right: 2px solid #0d0e13;
}
.icon-circle::before {
  content: '⬤';
}
.icon-circle.filled::before {
  color: #0d0e13;
}
.text-long .table-actions th {
  background-color: #0d0e13;
}


/* Responsive breakpoint using em units for consistency */
@media (max-width: 48em) {
    .container {
      display: block;
    }

    .sidebar {
      width: 100vw;
      height: auto;
      min-height: 5rem;
      padding: 0;
      position: static;
      .logo-desktop {
        display: none;
      }
    }

    .sidebar-logo {
      padding: 0;
      margin: 0;
    }

  
  .title-box {
    width: 100vw;
    min-height: 5rem;
    display: flex;
    align-items: center;

    > * {
      margin-left: 2rem;
    }
  }

  .sidebar-nav {
    display: none;
    width: 80vw;
    max-width: 20rem;
  }

  .open {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-header {
    display: block;
  }

  .header {
    margin-top: 5rem;
    padding: 1.5rem 1rem;
  }

  .header h1 {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }

  .patreon-bar {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .patreon-text {
    font-size: 1.25rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .content-section {
    padding: 1.5rem;
  }

  h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  h2 {
    font-size: clamp(1.5rem, 4vw, 1.875rem);
  }

  h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
  }

  body {
    font-size: clamp(0.9rem, 2vw, 1rem);
  }
}

/* Logo responsive swap: show desktop logo by default, mobile logo on small screens */
.logo-desktop { display: block; width: 100%; height: auto; }
.logo-mobile { display: none; width: 100%; height: auto; }

@media (max-width: 48em) {
  .logo-desktop { display: none; }
  .logo-mobile { display: block; }
  /* make logo a bit smaller on the mobile sidebar */
  .sidebar-logo img { 
    max-width: 60vw;
    display: block;
    display: flex;
  }
}
