/*
Theme Name: Cookie Gamer Clean
Theme URI: https://cookiegamer.ca/
Author: DesignShopp
Description: Clean, dependency-free rebuild of the Cookie Gamer informational, blog, and game experience.
Version: 1.0.15
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: cookie-gamer-clean
*/

:root {
  --cg-blue: #536fd1;
  --cg-sky: #45b8dc;
  --cg-teal: #1ca7a6;
  --cg-ink: #10233b;
  --cg-muted: #56667a;
  --cg-cream: #fff8ed;
  --cg-card: rgba(255, 255, 255, 0.96);
  --cg-line: rgba(16, 35, 59, 0.14);
  --cg-orange: #ff9a42;
  --cg-shadow: 0 18px 55px rgba(11, 42, 76, 0.18);
  --cg-radius: 24px;
  --cg-content: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--cg-ink);
  background: #f7fbff;
  font-family: Inter, ui-rounded, "Avenir Next", Avenir, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: #175fa8; text-underline-offset: 0.16em; }
a:hover, a:focus-visible { color: #0b3f79; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 0.7rem 1rem;
  clip: auto;
  color: var(--cg-ink);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--cg-shadow);
}

.cg-shell { width: min(calc(100% - 2rem), var(--cg-content)); margin-inline: auto; }

.cg-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--cg-line);
  backdrop-filter: blur(14px);
}

.admin-bar .cg-site-header { top: 32px; }
.cg-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cg-brand { display: inline-flex; align-items: center; color: var(--cg-ink); background: transparent; text-decoration: none; }
.cg-brand-logo { display: block; width: auto; height: 52px; object-fit: contain; }
.cg-nav ul { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.cg-nav a { display: block; padding: 0.65rem 0.8rem; color: var(--cg-ink); border-radius: 999px; font-size: 0.93rem; font-weight: 750; text-decoration: none; }
.cg-nav a:hover, .cg-nav a:focus-visible, .cg-nav .current-menu-item > a { color: #fff; background: var(--cg-blue); outline: none; }

.cg-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #45b8b3 url("assets/cookie-gamer-background.png") center / cover no-repeat;
}

.cg-hero::before, .cg-hero::after { content: ""; position: absolute; border: 2px solid rgba(255, 255, 255, 0.08); border-radius: 50%; pointer-events: none; }
.cg-hero::before { width: 36rem; height: 36rem; top: -18rem; left: -9rem; }
.cg-hero::after { width: 28rem; height: 28rem; right: -10rem; bottom: -14rem; }
.cg-hero-inner { position: relative; z-index: 1; padding: clamp(4.2rem, 9vw, 8rem) 0 clamp(3.5rem, 7vw, 6rem); text-align: center; }
.cg-display-brand { display: inline-flex; align-items: center; margin-bottom: 2rem; }
.cg-display-brand .cg-brand-logo { width: min(420px, 72vw); height: auto; }
.cg-hero h1 { max-width: 850px; margin: 0 auto 1rem; color: #fff; font-size: clamp(2.35rem, 6vw, 5.2rem); line-height: 0.98; letter-spacing: -0.05em; text-wrap: balance; }
.cg-hero-lede { max-width: 760px; margin: 0 auto 2rem; font-size: clamp(1.05rem, 2.1vw, 1.35rem); color: rgba(255, 255, 255, 0.92); text-wrap: balance; }
.cg-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.cg-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.75rem 1.2rem; color: var(--cg-ink); background: #fff; border: 2px solid #fff; border-radius: 999px; font-weight: 850; text-decoration: none; box-shadow: 0 10px 30px rgba(9, 40, 70, 0.16); }
.cg-button:hover, .cg-button:focus-visible { color: var(--cg-ink); transform: translateY(-2px); }
.cg-button--secondary { color: #fff; background: transparent; box-shadow: none; }
.cg-button--secondary:hover, .cg-button--secondary:focus-visible { color: var(--cg-blue); background: #fff; }

.cg-overview { padding: clamp(3rem, 7vw, 6rem) 0; background: var(--cg-cream); }
.cg-section-heading { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.cg-eyebrow { display: block; margin-bottom: 0.6rem; color: #1a7188; font-size: 0.82rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.cg-section-heading h2, .cg-page-title { margin: 0; font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.08; letter-spacing: -0.04em; text-wrap: balance; }
.cg-section-heading p { color: var(--cg-muted); }
.cg-game-guide { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 980px; margin-inline: auto; gap: 1rem; }
.cg-guide-card { padding: 1.5rem; background: #fff; border: 1px solid var(--cg-line); border-radius: 18px; box-shadow: 0 10px 32px rgba(25, 65, 100, 0.07); }
.cg-guide-card h3 { margin: 0 0 0.55rem; font-size: 1.18rem; line-height: 1.25; }
.cg-guide-card p { margin: 0 0 0.9rem; color: var(--cg-muted); }
.cg-guide-card p:last-child { margin-bottom: 0; }
.cg-guide-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.cg-game-section { padding: clamp(3rem, 7vw, 6rem) 0; color: #fff; background: #0f253c; }
.cg-game-section .cg-eyebrow { color: #7ddff5; }
.cg-game-section .cg-section-heading p { color: #c7d9e8; }
.cg-game-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; min-height: 360px; border: 8px solid var(--cg-orange); border-radius: var(--cg-radius); background: #211f20; box-shadow: var(--cg-shadow); }
.cg-game-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #211f20; }
.cg-game-frame[data-cg-game-frame-ready="true"] iframe { position: absolute; max-width: none; transform-origin: top left; }
.cg-game-note { margin: 1rem 0 0; color: #c7d9e8; text-align: center; font-size: 0.92rem; }
.cg-game-note a { color: #fff; }

.cg-latest { padding: clamp(3rem, 7vw, 6rem) 0; }
.cg-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.cg-card { display: flex; flex-direction: column; min-height: 100%; padding: 1.5rem; background: var(--cg-card); border: 1px solid var(--cg-line); border-radius: 18px; box-shadow: 0 10px 30px rgba(18, 52, 82, 0.07); }
.cg-card h2, .cg-card h3 { margin: 0 0 0.75rem; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.025em; }
.cg-card h2 a, .cg-card h3 a { color: var(--cg-ink); text-decoration: none; }
.cg-card h2 a:hover, .cg-card h2 a:focus-visible, .cg-card h3 a:hover, .cg-card h3 a:focus-visible { color: #175fa8; text-decoration: underline; }
.cg-card p { color: var(--cg-muted); }
.cg-card-meta { margin-top: auto; color: #65758a; font-size: 0.82rem; font-weight: 700; }

.cg-main { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.cg-content { max-width: 800px; margin-inline: auto; }
.cg-content-wide { max-width: var(--cg-content); margin-inline: auto; }
.cg-entry-header { margin-bottom: 2rem; }
.cg-entry-meta { color: var(--cg-muted); font-size: 0.9rem; }
.cg-entry-content { font-size: 1.06rem; }
.cg-entry-content > * { max-width: 760px; margin-inline: auto; }
.cg-entry-content > .alignwide { max-width: 1060px; }
.cg-entry-content h2, .cg-entry-content h3 { margin-top: 2.2em; line-height: 1.2; letter-spacing: -0.025em; }
.cg-entry-content a { overflow-wrap: anywhere; }
.cg-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--cg-line); }
.cg-post-nav > :last-child { text-align: right; }
.cg-pagination { margin-top: 2.5rem; }
.cg-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.cg-pagination a, .cg-pagination span { min-width: 42px; padding: 0.55rem 0.75rem; border: 1px solid var(--cg-line); border-radius: 999px; text-align: center; text-decoration: none; }
.cg-pagination .current { color: #fff; background: var(--cg-blue); border-color: var(--cg-blue); }

.cg-site-footer { color: #e7f4ff; background: #0a2137; }
.cg-footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: 2.5rem 0; }
.cg-site-footer .cg-brand { color: #fff; }
.cg-footer-copy { margin: 0.6rem 0 0; color: #a9c2d7; font-size: 0.86rem; }
.cg-footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1rem; }
.cg-footer-nav a { color: #fff; font-weight: 700; text-decoration: none; }
.cg-footer-nav a:hover, .cg-footer-nav a:focus-visible { text-decoration: underline; }

@media (max-width: 820px) {
  .admin-bar .cg-site-header { top: 46px; }
  .cg-header-inner { align-items: flex-start; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0; }
  .cg-nav { width: 100%; overflow-x: auto; scrollbar-width: thin; }
  .cg-nav ul { width: max-content; }
  .cg-game-guide, .cg-guide-summary, .cg-card-grid { grid-template-columns: 1fr; }
  .cg-game-frame { min-height: 260px; border-width: 5px; border-radius: 18px; }
  .cg-footer-inner { grid-template-columns: 1fr; }
  .cg-footer-nav { justify-content: flex-start; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .cg-shell { width: min(calc(100% - 1.25rem), var(--cg-content)); }
  .cg-brand-logo { height: 44px; }
  .cg-hero-inner { padding-top: 3rem; }
  .cg-display-brand { padding: 0.65rem 0.9rem; }
  .cg-game-frame { min-height: 0; }
  .cg-post-nav { grid-template-columns: 1fr; }
  .cg-post-nav > :last-child { text-align: left; }
}

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