* {
  box-sizing: border-box;
}

:root {
  --ink: #0b1433;
  --ink-soft: #1a2752;
  --text: #131a2b;
  --muted: #677086;
  --line: #d9deea;
  --bg: #f4f5f7;
  --white: #ffffff;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1180px, 94vw);
  margin: 0 auto;
}

.site-header {
  background: var(--white);
  border-top: 1px solid #eceff5;
  border-bottom: 1px solid #eceff5;
}

.utility-row {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eceff5;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  text-align: center;
}

.brand-main {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  margin-top: 0.2rem;
}

.utility-link {
  border: none;
  background: none;
  text-decoration: none;
  color: #273354;
  font: inherit;
  font-size: 0.83rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
}

.nav-row {
  min-height: 52px;
  display: grid;
  place-items: center;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.55rem;
}

.topnav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: #1f2a48;
  font-weight: 600;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.topnav a.active,
.topnav a:hover {
  border-bottom-color: #24355f;
}

.news-hero {
  background: linear-gradient(90deg, #0b1332 0%, #081a4b 100%);
  color: #f2f5ff;
  padding: 4rem 0 2.8rem;
}

.news-hero-inner {
  display: grid;
  justify-items: center;
}

.news-hero h1 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 400;
}

.search-box {
  margin-top: 2.25rem;
  width: min(620px, 86vw);
  background: #d9dde7;
  border: 1px solid #c4c9d8;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 1.15rem;
}

.search-box input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.15rem;
  padding: 1.2rem 0;
  color: #1d2436;
  outline: none;
}

.search-box input::placeholder {
  color: #6d768c;
}

.search-box span {
  font-size: 1.75rem;
  color: #2a385f;
}

.category-strip {
  margin-top: 3.2rem;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(5, 11, 33, 0.55);
  padding: 0.6rem;
}

.category-strip a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: #a8b3d4;
  padding: 0.85rem 1.2rem;
}

.category-strip a.active,
.category-strip a:hover {
  background: #19295a;
  color: #f3f6ff;
}

.content-wrap {
  padding: 2rem 0 3.2rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 2.4rem;
}

.featured-card img {
  width: 100%;
  min-height: 340px;
  height: 100%;
  object-fit: cover;
}

.featured-body {
  padding: 1.25rem;
}

.featured-body h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  font-weight: 400;
}

.section-title {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.news-card {
  border: 1px solid var(--line);
  background: var(--white);
}

.news-card img {
  width: 100%;
  height: 188px;
  object-fit: cover;
}

.news-card-body {
  padding: 0.95rem;
}

.news-card-body h3 {
  margin: 0.35rem 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.3;
}

.news-card-body p {
  margin: 0.4rem 0;
}

.news-card-body a {
  text-decoration: none;
  font-weight: 700;
  color: #1c2e5a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.meta {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-block;
  border: none;
  background: #15244f;
  color: #f2f5ff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.78rem 1rem;
  cursor: pointer;
}

.footer {
  border-top: 1px solid #dce1ef;
  background: #eef0f4;
  padding: 1rem 0;
  color: #4b556b;
}

.page-space {
  padding: 2rem 0 3rem;
}

.back-link {
  text-decoration: none;
  color: #223662;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
}

.article-page {
  max-width: 910px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 1.5rem;
}

.article-image {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
}

.article-page h1 {
  margin: 0.8rem 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
}

.article-summary {
  color: #2a3552;
  font-size: 1.06rem;
}

.article-content p {
  margin: 0.85rem 0;
  line-height: 1.72;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1rem;
}

.panel h1,
.panel h2 {
  margin-top: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: #1c2745;
}

.form input,
.form textarea {
  border: 1px solid #c6cede;
  border-radius: 0;
  padding: 0.65rem;
  font: inherit;
}

.message {
  min-height: 22px;
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.message.ok {
  color: #0b6a45;
}

.message.error {
  color: #b00020;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.admin-item {
  border: 1px solid var(--line);
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 75px 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.admin-item img {
  width: 75px;
  height: 55px;
  object-fit: cover;
}

.admin-item h4 {
  margin: 0.1rem 0 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
  line-height: 1.3;
}

.admin-delete-btn {
  border: none;
  background: #f3f4f6;
  color: #b91c1c;
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.admin-delete-btn:hover {
  background: #fee2e2;
}

.auth-main {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 260px);
}

.auth-card {
  width: min(480px, 94vw);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.auth-card h1 {
  margin-top: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
}

.auth-card .btn {
  width: 100%;
}

.articles-table {
  margin-top: 1rem;
}

.articles-list-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.articles-list-table thead {
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
}

.articles-list-table th {
  padding: 0.8rem 0.6rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
}

.articles-list-table td {
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.table-img {
  width: 55px;
  height: 40px;
  object-fit: cover;
}

.table-btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.35rem 0.65rem;
  margin-right: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  cursor: pointer;
}

.table-btn.edit {
  color: #1c2e5a;
  border-color: #1c2e5a;
}

.table-btn.edit:hover {
  background: #e8eef8;
}

.table-btn.delete {
  color: #b91c1c;
  border-color: #fecaca;
}

.table-btn.delete:hover {
  background: #fee2e2;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--white);
  border: 1px solid var(--line);
  width: min(700px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4b5563;
}

.modal-close:hover {
  color: #111827;
}

@media (max-width: 980px) {
  .featured-card,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .utility-row {
    min-height: 68px;
  }

  .utility-link {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .topnav {
    gap: 0.95rem;
  }

  .topnav a {
    letter-spacing: 0.12em;
    font-size: 0.68rem;
  }

  .news-hero {
    padding-top: 2.7rem;
  }

  .search-box {
    margin-top: 1.4rem;
  }

  .search-box input {
    font-size: 1rem;
  }

  .category-strip {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.8rem;
  }

  .category-strip a {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .news-card img {
    height: 210px;
  }
}
