/* ==========================================================================
   Global Bulletin Hub — static stylesheet
   Converted from Tailwind/oklch design tokens to plain CSS.
   ========================================================================== */

:root {
  --radius: 2px;

  --background: oklch(1 0 0);
  --foreground: oklch(0.19 0.005 250);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.19 0.005 250);

  --primary: oklch(0.47 0.185 27.5);
  --primary-foreground: oklch(0.99 0 0);

  --secondary: oklch(0.96 0.003 250);
  --secondary-foreground: oklch(0.24 0.005 250);

  --muted: oklch(0.965 0.003 250);
  --muted-foreground: oklch(0.48 0.008 250);

  --accent: oklch(0.95 0.006 250);
  --accent-foreground: oklch(0.24 0.005 250);

  --border: oklch(0.9 0.004 250);

  --ink: oklch(0.17 0.006 250);
  --ink-foreground: oklch(0.98 0 0);
  --newsprint: oklch(0.975 0.004 90);
  --rule: oklch(0.85 0.004 250);
  --live: oklch(0.47 0.185 27.5);
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}

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

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

.wrap {
  margin-left: auto;
  margin-right: auto;
  max-width: 72rem; /* 6xl */
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
}

main.wrap {
  flex: 1;
}

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

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-bar {
  background-color: var(--ink);
  color: var(--ink-foreground);
}

.header-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.menu-toggle {
  display: none;
  margin-left: -0.25rem;
  padding: 0.25rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

.menu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

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

.brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions a {
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.header-actions a:hover {
  opacity: 1;
}

.main-nav {
  display: none;
  border-bottom: 1px solid var(--rule);
  background-color: var(--background);
}

.main-nav-inner {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--rule);
  background-color: var(--background);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.headline-link {
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.headline-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  .main-nav {
    display: block;
  }
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .menu-toggle {
    display: block;
  }
}

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

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  background-color: var(--ink);
  color: var(--ink-foreground);
}

.footer-inner {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.footer-brand span {
  font-size: 1rem;
  font-weight: 800;
}

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

.footer-tagline {
  margin-top: 0.75rem;
  max-width: 28rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

.footer-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
  row-gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

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

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

.footer-copy {
  margin-top: 2rem;
  font-size: 0.75rem;
  opacity: 0.5;
}

/* -------------------------------------------------------------------------
   Kicker / category label
   ------------------------------------------------------------------------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  text-decoration: none;
}

.kicker-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--primary);
}

/* -------------------------------------------------------------------------
   Home layout
   ------------------------------------------------------------------------- */

.home-grid {
  display: grid;
  gap: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .home-grid {
    grid-template-columns: 1fr 320px;
  }
  .sidebar {
    border-left: 1px solid var(--rule);
    padding-left: 1.5rem;
  }
}

.secondary-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .secondary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.section-title {
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* -------------------------------------------------------------------------
   Article cards
   ------------------------------------------------------------------------- */

.lead-story {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
}

.lead-story a,
.article-card a,
.article-row a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.lead-story h2 {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .lead-story h2 {
    font-size: 2.25rem;
  }
}

.lead-story a:hover h2,
.article-card a:hover h3 {
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.summary-text {
  margin-top: 0.75rem;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.meta-text {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.lead-story img,
.article-card img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.lead-story .img-wrap {
  margin-top: 1rem;
}

.article-card {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.25rem;
}

.article-card h3 {
  margin-top: 0.375rem;
  font-size: 1.125rem;
  line-height: 1.35;
}

.article-card .summary-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta-text {
  margin-top: 0.5rem;
}

.article-card .img-wrap {
  margin-top: 0.75rem;
}

.article-row {
  border-bottom: 1px solid var(--rule);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.article-row a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.article-row .row-text {
  min-width: 0;
  flex: 1;
}

.article-row h3 {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
}

.article-row a:hover h3 {
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.article-row .meta-text {
  margin-top: 0.25rem;
}

.article-row img {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  object-fit: cover;
}

/* -------------------------------------------------------------------------
   Category page
   ------------------------------------------------------------------------- */

.category-page {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.category-title {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.category-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.empty-state {
  padding-top: 5rem;
  padding-bottom: 5rem;
  text-align: center;
  color: var(--muted-foreground);
}

.empty-state h1 {
  font-size: 1.5rem;
  font-weight: 400;
}

.empty-state a {
  margin-top: 1rem;
  display: inline-block;
  color: var(--primary);
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Article detail page
   ------------------------------------------------------------------------- */

.article-grid {
  display: grid;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 1024px) {
  .article-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .article-grid .sidebar {
    border-left: 1px solid var(--rule);
    padding-left: 1.5rem;
  }
}

.article-main {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 42rem;
}

.article-main h1 {
  margin-top: 0.5rem;
  font-size: 1.875rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .article-main h1 {
    font-size: 2.25rem;
  }
}

.article-dek {
  margin-top: 1rem;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.article-byline {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.article-figure {
  margin-top: 1.5rem;
}

.article-figure img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.prose-article {
  margin-top: 1.5rem;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--foreground);
}

.prose-article p {
  margin-bottom: 1.15rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------
   Forms (auth + admin)
   ------------------------------------------------------------------------- */

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--foreground);
  background-color: var(--background);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.field textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn:hover {
  opacity: 0.92;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
}

.icon-btn:hover {
  color: var(--foreground);
}

.icon-btn.danger:hover {
  color: var(--primary);
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Toggle switch */
.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  background-color: var(--border);
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

.switch-track::before {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  left: 0.125rem;
  top: 0.125rem;
  background-color: var(--background);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .switch-track {
  background-color: var(--primary);
}

.switch input:checked + .switch-track::before {
  transform: translateX(1rem);
}

/* -------------------------------------------------------------------------
   Auth page
   ------------------------------------------------------------------------- */

.auth-page {
  margin-left: auto;
  margin-right: auto;
  max-width: 28rem;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.auth-page h1 {
  margin-top: 0.5rem;
  font-size: 1.875rem;
}

.auth-page .lede {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-form {
  margin-top: 2rem;
}

.auth-toggle {
  margin-top: 1rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted-foreground);
}

.auth-toggle button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.form-message {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  border-left: 3px solid var(--primary);
  background-color: var(--muted);
}

.form-message.success {
  border-left-color: #2f8f4e;
}

/* -------------------------------------------------------------------------
   Admin dashboard
   ------------------------------------------------------------------------- */

.admin-header {
  background-color: var(--ink);
  color: var(--ink-foreground);
}

.admin-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.admin-badge {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border-radius: var(--radius);
}

.admin-header a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.admin-header-title {
  font-size: 1rem;
  font-weight: 800;
}

.admin-email {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.7;
}

.admin-signout {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  cursor: pointer;
}

.admin-signout:hover {
  opacity: 1;
}

.admin-signout svg {
  width: 0.875rem;
  height: 0.875rem;
}

.admin-main {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.admin-notice {
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
  background-color: var(--muted);
  padding: 1rem;
  font-size: 0.875rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.75rem;
}

.admin-toolbar h1 {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-filters {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-filters button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  border-radius: var(--radius);
}

.admin-filters button.active {
  background-color: var(--ink);
  color: var(--ink-foreground);
}

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.story-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.story-info {
  min-width: 0;
  flex: 1;
}

.story-info p:first-child {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.story-meta .live {
  color: var(--primary);
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.story-actions .publish-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.story-actions .publish-toggle:hover {
  color: var(--foreground);
}

.admin-empty {
  padding: 4rem 0;
  text-align: center;
  color: var(--muted-foreground);
}

.editor-form {
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
}

.editor-form h1 {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.75rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.editor-body {
  margin-top: 1.5rem;
}

.editor-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
}

.image-preview {
  margin-top: 0.5rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hint-text {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.image-picker {
  display: flex;
  gap: 0.5rem;
}

.image-gallery {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

.gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: none;
  aspect-ratio: 1 / 1;
}

.gallery-thumb:hover {
  border-color: var(--primary);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
