html {
  scroll-padding-top: 60px; /* header height + quick access height */
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f1eff7;
  min-height: 100vh;
  box-sizing: border-box;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0b0031;
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 8px #222;
}

/* --- HEADER LAYOUT --- */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  position: relative;
  padding: 15px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-logo {
  height: 30px;
  width: 30px;
}

.site-name {
  font-size: 1em;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-size 0.2s;
}

.quick-access {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.quick-label {
  font-weight: 400;
  color: #fff;
  margin-right: 6px;
}

.drawer-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 2em;
  cursor: pointer;
  margin-right: 35px;
  transition: color 0.2s;
}

.drawer {
  position: fixed;
  top: 72px;
  left: 0;
  width: 180px;
  height: calc(100vh - 72px);
  background: #0b0031;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
  /* z-index: 900; */
  padding: 24px 0 0 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer nav ul li a {
  display: block;
  padding: 14px 24px;
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  font-size: 15px;
  border-left: 4px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.drawer nav ul li a.active {
  border-left: 4px solid #860098;
  background: #27165a;
}

.drawer nav ul li a:hover {
  background: #1d0f48;
}

.drawer nav ul li a.active:hover {
  background: #27165a;
}

.content-area {
  display: flex;
  flex-direction: row;
  margin-top: 100px;
  margin-left: 180px;
  min-height: calc(100vh - 64px);
  box-sizing: border-box;
}

.content-section h2 {
  padding: 0 8px;
}

main {
  flex: 1 1 0;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

.ad-banner {
  width: 100%;
  background: rgba(0, 0, 0, 0.06);
  color: #222;
  text-align: center;
  padding: 14px 0;
  font-size: 1.1em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 0 0 24px 0;
}

.ad-banner.bottom {
  margin: 24px 0 0 0;
}

.cards-scroll-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 0;
  margin: 0;
}

.banner {
  width: 15%;
  min-width: 180px;
  color: hsl(0, 0%, 13%);
  background: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  height: auto;
}

.banner .ad {
  background: #fff;
  color: #222;
  padding: 16px;
  margin-bottom: 12px;
  width: 90%;
  height: auto;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  color: #222;
}

.card p {
  margin: 0;
  color: #444;
  font-size: 1em;
}

.intro-section {
  margin: 10px 0 0 0;
  text-align: center;
  color: #222;
  padding: 18px 12px 10px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(142, 209, 252, 0.07);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.intro-section h1 {
  margin-bottom: 8px;
  color: #27165a;
  font-weight: 700;
}

.intro-section p {
  margin: 0 auto;
  font-size: 1.08em;
  color: #333;
  max-width: 600px;
  line-height: 1.6;
}

.quick-access {
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* padding: 20px 0px 15px 0px; */
  margin-right: 35px;
}

.quick-access span {
  font-weight: 400;
  color: #fff;
}

.quick-access button {
  margin-left: 4px;
  padding: 4px 12px;
  border: 1px solid #8ed1fc;
  background: #f5faff;
  color: #27165a;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.quick-access button:hover {
  background: #e6f2fb;
}

.qa-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.qa-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 20px 18px;
  margin-bottom: 5px;
}

.question {
  font-weight: bold;
  color: #222;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.answer {
  color: #444;
  font-size: 1em;
  line-height: 1.6;
}

.item-sub-header {
  display: inline-block;
  font-weight: 600;
  color: #444;
  margin-top: 12px;
}

.item-note {
  display: inline-block;
  margin-top: 12px;
}

.qa-item ul {
  margin: 5px 0 0 15px;
  padding: 0;
  color: #444;
  font-size: 1em;
}

.qa-item pre {
  margin: 12px 0 0 0;
  font-size: 0.97em;
  background: #f4f4f4;
  border-radius: 6px;
  padding: 10px;
  overflow-x: auto;
}

.qa-item code {
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  background: none;
  color: #222;
}

.qa-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #fafafa;
  font-size: 0.98em;
}

.qa-table th,
.qa-table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
}

.qa-table th {
  background: #f0f0f0;
  font-weight: bold;
}

footer {
  width: 100%;
  background: #0b0031;
  color: #fff;
  text-align: center;
  padding: 22px;
  font-size: 14px;
  clear: both;
  position: relative;
  z-index: 0;
}

footer a {
  color: #fff;
  font-size: 14px;
}

.qa-item pre {
  background: #222;
  color: #c3c3c3;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  /* margin: 8px 0; */
}

.qa-item code {
  background: none;
  color: #dcdada;
  font-family: Arial, sans-serif;
  font-size: 1em;
}

.congrats-message {
  color: #27165a;
  padding-bottom: 28px;
  margin: 0 0 32px 0;
  font-size: 1.1em;
  font-weight: 500;
  text-align: center;
}

pre code .comment {
  color: #6a9955;
  font-style: italic;
}
pre code .keyword {
  color: #569cd6;
}
pre code .string {
  color: #ce9178;
}
pre code .number {
  color: #b5cea8;
}
pre code .function-name {
  color: #4ec9b0;
}
pre code .variable {
  color: #9cdcfe;
}
pre code .operator {
  color: #d4d4d4;
}
pre code .property {
  color: #dcdcaa;
}
pre code .tag {
  color: #569cd6;
}
pre code .attr {
  color: #fff;
}
pre code .media {
  color: #bc89bd;
}

/* Responsive: Hide banner on tablets and below */
@media (max-width: 1200px) {
  .banner {
    display: none;
  }
}

/* Responsive: Drawer becomes overlay, content full width, quick-access centered */
@media (max-width: 900px) {
  .drawer-toggle {
    display: inline-block;
  }

  .drawer {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    width: 220px;
    height: calc(100vh - 72px);
    background: #0b0031;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    padding-top: 24px;
  }

  .drawer.open {
    display: flex;
    flex-direction: column;
  }

  .content-area {
    margin-left: 0;
    flex-direction: column;
  }

  main {
    padding: 0 4px;
    max-width: 100%;
  }

  .quick-access {
    justify-content: center;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .quick-access span {
    display: none;
  }

  .cards-scroll-area {
    grid-template-columns: 1fr;
  }
}

/* Responsive: Small tablets and phones */
@media (max-width: 600px) {
  html {
    scroll-padding-top: 100px; /* header height + quick access height */
  }
  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  .header-left {
    flex: 1;
    gap: 8px;
  }
  .header-logo {
    height: 28px;
    width: 28px;
  }
  .site-name {
    font-size: 1em;
    max-width: 50vw;
  }
  .quick-access {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100vw;
    justify-content: center;
    background: #f1eff7;
    padding: 8px 0 8px 0;
    gap: 8px;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(142, 209, 252, 0.07);
  }
  .quick-label {
    display: none;
  }
  .drawer-toggle {
    display: block;
  }
}

/* Optional: Add a transition for .quick-access for smoother appearance */
.quick-access {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
