/* =========================================================
   Gama Blog — Public site styles
   Inspired by keketrucosfree.naola.xyz: clean, friendly,
   purple/coral accents, generous whitespace.
   ========================================================= */

:root,
[data-theme="light"] {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --accent: #f97373;
  --bg: #fdfaff;
  --surface: #ffffff;
  --surface-2: #faf7ff;
  --text: #1f2030;
  --muted: #6b7280;
  --border: #ece8f5;
  --chip-bg: #f3eaff;
  --hero-gradient: linear-gradient(135deg, #f3eaff 0%, #ffe7e7 100%);
  --cover-fallback-bg: linear-gradient(135deg, #ede2ff, #ffe2e2);
  --quote-bg: #faf6ff;
  --ad-stripe-a: #f7f4ff;
  --ad-stripe-b: #efe9ff;
  --ad-border: #d6c8f0;
  --footer-bg: #1c1830;
  --footer-text: #cbc4e0;
  --footer-border: #2e2848;
  --footer-link-hover: #ffffff;
  --preview-bg: #fff7c2;
  --preview-text: #6b5b00;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(80, 50, 160, 0.07);
  --shadow-lg: 0 14px 35px rgba(80, 50, 160, 0.12);
  --container: 1180px;
  color-scheme: light;
}

[data-theme="dark"] {
  --primary: #a78bfa;
  --primary-dark: #c4b5fd;
  --accent: #fb7185;
  --bg: #0f0d18;
  --surface: #1a1726;
  --surface-2: #221d32;
  --text: #ece9f5;
  --muted: #9b96ad;
  --border: #2c2740;
  --chip-bg: #2a2342;
  --hero-gradient: linear-gradient(135deg, #1f1736 0%, #2a1c2a 100%);
  --cover-fallback-bg: linear-gradient(135deg, #2a2342, #3a1f2c);
  --quote-bg: #221d32;
  --ad-stripe-a: #1d182b;
  --ad-stripe-b: #251f37;
  --ad-border: #3b3458;
  --footer-bg: #08070d;
  --footer-text: #b8b3ce;
  --footer-border: #1e1a2c;
  --footer-link-hover: #ffffff;
  --preview-bg: #3b3308;
  --preview-text: #ffe680;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 35px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* -------- Header -------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.nav-wrap {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.brand-name { font-size: 18px; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a {
  color: var(--text); font-weight: 500; font-size: 15px;
  padding: 6px 0; position: relative;
}
.main-nav a:hover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--primary); border-radius: 2px;
}
.search-form { display: flex; align-items: center; }
.search-form input {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; min-width: 200px;
  background: var(--surface-2); color: var(--text);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button { background: none; border: 0; cursor: pointer; font-size: 16px; margin-left: -36px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }

/* -------- Hero -------- */
.hero {
  background: var(--hero-gradient);
  padding: 70px 0 60px;
  text-align: center;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 54px);
  margin: 0 0 12px; line-height: 1.1;
}
.hero-title span {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto; }

/* -------- Sections -------- */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; margin: 40px 0 22px;
}
.featured-section, .posts-section, .related-section { padding-bottom: 30px; }

.featured-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.featured-card { background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.featured-card img { aspect-ratio: 16/10; object-fit: cover; }

/* -------- Layout w/ sidebar -------- */
.layout-with-sidebar {
  display: grid; grid-template-columns: 1fr 320px; gap: 30px;
  align-items: start;
}
.posts-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.post-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cover-link { display: block; }
.cover-link img { aspect-ratio: 16/10; object-fit: cover; }
.cover-fallback {
  aspect-ratio: 16/10; display: grid; place-items: center; font-size: 60px;
  background: var(--cover-fallback-bg);
}
.card-body { padding: 16px 18px 18px; }
.card-body h3 { margin: 8px 0 8px; font-size: 18px; line-height: 1.3; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }
.excerpt { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.meta { color: var(--muted); font-size: 13px; }

.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--chip-bg); color: var(--primary); font-size: 12px; font-weight: 600;
  margin-bottom: 4px;
}
.chip-lg { padding: 6px 14px; font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* -------- Sidebar -------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.widget {
  background: var(--surface); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.widget h4 { margin: 0 0 12px; font-size: 16px; }
.post-mini-list { list-style: none; padding: 0; margin: 0; }
.post-mini-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.post-mini-list li:last-child { border-bottom: 0; }
.post-mini-list a { color: var(--text); font-weight: 500; font-size: 14px; }
.post-mini-list small { color: var(--muted); font-size: 12px; }

/* -------- Article -------- */
.article-wrap { padding: 30px 20px 50px; }
.article-header { text-align: center; max-width: 800px; margin: 0 auto 30px; }
.article-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 44px); margin: 14px 0 12px; line-height: 1.15;
}
.article-meta { color: var(--muted); font-size: 14px; }
.article-meta span { margin: 0 4px; }
.article-cover { margin: 24px 0 0; }
.article-cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.article-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start;
  max-width: 1180px; margin: 0 auto;
}
.article-content {
  background: var(--surface); border-radius: var(--radius); padding: 30px 36px;
  box-shadow: var(--shadow); font-size: 17px; line-height: 1.8;
}
.article-content h2, .article-content h3 {
  font-family: 'Playfair Display', serif; margin-top: 1.6em;
}
.article-content img { border-radius: 10px; margin: 18px 0; }
.article-content blockquote {
  border-left: 4px solid var(--primary); padding: 6px 18px;
  background: var(--quote-bg); border-radius: 0 10px 10px 0;
  font-style: italic; color: var(--muted);
}
.tags-row { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }

.category-header { text-align: center; padding: 40px 20px 10px; }
.category-header h1 { font-family: 'Playfair Display', serif; font-size: 38px; margin-bottom: 4px; }
.lead { color: var(--muted); font-size: 16px; max-width: 600px; margin: 0 auto; }
.static-page { padding: 40px 20px; max-width: 760px; }
.static-page h1 { font-family: 'Playfair Display', serif; font-size: 36px; }

.preview-banner {
  background: var(--preview-bg); color: var(--preview-text); padding: 10px 18px;
  border-radius: 10px; margin: 18px auto; font-weight: 600;
}

/* -------- Pagination -------- */
.pagination {
  display: flex; gap: 16px; justify-content: center; align-items: center;
  padding: 30px 0; color: var(--muted);
}
.pagination a {
  padding: 8px 14px; border-radius: 8px; background: var(--surface);
  box-shadow: var(--shadow); font-weight: 600;
}

/* -------- Ads -------- */
.ad-placeholder {
  background: repeating-linear-gradient(45deg, var(--ad-stripe-a), var(--ad-stripe-a) 10px, var(--ad-stripe-b) 10px, var(--ad-stripe-b) 20px);
  color: var(--muted); text-align: center; padding: 24px;
  border: 1px dashed var(--ad-border); border-radius: var(--radius);
  margin: 18px auto; max-width: var(--container);
}
.ad-slot { margin: 18px auto; max-width: var(--container); padding: 0 20px; }
.ad-slot.ad-in_article { margin: 30px 0; }

/* -------- Footer -------- */
.site-footer {
  background: var(--footer-bg); color: var(--footer-text);
  padding: 50px 0 20px; margin-top: 60px;
}
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: var(--footer-link-hover); }
.footer-grid {
  display: grid; gap: 30px;
  grid-template-columns: 2fr 1fr 1fr;
}
.footer-grid h4 { color: var(--footer-link-hover); margin: 0 0 12px; font-size: 16px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 4px 0; }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--footer-border); text-align: center; }

.empty-state { color: var(--muted); padding: 30px; text-align: center; grid-column: 1 / -1; }

/* -------- Nav actions (lang switcher + theme toggle) -------- */
.nav-actions {
  display: flex; align-items: center; gap: 10px;
}
.lang-switch {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px;
}
.lang-btn {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: .04em; transition: background .15s, color .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.theme-toggle {
  appearance: none; cursor: pointer; padding: 6px;
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text); position: relative;
  transition: background .15s, transform .15s, border-color .15s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--primary); }
.theme-toggle .theme-icon { font-size: 16px; line-height: 1; }
[data-theme="light"] .theme-toggle .theme-icon-dark { display: none; }
[data-theme="dark"]  .theme-toggle .theme-icon-light { display: none; }

/* -------- Responsive -------- */
@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .article-content { padding: 26px; }
}

@media (max-width: 900px) {
  .layout-with-sidebar, .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { position: static; }
  .nav-wrap { flex-wrap: wrap; padding: 12px 16px; }
  .nav-toggle { display: block; order: 3; }
  .nav-actions { margin-left: auto; gap: 6px; }
  .main-nav { display: none; width: 100%; flex-direction: column; gap: 0; order: 4; }
  .nav-open .main-nav { display: flex; }
  .nav-open .main-nav a { padding: 12px 0; border-top: 1px solid var(--border); }
  .search-form { display: none; }
  .nav-open .search-form { display: flex; width: 100%; margin: 10px 0; }
  .nav-open .search-form input { flex: 1; min-width: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .article-content { padding: 22px; font-size: 16px; line-height: 1.75; }
  .article-wrap { padding: 24px 16px 40px; }
  .hero { padding: 50px 0 40px; }
  .section-title { font-size: 24px; margin: 30px 0 18px; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .nav-wrap { padding: 10px 14px; gap: 10px; }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .featured-grid, .posts-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero { padding: 40px 0 32px; }
  .hero-sub { font-size: 16px; padding: 0 8px; }
  .section-title { font-size: 22px; margin: 24px 0 14px; }
  .article-content { padding: 18px 16px; border-radius: 12px; }
  .article-cover img { border-radius: 10px; }
  .card-body { padding: 14px 16px 16px; }
  .card-body h3 { font-size: 17px; }
  .widget { padding: 16px; }
  .article-header h1 { font-size: 26px; margin: 10px 0 8px; }
  .article-meta { font-size: 13px; }
  .article-meta span { display: inline-block; }
  .site-footer { padding: 36px 0 18px; margin-top: 40px; }
  .ad-slot { padding: 0 16px; }
  .pagination { gap: 10px; padding: 24px 0; flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
  .nav-actions { gap: 4px; }
  .lang-btn { padding: 4px 8px; font-size: 11px; }
  .theme-toggle { width: 32px; height: 32px; }
  .nav-toggle { font-size: 20px; }
  .hero-title { font-size: 28px; }
  .article-header h1 { font-size: 22px; }
}

/* ----- Cookie consent banner ----- */
.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 720px;
  width: calc(100% - 32px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.55;
  animation: cookie-slide-up .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes cookie-slide-up {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.cookie-consent__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cookie-consent p { margin: 0; color: var(--text); }
.cookie-consent a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-consent a:hover { color: var(--primary-dark); }
.cookie-consent__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cookie-consent__btn {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  white-space: nowrap;
}
.cookie-consent__btn:active { transform: translateY(1px); }
.cookie-consent__btn--primary {
  background: var(--primary);
  color: #fff;
}
.cookie-consent__btn--primary:hover { background: var(--primary-dark); }
.cookie-consent__btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.cookie-consent__btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}
@media (min-width: 640px) {
  .cookie-consent__content { flex-direction: row; align-items: center; }
  .cookie-consent__actions { flex-shrink: 0; }
}
@media (max-width: 480px) {
  .cookie-consent { padding: 16px 18px; bottom: 12px; }
  .cookie-consent__actions { width: 100%; }
  .cookie-consent__btn { flex: 1; }
}
