:root {
  --accent: #A10852;
  --ink: #17191d;
  --muted: #606772;
  --line: #d8dde3;
  --surface: #f4f4f6;
  --dark: #292D2F;
  --max-width: 1140px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

a:hover,
a:focus {
  color: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.container,
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 10px 12px;
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-160%);
}

.skip-link:focus {
  color: #ffffff;
  transform: translateY(0);
}

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

.top-strip {
  display: flex;
  min-height: 34px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  max-width: var(--max-width);
  min-height: 78px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  width: 176px;
  min-width: 148px;
  align-items: center;
}

.brand img {
  width: 100%;
  height: auto;
}

.category-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.category-nav a,
.mobile-nav a {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 13px;
  color: #22262b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.category-nav a::after {
  position: absolute;
  right: 13px;
  bottom: 4px;
  left: 13px;
  height: 3px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.25);
  transition: opacity 160ms ease, transform 160ms ease;
}

.category-nav a:hover::after,
.category-nav a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-button {
  display: none;
}

.mobile-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px 18px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.mobile-nav a {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 18px;
  background: #ffffff;
}

.search-panel[hidden],
.mobile-nav[hidden] {
  display: none;
}

.search-panel input {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #ffffff;
}

.search-panel input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-panel button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-footer {
  background: var(--dark);
  color: #ffffff;
}

.hero {
  min-height: 520px;
  background: #111318;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}

.hero-media:focus-visible {
  outline-offset: -6px;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(17, 19, 24, 0.92), rgba(17, 19, 24, 0.42), rgba(17, 19, 24, 0.1));
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 170px 24px 70px;
}

.kicker,
.label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .kicker {
  display: inline-block;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--accent);
}

.hero h1 {
  max-width: 760px;
  margin: 24px 0 16px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.02;
}

.hero p {
  max-width: 660px;
  font-size: 20px;
}

.section {
  padding: 58px 0;
}

.category-stack > .section:first-child {
  padding-top: 0;
}

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

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

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

.card {
  border: 1px solid var(--line);
  background: #ffffff;
}

.card-media {
  display: block;
  color: inherit;
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body {
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 8px 0 10px;
  font-size: 21px;
  line-height: 1.18;
}

.card p,
.muted {
  color: var(--muted);
}

.sidebar {
  border-top: 4px solid var(--accent);
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(23, 25, 29, 0.08);
  padding: 20px;
}

.sidebar h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.sidebar-row.is-active,
.sidebar-row[aria-current="page"] {
  color: var(--accent);
}

.article-body {
  max-width: 760px;
  font-size: 19px;
  line-height: 1.72;
}

.article-body p {
  margin: 0 0 24px;
}

.article-body h2,
.article-body h3 {
  margin: 44px 0 16px;
  line-height: 1.16;
}

.article-body h2 {
  font-size: 32px;
}

.article-body h3 {
  font-size: 25px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 26px 26px;
  padding: 0;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border-left: 5px solid var(--accent);
  background: var(--surface);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.42;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
}

.related {
  margin-top: 70px;
}

.site-footer {
  margin-top: 70px;
}

.footer-inner {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-page,
.admin-page {
  background: var(--surface);
  min-height: 100vh;
}

.auth-box {
  width: min(420px, calc(100% - 40px));
  margin: 70px auto;
  padding: 30px;
  border-top: 4px solid var(--accent);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(23, 25, 29, 0.12);
}

.auth-box h1 {
  margin: 0 0 20px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--dark);
  color: #ffffff;
  padding: 28px 22px;
}

.admin-logo {
  display: block;
  margin-bottom: 32px;
  font-size: 24px;
  font-weight: 800;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a,
.logout-button {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.admin-nav a:hover,
.admin-nav a:focus,
.logout-button:hover,
.logout-button:focus {
  background: var(--accent);
  color: #ffffff;
}

.admin-main {
  padding: 34px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-header h1 {
  margin: 0;
}

.panel {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 24px;
}

.panel + .panel {
  margin-top: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  border-top: 4px solid var(--accent);
  background: #ffffff;
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 32px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
}

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

.button,
.danger-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.button:hover,
.button:focus {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
}

.danger-button {
  border-color: #9b1c1c;
  background: #9b1c1c;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #b9c0c8;
  background: #ffffff;
  padding: 11px 12px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.editor {
  border: 1px solid #b9c0c8;
  background: #ffffff;
}

.editor-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--surface);
}

.editor-link-panel {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.editor-link-panel[hidden] {
  display: none;
}

.editor-link-panel label {
  font-size: 13px;
}

.editor-link-panel input {
  min-height: 34px;
  padding: 7px 9px;
}

.editor-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #9aa3ad;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.editor-button:hover,
.editor-button:focus {
  border-color: var(--accent);
  color: var(--accent);
}

.editor-surface {
  min-height: 360px;
  max-height: min(620px, 68vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  outline: none;
  font-size: 17px;
  line-height: 1.65;
}

.editor-surface:focus {
  box-shadow: inset 0 0 0 3px rgba(161, 8, 82, 0.18);
}

.editor-surface p,
.editor-surface h2,
.editor-surface h3,
.editor-surface ul,
.editor-surface ol,
.editor-surface blockquote {
  margin-top: 0;
}

.editor-surface h2 {
  margin-bottom: 14px;
  font-size: 28px;
}

.editor-surface h3 {
  margin-bottom: 12px;
  font-size: 22px;
}

.editor-surface blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.editor-surface ul,
.editor-surface ol {
  margin-left: 24px;
  padding-left: 0;
}

.editor-source {
  display: none !important;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .editor-link-panel {
    grid-template-columns: 1fr;
  }
}

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

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}

.check input {
  width: auto;
}

.current-image {
  display: grid;
  max-width: 520px;
  gap: 12px;
}

.current-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  object-fit: cover;
}

.alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 5px solid var(--accent);
  background: #fff4f8;
}

.errors {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 5px solid #9b1c1c;
  background: #fff5f5;
}

.pagination {
  margin-top: 22px;
}

.empty-state {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

/*** Pagination ***/
.pagination-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    background: #f4f6fb;
    border-radius: 0.75rem;
}

.pagination-item,
.pagination-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    background: transparent;
    transition: background 0.15s, color 0.15s;
}

.pagination-item:hover,
.pagination-arrow:hover {
    background: #e5e9f2;
    color: #111827;
}

.pagination-item--active {
    background: #111827;
    color: #fff;
    font-weight: 600;
}

.pagination-item--active:hover {
    background: #111827;
    color: #fff;
}

.pagination-arrow--disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: #9ca3af;
}

.pagination-item:focus-visible,
.pagination-arrow:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 1px;
}

@media (max-width: 960px) {
  .main-nav {
    gap: 18px;
  }

  .brand {
    width: 152px;
  }

  .category-nav a {
    padding: 0 8px;
    font-size: 13px;
  }

  .content-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 700px) {
  .top-strip {
    display: none;
  }

  .main-nav {
    grid-template-columns: auto auto;
    min-height: 68px;
    justify-content: space-between;
  }

  .brand {
    width: 142px;
    min-width: 142px;
  }

  .category-nav {
    display: none;
  }

  .menu-button {
    display: inline-grid;
  }

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

  .search-panel {
    padding: 0 24px 18px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 0;
  }

  .hero-media {
    position: relative;
    inset: auto;
  }

  .hero img {
    position: relative;
    height: auto;
    opacity: 1;
  }

  .hero::after {
    content: none;
  }

  .hero-copy {
    padding: 26px 24px;
    background: #111318;
  }

  .admin-main {
    padding: 24px;
  }
}

@media (max-width: 420px) {
  .main-nav {
    padding: 0 16px;
  }

  .brand {
    width: 128px;
    min-width: 128px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .search-panel,
  .mobile-nav {
    padding-right: 16px;
    padding-left: 16px;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }
}
