/* coming-soon-games.css
   Versão completa, mantido todo o layout original e corrigido para:
   - Capa do jogo (grid/single) aparece sempre completa, centralizada, nunca explode ou distorce em nenhuma resolução.
   - Mantém estilos, fontes, animações, responsividade e sombras originais.
   - Regras originais preservadas e ampliadas para cobrir o bug apontado (capas cortadas/esticadas).
*/

/* ---------------------------
   Root variables (injetadas via PHP inline style)
   - O coming-soon-games.php já injeta: --csg-grid-cover-style: cover | contain
*/
:root{
  --csg-player-max: 44vh;
  --csg-accent: #7b4cff;
  --csg-thumb-size: 72px;
  --csg-thumb-gap: 10px;
  --csg-grid-cover-radius: 8px;
  --csg-similar-cover-height: 200px;
}

/* Reset box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================
   GRID / LIST
   ============================ */
.csg-list-grid {
  display: grid;
  gap: 18px;
  align-items: stretch;
  width: 100%;
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width:1200px) { .csg-list-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width:1000px) { .csg-list-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:700px)  { .csg-list-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:420px)  { .csg-list-grid { grid-template-columns: 1fr; } }

.csg-list-item { display:flex; flex-direction:column; background: transparent; border-radius:8px; overflow:visible; text-decoration:none; }

.csg-list-thumb {
  height: 180px;
  overflow: hidden;
  border-radius: var(--csg-grid-cover-radius);
  /* box-shadow: 0 6px 14px rgba(0,0,0,0.18); */
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

.csg-list-thumb img {
  width: 94%;
  height: 94%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important; /* CAPA SEMPRE INTEIRA NO GRID */
  object-position: center center;
  display:block;
  border-radius: calc(var(--csg-grid-cover-radius) - 2px);
  background: transparent;
  transition: transform .25s ease;
}

.csg-list-item:hover .csg-list-thumb img { transform: scale(1.03) rotate(-2deg); }

.csg-list-meta { padding:8px 6px 12px 6px; background:transparent; }
.csg-list-title { color: var(--csg-grid-title-color, var(--csg-accent)); font-weight:700; font-size:18px; margin-top:8px; }
.csg-list-genre { color: var(--csg-grid-genre-color, #bdbdbd); font-size:16px; margin-top:6px; }
.csg-list-date { color: var(--csg-grid-date-color, #fff); font-weight:600; font-size:14px; margin-top:6px; }
.csg-thumb-placeholder {
  width: 55px; height: 74px; display:flex; align-items:center; justify-content:center;
  background: #181820; color: #bbb; font-size: 22px; border-radius:6px; font-weight:700;
}

/* ============================
   SINGLE PAGE: BACKGROUND, HERO, GRID LAYOUT
   ============================ */

.csg-content-bg-wrapper {
  position: fixed;
  left:0; right:0; top:0;
  bottom: 0;
  z-index:-9999;
  pointer-events:none;
  overflow:hidden;
}
.csg-content-bg {
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center center;
  background-repeat:no-repeat;
  transform:scale(1.04);
  filter: blur(14px) brightness(.36);
  pointer-events:none;
}
.csg-content-bg::before {
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.38) 50%, rgba(0,0,0,0.98) 100%);
  pointer-events:none;
}

.csg-content-bg--scroll {
  position: absolute !important;
  transform: scale(1.04);
  background-attachment: scroll !important;
  z-index: -20 !important;
  pointer-events: none;
}

/* Hero section estilização mantida */
.csg-hero { padding: 18px 0; position: relative; z-index: 3; }
.csg-hero-overlay { max-width:1280px; margin:0 auto; padding:18px 22px; }
.csg-hero-inner { display:flex; flex-direction:column; gap:8px; }

.csg-single-title { font-family: var(--csg-header-font, 'Poppins', inherit); font-weight:700; font-size:34px; line-height:1.05; margin:0 0 6px 0; color: var(--csg-accent); text-shadow: 0 6px 24px rgba(0,0,0,0.55); }
.csg-hero-meta { color: var(--csg-hero-meta-color, #bdbdbd); }
.csg-hero-meta .csg-hero-date {
  font-family: 'Poppins', inherit;
  font-weight: 600;
  font-size: 18px;
  color: var(--csg-hero-meta-color, #bdbdbd);
  line-height:1.2;
}
.csg-hero-meta .csg-hero-company {
  color: #ebe8ed;
  font-size: 12px;
  font-weight: 400;
  margin-top:6px;
  line-height:1.2;
}

@media (max-width:900px) {
  .csg-hero-overlay { padding: 14px 16px; max-width: 100%; }
  .csg-single-title { font-size: 28px; }
  .csg-hero-meta .csg-hero-date { font-size: 16px; }
  .csg-hero-meta .csg-hero-company { font-size: 12px; }
}
@media (max-width:480px) {
  .csg-single-title { font-size: 22px; }
  .csg-hero-overlay { padding: 10px 12px; }
  .csg-hero-meta .csg-hero-date { font-size: 15px; }
  .csg-hero-meta .csg-hero-company { font-size: 12px; }
}

/* GRID Single layout (colunas) */
.csg-grid {
  display: grid;
  grid-template-columns: 260px 1fr 200px;
  column-gap: 14px;
  row-gap: 24px;
  align-items: start;
}

.csg-cover-card {
  background: transparent;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  display:flex;
  flex-direction:column;
  align-items:stretch;
}

.csg-cover-main {
  width:100%;
  height: 320px;
  max-width:100%;
  max-height:320px;
  min-height:100px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: calc(var(--csg-grid-cover-radius));
  overflow:hidden;
  background: transparent;
  position: relative;
}

.csg-cover-main img {
  width: 95%;
  height: 95%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important; /* CAPA SEMPRE INTEIRA NO SINGLE */
  object-position: center center;
  display:block;
  border-radius: calc(var(--csg-grid-cover-radius) - 2px);
  background: transparent;
  margin:auto;
  box-shadow: none;
}

.csg-cover-meta { margin-top:12px; display:flex; flex-direction:column; gap:8px; }

/* ========= PLAYER ========== */
.csg-media-main {
  width: 95%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 6;
}
.csg-video-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: var(--csg-player-max, 44vh);
  border-radius: 10px;
  overflow: hidden;
  z-index: 8;
  margin-bottom: 12px;
  max-width: 100%;
  box-sizing: border-box;
}
.csg-video-main iframe,
.csg-video-main video,
.csg-video-main embed {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  display:block;
  border-radius:10px;
  max-width:100%;
  max-height:100%;
  box-sizing: border-box;
}

/* ========= SUMÁRIO ========== */
.csg-summary {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 12px;
  color: var(--csg-text, #ddd);
  line-height:1.6;
  font-size:15px;
  background: rgba(0,0,0,0.18);
  padding:14px;
  border-radius:10px;
  position: relative;
  z-index: 6;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}
@media (max-width:900px) {
  .csg-summary { font-size:14px; padding: 10px; }
}
@media (max-width:480px) {
  .csg-summary { font-size:13px; padding: 8px; }
}

.csg-cover-meta {
  margin-top:20px;
  display:flex;
  flex-direction:column;
  gap:8px;
  max-width:100%;
  overflow-wrap: break-word;
}

.csg-grid {
  display: grid;
  grid-template-columns: 260px 1fr 200px;
  column-gap: 14px;
  row-gap: 24px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width:1100px) {
  .csg-grid{ grid-template-columns: 1fr; column-gap:14px; row-gap:18px; }
  .csg-media-main, .csg-summary { width: 100% !important; margin: 0; }
  .csg-thumbs-rail { order:3; display:flex; flex-direction:row; gap:8px; overflow:auto; padding-bottom:8px; align-items:center; }
  .csg-thumbs-grid { grid-template-columns: repeat(5, var(--csg-thumb-size)); }
  .csg-cover-card { order:1; margin-bottom:12px; }
  .csg-cover-main { height: 200px; max-height: 400px; }
  .csg-cover-main img { height: 95%; width: 95%; }
  .csg-entry-content.csg-layout-container { padding:12px; }
  .csg-similar-grid--covers { grid-template-columns: repeat(3, 1fr); gap:12px; }
  .csg-screenshot-grid { margin-top:18px; max-height:260px; }
}
@media (max-width:900px) {
  .csg-grid { grid-template-columns: 1fr; }
  .csg-cover-card { width: 100%; }
  .csg-cover-main { height: 140px; max-height:400px; }
  .csg-cover-main img { width: 93%; height:93%; }
  .csg-thumbs-rail { justify-content:flex-start; }
  .csg-media-main { width: 100% !important; }
  .csg-summary { font-size:15px; }
}
@media (max-width:700px) {
  .csg-similar-grid--covers { grid-template-columns: repeat(2, 1fr); gap:10px; }
  .csg-list-thumb { height: 120px; }
  .csg-screenshot-grid { grid-template-columns: repeat(2, 1fr); margin-top:14px; }
  :root { --csg-thumb-size: 64px; --csg-similar-cover-height: 160px; }
  .csg-cover-main { height: 90px; max-height:90px; min-height:400px; }
  .csg-cover-main img { height:90%; width:90%; }
  .csg-hero-overlay { padding-left: 12px; padding-right:12px; }
}
@media (max-width:480px) {
  .csg-list-thumb { height:300px; }
  .csg-similar-item { width:120px; }
  .csg-screenshot-grid { grid-template-columns: 1fr; max-height:none; overflow:visible; margin-top:12px; }
  :root { --csg-thumb-size: 56px; --csg-similar-cover-height: 140px; }
  .csg-single-title { font-size: 20px; }
  .csg-hero-overlay { padding-left: 8px; padding-right:8px; }
  .csg-cover-main { height: 54px; max-height:54px; min-height:400px; }
  .csg-cover-main img { width: 90%; height:90%; }
  .csg-thumbs-grid { grid-template-columns: repeat(4, var(--csg-thumb-size)); }
}

/* ============================
   THUMBS RAIL (miniaturas)
   ============================ */
.csg-thumbs-rail { display:flex; flex-direction:column; gap:var(--csg-thumb-gap); align-items:flex-end; }
.csg-thumbs-grid {
  width:100%;
  display: grid;
  grid-template-columns: repeat(3, var(--csg-thumb-size));
  gap: var(--csg-thumb-gap);
  justify-content: end;
  align-content: start;
}
.csg-thumb-btn {
  width: var(--csg-thumb-size);
  height: var(--csg-thumb-size);
  min-width: 48px;
  min-height: 48px;
  max-width: 120px;
  max-height: 120px;
  border-radius:8px;
  overflow:hidden;
  border:0;
  background: transparent;
  padding:0;
  cursor:pointer;
  display:block;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}
.csg-thumb-btn img {
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  border-radius:8px;
  max-width:100%;
  max-height:100%;
}

/* sticky rail */
@media (min-width:1100px) {
  .csg-thumbs-rail { position: sticky; top: 90px; align-self: start; }
}

/* ============================
   SCREENSHOTS GRID
   ============================ */
.csg-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  margin-top:20px;
  max-height: 300px;
  overflow: auto;
  padding-right: 6px;
  box-sizing: border-box;
  z-index: 3;
  position: relative;
}
.csg-screenshot-grid img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  display:block;
  max-width:100%;
  max-height:140px;
}
.csg-screenshot-grid img:hover { transform: none; }

/* ============================
   SIMILAR GAMES (cover contain)
   ============================ */
.csg-similar { margin-top:26px; }
.csg-similar-title { margin:0 0 12px 0; font-size:15px; letter-spacing:.06em; color: var(--csg-similar-title, var(--csg-similar-header, #fff)); }

.csg-similar-grid--covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
}
.csg-similar-item { width:100%; text-decoration:none; color:inherit; display:flex; flex-direction:column; gap:8px; transition: transform .18s, box-shadow .18s; transform-origin: center; }

.csg-similar-cover {
  height: var(--csg-similar-cover-height);
  border-radius: 12px;
  overflow:hidden;
/*  box-shadow: 0 8px 18px rgba(0,0,0,0.10); */
  transition: transform .18s, box-shadow .18s;
  display:flex;
  align-items:center;
  justify-content:center;
/* background: transparent; */
}
.csg-similar-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center center;
  display:block;
  border-radius:10px;
  max-width:100%;
  max-height:100%;
}
.csg-similar-item:hover { transform: translateY(-6px); }
.csg-similar-item:hover .csg-similar-cover { transform: scale(1.02); box-shadow:0 12px 28px rgba(0,0,0,0.14); }

.csg-similar-name { color: var(--csg-grid-title-color, var(--csg-accent)); font-weight:700; font-size:14px; }

.csg-similar-footer { margin-top:18px; text-align:right; }
.csg-back-button {
  display:inline-block !important;
  background: var(--csg-back-button, var(--csg-accent));
  color: var(--csg-back-button-text-color, #fff);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration:none;
  font-weight:700;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.06);
}
.csg-back-button:hover { background: var(--csg-back-button-hover, #5a2bd6); color: var(--csg-back-button-text-color, #fff); }

/* ============================
   LIGHTBOX / MODAL
   ============================ */
.csg-lightbox { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,0.85); z-index:99999; visibility:hidden; opacity:0; transition: opacity .18s, visibility .18s; padding:24px; box-sizing:border-box; }
.csg-lightbox[aria-hidden="false"]{ visibility:visible; opacity:1; }
.csg-lightbox img { max-width:90vw; max-height:90vh; display:block; border-radius:6px; }
#csg-lightbox-close { position:absolute; top:18px; right:18px; z-index:100000; width:48px; height:48px; border-radius:10px; background:rgba(0,0,0,0.6); color:#fff; font-size:26px; display:inline-flex; align-items:center; justify-content:center; border:none; cursor:pointer; box-shadow: 0 8px 20px rgba(0,0,0,0.25); transition: background .12s ease, transform .09s ease; }
#csg-lightbox-close:hover{ background:rgba(0,0,0,0.78); transform: translateY(-2px); }
.csg-lightbox-nav { position:absolute; top:50%; transform:translateY(-10%); width:44px; height:44px; border-radius:12px; background:rgba(0,0,0,0.5); color:#fff; display:inline-flex; align-items:center; justify-content:center; box-shadow:0 12px 34px rgba(0,0,0,0.65); border:none; cursor:pointer; transition: background .12s ease, transform .10s ease; }
#csg-lightbox-prev{ left:22px; z-index:100000; } #csg-lightbox-next{ right:22px; z-index:100000; }
.csg-lightbox-nav:hover{ background:rgba(0,0,0,0.68); transform: translateY(-6%); }

/* ============================
   Pagination / misc
   ============================ */
.csg-pagination{ margin-top:20px; text-align:center; }
.csg-pagination-list{ list-style:none; display:inline-flex; gap:8px; align-items:center; padding:0; margin:0; }
.csg-pagination-list a{ display:inline-flex; align-items:center; justify-content:center; min-width:36px; height:36px; padding:0 10px; border-radius:8px; background: var(--csg-pagination-bg, #0f0f10); color: var(--csg-pagination-text, #fff); text-decoration:none; border:1px solid rgba(255,255,255,0.03); font-weight:600; }
.csg-pagination-list a.current{ background: var(--csg-accent); color:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.45); transform: translateY(-2px); }
.csg-pagination-list a:hover{ background: var(--csg-pagination-hover, #5a2bd6); }

/* ============================
   Accessibility
   ============================ */
.csg-content-bg-wrapper,
.csg-content-bg { pointer-events:none; user-select:none; }