/* ===== Base ===== */
:root {
  --color-bg: #0d0f14;
  --color-bg-alt: #161922;
  --color-accent: #d4af37;
  --color-accent-dark: #a8842a;
  --color-text: #ece9e2;
  --color-text-dim: #b0aca1;
  --color-border: #2a2d38;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  line-height: 1.25;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  overflow-x: auto;
  display: block;
}

table thead, table tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 0.6em 0.8em;
  text-align: left;
}

th {
  background: var(--color-bg-alt);
}

/* ===== Layout wrapper ===== */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-header__logo {
  height: 46px;
  width: auto;
}

.site-header__nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.site-header__nav a {
  color: var(--color-text);
  font-weight: 600;
}

.site-header__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.55em 1.2em;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #1a1608;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  text-decoration: none;
}

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

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

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  gap: 0.4rem;
  color: var(--color-text-dim);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--color-text-dim);
}

.breadcrumbs a {
  color: var(--color-text-dim);
}

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

.breadcrumbs li[aria-current="page"] {
  color: var(--color-text);
}

/* ===== Hero ===== */
.hero {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.hero .wrap {
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.hero__inner {
  position: relative;
}

.hero__img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.hero__text {
  position: absolute;
  top: 50%;
  left: 5%;
  transform: translateY(-50%);
  max-width: 40%;
}

.hero__title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: #ffffff;
}

.hero__subtitle {
  margin: 0 0 1rem;
  color: var(--color-text-dim);
  font-size: 0.95rem;
}

/* ===== Main content / article ===== */
article {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

article h1 {
  font-size: 1.9rem;
  margin-top: 0;
}

article section {
  margin-top: 2.2rem;
}

/* ===== Rating badge ===== */
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  margin: 0.2rem 0 1.2rem;
}

.rating-badge__score {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.rating-badge__score small {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-dim);
}

.rating-badge__label {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  line-height: 1.35;
}

/* ===== TOC accordion ===== */
.toc-accordion {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 1.5rem 0;
  padding: 0;
}

.toc-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.2rem;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-accordion summary::-webkit-details-marker {
  display: none;
}

.toc-accordion summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-accent);
  margin-left: 1rem;
}

.toc-accordion[open] summary::after {
  content: "\2212";
}

.toc-accordion .toc-body {
  padding: 0 1.2rem 1.2rem;
}

.toc-accordion ol {
  margin: 0;
  padding-left: 1.4rem;
}

.toc-accordion li {
  margin: 0.4rem 0;
}

/* ===== FAQ accordion (bonus page) ===== */
.faq-item {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 0.8rem 0;
  padding: 0;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  padding: 0 1.2rem 1.1rem;
  margin: 0;
  color: var(--color-text-dim);
}

/* ===== Author box ===== */
.author-box {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 1rem 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

.author-box p {
  margin: 0.2rem 0;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.site-footer .wrap {
  padding: 2rem 1rem;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  margin-bottom: 1.2rem;
}

.site-footer__nav a {
  color: var(--color-text-dim);
  font-weight: 600;
}

.site-footer__nav a:hover {
  color: var(--color-accent);
}

.site-footer__legal {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .site-header .wrap {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .site-header__brand {
    flex-shrink: 0;
  }

  .site-header__logo {
    height: 34px;
  }

  .site-header__nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    gap: 0.6rem;
  }

  .site-header__nav a {
    font-size: 0.85rem;
  }

  .site-header__actions {
    flex-shrink: 0;
    gap: 0.4rem;
  }

  .btn {
    padding: 0.45em 0.7em;
    font-size: 0.8rem;
  }

  .hero__text {
    position: static;
    transform: none;
    max-width: 100%;
    margin-top: 1rem;
    text-align: center;
  }

  article h1 {
    font-size: 1.5rem;
  }

  .breadcrumbs ol {
    font-size: 0.8rem;
  }
}

@media (max-width: 420px) {
  .site-header__logo {
    height: 28px;
  }

  .site-header__nav a {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
  }

  .site-header__actions {
    gap: 0.3rem;
  }

  .btn {
    padding: 0.45em 0.55em;
    font-size: 0.72rem;
  }
}
