/* ==========================================================================
   Stackz Gaming — rebuilt theme
   Palette pulled from the original logo: navy #202030, green #30c870,
   red #c83030. Self-contained (no external fonts/requests).
   ========================================================================== */

:root {
  --navy:      #202030;
  --navy-2:    #2a2a3d;
  --navy-3:    #33334a;
  --green:     #30c870;
  --green-dk:  #24a85c;
  --red:       #c83030;
  --red-br:    #e84a43;
  --page:      #f4f5f7;
  --card:      #ffffff;
  --ink:       #202030;
  --muted:     #6a6a76;
  --line:      #e5e6ea;
  --shadow:    0 2px 4px rgba(32,32,48,.06), 0 8px 24px rgba(32,32,48,.08);
  --radius:    14px;
  --wrap:      1120px;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
  line-height: 1.65;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ------------------------------ Header ---------------------------------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.18);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 44px; height: 44px; background: #fff; border-radius: 10px; padding: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .2px; }
.brand-tag { font-size: .72rem; color: #b9b9c8; font-weight: 500; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: #d7d7e2; font-weight: 600; font-size: .92rem;
  padding: 8px 14px; border-radius: 8px; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--navy-3); color: #fff; text-decoration: none; }

.nav-toggle {
  display: none; margin-left: auto; background: var(--navy-3); color: #fff;
  border: 0; font-size: 1.2rem; width: 44px; height: 40px; border-radius: 8px; cursor: pointer;
}

.site-main { padding: 40px 20px 64px; min-height: 60vh; }

/* -------------------------------- Hero ---------------------------------- */
.hero {
  text-align: center;
  background:
    linear-gradient(160deg, rgba(32,32,48,.82), rgba(42,42,61,.9)),
    url("../images/hero.jpg") center/cover no-repeat,
    linear-gradient(160deg, var(--navy), var(--navy-2));
  color: #fff;
  border-radius: 20px;
  padding: 72px 32px 64px;
  margin-bottom: 44px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 5px;
  background: linear-gradient(90deg, var(--green) 0 33%, var(--red) 33% 66%, var(--green) 66% 100%);
}
.hero-title { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; letter-spacing: -.5px; }
.hero-tagline { margin: 10px 0 0; font-size: 1.15rem; color: #c7c7d6; }

/* Three "why we do this" reasons, as translucent horizontal cards over the hero image */
.hero-reasons {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  max-width: 1000px; margin: 40px auto 0; text-align: left;
}
.hero-reason {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 18px 18px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-reason-num {
  flex: 0 0 34px; display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--green); color: #08130c; font-weight: 800;
}
.hero-reason:nth-child(2) .hero-reason-num { background: #fff; color: var(--navy); }
.hero-reason:nth-child(3) .hero-reason-num { background: var(--red); color: #fff; }
.hero-reason p { margin: 0; font-size: .92rem; line-height: 1.5; color: #ececf3; }

/* ---------------------------- Section heading --------------------------- */
.section-heading {
  font-size: 1.4rem; font-weight: 800; margin: 0 0 20px;
  display: inline-block; position: relative; padding-bottom: 8px;
}
.section-heading::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 4px;
  border-radius: 4px; background: var(--green);
}

/* ------------------------- Section header row --------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.see-all { font-weight: 700; }

/* ------------------------------- Cards ---------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(32,32,48,.10), 0 18px 40px rgba(32,32,48,.14); }
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--navy-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media--empty { display: grid; place-items: center; height: 100%; color: #55556e; font-weight: 900; letter-spacing: 3px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cats, .post-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--green-dk); background: rgba(48,200,112,.12); padding: 3px 9px; border-radius: 999px;
}
.tag:hover { text-decoration: none; background: rgba(48,200,112,.2); }
.card-title { margin: 0; font-size: 1.12rem; line-height: 1.3; font-weight: 800; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--green-dk); text-decoration: none; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.card-meta { color: #9a9aa6; font-size: .8rem; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.dot { opacity: .5; }

/* ---------------------------- Listing head ------------------------------ */
.list-head { margin-bottom: 28px; }
.page-title { font-size: 2rem; font-weight: 900; margin: 0 0 16px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-filter a {
  font-weight: 700; font-size: .9rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px;
}
.cat-filter a:hover { text-decoration: none; border-color: var(--green); }
.cat-filter a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.empty { color: var(--muted); }

/* ------------------------------ Pager ----------------------------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 44px; }
.pager-btn {
  font-weight: 700; background: var(--navy); color: #fff; padding: 10px 20px; border-radius: 10px;
}
.pager-btn:hover { text-decoration: none; background: var(--navy-2); }
.pager-info { color: var(--muted); font-size: .9rem; }

/* ------------------------------- Post ----------------------------------- */
.post { max-width: 760px; margin: 0 auto; }
.post-header { margin-bottom: 22px; }
.post-title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.15; margin: 12px 0 14px; }
.post-meta { color: var(--muted); font-size: .9rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.post-cover { margin: 0 0 30px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-cover img { width: 100%; }

.post-body { font-size: 1.08rem; color: #26262f; }
.post-body h2 { font-size: 1.5rem; font-weight: 800; margin: 2em 0 .6em; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.post-body h3 { font-size: 1.2rem; font-weight: 800; margin: 1.6em 0 .5em; }
.post-body p { margin: 0 0 1.15em; }
.post-body ul, .post-body ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.post-body li { margin: .3em 0; }
.post-body a { color: var(--green-dk); text-decoration: underline; }
.post-body strong { color: var(--navy); }
.post-body blockquote {
  margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--green);
  background: #eefaf2; border-radius: 0 10px 10px 0; color: #2c3b33;
}
.post-body code { background: #eceef1; padding: 2px 6px; border-radius: 5px; font-size: .92em; }
.post-body figure { margin: 1.6em 0; }
.post-body figure img { border-radius: 10px; box-shadow: var(--shadow); }
.post-body figcaption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.post-footer { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.back-link { font-weight: 700; }

/* ------------------------------ 404 ------------------------------------- */
.notfound { text-align: center; padding: 80px 20px; }
.notfound h1 { font-size: 5rem; margin: 0; color: var(--navy); font-weight: 900; }
.btn, .notfound .btn {
  display: inline-block; margin-top: 16px; background: var(--green); color: #fff;
  font-weight: 700; padding: 12px 24px; border-radius: 10px;
}
.btn:hover { text-decoration: none; background: var(--green-dk); }

/* ----------------------------- Footer ----------------------------------- */
.site-footer { background: var(--navy); color: #c7c7d6; margin-top: 40px; }
.site-footer::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--green), var(--red)); }
.footer-inner { padding: 40px 20px; display: grid; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-logo { width: 46px; height: 46px; background: #fff; border-radius: 10px; padding: 4px; }
.footer-brand strong { color: #fff; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: #c7c7d6; font-weight: 600; }
.footer-nav a:hover { color: #fff; }
.copyright { margin: 0; color: #8a8a9a; font-size: .85rem; }
.muted { color: #8a8a9a; }

/* --------------------------- Responsive --------------------------------- */
@media (max-width: 780px) {
  .hero-reasons { grid-template-columns: 1fr; max-width: 460px; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 74px; left: 0; right: 0;
    background: var(--navy-2); flex-direction: column; align-items: stretch; padding: 8px;
    box-shadow: 0 12px 24px rgba(0,0,0,.3);
  }
  body.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 12px 14px; }
  .card-grid { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
}

/* ---- Search ---- */
.nav-search{display:flex;align-items:center;gap:0;margin-left:8px}
.nav-search input{border:1px solid var(--navy-3);background:var(--navy-2);color:#fff;
  padding:7px 12px;border-radius:8px 0 0 8px;font:inherit;font-size:.9rem;width:150px}
.nav-search input::placeholder{color:#9a9aac}
.nav-search input:focus{outline:none;border-color:var(--green)}
.nav-search button{border:1px solid var(--navy-3);border-left:0;background:var(--navy-3);color:#fff;
  padding:7px 12px;border-radius:0 8px 8px 0;cursor:pointer;font-size:.9rem}
.nav-search button:hover{background:var(--green);border-color:var(--green)}

.search-form{display:flex;gap:8px;margin:14px 0 18px;max-width:520px}
.search-form input{flex:1;border:1px solid var(--line);border-radius:10px;padding:12px 16px;font:inherit;font-size:1rem;background:#fff}
.search-form input:focus{outline:none;border-color:var(--green)}
.search-form .btn{margin-top:0}
.search-count{color:var(--muted);margin:0 0 20px}

@media(max-width:680px){
  .nav-search{margin:8px 6px 4px;width:calc(100% - 12px)}
  .nav-search input{flex:1;width:auto}
}

/* ---- Filter labels + feature tags ---- */
.filter-label{font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);margin:14px 0 6px}
.list-head .filter-label:first-of-type{margin-top:0}
.tag--feature{color:#8a5a12;background:rgba(232,138,20,.14)}
.tag--feature:hover{background:rgba(232,138,20,.24)}
.post-features{margin-top:8px}

/* ---- Search typeahead dropdown ---- */
.typeahead{position:absolute;top:calc(100% + 6px);left:0;right:0;min-width:280px;z-index:60;
  background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(32,32,48,.22);
  overflow:hidden;max-height:70vh;overflow-y:auto}
.search-form .typeahead{right:auto;width:520px;max-width:90vw}
.typeahead-row{display:flex;gap:12px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);color:var(--ink)}
.typeahead-row:last-child{border-bottom:0}
.typeahead-row:hover,.typeahead-row.is-active{background:#f2fbf5;text-decoration:none}
.typeahead-thumb{flex:0 0 54px;width:54px;height:40px;border-radius:7px;overflow:hidden;background:var(--navy-2);display:block}
.typeahead-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.typeahead-thumb--empty{display:grid;place-items:center;height:100%;color:#8a8aa0;font-size:.5rem;font-weight:900;letter-spacing:1px}
.typeahead-text{display:flex;flex-direction:column;min-width:0}
.typeahead-text strong{font-size:.92rem;line-height:1.25;color:var(--ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.typeahead-snip{font-size:.8rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.typeahead-empty{padding:12px 14px;color:var(--muted);font-size:.9rem}

/* ---- Score badge (heat-map A+…F, bottom-right of card media) ---- */
.card-media{position:relative}
.card-score{position:absolute;bottom:8px;right:8px;min-width:32px;height:28px;padding:0 8px;
  display:inline-flex;align-items:center;justify-content:center;font-weight:900;font-size:.95rem;
  letter-spacing:.3px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.4);line-height:1}

/* ---- Score on the post page ---- */
.post-cover{position:relative}
.post-score{display:inline-flex;align-items:center;justify-content:center;font-weight:900;color:#fff;
  border-radius:16px;line-height:1}
.post-score--overlay{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  font-size:clamp(3.2rem,12vw,7rem);padding:.06em .28em;
  text-shadow:0 3px 18px rgba(0,0,0,.6);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.post-score-solo{margin:0 0 26px}
.post-score-solo .post-score{font-size:2.4rem;padding:.12em .45em;border-radius:14px}
