:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F2F5FC;
  --masthead: #14277D;
  --action-blue: #243ACB;
  --text-primary: #18212E;
  --text-secondary: #4D5B70;
  --borders: #D5DDED;
  --age-notice-surface: #162C85;
  --age-grid: rgba(255,255,255,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 17px;
  text-transform: none;
}
a { color: var(--action-blue); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Skip Link */
.skip-link {
  position: absolute; top: -40px; left: 0; background: var(--action-blue); color: #fff;
  padding: 8px; z-index: 1000; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Header & Nav */
.site-header {
  background-color: var(--masthead);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #fff;
}
.wordmark {
  font-size: 20px; font-weight: 700; color: #fff; text-decoration: none;
}
.wordmark:hover { text-decoration: none; }

.main-nav { display: flex; align-items: center; gap: 20px; }
.nav-link {
  color: #fff; font-size: 15px; padding: 18px 0; border-bottom: 3px solid transparent;
}
.nav-link:hover, .nav-link:focus, .nav-link[aria-current="page"] {
  border-bottom: 3px solid #fff; text-decoration: none;
}

/* Search */
.header-search { display: flex; align-items: center; gap: 8px; margin-left: 20px; }
.header-search input {
  padding: 4px 8px; border: 1px solid var(--borders); border-radius: 4px; font-size: 14px;
}
.header-search button {
  background: var(--action-blue); color: #fff; border: none; padding: 4px 12px;
  border-radius: 4px; cursor: pointer; font-size: 14px;
}

.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

@media (max-width: 1040px) {
  .main-nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: #fff; flex-direction: column; gap: 0; border-bottom: 1px solid var(--borders);
    z-index: 100;
  }
  .main-nav.is-open { display: flex; }
  .nav-link { color: var(--text-primary); padding: 16px 20px; border-bottom: 1px solid var(--borders); }
  .nav-link:hover, .nav-link[aria-current="page"] { background: var(--bg-secondary); border-bottom: 1px solid var(--borders); }
  .mobile-menu-btn { display: block; }
  .header-search { padding: 16px 20px; margin: 0; }
  .header-search input { flex: 1; }
}

/* Independence Strip */
.indep-strip {
  background: #fff; border-bottom: 1px solid var(--borders);
  padding: 12px 20px; font-size: 14px; color: var(--text-secondary);
  text-align: center;
}

/* Main Container */
.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
}
.reading-container {
  max-width: 760px; margin: 0 auto;
}

@media (max-width: 620px) { .container { padding: 28px 0; } }

/* Typography */
h1 { font-size: 36px; margin-bottom: 16px; color: var(--text-primary); }
@media (max-width: 620px) { h1 { font-size: 28px; } }
h2 { font-size: 25px; margin-top: 32px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-top: 24px; margin-bottom: 12px; }
p { margin-bottom: 16px; }

.eyebrow { font-size: 14px; font-weight: 700; color: var(--action-blue); text-transform: uppercase; margin-bottom: 8px; display: block; }

/* Article Grid */
.article-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 32px;
}
@media (max-width: 1100px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .article-grid { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--borders); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column;
}
.card-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
}
.card-thumb svg { width: 48px; height: 48px; fill: var(--text-secondary); opacity: 0.5; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-content { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-cat { font-size: 12px; font-weight: bold; color: var(--action-blue); }
.card-date { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.card-excerpt { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; flex: 1; }
.card-link { font-size: 14px; font-weight: bold; margin-top: auto; }

/* News Page Content */
.news-article {
  padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--borders);
}
.news-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.fact-strip { background: var(--bg-secondary); padding: 16px; border-left: 4px solid var(--action-blue); margin: 16px 0; font-size: 15px; }

/* How to Read & Pale Section */
.pale-section { background: var(--bg-secondary); padding: 32px; margin: 44px 0; border-radius: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 620px) { .two-col { grid-template-columns: 1fr; } }

/* FAQ */
details { background: var(--bg-secondary); margin-bottom: 8px; border-radius: 4px; overflow: hidden; }
summary { padding: 16px; font-weight: 700; cursor: pointer; display: block; outline: none; }
summary:focus { box-shadow: inset 0 0 0 2px var(--action-blue); }
.details-content { padding: 0 16px 16px; }

/* Support Strip */
.support-strip { border: 1px solid var(--borders); padding: 24px; text-align: center; margin-top: 44px; }

/* Age Notice Dialog */
.age-dialog-backdrop {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,.97); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.age-dialog-backdrop[hidden] { display: none; }
.age-panel {
  width: calc(100vw - 32px); max-width: 400px; padding: 30px;
  background-color: var(--age-notice-surface);
  background-image: linear-gradient(var(--age-grid) 1px, transparent 1px), linear-gradient(90deg, var(--age-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(10,20,50,.25);
  color: #fff;
  max-height: 100%; overflow-y: auto;
}
.age-18 { font-size: 38px; font-weight: 800; line-height: 1; }
.age-divider { height: 4px; width: 34px; background: #00E5FF; margin: 16px 0; }
.age-q { font-size: 25px; font-weight: 700; margin-bottom: 16px; line-height: 1.2; }
.age-p { font-size: 15px; margin-bottom: 24px; opacity: 0.9; }
.btn {
  display: block; width: 100%; text-align: center; border: none; border-radius: 4px;
  font-size: 16px; font-weight: 700; cursor: pointer; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.btn-primary { background: #fff; color: var(--masthead); min-height: 48px; }
.btn-primary:hover, .btn-primary:focus { background: #f0f0f0; }
.btn-secondary { background: transparent; color: #fff; border: 1px solid #fff; min-height: 44px; }
.btn-secondary:hover, .btn-secondary:focus { background: rgba(255,255,255,0.1); }
.age-links { margin-top: 16px; font-size: 13px; text-align: center; }
.age-links a { color: #fff; text-decoration: underline; margin: 0 8px; opacity: 0.8; }

/* Correction Tool */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 8px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px; border: 1px solid var(--borders); border-radius: 4px;
  font-family: inherit; font-size: 16px;
}
.draft-output { background: var(--bg-secondary); padding: 16px; border: 1px solid var(--borders); margin-top: 24px; min-height: 100px; white-space: pre-wrap; font-family: monospace; font-size: 14px;}
.tool-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.btn-tool { background: var(--action-blue); color: #fff; border: none; padding: 12px 24px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* Search Results Area */
#search-results-container { display: none; }
#search-results-container.active { display: block; }
.search-result-item { padding: 16px 0; border-bottom: 1px solid var(--borders); }
.search-result-item h3 { margin-top: 0; margin-bottom: 8px; }

/* Footer */
.site-footer { background: var(--bg-secondary); padding: 44px 20px; text-align: center; border-top: 1px solid var(--borders); margin-top: 60px; font-size: 14px; color: var(--text-secondary); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 24px; }
.footer-text { max-width: 600px; margin: 0 auto 16px; }
.reopen-age { background: none; border: none; color: var(--action-blue); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 4px; }