/* =========================================================
   The Bulletin — front-end styles
   Type: Signika (headlines/UI) + JetBrains Mono (meta/data)
   ========================================================= */

:root {
  --ink: #15151f;
  --paper: #f7f6f1;
  --paper-raised: #ffffff;
  --accent: #b3242b;
  --accent-dark: #8f1c22;
  --teal: #1c6b66;
  --line: #dedad0;
  --muted: #6b6a62;
  --muted-soft: #8c8a80;
  --radius: 3px;
  --max-width: 1180px;
  --font-head: 'Signika', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-head);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Skip link / accessibility ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 10px; top: 10px; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--ink);
  color: #cfcfc7;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 34px;
}
.topbar time { letter-spacing: 0.02em; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-search input[type="search"] {
  background: transparent;
  border: none;
  border-bottom: 1px solid #45453f;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 3px 2px;
  width: 140px;
}
.topbar-search input[type="search"]::placeholder { color: #83837a; }
.topbar-search button {
  background: none;
  border: none;
  color: #cfcfc7;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 0;
}
.topbar-search button:hover { color: #fff; }

/* ---------- Masthead ---------- */
.masthead {
  background: var(--paper-raised);
  text-align: center;
  padding: 34px 20px 22px;
  border-bottom: 1px solid var(--line);
}
.masthead a.brand { display: inline-block; }
.masthead h1.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  margin: 0;
  letter-spacing: -0.01em;
}
.masthead .tagline {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ---------- Category nav ---------- */
.nav-bar {
  background: var(--paper-raised);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-bar .container {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar .container::-webkit-scrollbar { display: none; }
.nav-bar a {
  display: block;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 0.96rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-bar a:hover { color: var(--accent); }
.nav-bar a.active { border-color: var(--accent); color: var(--accent); }
.nav-bar a.home-link { color: var(--accent); }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle { display: none; }

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin: 44px 0 18px;
}
.section-head h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
}
.section-head .see-all {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  white-space: nowrap;
}
.section-head .see-all:hover { text-decoration: underline; }

/* ---------- Tag / meta pills ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 2px 8px;
  border-radius: var(--radius);
}
.tag.on-image {
  color: #fff;
  border-color: rgba(255,255,255,0.7);
  background: rgba(21,21,31,0.55);
}
.meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.meta .dot { margin: 0 6px; color: var(--muted-soft); }

/* ---------- Hero / lead layout ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 34px;
  margin-top: 30px;
}
.lead-story figure { margin: 0 0 16px; }
.lead-story img {
  width: 100%;
  aspect-ratio: 16/9.5;
  object-fit: cover;
  border-radius: var(--radius);
}
.lead-story h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.2;
  margin: 14px 0 10px;
}
.lead-story p.dek {
  color: #333228;
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.side-list { display: flex; flex-direction: column; }
.side-list h3.rail-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin: 0 0 4px;
}
.rail-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.rail-item .rail-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--line);
  font-weight: 700;
  line-height: 1;
  min-width: 26px;
}
.rail-item h4 {
  font-size: 0.98rem;
  margin: 0 0 4px;
  line-height: 1.3;
}
.rail-item:hover h4 { color: var(--accent); }

/* ---------- News card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.news-card figure { margin: 0 0 12px; position: relative; }
.news-card img {
  width: 100%;
  aspect-ratio: 4/2.7;
  object-fit: cover;
  border-radius: var(--radius);
}
.news-card .tag { margin-bottom: 8px; }
.news-card h3 {
  font-size: 1.08rem;
  line-height: 1.32;
  margin: 0 0 8px;
}
.news-card:hover h3 { color: var(--accent); }
.news-card p.dek {
  color: #46453c;
  font-size: 0.92rem;
  margin: 0 0 8px;
}

/* ---------- Article page ---------- */
.article-head { max-width: 760px; margin: 34px auto 0; }
.article-head h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.18;
  margin: 14px 0 12px;
}
.article-head .dek {
  font-size: 1.15rem;
  color: #38372d;
  margin-bottom: 14px;
}
.article-figure { max-width: 900px; margin: 26px auto; }
.article-figure img { width: 100%; border-radius: var(--radius); }
.article-figure figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
}
.article-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.08rem;
  color: #232219;
}
.article-body p { margin: 0 0 20px; }
.article-body h2, .article-body h3 { margin: 32px 0 14px; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  font-size: 1.15rem;
  font-style: italic;
  color: #38372d;
}
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 20px; }
.article-share {
  max-width: 760px;
  margin: 30px auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}
.article-share span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.article-share a {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius);
}
.article-share a:hover { border-color: var(--ink); }

/* ---------- Category page header ---------- */
.category-head {
  margin-top: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}
.category-head h1 { font-size: 2rem; margin: 0 0 6px; }
.category-head p { color: var(--muted); margin: 0; max-width: 620px; }

/* list layout for category pages */
.news-list { display: flex; flex-direction: column; margin-top: 20px; }
.news-list-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.news-list-item img { width: 100%; aspect-ratio: 4/2.7; object-fit: cover; border-radius: var(--radius); }
.news-list-item h3 { font-size: 1.2rem; margin: 6px 0 8px; }
.news-list-item:hover h3 { color: var(--accent); }
.news-list-item p.dek { color: #46453c; margin: 0 0 8px; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 40px 0;
  font-family: var(--font-mono);
  font-size: 13px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 8px;
}
.pagination a:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Static pages ---------- */
.static-page { max-width: 760px; margin: 34px auto 60px; }
.static-page h1 { font-size: 2rem; margin-bottom: 20px; }
.static-page .content p { margin: 0 0 18px; font-size: 1.05rem; }

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  margin-top: 10px;
}
.contact-info dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 18px;
}
.contact-info dd { margin: 4px 0 0; font-size: 1.02rem; }
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-field input, .form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-family: var(--font-head);
  font-size: 0.98rem;
  background: var(--paper-raised);
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--ink);
}
.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
}
.btn:hover { background: var(--accent); }
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.notice.success { background: #e7f2ea; color: #1e5b33; border: 1px solid #bfe0c9; }
.notice.error { background: #fbe9e8; color: #8f1c22; border: 1px solid #f0c3c1; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #cfcfc7;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 50px 0 30px;
}
.footer-brand .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 0 12px;
}
.footer-brand p { font-size: 0.92rem; line-height: 1.6; color: #b3b2a8; max-width: 320px; }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid #3d3d36;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: #cfcfc7;
}
.footer-social a:hover { border-color: #cfcfc7; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #8c8a80;
  margin: 0 0 14px;
  font-weight: 400;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.94rem; color: #dedad0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #33332c;
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #8c8a80;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #8c8a80; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-search input[type="search"] { width: 90px; }
  .card-grid { grid-template-columns: 1fr; }
  .news-list-item { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; padding: 40px 0 20px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .masthead { padding: 26px 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
