/* Zallixor Blog — visual theme matching the approved desktop layout.
   Dark navy header/footer, purple-to-blue gradient brand accent,
   card-based magazine layout. Mobile-first, expands at wider widths. */

:root {
  --navy: #0b1220;
  --navy-2: #111a2c;
  --paper: #ffffff;
  --paper-muted: #f5f6fa;
  --rule: #e4e6ee;
  --ink: #14151a;
  --muted-text: #667085;
  --grad-start: #7c3aed;
  --grad-end: #3b82f6;
  --accent: #7c3aed;
  --accent-2: #3b82f6;
  --danger: #e0272c;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1280px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper-muted);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.brand-gradient {
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Masthead ---------- */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 30;
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
}

.masthead-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.masthead-brand img { width: 40px; height: 40px; border-radius: 9px; display: block; }

.masthead-title {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.masthead-title .sub {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted-text);
}

.masthead-tagline {
  display: none;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-text);
  white-space: nowrap;
}

.masthead-edition {
  display: none;
  font-size: 12px;
  color: var(--muted-text);
  text-align: right;
  line-height: 1.35;
  white-space: nowrap;
}

.masthead-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.search-box {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  min-width: 0;
  width: 170px;
  background: var(--paper-muted);
  font-family: inherit;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper-muted);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-text);
  flex-shrink: 0;
  overflow: hidden;
}

.account-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Category nav (dark bar) ---------- */
.masthead-nav-bar {
  background: var(--navy);
}

.masthead-nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  padding: 0 20px;
  font-size: 13px;
  color: #b7c0d6;
  scrollbar-width: none;
}

.masthead-nav::-webkit-scrollbar { display: none; }

.nav-menu-btn {
  background: none;
  border: none;
  color: #b7c0d6;
  cursor: pointer;
  padding: 12px 0;
  display: none;
  flex-shrink: 0;
}

.masthead-nav button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}

.masthead-nav button.active {
  color: #fff;
  border-bottom-color: var(--accent-2);
}

.masthead-nav button:hover { color: #fff; }

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 14px;
}

.section-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0;
}

.view-all-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Homepage hero row: featured + secondary list + sidebar --- */
.hero-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ---------- Featured story ---------- */
.featured {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  min-height: 320px;
}

.featured-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.featured-media.icon-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,18,32,0.05) 30%, rgba(11,18,32,0.92) 90%);
}

.featured-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

.featured-body {
  position: relative;
  z-index: 2;
  padding: 20px;
  padding-top: 160px;
}

.featured .category {
  color: #c7b6ff;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(124,58,237,0.25);
  padding: 3px 9px;
  border-radius: 5px;
  display: inline-block;
}

.featured h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 10px 0 8px;
  font-weight: 800;
}

.featured .excerpt {
  color: #d4d8e4;
  font-size: 14.5px;
  max-width: 640px;
  margin: 0 0 14px;
}

.featured .meta-line { color: #9aa3b8; }

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
}

/* ---------- Secondary "latest updates" list (middle column) ---------- */
.mini-list { display: flex; flex-direction: column; gap: 10px; }

.mini-item {
  display: flex;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  align-items: flex-start;
}

.mini-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--paper-muted);
}

.mini-thumb.icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-item .category {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mini-item h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 3px 0 4px;
  line-height: 1.3;
}

.mini-item .meta-line { font-size: 11.5px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.side-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}

.breaking-card {
  background: #fdf1f0;
  border: 1px solid #f6d3d1;
}

.breaking-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 5px;
  text-transform: uppercase;
}

.breaking-card p { font-weight: 700; font-size: 14px; margin: 10px 0 4px; }
.breaking-card .excerpt { font-size: 13px; color: var(--muted-text); margin: 0 0 8px; }
.breaking-card a.learn-more { font-size: 13px; font-weight: 700; color: var(--accent); }

.side-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
  font-size: 13px;
}

.side-tabs button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: var(--muted-text);
  padding: 0 0 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.side-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

.rank-list { display: flex; flex-direction: column; gap: 12px; }

.rank-item { display: flex; gap: 10px; align-items: flex-start; }

.rank-num {
  font-weight: 800;
  color: var(--muted-text);
  font-size: 14px;
  width: 16px;
  flex-shrink: 0;
}

.rank-thumb {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-muted);
}

.rank-thumb.icon-fallback { display: flex; align-items: center; justify-content: center; }

.rank-item h5 { font-size: 12.5px; font-weight: 700; margin: 0 0 3px; line-height: 1.3; }
.rank-item .meta-line { font-size: 11px; }

.discussion-card h5 { font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.discussion-card p { font-size: 13px; color: var(--muted-text); margin: 0 0 12px; }

.follow-card h5 { font-size: 14px; font-weight: 800; margin: 0 0 12px; }
.follow-icons { display: flex; gap: 10px; }

.follow-icons a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ---------- Icon fallback tiles (category thumbnails) ---------- */
.icon-fallback svg { width: 44%; height: 44%; }
.icon-fallback.sz-lg svg { width: 40%; height: 40%; }

/* ---------- Article grid / cards ---------- */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover { box-shadow: 0 8px 24px rgba(20,21,26,0.08); transform: translateY(-2px); }

.card .thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--paper-muted);
  display: block;
}

.card .thumb.icon-fallback { display: flex; }

.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }

.category {
  color: var(--accent);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
}

.card .excerpt {
  color: var(--muted-text);
  font-size: 13px;
  flex: 1;
  margin: 0;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted-text);
  margin-top: 4px;
}

.meta-line { color: var(--muted-text); font-size: 12px; }

/* ---------- Newsletter banner ---------- */
.newsletter-banner {
  margin-top: 32px;
  background: var(--navy);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: #fff;
}

.newsletter-copy { display: flex; align-items: center; gap: 14px; }
.newsletter-copy img { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.newsletter-copy h4 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.newsletter-copy p { margin: 0; font-size: 13px; color: #b7c0d6; }

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

.newsletter-form input {
  border: 1px solid #2a3550;
  background: #16203a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  min-width: 220px;
  font-family: inherit;
}

.newsletter-form input::placeholder { color: #7c88a3; }

.newsletter-form button {
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
}

.newsletter-note { width: 100%; font-size: 12px; color: #9aa3b8; margin-top: 4px; }

/* ---------- Categories tiles ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.category-tile .icon-fallback {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
}

.category-tile .icon-fallback svg { width: 55%; height: 55%; }

.category-tile .cat-name { font-size: 13.5px; font-weight: 700; display: block; }
.category-tile .cat-count { font-size: 12px; color: var(--muted-text); }

/* ---------- States ---------- */
.state-block {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted-text);
  font-size: 14px;
  grid-column: 1 / -1;
}

.skeleton {
  background: linear-gradient(90deg, var(--rule) 25%, #eceef4 37%, var(--rule) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Auth card ---------- */
.auth-card {
  max-width: 380px;
  margin: 40px auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.auth-card h1 { font-size: 22px; margin: 0 0 6px; font-weight: 800; }
.muted { color: var(--muted-text); font-size: 14px; }
.muted.small { font-size: 12px; margin-top: 16px; }

.btn-primary {
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 14px;
}

.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.auth-error { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ---------- Article page ---------- */
.article-header { margin-bottom: 18px; }

.article-header h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 10px 0;
  font-weight: 800;
}

@media (min-width: 700px) {
  .article-header h1 { font-size: 40px; }
}

.article-header .meta-line { font-size: 13px; }

.article-media {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 16px 0;
  background: var(--rule);
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.article-body p { margin: 0 0 1.1em; }
.article-body img { max-width: 100%; border-radius: 8px; }
.article-body h2, .article-body h3 { margin: 1.4em 0 0.5em; font-weight: 800; }

.share-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.share-bar button, .share-bar a {
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Comments ---------- */
.comments-section { margin-top: 32px; }

.comments-disabled {
  color: var(--muted-text);
  font-size: 14px;
  padding: 16px 0;
}

.comment-form textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 10px;
}

.char-count { font-size: 12px; color: var(--muted-text); }

.signin-prompt {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-size: 14px;
}

.restriction-notice {
  background: #fdf1ef;
  border: 1px solid #f0c9c3;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--danger);
}

.restriction-notice a { text-decoration: underline; }

.my-submissions {
  margin: 14px 0;
  font-size: 13px;
}

.status-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}

.status-chip.pending { background: #fff3d6; color: #8a6100; }
.status-chip.approved { background: #dff5e1; color: #1c6b2c; }
.status-chip.rejected { background: #f6dede; color: #8a1c1c; }

.comment-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper-muted);
  border: 1px solid var(--rule);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.comment-body-wrap { flex: 1; }

.comment-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.comment-author { font-weight: 700; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--muted-text); }
.comment-text { font-size: 14px; margin: 4px 0 6px; white-space: pre-wrap; }

.report-link {
  font-size: 12px;
  color: var(--muted-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.report-panel {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.report-panel select { font-size: 12px; padding: 4px 6px; font-family: inherit; }

/* ---------- Community rules page ---------- */
.rules-body { font-size: 15px; line-height: 1.7; }
.rules-body h2 { font-size: 19px; font-weight: 800; margin: 1.6em 0 0.5em; }
.rules-body ul { padding-left: 20px; }
.rules-body li { margin-bottom: 8px; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--navy);
  color: #b7c0d6;
  margin-top: 40px;
}

.footer-top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 34px; height: 34px; border-radius: 8px; }
.footer-brand .name { color: #fff; font-weight: 800; font-size: 15px; }
.footer-brand .name .sub { display: block; font-size: 9px; letter-spacing: 2px; color: #8a93ab; font-weight: 700; }

.footer-tagline { font-size: 12.5px; color: #8a93ab; }

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.footer-links a:hover { color: #fff; }

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #16203a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b7c0d6;
}

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px 24px;
  border-top: 1px solid #1c2740;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6f7994;
}

/* ---------- Responsive: tablet / desktop ---------- */
@media (min-width: 640px) {
  .article-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 860px) {
  .masthead-tagline { display: flex; }
  .masthead-edition { display: block; }
  .search-box { width: 220px; }
}

@media (min-width: 1000px) {
  .nav-menu-btn { display: inline-flex; align-items: center; }
  .hero-row { grid-template-columns: 1.7fr 1.1fr 1fr; align-items: stretch; }
  .article-grid { grid-template-columns: repeat(4, 1fr); }
  .category-grid { grid-template-columns: repeat(6, 1fr); }
  .featured-body { padding: 24px; padding-top: 200px; }
  .featured h1 { font-size: 28px; }
}
