@import url('/variables.css');

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body[data-theme='dark'] {
  --bg: #0b1220;
  --surface: #111b2d;
  --surface-alt: #16233b;
  --text: #edf4ff;
  --muted: #b4c2dc;
  --primary: #7aa2ff;
  --primary-dark: #bdd1ff;
  --accent: #5dc8b5;
  --border: rgba(158, 177, 214, 0.28);
  --shadow: 0 16px 32px rgba(3, 7, 18, 0.42);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.main-nav {
  display: flex;
  gap: 18px;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.main-nav .text-button {
  padding: 0;
  font-weight: 700;
  color: var(--primary);
}

.header-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px !important;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(122, 162, 255, 0.08);
}

.hero {
  background: linear-gradient(135deg, #edf3ff 0%, #e6f6f0 100%);
  padding: 64px 0 40px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.hero h1,
.section-heading h2 {
  margin: 0 0 12px;
  color: var(--text);
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.08;
}

.hero-copy {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.stats-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.stat-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stats-card strong {
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.section-block {
  padding: 56px 0 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.articles-grid,
.suggestions-grid,
.theme-list {
  display: grid;
  gap: 18px;
}

.articles-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.article-card,
.suggestion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-image {
  height: 180px;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #dfeaff, #eff4ff);
}

.article-body,
.suggestion-card {
  padding: 18px;
}

.meta-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.theme-pill,
.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--primary-dark);
}

.date-pill {
  background: #f3f7fb;
  color: var(--muted);
}

.article-card h3,
.suggestion-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.summary,
.suggestion-card p {
  margin: 0;
  color: var(--muted);
}

.article-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.author {
  font-size: 0.92rem;
  color: var(--muted);
}

.button,
.text-button {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.button {
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.text-button {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  padding: 0;
}

.theme-list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.theme-chip {
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f3f8ff);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.read-more-block {
  padding-bottom: 32px;
}

.suggestions-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-form,
.article-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.theme-chip.filterable {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-chip.filterable:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.theme-chip.is-active {
  background: linear-gradient(135deg, var(--primary), #7d95ff);
  color: white;
}

.role-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
}

.approval-queue,
.moderation-queue {
  display: grid;
  gap: 14px;
}

.approval-item,
.moderation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.compact-item {
  min-height: 62px;
}

.compact-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.compact-item-main strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-button {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.moderation-comment {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-news-carousel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
}

.top-news-track {
  min-height: 320px;
}

.carousel-slide {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.carousel-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

.carousel-copy h3 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.carousel-copy p {
  margin: 0 0 18px;
  color: var(--muted);
}

.carousel-control {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.search-wrap {
  min-width: min(100%, 300px);
}

.search-wrap input {
  min-height: 42px;
}

.publish-block {
  padding-bottom: 80px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 33, 61, 0.6);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 32px 90px rgba(20, 33, 61, 0.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.8rem;
  cursor: pointer;
}

.modal-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: linear-gradient(135deg, #dfeaff, #eff4ff);
}

.modal-body {
  padding: 24px;
}

.modal-summary {
  color: var(--muted);
  font-size: 1.06rem;
}

.modal-author {
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 20px;
}

.article-page-shell {
  padding-bottom: 80px;
}

.policy-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 0 80px;
}

.policy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.policy-card h1,
.policy-card h2,
.policy-card h3 {
  margin-top: 0;
}

.policy-card ul {
  padding-left: 20px;
}

.article-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-detail-image {
  width: 100%;
  height: min(52vw, 520px);
  object-fit: cover;
  display: block;
}

.article-detail-body {
  padding: 28px;
}

.modal-content {
  color: var(--text);
  white-space: pre-line;
  line-height: 1.7;
}

.comment-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
}

.comment-item {
  background: #f6f9ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.comment-item strong {
  display: block;
  margin-bottom: 6px;
}

.comment-form {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

@media (max-width: 900px) {
  .hero-inner,
  .two-up {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .nav {
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
    gap: 12px;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .approval-item,
  .moderation-item,
  .compact-item {
    flex-direction: column;
    align-items: stretch;
  }

  .compact-item-main,
  .compact-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-wrap {
    width: 100%;
  }

  .button,
  .compact-button {
    width: 100%;
  }
}
