/* ==========================================================================
   JoJo's Bizarre Adventure: Golden Spirit — Site Stylesheet
   Mobile-first, dark gaming theme. No frameworks.
   ========================================================================== */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #e0b13d;
  --accent-hover: #f4cf6b;
  --accent2: #9b6bf2;
  --border: #30363d;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --radius: 8px;
  --max-width: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-hover); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  font-size: 16px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-image:
    linear-gradient(180deg, rgba(9, 11, 15, 0.90) 0%, rgba(13, 17, 23, 0.93) 60%, rgba(13, 17, 23, 0.97) 100%),
    url('../images/jojo-golden-spirit-hub-key-art-cast.jpg');
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
/* Header nav is Bootstrap 5.3 (navbar/collapse/dropdown) — .site-header
   is kept only for the background-art image/overlay above. Bootstrap's
   own CSS variables are overridden below to pick up this site's accent
   color instead of Bootstrap's default blue. */
.site-header.navbar {
  --bs-navbar-color: var(--text-secondary);
  --bs-navbar-hover-color: var(--accent);
  --bs-navbar-active-color: var(--accent);
  --bs-navbar-brand-color: var(--text-primary);
  --bs-navbar-brand-hover-color: var(--text-primary);
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}
.site-header .navbar-brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.site-header .text-accent-brand { color: var(--accent); }
.site-header .nav-link { display: flex; align-items: center; }
.site-header .dropdown-menu {
  --bs-dropdown-bg: var(--bg-card);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text-primary);
  --bs-dropdown-link-hover-bg: var(--bg-secondary);
  --bs-dropdown-link-hover-color: var(--accent);
  --bs-dropdown-link-active-bg: var(--bg-secondary);
  --bs-dropdown-link-active-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.site-header .dropdown-item { display: flex; align-items: center; }

.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
}
.breadcrumb ol { list-style: none; display: flex; gap: 0.4rem; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 0.4rem; color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li[aria-current="page"] { color: var(--text-primary); }

/* ---- Layout ---- */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
}

article h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
article h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
}
article h3 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}
article p, article li { color: var(--text-primary); margin-bottom: 0.75rem; }
article ul, article ol { padding-left: 1.4rem; margin-bottom: 1rem; }
article strong { color: var(--accent-hover); }

.last-updated {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem !important;
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}
th, td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-secondary);
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:hover td { background: rgba(224, 177, 61, 0.05); }

.copy-btn {
  display: inline-block;
  margin-left: 0.5rem;
  margin-top: 0.35rem;
  background: var(--bg-secondary);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.copy-btn:hover { border-color: var(--accent); background: var(--bg-card); transform: translateY(-1px); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

/* ---- Content image ---- */
/* .content-image is applied directly to the <img> element (see page markup) */
img.content-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.1rem 0 1.75rem;
  background: var(--bg-card);
  transition: opacity 0.3s ease;
}

/* ---- Link cards (hub) ---- */
.link-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}
.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
  text-decoration: none;
}
.card h3 { color: var(--accent); margin-bottom: 0.35rem; font-size: 1rem; }
.card p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0; }

/* ---- CPA gate ---- */
.cpa-gate {
  border: 1px solid var(--accent);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.35rem 1.1rem;
  margin: 1.75rem 0;
  text-align: center;
}
.cpa-gate__lock { display: block; margin: 0 auto 0.35rem; color: var(--accent); }
.cpa-gate__message {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.9rem !important;
}
.cpa-gate__button {
  background: var(--accent);
  color: #14110a;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.cpa-gate__button:hover {
  background: var(--accent-hover);
}
.cpa-gate__content { margin-top: 1rem; text-align: left; }

/* Skeleton loader shown in .cpa-gate__content while locked-content.json fetches */
.cpa-skeleton { display: flex; flex-direction: column; gap: 10px; }
.cpa-skeleton__line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: cpa-skeleton-shimmer 1.4s ease infinite;
}
@keyframes cpa-skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Tier badges ---- */
.tier-s, .tier-a, .tier-b, .tier-c {
  display: inline-block;
  font-weight: 800;
  border-radius: 4px;
  padding: 0.05rem 0.5rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.tier-s { background: var(--accent); color: #14110a; }
.tier-a { background: var(--accent2); color: #fff; }
.tier-b { background: #2f81f7; color: #fff; }
.tier-c { background: var(--text-secondary); color: #14110a; }

/* ---- Related pages / aside ---- */
.related-pages {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.related-pages h2 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.related-pages ul { list-style: none; display: grid; gap: 0.55rem; }
.related-pages a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.related-pages a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  padding: 1.75rem 1rem 2.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-inner p { margin-bottom: 0.5rem; }
.footer-inner a { color: var(--text-secondary); text-decoration: underline; }
.footer-inner a:hover { color: var(--accent); }

/* Sponsored-content footnote — visually subordinate to the main disclaimer above it */
.footer-inner .cpa-disclosure {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  opacity: 0.7;
  margin-bottom: 0;
}

/* ---- 404 page ---- */
.not-found {
  text-align: center;
  padding: 4rem 1rem;
}
.not-found h1 { font-size: 3rem; color: var(--accent); margin-bottom: 0.5rem; }

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (min-width: 768px) {
  .link-cards { grid-template-columns: 1fr 1fr; }
  .related-pages ul { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 1024px) {
  article h1 { font-size: 1.9rem; }
  .link-cards { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------------- SEO/Mobile audit: touch target minimum sizing (44px) ---------------- */
.cpa-gate__button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-header .nav-link, .site-header .dropdown-item { min-height: 44px; }
