/* ==========================================================================
   Venngage — common.css
   Design tokens, base elements and shared utilities used on every page.
   Load order: bootstrap.min.css → common.css → component CSS for the page.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --ink: #15172e;
  --sub: #5a5f7a;
  --paper: #fff;
  --mist: #f2f3f9;
  --line: #e0e2ee;
  --brand: #5b3df5;
  --brand-soft: #a99bff;
  --hot: #ffd84d;
  --onbrand: #fff;
  --night: #15172e;
  --surface: #fff;
  --muted: #8a8fa3;
  --shadow: 0 6px 24px rgba(18, 20, 43, .06);
  --shadow-hover: 0 12px 32px rgba(91, 61, 245, .16);

  --c-news: #5b3df5;
  --c-ent: #e8447a;
  --c-life: #12a37f;
  --c-food: #f0821f;
  --c-health: #1e88e5;
  --c-shop: #8e44ad;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Bootstrap bridges */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 21, 23, 46;
  --bs-link-hover-color-rgb: 91, 61, 245;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #eceef9;
  --sub: #a3a8c4;
  --paper: #0f1020;
  --mist: #181a30;
  --line: #2a2d4a;
  --brand: #8f7bff;
  --onbrand: #0f1020;
  --surface: #171a2f;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, .5);
  --bs-link-color-rgb: 236, 238, 249;
  color-scheme: dark;
}

/* Category accent — set --c once, every component reads it */
.cat-news   { --c: var(--c-news); }
.cat-ent    { --c: var(--c-ent); }
.cat-life   { --c: var(--c-life); }
.cat-food   { --c: var(--c-food); }
.cat-health { --c: var(--c-health); }
.cat-shop   { --c: var(--c-shop); }

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  color: inherit;
  letter-spacing: -.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  max-width: 100%;
  height: auto;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Container width tuned for a reading site */
@media (min-width: 1200px) {
  .container { max-width: 1220px; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--onbrand);
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--onbrand);
  font: 600 .95rem/1.2 var(--font);
  cursor: pointer;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.btn-pill:hover { filter: brightness(1.08); color: var(--onbrand); }
.btn-pill:active { transform: translateY(1px); }
.btn-pill--hot { background: var(--hot); color: var(--night); }
.btn-pill--hot:hover { color: var(--night); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: var(--mist); }

/* ---------- Badges & meta text ---------- */
.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--hot);
  color: var(--night);
  font: 600 .8rem/1.5 var(--font);
  letter-spacing: .01em;
}

.meta {
  font-size: .875rem;
  font-weight: 500;
  color: var(--sub);
}

.cat-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--c, var(--brand));
}

/* ---------- SVG icons (assets/svg/icons, used as <img>) ---------- */
.icon {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* Dark theme: flip the dark UI icons to light */
:root[data-theme="dark"] .icon--search,
:root[data-theme="dark"] .icon--menu,
:root[data-theme="dark"] .icon--close,
:root[data-theme="dark"] .icon--theme { filter: invert(1) brightness(1.6); }
:root[data-theme="dark"] .icon--arrow-right { filter: brightness(1.5); }

/* ---------- Brand logo (header + footer) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 38px; height: 27px; }
.brand__accent { color: var(--brand); }

@media (max-width: 575.98px) {
  .brand { font-size: 1.4rem; }
  .brand__mark { width: 30px; height: 21px; }
}

/* ---------- Section heading (shared by all content blocks) ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 20px;
}
.section-head__title {
  margin: 0;
  padding-left: 12px;
  border-left: 6px solid var(--c, var(--brand));
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}
.section-head__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--brand);
}
.section-head__link .icon { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.section-head__link:hover { color: var(--brand); }
.section-head__link:hover .icon { transform: translateX(3px); }

/* ---------- Panels & sidebar widgets (shared by inner pages) ---------- */
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.widget-title {
  position: relative;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.widget-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 42px;
  height: 2px;
  background: var(--brand);
}

/* ---------- Post meta row (author, date, read time) ---------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .78rem;
  color: var(--muted);
}
.post-meta li { display: inline-flex; align-items: center; gap: 6px; }
.post-meta .icon { width: 14px; height: 14px; }

.author-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}
.author-link:hover { color: var(--brand); }
.author-avatar {
  border: 2px solid var(--line);
  border-radius: 50%;
}

/* ---------- Category badge ---------- */
.cat-badge {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--c, var(--brand));
  color: #fff;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cat-badge:hover { color: #fff; filter: brightness(1.08); }

/* Utility: hide items until "Load more" reveals them */
[data-hidden] { display: none !important; }

/* ---------- Page title (category / subcategory H1) ---------- */
.page-title {
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 6px solid var(--c, var(--brand));
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.03em;
}

/* ---------- Section spacing + bar title (inner pages) ---------- */
.section-gap { padding: 40px 0 48px; }

/* Title with brand → accent bar (globallyvox style) */
.bar-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding-left: 14px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.bar-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 1.15em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--c, var(--brand)), var(--c-ent));
  transform: translateY(-50%);
}
/* Load more button row */
.load-more { margin-top: 28px; text-align: center; }
.load-more .btn-pill { padding: 11px 36px; }

@media (max-width: 575.98px) {
  .section-gap { padding: 28px 0 36px; }
  .panel { padding: 20px; }
}

/* ---------- Touch: no double-tap zoom, no iOS focus zoom ---------- */
/* Pinch/pan stay native; game boards set their own (stricter) touch-action. */
html,
body { touch-action: manipulation; }

/* iOS Safari zooms into any field under 16px when it gets focus */
@media (max-width: 991.98px) {
  :root .site-search__input,
  :root .newsletter__input,
  :root .vg-field__input,
  :root .vg-search__input,
  :root .ws-select,
  :root .wsm-select { font-size: 16px; }
}

/* ---------- Fluid blog images ---------- */
/* Fixed-ratio thumbnail boxes: the photo always fills the whole box. */
.pop-post__thumb,
.list-card__thumb,
.grid-card__thumb,
.article-card__media { display: block; }
.pop-post__thumb img,
.list-card__thumb img,
.grid-card__thumb img,
.article-card__img,
.lead-story__media {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
/* Free-height images (featured image, images inside articles): img-fluid */
.post-featured img { display: block; width: 100%; height: auto; }
.post-content img { max-width: 100%; height: auto !important; }

/* ---------- Game pages: the game's cover photo, very faint, behind the game panel ---------- */
.vg-game-cover-host { position: relative; isolation: isolate; }
.vg-game-cover {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: .1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .65) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .65) 100%);
}

/* SVG-file icon tinted by CSS colour (use: <span class="svg-mask" style="--svg:url('…/x.svg')"></span>) */
.svg-mask { display:inline-block; width:1em; height:1em; flex:none; background-color:currentColor;
  -webkit-mask: var(--svg) center / contain no-repeat; mask: var(--svg) center / contain no-repeat; }
