/*
  HumansExplained.org
  Main stylesheet
  Publisher: WRS Web Solutions Inc.

  Design direction:
  - Warm parchment / deep blue / muted copper
  - Wide responsive layout
  - Calm, family-friendly educational feel
  - No narrow large-screen text issue
*/

:root {
  --bg: #f7f1e7;
  --surface: #fffaf2;
  --surface-2: #efe3d1;

  --text: #243044;
  --muted: #657084;

  --primary: #243b5a;
  --primary-2: #345f7d;

  --accent: #b8793f;
  --accent-2: #d8b36a;

  --border: #dfd0bc;
  --shadow: rgba(36, 48, 68, 0.14);

  --white: #ffffff;
  --danger: #8a3a2b;

  --wrap: 1680px;
  --radius: 22px;
  --radius-sm: 14px;
  --focus: rgba(184, 121, 63, 0.34);
}

/* -----------------------------
   Base
----------------------------- */

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(circle at top left, rgba(216, 179, 106, 0.22), transparent 34rem),
    radial-gradient(circle at top right, rgba(52, 95, 125, 0.14), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-2);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin-top: 0.4rem;
  margin-bottom: 1.2rem;
  padding-left: 1.45rem;
}

li + li {
  margin-top: 0.4rem;
}

strong {
  color: #1d2b40;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* -----------------------------
   Layout helpers
----------------------------- */

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

.narrow {
  width: min(980px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 72px 0;
}

.section-tight {
  padding: 48px 0;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.center {
  text-align: center;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 999;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--white);
  border-radius: 999px;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* -----------------------------
   Header
----------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 242, 0.93);
  border-bottom: 1px solid rgba(223, 208, 188, 0.8);
  box-shadow: 0 10px 30px rgba(36, 48, 68, 0.07);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--primary);
  text-decoration: none;
}

.brand:hover {
  color: var(--primary);
}

.brand-logo {
  display: block;
  width: auto;
  height: 54px;
  max-width: 320px;
  object-fit: contain;
}

.brand-mark {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(36, 48, 68, 0.13);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(184, 121, 63, 0.13);
  color: #8a552b;
}

/* -----------------------------
   Hero
----------------------------- */

.hero {
  padding: 70px 0 52px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 36px;
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(36, 59, 90, 0.98), rgba(52, 95, 125, 0.94)),
    var(--primary);
  color: var(--white);
  border-radius: calc(var(--radius) + 10px);
  box-shadow: 0 24px 70px rgba(36, 48, 68, 0.24);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(216, 179, 106, 0.28), transparent 66%);
  pointer-events: none;
}

.hero-content,
.hero-aside {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 13px;
  border: 1px solid rgba(216, 179, 106, 0.48);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.11);
  color: #f6dfad;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  max-width: 980px;
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 5vw, 5.15rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero p {
  max-width: 1120px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-aside {
  padding: 26px;
  background: rgba(255, 250, 242, 0.11);
  border: 1px solid rgba(255, 250, 242, 0.22);
  border-radius: var(--radius);
}

.hero-aside h2 {
  margin-top: 0;
  color: #fff3d6;
  font-size: 1.45rem;
}

.hero-aside p,
.hero-aside li {
  color: rgba(255, 255, 255, 0.84);
}

.hero-aside ul {
  margin-bottom: 0;
}

/* -----------------------------
   Buttons
----------------------------- */

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(184, 121, 63, 0.24);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.btn:hover {
  background: #9b622f;
  color: var(--white);
}

.button.secondary,
.btn.secondary {
  background: rgba(255, 250, 242, 0.14);
  color: var(--white);
  border: 1px solid rgba(255, 250, 242, 0.32);
  box-shadow: none;
}

.button.secondary:hover,
.btn.secondary:hover {
  background: rgba(255, 250, 242, 0.22);
}

.button.light,
.btn.light {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(36, 48, 68, 0.08);
}

.button.light:hover,
.btn.light:hover {
  background: #fdf4e6;
  color: var(--accent);
}

/* -----------------------------
   Cards and content blocks
----------------------------- */

.card {
  min-width: 0;
  padding: 28px;
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(36, 48, 68, 0.08);
}

.card h2,
.card h3,
.card h4 {
  margin-top: 0;
}

.card p:last-child,
.card ul:last-child,
.card ol:last-child {
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 121, 63, 0.55);
  box-shadow: 0 20px 52px rgba(36, 48, 68, 0.13);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 1180px;
  margin: 0 0 28px;
}

.section-heading.center {
  margin-inline: auto;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--primary);
}

.section-heading p {
  color: var(--muted);
  font-size: 1.08rem;
}

/* -----------------------------
   Typography
----------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.7rem 0 0.7rem;
  color: var(--primary);
  line-height: 1.18;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 4.2rem);
}

h2 {
  font-size: clamp(1.65rem, 2.4vw, 2.55rem);
}

h3 {
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
}

.lead {
  color: #4b586d;
  font-size: clamp(1.08rem, 1.45vw, 1.28rem);
  line-height: 1.72;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.92rem;
}

/* -----------------------------
   Article pages
----------------------------- */

.article-shell {
  padding: 54px 0 72px;
}

.article-hero {
  padding: clamp(28px, 4vw, 52px);
  background:
    linear-gradient(135deg, rgba(36, 59, 90, 0.96), rgba(52, 95, 125, 0.9)),
    var(--primary);
  border-radius: calc(var(--radius) + 8px);
  color: var(--white);
  box-shadow: 0 22px 60px rgba(36, 48, 68, 0.2);
}

.article-hero h1 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: clamp(2.1rem, 4.8vw, 4.6rem);
}

.article-hero .lead {
  color: rgba(255, 255, 255, 0.88);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.96rem;
}

.article-meta a {
  color: #fff3d6;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}

.article-content {
  min-width: 0;
  padding: clamp(28px, 4vw, 52px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(36, 48, 68, 0.08);
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content h2 {
  padding-top: 0.25rem;
}

.article-content blockquote {
  margin: 1.6rem 0;
  padding: 1.1rem 1.25rem;
  border-left: 5px solid var(--accent);
  background: #f6ead9;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #344158;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.article-content th,
.article-content td {
  padding: 0.8rem;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.article-content th {
  background: #efe3d1;
  color: var(--primary);
}

.sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
}

.sidebar-card {
  padding: 22px;
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(36, 48, 68, 0.07);
}

.sidebar-card h2,
.sidebar-card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.sidebar-card ul {
  margin-bottom: 0;
}

.breadcrumbs {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: var(--primary-2);
}

/* -----------------------------
   Notices and assumptions blocks
----------------------------- */

.note,
.assumption-box,
.editorial-box {
  padding: 22px;
  background: #f6ead9;
  border: 1px solid #dec59e;
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
}

.note h2,
.note h3,
.assumption-box h2,
.assumption-box h3,
.editorial-box h2,
.editorial-box h3 {
  margin-top: 0;
}

.safe-box {
  padding: 22px;
  background: #edf2ef;
  border: 1px solid #cdd9d1;
  border-left: 6px solid #527663;
  border-radius: var(--radius);
}

/* -----------------------------
   Article lists
----------------------------- */

.article-list {
  display: grid;
  gap: 18px;
}

.article-teaser {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(36, 48, 68, 0.06);
}

.article-teaser h2,
.article-teaser h3 {
  margin-top: 0;
}

.article-teaser a {
  text-decoration: none;
}

.article-teaser a:hover {
  text-decoration: underline;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: #efe3d1;
  color: #674626;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

/* -----------------------------
   AdSense placement
----------------------------- */

.ad-slot {
  margin: 30px 0;
  padding: 16px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(36, 48, 68, 0.035),
      rgba(36, 48, 68, 0.035) 8px,
      rgba(255, 250, 242, 0.55) 8px,
      rgba(255, 250, 242, 0.55) 16px
    );
  border: 1px dashed rgba(101, 112, 132, 0.42);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
}

.ad-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -----------------------------
   Forms
----------------------------- */

.form-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(36, 48, 68, 0.08);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--primary);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.form-row {
  margin-bottom: 16px;
}

/* -----------------------------
   Footer
----------------------------- */

.site-footer {
  margin-top: 36px;
  padding: 54px 0 28px;
  background: #20324d;
  color: rgba(255, 255, 255, 0.84);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(0, 0.8fr));
  gap: 28px;
}

.site-footer h2,
.site-footer h3 {
  margin-top: 0;
  color: #fff3d6;
}

.site-footer a {
  color: #ffe0a4;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.94rem;
}

/* -----------------------------
   Utility classes
----------------------------- */

.rounded {
  border-radius: var(--radius);
}

.shadow {
  box-shadow: 0 16px 42px rgba(36, 48, 68, 0.08);
}

.surface {
  background: var(--surface);
}

.surface-2 {
  background: var(--surface-2);
}

.border {
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

/* -----------------------------
   Responsive rules
----------------------------- */

@media (max-width: 1180px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    font-size: 16px;
  }

  .wrap,
  .narrow {
    width: min(100% - 32px, var(--wrap));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .site-nav a {
    padding: 7px 10px;
    font-size: 0.92rem;
  }

  .brand-logo {
    height: 48px;
    max-width: 270px;
  }

  .hero {
    padding: 38px 0 34px;
  }

  .hero-card {
    padding: 28px;
  }

  .section {
    padding: 48px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .sidebar,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-shell {
    padding: 34px 0 52px;
  }

  .article-content {
    padding: 26px;
  }
}

@media (max-width: 520px) {
  .wrap,
  .narrow {
    width: min(100% - 24px, var(--wrap));
  }

  .brand-logo {
    height: 42px;
    max-width: 235px;
  }

  .brand-name {
    font-size: 1.28rem;
  }

  .brand-tagline {
    display: none;
  }

  .hero-card,
  .article-hero,
  .article-content,
  .card,
  .form-card {
    border-radius: 18px;
  }

  .hero-actions {
    display: grid;
  }

  .button,
  .btn {
    width: 100%;
  }
}

/* -----------------------------
   Print
----------------------------- */

@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .ad-slot,
  .hero-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .wrap,
  .narrow {
    width: 100%;
  }

  .article-content,
  .article-hero,
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .article-hero {
    color: #000;
    background: #fff;
  }

  .article-hero h1,
  .article-hero .lead,
  .article-meta {
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

