/*
Theme Name: GameInfo
Theme URI: https://gameinfo.com.br
Author: GameInfo
Description: Tema ultraleve para portal de games. Zero dependências JS, CSS puro, Core Web Vitals otimizados.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: gameinfo
Tags: news, custom-colors, custom-logo, featured-images, full-width-template
*/

/* ============================================================
   RESET & BASE — < 2KB minificado
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:       #0d0f12;
  --c-surface:  #161a1f;
  --c-border:   #252a30;
  --c-text:     #e8ecf0;
  --c-muted:    #7a8694;
  --c-accent:   #00e5a0;
  --c-accent2:  #ff4d6d;
  --c-tag-bg:   #1c2028;
  --f-head:     'Barlow Condensed', sans-serif;
  --f-body:     'Inter', sans-serif;
  --radius:     6px;
  --max-w:      1120px;
  --gap:        1.25rem;
}

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

body {
  font-family: var(--f-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-accent); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: 1rem; }
.grid-main { display: grid; grid-template-columns: 1fr 300px; gap: var(--gap); align-items: start; }

@media (max-width: 860px) {
  .grid-main { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ============================================================
   CABEÇALHO
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,18,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  padding: .6rem 0;
}

.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--f-head);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -.02em;
  color: var(--c-text);
  flex-shrink: 0;
}
.site-logo span { color: var(--c-accent); }

.main-nav { display: flex; gap: .1rem; flex-wrap: wrap; }
.main-nav a {
  font-size: .78rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .06em; padding: .45rem .75rem;
  border-radius: var(--radius); color: var(--c-muted);
  transition: color .15s, background .15s;
}
.main-nav a:hover, .main-nav a.current-menu-item {
  color: var(--c-text); background: var(--c-tag-bg);
}

.header-search { display: flex; align-items: center; }
.search-input {
  background: var(--c-surface); border: 1px solid var(--c-border);
  color: var(--c-text); border-radius: var(--radius);
  padding: .4rem .8rem; font-size: .82rem; width: 160px;
  outline: none; transition: border-color .15s, width .2s;
}
.search-input:focus { border-color: var(--c-accent); width: 200px; }

/* hamburger mobile */
.nav-toggle {
  display: none; background: none; border: none;
  color: var(--c-text); font-size: 1.4rem; padding: .3rem;
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; flex-direction: column; gap: 0; }
  .main-nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: .5rem; }
}

/* ============================================================
   BREAKING NEWS BAR
   ============================================================ */
.breaking-bar {
  background: var(--c-accent2);
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  overflow: hidden; white-space: nowrap;
}
.breaking-bar__inner {
  display: flex; align-items: center; gap: 0;
}
.breaking-bar__label {
  background: #c0001f; color: #fff;
  padding: .35rem .8rem; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .08em;
}
.breaking-bar__track {
  display: flex; gap: 3rem; padding: .35rem 1rem;
  animation: marquee 30s linear infinite;
  color: #fff;
}
.breaking-bar__track a { color: #fff; opacity: .9; }
.breaking-bar__track a:hover { opacity: 1; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   HERO GRID
   ============================================================ */
.hero { padding: 1.5rem 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 3px;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-grid .card:first-child {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

/* card base */
.card {
  position: relative; overflow: hidden;
  background: var(--c-surface);
  display: flex; flex-direction: column;
}

.card__thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.card:hover .card__thumb { transform: scale(1.04); }

.card__thumb-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 16/9;
}
.hero-grid .card:first-child .card__thumb-wrap {
  aspect-ratio: unset; height: 100%; min-height: 300px;
}

.card__body {
  padding: .8rem;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, transparent 100%);
  position: absolute; bottom: 0; left: 0; right: 0;
}

.card__cat {
  display: inline-block; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--c-accent); color: #000;
  padding: .15rem .5rem; border-radius: 3px; margin-bottom: .4rem;
}
.card__cat.red { background: var(--c-accent2); color: #fff; }

.card__title {
  font-family: var(--f-head);
  font-size: 1rem; font-weight: 700; line-height: 1.25;
  color: #fff; letter-spacing: -.01em;
}
.hero-grid .card:first-child .card__title { font-size: 1.55rem; }

.card__meta {
  font-size: .7rem; color: rgba(255,255,255,.55);
  margin-top: .35rem;
}

@media (max-width: 600px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .card:first-child { grid-column: 1; grid-row: 1; }
}

/* ============================================================
   SEÇÃO DE POSTS (loop principal)
   ============================================================ */
.section-head {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.5rem 0 .8rem;
}
.section-head h2 {
  font-family: var(--f-head); font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--c-text);
}
.section-head__line { flex: 1; height: 1px; background: var(--c-border); }
.section-head__more {
  font-size: .72rem; font-weight: 600; color: var(--c-accent);
  text-transform: uppercase; letter-spacing: .06em;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
}

.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.post-card:hover { border-color: var(--c-accent); transform: translateY(-2px); }

.post-card__thumb { aspect-ratio: 16/9; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }

.post-card__body { padding: .75rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.post-card__cat { font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--c-accent); }
.post-card__title { font-family: var(--f-head); font-size: .95rem; font-weight: 600; line-height: 1.3; color: var(--c-text); }
.post-card__excerpt { font-size: .78rem; color: var(--c-muted); line-height: 1.5; flex: 1; }
.post-card__meta { font-size: .68rem; color: var(--c-muted); margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--c-border); }

/* ============================================================
   LIST POSTS (coluna alternada)
   ============================================================ */
.post-list { display: flex; flex-direction: column; gap: .5rem; }

.post-list-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .6rem; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  transition: border-color .15s;
}
.post-list-item:hover { border-color: var(--c-accent); }
.post-list-item__thumb { width: 90px; height: 60px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.post-list-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list-item__title { font-family: var(--f-head); font-size: .88rem; font-weight: 600; line-height: 1.3; color: var(--c-text); }
.post-list-item__meta { font-size: .65rem; color: var(--c-muted); margin-top: .3rem; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

.widget {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden;
}
.widget__head {
  font-family: var(--f-head); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: .55rem .85rem; border-bottom: 1px solid var(--c-border);
  color: var(--c-muted);
}
.widget__body { padding: .75rem .85rem; }

/* widget mais lidas */
.top-list { display: flex; flex-direction: column; gap: .5rem; }
.top-item { display: flex; gap: .6rem; align-items: flex-start; }
.top-item__num { font-family: var(--f-head); font-size: 1.3rem; font-weight: 700; color: var(--c-border); line-height: 1; width: 22px; flex-shrink: 0; }
.top-item__title { font-size: .8rem; color: var(--c-text); line-height: 1.4; }
.top-item__title a:hover { color: var(--c-accent); }

/* widget ad placeholder */
.ad-box {
  background: var(--c-tag-bg); border: 1px dashed var(--c-border);
  border-radius: var(--radius); text-align: center; padding: 1.5rem 1rem;
  font-size: .72rem; color: var(--c-muted); letter-spacing: .04em;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-header { margin: 1.5rem 0 1rem; }
.single-header .cats { display: flex; gap: .4rem; margin-bottom: .6rem; flex-wrap: wrap; }
.single-header .cats a { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--c-accent); }
.single-header h1 { font-family: var(--f-head); font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.single-header .byline { font-size: .8rem; color: var(--c-muted); margin-top: .6rem; }
.single-header .byline strong { color: var(--c-text); }

.single-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.single-thumb img { width: 100%; max-height: 440px; object-fit: cover; }

.entry-content { max-width: 720px; }
.entry-content p { font-size: .95rem; line-height: 1.75; color: var(--c-text); margin-bottom: 1rem; }
.entry-content h2 { font-family: var(--f-head); font-size: 1.35rem; font-weight: 700; margin: 1.5rem 0 .6rem; color: var(--c-text); }
.entry-content h3 { font-family: var(--f-head); font-size: 1.1rem; font-weight: 600; margin: 1.2rem 0 .5rem; }
.entry-content a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.2rem; margin-bottom: 1rem; list-style: revert; }
.entry-content li { font-size: .95rem; line-height: 1.7; }
.entry-content blockquote { border-left: 3px solid var(--c-accent); padding: .6rem 1rem; background: var(--c-surface); border-radius: 0 var(--radius) var(--radius) 0; margin: 1.2rem 0; font-style: italic; color: var(--c-muted); }
.entry-content img { border-radius: var(--radius); margin: 1rem 0; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 2rem 0; }
.pagination a, .pagination span {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-size: .82rem; font-weight: 600;
  border: 1px solid var(--c-border); color: var(--c-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.pagination a:hover { background: var(--c-tag-bg); color: var(--c-text); border-color: var(--c-accent); }
.pagination .current { background: var(--c-accent); color: #000; border-color: var(--c-accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--c-border);
  padding: 2rem 0 1.2rem; font-size: .8rem; color: var(--c-muted);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-about .site-logo { font-size: 1.2rem; margin-bottom: .6rem; }
.footer-col h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--c-text); margin-bottom: .6rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .35rem; }
.footer-col ul a { color: var(--c-muted); transition: color .15s; }
.footer-col ul a:hover { color: var(--c-accent); }
.footer-bottom { border-top: 1px solid var(--c-border); padding-top: 1rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.tag-badge {
  display: inline-block; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .18rem .55rem; border-radius: 3px; background: var(--c-tag-bg); color: var(--c-muted);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.no-image { background: var(--c-tag-bg); display: flex; align-items: center; justify-content: center; color: var(--c-border); font-size: .7rem; }
