:root {
  --bg: #efe3cd;
  --surface: #fbf4e7;
  --surface-strong: #fffdf8;
  --ink: #1f1a13;
  --muted: #635744;
  --line: #d8c19b;
  --brand: #c7a15a;
  --brand-dark: #2a1b0d;
  --accent: #e2bf7a;
  --nav: #2b4570;
  --good: #0c8a4b;
  --shadow: 0 16px 38px rgba(36, 27, 14, 0.16);
  --radius: 20px;
  --radius-sm: 13px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(199, 161, 90, 0.28), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(24, 36, 62, 0.12), transparent 32%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 2px, rgba(255, 255, 255, 0) 2px 8px),
    linear-gradient(180deg, #f2e9d9 0%, #faf4e8 45%, #efe2cb 100%);
  font-family: "Palatino Linotype", "Book Antiqua", Garamond, serif;
  overflow-x: hidden;
}

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

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  color: #2a2217;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid rgba(42, 27, 11, 0.15);
}

.date-line,
.social-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.aqi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(118, 88, 41, 0.28);
  background: #fff7e9;
  color: #352312;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
}

.aqi-chip.good {
  background: #eaf8eb;
  border-color: rgba(19, 126, 60, 0.28);
  color: #166138;
}

.aqi-chip.moderate {
  background: #fff2d8;
  border-color: rgba(156, 113, 31, 0.32);
  color: #7e5515;
}

.aqi-chip.unhealthy-sensitive,
.aqi-chip.unhealthy,
.aqi-chip.very-unhealthy,
.aqi-chip.hazardous {
  background: #fde5df;
  border-color: rgba(149, 45, 28, 0.35);
  color: #8d2719;
}

.badge,
.social-line a {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge {
  background: linear-gradient(140deg, #f3d694, #bf8f3d);
  color: #26170a;
  border: 1px solid rgba(110, 73, 23, 0.35);
}

.social-line a:nth-child(2) {
  background: linear-gradient(135deg, #f3d694, #c69846);
  color: #1e1409;
  border: 1px solid rgba(105, 70, 21, 0.35);
}

.social-line a:nth-child(3) {
  background: linear-gradient(135deg, #f3d694, #c69846);
  color: #1e1409;
  border: 1px solid rgba(105, 70, 21, 0.35);
}

.social-line a:nth-child(4) {
  background: linear-gradient(135deg, #f3d694, #c69846);
  color: #1e1409;
  border: 1px solid rgba(105, 70, 21, 0.35);
}

.masthead {
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 213, 142, 0.2), transparent 38%),
    linear-gradient(160deg, #5f0f10 0%, #8b1215 42%, #b11318 100%);
  color: #fef9ef;
  box-shadow:
    inset 0 -1px 0 rgba(255, 232, 188, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.08);
  border-bottom: 2px solid rgba(200, 161, 87, 0.5);
}

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

.masthead-inner > * {
  min-width: 0;
}

.compact-inner {
  padding: 18px 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.88;
  color: rgba(245, 222, 177, 0.96);
}

.masthead h1 {
  margin: 0;
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0.045em;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.admin-title {
  margin: 0;
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0.032em;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
}

.tagline {
  max-width: 760px;
  margin: 12px 0 0;
  font-size: 1.05rem;
  color: rgba(246, 230, 198, 0.95);
  line-height: 1.8;
}

.logo-link {
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-link,
.ghost-link,
.refresh-link,
.primary-btn,
.secondary-btn {
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.admin-link,
.ghost-link,
.refresh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-weight: 700;
}

.admin-link {
  background: linear-gradient(140deg, #f5dfad, #c89b48);
  color: #201509;
  border: 1px solid rgba(94, 60, 14, 0.28);
  box-shadow: 0 12px 24px rgba(29, 20, 9, 0.28);
}

.ghost-link,
.refresh-link {
  color: #f4deaf;
  border: 1px solid rgba(236, 202, 132, 0.36);
  background: rgba(18, 28, 48, 0.35);
}

.category-nav {
  background: var(--nav);
  color: #fffdf9;
  position: sticky;
  top: 0;
  z-index: 5;
  border-top: 1px solid rgba(237, 205, 141, 0.25);
  border-bottom: 1px solid rgba(237, 205, 141, 0.22);
  box-shadow: 0 10px 22px rgba(28, 44, 72, 0.2);
}

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

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 221, 0.82);
  padding: 8px 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip.active {
  color: #1f1408;
  background: linear-gradient(140deg, #f4dfb0, #c79b4a);
  border-color: rgba(105, 70, 22, 0.3);
}

.home-layout,
.article-layout,
.admin-layout {
  padding: 26px 0 48px;
}

.breaking-strip {
  display: grid;
  grid-template-columns: 210px 1fr;
  background: var(--surface);
  border: 1px solid rgba(133, 99, 45, 0.4);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.breaking-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  font-size: 1.45rem;
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #25180a;
  background: linear-gradient(145deg, #f4ddb0, #c59742);
  border-right: 1px solid rgba(112, 78, 27, 0.32);
}

.ticker-wrap {
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #fffefb, #f9f2e4);
}

.ticker-track {
  display: inline-flex;
  gap: 56px;
  min-width: max-content;
  padding: 18px 0;
  white-space: nowrap;
  animation: ticker 24s linear infinite;
  font-size: 1.08rem;
  font-weight: 700;
  color: #2d2417;
  letter-spacing: 0.02em;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ticker-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c69942;
  box-shadow: 0 0 0 3px rgba(198, 153, 66, 0.26);
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes royalRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-layout > .breaking-strip {
  animation: royalRise 0.42s ease both;
}

.home-layout > .ad-strip {
  animation: royalRise 0.54s ease both;
}

.home-layout > .lead-layout {
  animation: royalRise 0.66s ease both;
}

.home-layout > .split-heading {
  animation: royalRise 0.78s ease both;
}

.home-layout > .news-grid {
  animation: royalRise 0.9s ease both;
}

.ad-strip,
.ad-stack,
.news-grid,
.latest-list,
.admin-list {
  display: grid;
  gap: 18px;
}

.ad-stack,
.news-grid,
.latest-list,
.admin-list {
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}

.ad-strip {
  margin: 24px 0;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 26px;
  align-items: start;
}

.lead-story,
.sidebar-block,
.article-content,
.admin-panel {
  background: var(--surface-strong);
  border: 1px solid rgba(132, 97, 40, 0.32);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lead-story {
  overflow: hidden;
}

.lead-image {
  height: 340px;
  object-fit: cover;
  width: 100%;
}

.lead-copy {
  padding: 28px;
}

.story-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 18px;
}

.story-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 220, 179, 0.85);
  color: #31200f;
  font-size: 0.74rem;
  border: 1px solid rgba(136, 100, 44, 0.26);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lead-copy h2,
.article-content h1 {
  margin: 0;
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.04;
  letter-spacing: 0.012em;
}

.lead-copy p,
.article-intro,
.ad-card p,
.helper-text,
.section-heading p {
  color: var(--muted);
  line-height: 1.7;
}

.story-actions,
.button-row,
.checkbox-row,
.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn {
  border: 0;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  min-height: 44px;
}

.primary-btn {
  background: linear-gradient(140deg, #f3dcab, #c79b49);
  color: #211508;
  border: 1px solid rgba(108, 73, 23, 0.38);
  box-shadow: 0 10px 20px rgba(43, 30, 12, 0.24);
}

.secondary-btn {
  background: #f6eddc;
  color: #2a2013;
  border: 1px solid rgba(145, 113, 66, 0.3);
}

.section-heading,
.sidebar-block,
.article-content,
.admin-panel {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  margin-bottom: 16px;
}

.split-heading {
  margin-top: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.9rem;
  font-family: "Bodoni MT", Didot, "Times New Roman", serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #25190c;
}

.latest-item,
.news-card,
.ad-card,
.admin-item {
  display: grid;
  gap: 14px;
  border-radius: 18px;
}

.latest-item {
  grid-template-columns: 112px 1fr;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.latest-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.latest-thumb {
  width: 112px;
  height: 88px;
  object-fit: cover;
  border-radius: 14px;
}

.latest-item h3,
.news-card h3,
.admin-item h3,
.ad-card h3 {
  margin: 0;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.mini-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.news-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.news-card {
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf8, #f8efdf);
  border: 1px solid rgba(136, 99, 45, 0.36);
  box-shadow: var(--shadow);
}

.card-image {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-copy {
  padding: 18px;
}

.card-copy p {
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ad-card {
  overflow: hidden;
  background: linear-gradient(180deg, #fff9ef, #f9edd8);
  border: 1px solid rgba(173, 130, 63, 0.42);
  box-shadow: var(--shadow);
}

.ad-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.ad-copy {
  padding: 18px;
}

.ad-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7e5a19;
  font-weight: 800;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.92fr);
  gap: 26px;
  align-items: start;
}

.article-content img.hero-article-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 26px;
}

.article-body {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #28303f;
}

.article-body p {
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}

.article-tools {
  margin: 24px 0 6px;
}

.article-empty {
  text-align: center;
  padding: 48px 24px;
}

.admin-layout {
  display: grid;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid rgba(138, 106, 56, 0.34);
  border-radius: 14px;
  padding: 14px 15px;
  font: inherit;
  background: #fff9ef;
}

.admin-form textarea {
  resize: vertical;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f4e7cf;
  border: 1px solid rgba(143, 109, 58, 0.3);
}

.status-line {
  min-height: 24px;
  font-weight: 700;
  color: var(--good);
}

.upload-preview-block {
  display: grid;
  gap: 10px;
}

.upload-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.upload-preview {
  width: min(100%, 340px);
  max-height: 220px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f7f0e6;
}

.admin-list {
  margin-top: 10px;
}

.admin-item {
  padding: 18px;
  background: #fffaf1;
  border: 1px solid rgba(136, 99, 45, 0.34);
}

.admin-item .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.helper-panel {
  background: linear-gradient(135deg, #f9eed9, #fff9ef);
}

.empty-note {
  padding: 18px;
  border-radius: 16px;
  background: #f5e8d0;
  color: var(--muted);
  border: 1px solid rgba(145, 111, 62, 0.28);
  text-align: center;
}

.admin-link:hover,
.ghost-link:hover,
.refresh-link:hover,
.primary-btn:hover,
.secondary-btn:hover,
.news-card:hover,
.ad-card:hover {
  transform: translateY(-3px);
}

.news-card:hover,
.ad-card:hover,
.lead-story:hover,
.sidebar-block:hover {
  box-shadow: 0 18px 34px rgba(42, 30, 12, 0.22);
}

@media (max-width: 980px) {
  .lead-layout,
  .article-layout,
  .breaking-strip {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-row {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .breaking-label {
    padding: 16px 22px 8px;
    justify-content: flex-start;
  }

  .latest-item {
    grid-template-columns: 92px 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .masthead-inner,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-copy,
  .section-heading,
  .sidebar-block,
  .article-content,
  .admin-panel {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .lead-image,
  .article-content img.hero-article-image {
    height: 250px;
  }

  .filter-chip {
    font-size: 1rem;
  }

  .button-row .primary-btn,
  .button-row .secondary-btn,
  .compact-actions .admin-link,
  .compact-actions .ghost-link {
    width: 100%;
    justify-content: center;
  }

  .compact-actions {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .container {
    width: min(1180px, calc(100% - 20px));
  }

  .topbar {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    padding: 10px 0;
  }

  .masthead h1 {
    font-size: clamp(1.35rem, 6.2vw, 2rem);
    line-height: 1.05;
    white-space: nowrap;
  }

  .admin-title {
    font-size: clamp(1.7rem, 9.8vw, 2.5rem);
    line-height: 1.03;
  }

  .logo-link {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

  .tagline {
    font-size: 0.92rem;
  }

  .home-layout,
  .article-layout,
  .admin-layout {
    padding: 16px 0 34px;
  }

  .story-meta,
  .article-meta {
    gap: 8px 12px;
    font-size: 0.9rem;
    margin-bottom: 14px;
  }

  .lead-copy,
  .sidebar-block,
  .article-content,
  .admin-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .breaking-label {
    font-size: 1.25rem;
    padding: 14px 16px 4px;
  }

  .ticker-track {
    gap: 28px;
    font-size: 0.95rem;
    padding: 12px 0;
  }

  .lead-image,
  .article-content img.hero-article-image,
  .card-image,
  .ad-card img {
    height: 200px;
  }

  .latest-item {
    grid-template-columns: 78px 1fr;
    gap: 10px;
  }

  .latest-thumb {
    width: 78px;
    height: 64px;
    border-radius: 10px;
  }

  .check-pill {
    width: 100%;
    justify-content: flex-start;
  }

  .upload-preview {
    width: 100%;
    max-height: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
