/* =============================================================
   TCGRelease Theme — screen.css
   Based on Ghost Source v1.6.1 conventions
   Palette: Charcoal (#1c1917) + Burnt Orange (#ea580c)
   Typography: Chakra Petch (Google Fonts)
   ============================================================= */

/* ── Custom Properties ─────────────────────────────────── */
:root {
  --tcg-bg:       #faf8f5;
  --tcg-dark:     #1c1917;
  --tcg-orange:   #ea580c;
  --tcg-mark:     #c2410c;
  --tcg-rule:     #e7e0d8;
  --tcg-gray:     #f0ece6;
  --tcg-muted:    #888480;
  --tcg-white:    #ffffff;
  --tcg-font:     'Chakra Petch', sans-serif;

  /* Game colors */
  --game-magic:     #2563eb;
  --game-pokemon:   #16a34a;
  --game-yugioh:    #dc2626;
  --game-lorcana:   #7c3aed;
  --game-onepiece:  #d4a800;
  --game-riftbound: #1c1917;
}

/* ── Reset + Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--tcg-font);
  background: var(--tcg-bg);
  color: var(--tcg-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Game Color Utilities ──────────────────────────────── */
.tcg-game-color--magic     { background: var(--game-magic); }
.tcg-game-color--pokemon   { background: var(--game-pokemon); }
.tcg-game-color--yugioh    { background: var(--game-yugioh); }
.tcg-game-color--lorcana   { background: var(--game-lorcana); }
.tcg-game-color--onepiece  { background: var(--game-onepiece); }
.tcg-game-color--riftbound { background: var(--game-riftbound); }

.tcg-game-bg--magic     { background: var(--game-magic);     color: #fff; }
.tcg-game-bg--pokemon   { background: var(--game-pokemon);   color: #fff; }
.tcg-game-bg--yugioh    { background: var(--game-yugioh);    color: #fff; }
.tcg-game-bg--lorcana   { background: var(--game-lorcana);   color: #fff; }
.tcg-game-bg--onepiece  { background: var(--game-onepiece);  color: var(--tcg-dark); }
.tcg-game-bg--riftbound { background: var(--game-riftbound); color: #fff; }

/* ── Tag Pill ───────────────────────────────────────────── */
.tcg-tag-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ── Logo ───────────────────────────────────────────────── */
.tcg-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}

.tcg-logo__mark {
  width: 34px;
  height: 34px;
  background: var(--tcg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tcg-logo--inverted .tcg-logo__mark {
  background: var(--tcg-orange);
}
.tcg-logo--inverted .tcg-logo__mark svg line {
  stroke: var(--tcg-orange);
}

.tcg-logo__mark svg { color: #fff; }
.tcg-logo--inverted .tcg-logo__mark svg { color: var(--tcg-dark); }

.tcg-logo__wordmark {
  font-family: var(--tcg-font);
  font-size: 18px;
  line-height: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.tcg-logo__tcg    { font-weight: 700; color: var(--tcg-dark); }
.tcg-logo__release { font-weight: 600; color: var(--tcg-orange); }

.tcg-logo--inverted .tcg-logo__tcg { color: #fff; }

/* ── Header ─────────────────────────────────────────────── */
.tcg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tcg-white);
  border-bottom: 3px solid var(--tcg-orange);
}

.tcg-header__topbar {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  gap: 16px;
  border-bottom: 1px solid var(--tcg-rule);
}

.tcg-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.tcg-search-toggle,
.tcg-menu-toggle {
  color: var(--tcg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.tcg-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 28px;
}

.tcg-menu-toggle span {
  display: block;
  height: 2px;
  background: var(--tcg-dark);
  width: 100%;
  transition: transform .2s, opacity .2s;
}

.tcg-search-bar {
  padding: 6px 24px;
  border-bottom: 1px solid var(--tcg-rule);
  display: none;
}

.tcg-search-bar input {
  width: 100%;
  max-width: 400px;
  border: 1.5px solid var(--tcg-rule);
  padding: 6px 12px;
  font-family: var(--tcg-font);
  font-size: 13px;
  background: var(--tcg-bg);
  color: var(--tcg-dark);
  outline: none;
}

.tcg-search-bar input:focus {
  border-color: var(--tcg-orange);
}

/* Game nav tabs */
.tcg-game-nav {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.tcg-game-nav::-webkit-scrollbar { display: none; }

.tcg-game-nav__tab {
  flex: 1;
  min-width: 80px;
  padding: 9px 6px;
  text-align: center;
  font-family: var(--tcg-font);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tcg-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tcg-game-nav__tab + .tcg-game-nav__tab { border-left: 1px solid var(--tcg-rule); }

.tcg-game-nav__tab--magic:hover,    body.tag-magic .tcg-game-nav__tab--magic    { color: var(--game-magic);     border-bottom-color: var(--game-magic); }
.tcg-game-nav__tab--pokemon:hover,  body.tag-pokemon .tcg-game-nav__tab--pokemon { color: var(--game-pokemon);   border-bottom-color: var(--game-pokemon); }
.tcg-game-nav__tab--yugioh:hover,   body.tag-yugioh .tcg-game-nav__tab--yugioh  { color: var(--game-yugioh);    border-bottom-color: var(--game-yugioh); }
.tcg-game-nav__tab--lorcana:hover,  body.tag-lorcana .tcg-game-nav__tab--lorcana { color: var(--game-lorcana);  border-bottom-color: var(--game-lorcana); }
.tcg-game-nav__tab--onepiece:hover, body.tag-onepiece .tcg-game-nav__tab--onepiece { color: var(--game-onepiece); border-bottom-color: var(--game-onepiece); }
.tcg-game-nav__tab--riftbound:hover,body.tag-riftbound .tcg-game-nav__tab--riftbound { color: var(--game-riftbound); border-bottom-color: var(--game-riftbound); }

/* Mobile drawer */
.tcg-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  background: var(--tcg-dark);
  z-index: 200;
  padding: 60px 24px 24px;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.tcg-drawer.is-open { transform: translateX(0); }
.tcg-drawer a {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.tcg-drawer hr { border-color: rgba(255,255,255,.15); margin: 16px 0; }
.tcg-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.tcg-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ── Carousel ───────────────────────────────────────────── */
.tcg-carousel {
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--tcg-dark);
}

.tcg-carousel__track {
  display: flex;
  transition: transform .45s ease;
}

.tcg-carousel__slide {
  position: relative;
  min-width: 100%;
  height: 400px;
  overflow: hidden;
}

.tcg-carousel__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tcg-carousel__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 20%, rgba(0,0,0,.75));
}

.tcg-carousel__content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 40px 28px;
}

.tcg-carousel__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(255,255,255,.65);
  font-size: 12px;
}

.tcg-carousel__title {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
  color: #fff;
  max-width: 700px;
  margin-bottom: 14px;
}

.tcg-carousel__title a { color: inherit; }
.tcg-carousel__title a:hover { color: var(--tcg-orange); }

.tcg-carousel__excerpt {
  color: rgba(255,255,255,.75);
  font-size: 14px;
  max-width: 540px;
  margin-bottom: 14px;
}

.tcg-carousel__cta {
  display: inline-block;
  background: var(--tcg-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 16px;
  transition: background .15s;
}
.tcg-carousel__cta:hover { background: var(--tcg-mark); }

.tcg-carousel__arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: #fff;
  width: 40px; height: 40px;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 10;
}
.tcg-carousel__arrow:hover { background: rgba(0,0,0,.7); }
.tcg-carousel__arrow--prev { left: 12px; }
.tcg-carousel__arrow--next { right: 12px; }

.tcg-carousel__dots {
  position: absolute;
  bottom: 18px; right: 20px;
  display: flex; gap: 6px;
  z-index: 10;
}

.tcg-carousel__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
  background: transparent;
  transition: background .2s;
  padding: 0;
}
.tcg-carousel__dot.is-active { background: #fff; }

/* ── Post Grid ──────────────────────────────────────────── */
.tcg-grid-section {
  padding: 28px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.tcg-grid-section__header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tcg-muted);
  margin-bottom: 18px;
}
.tcg-grid-section__header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--tcg-rule);
}

.tcg-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ── Post Card ──────────────────────────────────────────── */
.tcg-card {
  background: var(--tcg-white);
  border: 1.5px solid var(--tcg-rule);
  overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.tcg-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.tcg-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.tcg-card__bar { height: 4px; }

.tcg-card__img {
  width: 100%;
  height: 160px;
  overflow: hidden;
}
.tcg-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.tcg-card:hover .tcg-card__img img { transform: scale(1.03); }

.tcg-card__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(-45deg, #ddd 0, #ddd 2px, #eee 2px, #eee 10px);
}
.tcg-card__img--placeholder span {
  font-size: 10px;
  color: #aaa;
  letter-spacing: .06em;
  font-family: monospace;
}

.tcg-card__body { padding: 12px 14px 16px; }

.tcg-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.tcg-card__date {
  font-size: 11px;
  color: var(--tcg-muted);
}

.tcg-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tcg-dark);
  margin-bottom: 6px;
  text-wrap: pretty;
}

.tcg-card__read {
  font-size: 11px;
  color: var(--tcg-muted);
}

/* ── Tag Header (game section page) ────────────────────── */
.tcg-tag-header {
  padding: 40px 24px;
  color: #fff;
}
.tcg-tag-header__inner { max-width: 800px; margin: 0 auto; }
.tcg-tag-header__name  { font-size: 36px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.tcg-tag-header__desc  { font-size: 16px; opacity: .85; margin-bottom: 8px; }
.tcg-tag-header__count { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }

/* ── Single Post ────────────────────────────────────────── */
.tcg-post, .tcg-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.tcg-post__header, .tcg-page__header { margin-bottom: 28px; }

.tcg-post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--tcg-muted);
}

.tcg-post__title, .tcg-page__title {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: 14px;
  text-wrap: pretty;
}

.tcg-post__excerpt, .tcg-page__excerpt {
  font-size: 17px;
  color: var(--tcg-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.tcg-post__byline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tcg-post__author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.tcg-post__author-img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.tcg-post__hero-img, .tcg-page__hero-img {
  margin-bottom: 32px;
}
.tcg-post__hero-img img, .tcg-page__hero-img img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}
.tcg-post__hero-img figcaption {
  font-size: 12px;
  color: var(--tcg-muted);
  margin-top: 6px;
  text-align: center;
}

/* Ghost content styles */
.tcg-post__content, .tcg-page__content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--tcg-dark);
}
.gh-content h2 { font-size: 24px; font-weight: 700; margin: 2em 0 .75em; }
.gh-content h3 { font-size: 20px; font-weight: 700; margin: 1.75em 0 .6em; }
.gh-content p  { margin-bottom: 1.4em; text-wrap: pretty; }
.gh-content a  { color: var(--tcg-orange); text-decoration: underline; text-underline-offset: 3px; }
.gh-content a:hover { color: var(--tcg-mark); }
.gh-content img { margin: 2em auto; max-width: 100%; }
.gh-content blockquote {
  border-left: 4px solid var(--tcg-orange);
  padding-left: 20px;
  margin: 2em 0;
  color: var(--tcg-muted);
  font-style: italic;
}
.gh-content ul, .gh-content ol { padding-left: 24px; margin-bottom: 1.4em; }
.gh-content li { margin-bottom: .4em; }
.gh-content hr { border: none; border-top: 1px solid var(--tcg-rule); margin: 2em 0; }

.tcg-post__footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--tcg-rule); }
.tcg-post__tags   { display: flex; flex-wrap: wrap; gap: 8px; }

/* Related posts */
.tcg-related {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ── Pagination ─────────────────────────────────────────── */
.tcg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 0 16px;
}

.tcg-pagination__btn {
  background: var(--tcg-dark);
  color: #fff;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .15s;
}
.tcg-pagination__btn:hover { background: var(--tcg-orange); }

.tcg-pagination__info {
  font-size: 12px;
  color: var(--tcg-muted);
  letter-spacing: .06em;
}

/* ── Footer ─────────────────────────────────────────────── */
.tcg-footer {
  background: var(--tcg-dark);
  border-top: 3px solid var(--tcg-orange);
  padding: 24px;
}

.tcg-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.tcg-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.tcg-footer__nav a {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
  transition: color .15s;
}
.tcg-footer__nav a:hover { color: var(--tcg-orange); }

.tcg-footer__copy {
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

/* ── Main ───────────────────────────────────────────────── */
.tcg-main { min-height: 60vh; }

/* ── Mobile chip nav ───────────────────────────────────── */
.tcg-chip-nav {
  display: none;
  gap: 6px;
  padding: 6px 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--tcg-dark);
}
.tcg-chip-nav::-webkit-scrollbar { display: none; }

.tcg-chip {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1.5px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: .15s;
  font-family: var(--tcg-font);
}
.tcg-chip.is-active {
  border-color: var(--game-color, #ea580c);
  background: var(--game-color, #ea580c);
}

/* ── Bottom nav (mobile) ────────────────────────────────── */
.tcg-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--tcg-white);
  border-top: 2px solid var(--tcg-rule);
  z-index: 100;
}
.tcg-bottom-nav__inner { display: flex; }
.tcg-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 2px;
  gap: 3px;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tcg-muted);
  border-top: 2px solid transparent;
  border-left: 1px solid var(--tcg-rule);
  cursor: pointer;
  background: none;
  font-family: var(--tcg-font);
  transition: .15s;
}
.tcg-bottom-nav__item:first-child { border-left: none; }
.tcg-bottom-nav__item.is-active {
  color: var(--game-color);
  border-top-color: var(--game-color);
}
.tcg-bottom-nav__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--game-color, #888);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .tcg-post-grid { grid-template-columns: repeat(2, 1fr); }
  .tcg-carousel__slide { height: 300px; }
  .tcg-carousel__content { padding: 24px 24px 20px; }
}

/* Mobile */
@media (max-width: 600px) {
  /* Header: switch to dark */
  .tcg-header { border-bottom: none; }
  .tcg-header__topbar { background: var(--tcg-dark); border-bottom: none; padding: 10px 14px; }
  .tcg-logo__mark { background: var(--tcg-orange) !important; }
  .tcg-logo__tcg { color: #fff; }
  .tcg-search-toggle { color: #ccc; }
  .tcg-menu-toggle { display: flex; }
  .tcg-menu-toggle span { background: #fff; }

  /* Show chip nav, hide desktop tabs */
  .tcg-chip-nav { display: flex; }
  .tcg-game-nav { display: none; }

  /* Carousel */
  .tcg-carousel__slide { height: 220px; }
  .tcg-carousel__content { padding: 20px 14px 16px; }
  .tcg-carousel__title { font-size: 15px; }
  .tcg-carousel__excerpt { display: none; }
  .tcg-carousel__arrow { width: 30px; height: 30px; font-size: 18px; }

  /* Grid */
  .tcg-post-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tcg-card__img { height: 95px; }
  .tcg-card__title { font-size: 11px; }
  .tcg-grid-section { padding: 14px 12px 80px; }

  /* Bottom nav */
  .tcg-bottom-nav { display: block; }
  .tcg-footer { padding-bottom: 80px; }

  /* Post */
  .tcg-post, .tcg-page { padding: 24px 14px 40px; }
  .tcg-post__title, .tcg-page__title { font-size: 22px; }
  .tcg-post__content, .tcg-page__content { font-size: 15px; }

  /* Footer */
  .tcg-footer__inner { flex-direction: column; align-items: flex-start; }
  .tcg-footer__nav { gap: 4px 12px; }
}

@media (max-width: 380px) {
  .tcg-post-grid { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────
   Koenig editor width classes (Ghost requirement)
   .kg-width-wide  → wide images break out of content column
   .kg-width-full  → full-bleed images span entire viewport
─────────────────────────────────────── */
.kg-width-wide {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: none;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
