:root {
  color-scheme: light;
  --bg: #f3f0e9;
  --panel: #ffffff;
  --ink: #18191d;
  --muted: #686d75;
  --line: #ddd6cc;
  --accent: #146c5c;
  --accent-dark: #0d4d43;
  --danger: #b73939;
  --game: #d9382f;
  --tech: #146cdb;
  --life: #16845f;
  --movies: #8c4bd6;
  --gold: #c3831e;
  --shadow: 0 18px 45px rgba(24, 25, 29, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: #e7e0d5;
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.5rem, 7vw, 6.6rem);
  line-height: 1;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.12;
  text-wrap: balance;
}

h3 {
  font-size: 1.13rem;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  align-items: end;
  gap: 26px;
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--line);
}

.hero-copy p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.theme-rail,
.filter-panel,
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-rail {
  justify-content: flex-end;
}

button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link,
.filter-button,
.theme-chip,
.read-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.primary-link,
.primary-button,
.secondary-button,
.filter-button,
.secondary-link,
.theme-chip,
.read-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.primary-link,
.primary-button,
.filter-button.is-active {
  background: var(--ink);
  color: #fff;
}

.secondary-button,
.secondary-link,
.filter-button {
  background: #e7e0d5;
  color: var(--ink);
  padding: 0 14px;
}

.read-link {
  width: fit-content;
  margin-top: 16px;
  background: #efe8dc;
  color: var(--ink);
}

.primary-link:hover,
.primary-button:hover {
  background: var(--accent-dark);
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin: 26px 0;
}

.lead-story,
.trending-panel,
.side-panel,
.media-card,
.empty-state,
.admin-panel,
.game-card,
.content-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lead-story {
  overflow: hidden;
}

.lead-story img,
.page-image,
.article-image,
.admin-preview {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.lead-story img,
.image-fallback {
  aspect-ratio: 16 / 8.5;
}

.lead-story-body {
  padding: 22px;
}

.lead-story h2 {
  margin-top: 10px;
}

.lead-story h2 a,
.media-card h3 a,
.trend-item h3 a,
.article-title-link {
  text-decoration: none;
}

.lead-story p,
.media-card p,
.trend-item p,
.side-panel p,
.empty-state p,
.game-card p,
.muted,
.page-body,
.article-summary,
.content-meta,
.story-meta {
  color: var(--muted);
}

.story-meta,
.content-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 800;
}

.trending-panel,
.side-panel,
.empty-state,
.admin-panel,
.game-card,
.content-page {
  padding: 22px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading.split {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.trend-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.trend-rank {
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: 950;
  line-height: 1;
}

.trend-item p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

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

.media-card {
  overflow: hidden;
}

.media-thumb {
  display: block;
  background: #ddd4c8;
}

.media-thumb img,
.image-fallback {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  color: #fff;
  font-weight: 950;
  text-transform: uppercase;
}

.media-thumb img {
  object-fit: cover;
}

.media-card-body {
  padding: 16px;
}

.media-card h3 {
  margin-top: 9px;
}

.media-card p {
  margin: 9px 0 0;
}

.side-stack {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.theme-list {
  display: grid;
  gap: 10px;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  text-decoration: none;
  font-weight: 900;
}

.theme-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.article-category,
.mini-category,
.theme-chip {
  width: fit-content;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.article-category,
.mini-category {
  display: inline-flex;
  padding: 4px 9px;
}

.theme-games,
.theme-game {
  background: var(--game);
}

.theme-tech {
  background: var(--tech);
}

.theme-life {
  background: var(--life);
}

.theme-movies {
  background: var(--movies);
}

.image-fallback.theme-life,
.image-fallback.theme-tech,
.image-fallback.theme-games,
.image-fallback.theme-movies {
  background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.08));
}

.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.intro.compact {
  align-items: start;
}

.intro h1,
.content-page h1 {
  max-width: 100%;
  font-size: clamp(2.15rem, 5.2vw, 4.8rem);
  line-height: 1;
}

.intro.compact h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 4.4vw, 4.1rem);
  line-height: 1.06;
}

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

.article-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.article-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.article-image {
  max-height: 360px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.article-body,
.page-body {
  white-space: pre-wrap;
}

.content-page {
  max-width: 880px;
}

.content-page h1 {
  margin-bottom: 14px;
}

.page-image {
  max-height: 480px;
  margin-bottom: 22px;
  border-radius: 8px;
}

.page-body {
  font-size: 1.06rem;
}

.article-summary {
  font-size: 1.12rem;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.game-card {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.game-card .primary-link {
  align-self: center;
  min-width: 96px;
}

.game-tag {
  margin: 0 0 8px;
  color: var(--game);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-layout {
  display: block;
  max-width: 920px;
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.admin-topbar .eyebrow {
  margin-bottom: 8px;
}

.login-layout {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(100%, 420px);
}

.login-panel h1 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.admin-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.admin-spacer {
  display: none;
}

.admin-sidebar h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.admin-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-tabs .is-active {
  background: var(--accent);
  color: #fff;
}

.logout-form {
  margin: 0;
}

.logout-form button,
.admin-tabs .secondary-link {
  justify-content: center;
}

.editor-panel,
.post-manager {
  grid-column: auto;
  width: 100%;
}

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

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(20, 108, 92, 0.18);
  border-color: var(--accent);
}

.form-row,
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

.form-message.error {
  color: var(--danger);
}

.danger-button {
  background: #f2dddd;
  color: var(--danger);
  padding: 0 16px;
}

.delete-form {
  margin-top: 14px;
}

.admin-preview {
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-post-list {
  display: grid;
  gap: 10px;
}

.admin-post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-post-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer {
  min-height: 72px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  font-weight: 800;
}

@media (max-width: 900px) {
  .home-hero,
  .front-grid,
  .content-shell,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .theme-rail,
  .filter-panel {
    justify-content: start;
  }

  .side-stack {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    width: min(100% - 24px, 1180px);
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }

  main {
    width: min(100% - 24px, 1180px);
    padding-top: 26px;
  }

  .home-hero {
    min-height: auto;
    padding-top: 12px;
  }

  .intro,
  .section-heading.split,
  .game-card,
  .admin-post-item {
    display: grid;
    align-items: start;
  }

  .article-card,
  .admin-layout,
  .form-row,
  .button-row {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    display: grid;
    align-items: start;
  }

  .admin-sidebar,
  .editor-panel,
  .post-manager {
    position: static;
    grid-column: auto;
  }
}
