/* ============ ARTIGOS — GAMING/TECH NEWS MAGAZINE THEME ============ */
body.theme-artigos {
  --accent: #f59e0b;
  --accent-2: #38bdf8;
  --header-bg: rgba(13,10,4,0.92);
  background: #0d0b08;
  font-family: var(--font-body);
}

/* ---- breaking news ticker ---- */
.ticker {
  background: var(--accent);
  color: #000;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.5px;
}
.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 26s linear infinite;
}
.ticker-track span { margin-right: 48px; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; padding-left: 0; } }

/* ---- page head ---- */
.mag-head { max-width: 1240px; margin: 0 auto; padding: 44px 6% 10px; }
.mag-kicker {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.mag-h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4vw, 42px);
  color: #fff;
  margin-bottom: 8px;
}
.mag-sub { color: var(--muted); font-size: 15px; max-width: 60ch; }

/* ---- toolbar: filters + search ---- */
.mag-toolbar {
  max-width: 1240px;
  margin: 26px auto 0;
  padding: 0 6%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.mag-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.mag-filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.mag-filter-btn:hover { border-color: var(--accent); color: #fff; }
.mag-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

.mag-search {
  background: var(--surface);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  min-width: 220px;
  outline: none;
}
.mag-search:focus { border-color: var(--accent); }

/* ---- featured article ---- */
.mag-featured {
  max-width: 1240px;
  margin: 30px auto 0;
  padding: 0 6%;
}
.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}
@media (max-width: 780px) { .featured-card { grid-template-columns: 1fr; } }
.featured-media {
  min-height: 220px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px;
  font-size: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #171208;
}
.featured-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,11,8,0.05) 0%, rgba(13,11,8,0.05) 55%, rgba(13,11,8,0.85) 100%);
}
.featured-media > * { position: relative; z-index: 1; }
.featured-icon-badge {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  background: rgba(13,11,8,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
}
.featured-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.featured-body .cat-badge { margin-bottom: 12px; }
.featured-title { font-family: 'Space Grotesk', sans-serif; font-size: clamp(19px,2.4vw,26px); font-weight: 700; color: #fff; margin-bottom: 12px; line-height: 1.3; }
.featured-title:hover { color: var(--accent); }
.featured-excerpt { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.featured-meta { font-size: 12px; color: var(--muted); }
.featured-meta b { color: var(--accent-2); }

/* ---- category badges ---- */
.cat-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid currentColor;
}
.cat-noticias { color: #38bdf8; }
.cat-reviews { color: #fbbf24; }
.cat-hardware { color: #f472b6; }
.cat-retro { color: #34d399; }
.cat-emulacao { color: #a855f7; }

/* ---- article grid ---- */
.mag-grid {
  max-width: 1240px;
  margin: 34px auto 0;
  padding: 0 6% 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.mag-card {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.mag-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.mag-card-media {
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(150deg, #171208, #0d0b08);
  border-bottom: 1px solid var(--border);
}
.mag-card-media.has-photo {
  background-color: #171208;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.mag-card-media.has-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,11,8,0.05) 0%, rgba(13,11,8,0.05) 55%, rgba(13,11,8,0.8) 100%);
  z-index: 1;
}
.mag-card-media.has-photo .main-icon {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  background: rgba(13,11,8,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
}
.mag-card-media .main-icon { position: relative; z-index: 3; }
.mag-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.mag-card-body .cat-badge { margin-bottom: 10px; align-self: flex-start; }
.mag-card-title { font-size: 15.5px; font-weight: 700; color: #fff; line-height: 1.35; margin-bottom: 10px; flex: 1; }
.mag-card:hover .mag-card-title { color: var(--accent); }
.mag-card-meta { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }

.mag-empty { text-align: center; padding: 60px 20px; color: var(--muted); display: none; }
.mag-empty.show { display: block; }

/* ---- reading modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--accent);
  max-width: 880px;
  width: 100%;
  padding: 40px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 3;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: clamp(22px, 3.4vw, 30px); color: #fff; margin: 18px 0; line-height: 1.3; }
.modal-body { color: #cbd5e1; font-size: 16.5px; line-height: 1.9; }
.modal-body p { margin-bottom: 16px; }

/* ---- real photo embedded mid-article ---- */
.article-photo {
  margin: 22px 0;
  border: 1px solid var(--border);
  background: #000;
}
.article-photo img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #171208;
  display: block;
}
.article-photo figcaption {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
}
.article-photo figcaption span { opacity: 0.75; }

/* ---- interactive themed background icons (cards + modal banner) ---- */
@keyframes icon-float {
  0%, 100% { transform: translate(var(--px, 0px), var(--py, 0px)) translateY(0) rotate(0deg); }
  50% { transform: translate(var(--px, 0px), var(--py, 0px)) translateY(-8px) rotate(6deg); }
}

.bg-icon {
  position: absolute;
  font-size: 20px;
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
  animation: icon-float 4.5s ease-in-out infinite;
  transition: transform 0.15s ease-out;
  will-change: transform;
}
.mag-card:hover .bg-icon { opacity: 0.45; }

.modal-banner {
  position: relative;
  overflow: hidden;
  height: 170px;
  margin: -40px -40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #1a1408, #0d0b08);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.modal-banner.revealed { opacity: 1; transform: translateY(0); }

.banner-main-icon {
  position: relative;
  z-index: 2;
  font-size: 46px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.banner-icon {
  position: absolute;
  font-size: 26px;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  animation: icon-float 5s ease-in-out infinite;
  transition: transform 0.15s ease-out, opacity 0.5s ease;
  will-change: transform;
}
.modal-banner.revealed .banner-icon { opacity: 0.35; }

@media (max-width: 560px) {
  .modal-content { padding: 22px; }
  .modal-banner { margin: -22px -22px 18px; height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-icon, .banner-icon { animation: none; }
}
