/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: var(--color-gold);
}

ul {
  padding-left: 1.2rem;
}

:root {
  --color-bg: #0e0b12;
  --color-bg-alt: #16111c;
  --color-surface: #1c1620;
  --color-text: #ece6da;
  --color-text-muted: #b7ada0;
  --color-gold: #d3af64;
  --color-gold-dark: #a9843a;
  --color-border: rgba(211, 175, 100, 0.25);
  --content-width: 1200px;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--color-gold);
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-outline {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: transparent;
}

.btn-solid,
.btn-cta {
  color: #1a1408;
  background: linear-gradient(180deg, #e6c988, var(--color-gold-dark));
  border-color: var(--color-gold-dark);
}

.btn-cta {
  padding: 0.75rem 1.75rem;
  font-size: 1.05rem;
}

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

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1rem;
}

.brand {
  display: block;
  flex-shrink: 0;
}

.brand-logo {
  height: 64px;
  width: auto;
  border-radius: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

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

.breadcrumbs ol {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

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

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

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

/* ===== Hero ===== */
.hero {
  position: relative;
  max-width: var(--content-width);
  margin: 0 auto;
}

.hero-media img {
  width: 100%;
  height: auto;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 46%;
  padding: 0 2.5rem;
}

.hero-content h1 {
  margin-top: 0;
}

.hero-content p {
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

/* ===== Main content ===== */
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

section[id] {
  scroll-margin-top: 1rem;
}

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

.toc summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-gold);
  padding: 0.35rem 0;
}

.toc ul {
  margin: 0.75rem 0 0.25rem;
}

.toc li {
  margin: 0.35rem 0;
}

/* ===== Tables (no horizontal scroll on mobile) ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

th,
td {
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  text-align: left;
  word-break: break-word;
}

/* ===== Author box ===== */
aside {
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

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

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.footer-logo {
  height: 56px;
  width: auto;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-cta h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.footer-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-legal {
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  max-width: var(--content-width);
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-legal p {
  margin: 0.3rem 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .header-actions .btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
  }

  .hero-content {
    position: static;
    transform: none;
    width: 100%;
    padding: 1.25rem;
  }

  main {
    padding-top: 1.25rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .header-actions .btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
  }

  .brand-logo {
    height: 48px;
  }

  th,
  td {
    font-size: 0.82rem;
    padding: 0.4rem;
  }
}
