/* KGame - kgames.autos */
:root {
  --bg: #eef5f6;
  --bg-alt: #e2eef0;
  --surface: #ffffff;
  --ink: #12262c;
  --muted: #5d757c;
  --line: rgba(18, 38, 44, 0.1);
  --teal: #0c8f82;
  --teal-dark: #067065;
  --teal-soft: #d5f0ec;
  --navy: #0a2c36;
  --navy-2: #134554;
  --sand: #f4a261;
  --danger: #c44536;
  --shadow: 0 18px 40px rgba(10, 44, 54, 0.12);
  --radius: 16px;
  --nav-h: 72px;
  --max: 1120px;
  --font-display: "Sora", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(12, 143, 130, 0.16), transparent 42%),
    radial-gradient(circle at 90% 8%, rgba(244, 162, 97, 0.14), transparent 36%),
    linear-gradient(180deg, #f7fbfb 0%, var(--bg) 40%, #e8f2f3 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
}

a:hover {
  color: var(--teal);
}

ul {
  padding-left: 1.2rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--navy);
}

p {
  margin: 0 0 1rem;
  color: var(--ink);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Fixed header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(10, 44, 54, 0.06);
}

.nav-bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--navy);
  flex-shrink: 1;
  min-width: 0;
  max-width: calc(100% - 4.5rem);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 44px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.desktop-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.auth-links {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(12, 143, 130, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--navy);
}

.btn-sand {
  background: var(--sand);
  color: #3a2210;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(86vw, 320px);
  height: calc(100vh - var(--nav-h));
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(10, 44, 54, 0.14);
  padding: 1.25rem;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  overflow-y: auto;
}

.mobile-panel.is-open {
  transform: translateX(0);
}

.mobile-panel a {
  display: block;
  padding: 0.85rem 0.4rem;
  color: var(--ink);
  font-weight: 560;
  border-bottom: 1px solid var(--line);
}

.mobile-panel .panel-auth {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 34, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 998;
}

.menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 28, 34, 0.88) 8%, rgba(7, 28, 34, 0.55) 48%, rgba(7, 28, 34, 0.28) 100%),
    linear-gradient(180deg, rgba(7, 28, 34, 0.2) 0%, rgba(7, 28, 34, 0.72) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.85rem, 4.5vw, 3.1rem);
  margin-bottom: 0.85rem;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 720px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.55rem;
}

.intro-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.intro-copy a.ext-link {
  color: var(--teal-dark);
  font-weight: 600;
  border-bottom: 1px dashed rgba(12, 143, 130, 0.45);
}

.visual-panel {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--navy);
}

.visual-panel img {
  width: 100%;
  height: auto;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cat-item {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cat-item img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.cat-item span {
  display: block;
  padding: 0.85rem 1rem 1rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.98rem;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-alt);
}

.article-card .card-body {
  padding: 1rem 1.05rem 1.2rem;
}

.article-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  color: var(--navy);
}

.article-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin: 0;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.faq-item h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

/* Page hero compact */
.page-hero {
  padding: 2.6rem 0 1.4rem;
  background:
    linear-gradient(135deg, rgba(10, 44, 54, 0.96), rgba(12, 143, 130, 0.88)),
    url("images/banner.3dd2.webp") center/cover;
  color: #fff;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

.page-hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 680px;
  margin: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb a {
  color: #fff;
}

.breadcrumb span {
  opacity: 0.7;
}

/* Content layout */
.content-wrap {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.prose {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
}

.prose h2 {
  margin-top: 1.6rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose img.cover {
  width: 100%;
  border-radius: 12px;
  margin: 0.4rem 0 1.2rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.prose .lead {
  font-size: 1.08rem;
  color: var(--navy-2);
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h2 {
  font-size: 1.1rem;
}

.side-box a {
  display: block;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 560;
}

.side-box a:last-child {
  border-bottom: 0;
}

.related-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 7rem);
  color: var(--teal);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: rgba(255, 255, 255, 0.86);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.tag {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 600;
}

.feature-row {
  display: grid;
  gap: 1rem;
}

.feature {
  padding: 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.feature h3 {
  font-size: 1.02rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.feature img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .feature-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prose {
    padding: 1.8rem 1.6rem;
  }
}

@media (min-width: 980px) {
  .desktop-nav,
  .auth-links {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-wrap.has-sidebar {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }

  .cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 979px) {
  .brand-text {
    font-size: 1rem;
  }

  .brand img {
    height: 34px;
  }
}
