/* SimpCity Community Portal */
:root {
  --navy: #1a1d2e;
  --navy-deep: #12141f;
  --ink: #0f1220;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #c41e3a;
  --lavender: #ede7f6;
  --purple: #5b4a8a;
  --purple-dark: #4a3a72;
  --card: #f3f4f6;
  --white: #ffffff;
  --max: 1080px;
  --font-display: "Libre Baskerville", Georgia, serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--red);
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 1.25rem 0 0.85rem;
}

.logo-link {
  display: flex;
  justify-content: center;
  color: inherit;
}

.logo-link:hover {
  color: inherit;
}

.logo-tiles {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
}

.logo-tiles span {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.logo-tiles.dark span {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--white);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.1rem;
  margin-top: 0.95rem;
  padding: 0 1rem 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.92);
  opacity: 0.92;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Hero */
.hero {
  padding: 2.75rem 0 1.5rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.accent-rule {
  height: 2px;
  background: var(--red);
  border: 0;
  margin: 1.5rem 0 1.15rem;
}

/* Quick links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 2.5rem;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border: 1px solid #d1d5db;
  background: var(--white);
  color: var(--ink);
  font-size: 0.8rem;
  transition: border-color 0.15s, background 0.15s;
}

.quick-links a:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: #fafafa;
}

/* Featured post */
.featured {
  margin-bottom: 2.75rem;
}

.category {
  display: inline-block;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.featured h2 a:hover {
  color: var(--red);
}

.featured-excerpt {
  margin: 0 0 0.7rem;
  max-width: 42rem;
  color: #374151;
  font-size: 0.98rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.thumb-row a {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
}

.thumb-row img,
.story-card__media img,
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.thumb-row a:hover img,
.story-card:hover .story-card__media img {
  transform: scale(1.04);
}

/* More stories */
.section {
  padding: 0.5rem 0 3rem;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.25rem;
  margin-top: 1.35rem;
}

.story-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  margin-bottom: 0.7rem;
}

.story-card h3 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.story-card h3 a:hover {
  color: var(--red);
}

/* Mirror sites */
.mirrors {
  margin: 1rem 0 3.5rem;
  padding: 2rem 1.25rem 1.75rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
}

.mirrors h2 {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.mirror-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.mirror-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.15rem 0.75rem 1rem;
  background: #f0f1f3;
  color: var(--ink);
  border-radius: 8px;
  text-align: center;
}

.mirror-card svg {
  width: 22px;
  height: 22px;
  color: var(--purple);
}

.mirror-card strong {
  font-size: 0.95rem;
}

.mirror-pill {
  display: inline-block;
  margin-top: auto;
  padding: 0.35rem 0.7rem;
  background: var(--lavender);
  color: var(--purple-dark);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.mirror-card:hover .mirror-pill {
  background: #ddd4f0;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.88);
  padding: 1.15rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.85rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.85);
}

.footer-nav a:hover {
  color: #fff;
}

/* Page chrome */
.page-header {
  padding: 2.25rem 0 0.5rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
  line-height: 1.15;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.prose {
  padding-bottom: 3rem;
  max-width: 42rem;
}

.prose h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.25rem;
}

.prose p,
.prose li {
  color: #374151;
}

.prose ul {
  padding-left: 1.2rem;
}

/* Blog list */
.blog-list {
  display: grid;
  gap: 2rem;
  padding-bottom: 3rem;
}

.blog-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.blog-item__media {
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: #e5e7eb;
}

.blog-item h2 {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.post-cover {
  margin: 1.25rem 0 1.5rem;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: #e5e7eb;
}

/* Forum */
.forum-layout {
  display: grid;
  gap: 1rem;
  padding-bottom: 3rem;
}

.forum-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.forum-board__head {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.forum-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.forum-row:nth-child(even) {
  background: #fafafa;
}

.forum-row h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.forum-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat {
  text-align: center;
  font-size: 0.9rem;
  color: #374151;
}

.thread-list .forum-row {
  grid-template-columns: 1fr 70px 120px;
}

.thread-list .forum-board__head {
  grid-template-columns: 1fr 70px 120px;
}

.composer,
.reply-box,
.auth-panel {
  margin: 1.25rem 0;
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 8px;
}

.composer h2,
.reply-box h2,
.auth-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--navy-deep);
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--lavender);
  color: var(--purple-dark);
}

.btn-secondary:hover {
  background: #ddd4f0;
  color: var(--purple-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #d1d5db;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.post {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.post:first-of-type {
  border-top: 1px solid var(--line);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-author {
  font-weight: 700;
  color: var(--navy);
}

.post-body {
  white-space: pre-wrap;
  color: #1f2937;
}

.reaction {
  margin-top: 0.75rem;
}

.reaction button {
  min-width: 4.5rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.lang-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 0;
  cursor: default;
}

.faq details {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq p {
  margin: 0.65rem 0 0;
  color: #374151;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.note {
  padding: 0.85rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 0.9rem;
}

.seo-strip {
  margin: 0 0 2rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.seo-strip h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.seo-strip p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
}

.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 900px) {
  .stories-grid,
  .mirror-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .thumb-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-item {
    grid-template-columns: 1fr;
  }

  .forum-board__head,
  .forum-row,
  .thread-list .forum-board__head,
  .thread-list .forum-row {
    grid-template-columns: 1fr;
  }

  .forum-board__head span:not(:first-child),
  .stat {
    display: none;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .stories-grid,
  .mirror-grid,
  .thumb-row {
    grid-template-columns: 1fr;
  }

  .logo-tiles span {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
  }

  .lang-fab {
    display: none;
  }
}

/* Motion */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.featured,
.stories-grid,
.mirrors {
  animation: rise-in 0.55s ease both;
}

.featured {
  animation-delay: 0.08s;
}

.stories-grid {
  animation-delay: 0.14s;
}

.mirrors {
  animation-delay: 0.2s;
}

.story-card,
.mirror-card,
.quick-links a {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s, background 0.15s;
}

.story-card:hover,
.mirror-card:hover {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .featured,
  .stories-grid,
  .mirrors,
  .thumb-row img,
  .story-card__media img {
    animation: none;
    transition: none;
  }
}
