/* The /addon page (templates/addon.html): the PandaQuest addon.  Loaded by that page only, on top of
 * pq.css, and in its colours: the page is part of this site.  The WoW touches are the game's own
 * icons in a dark bevelled frame, a gold heading line, and two boxes set the way the game sets a
 * tooltip (navy, a grey edge, the game's text colours).  `--game` comes from versions.css.
 */

.ad-page { --ad-gold: #f8d36a; --ad-gold-dim: #a8862f; --ad-frame: #0b0c10; }

/* ------------------------------------------------------------------------------- the hero */

.ad-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.1rem, 0.6rem + 2vw, 2.4rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--game, var(--accent)) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-raised), var(--bg));
  position: relative;
  overflow: hidden;
}
.ad-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ad-gold-dim), var(--ad-gold), var(--ad-gold-dim), transparent);
  opacity: 0.7;
}
.ad-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ad-gold);
}
.ad-hero h1 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.8rem;
  color: var(--text);
  text-shadow: 0 2px 0 #000;
}
.ad-lede { font-size: 1.07rem; max-width: 46rem; color: var(--text-dim); margin: 0; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0 0.9rem; }
.ad-actions a.ad-cta,
.ad-actions a.ad-cta:visited,
.ad-actions a.ad-cta:hover {
  font-size: 1.02rem;
  padding: 0.6rem 1.15rem;
  background: linear-gradient(180deg, #ffe08a, var(--ad-gold) 45%, #c99a2e);
  border-color: #6b5214;
  color: #241800;
  box-shadow: 0 0 0 1px #000, 0 4px 14px rgba(248, 211, 106, 0.18);
}
.ad-meta { margin: 0; font-size: 0.9rem; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.ad-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }

.ad-hero-art {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 0.75rem;
  transform: rotate(-4deg);
}
.ad-hero-art img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid #3a3122;
  outline: 1px solid #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ad-hero-art img:nth-child(2n) { transform: translateY(14px); }

@media (max-width: 40rem) {
  .ad-hero { grid-template-columns: 1fr; }
  .ad-hero-art { display: none; }
}

/* ----------------------------------------------------------------------------- sections */

.ad-section { margin-top: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); }
.ad-section > h2 {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);
  margin: 0 0 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ad-gold) 35%, var(--border));
  color: var(--ad-gold);
}
.ad-sub { color: var(--text-dim); margin: 0.35rem 0 1rem; max-width: 52rem; }
.ad-note, .ad-footnote { color: var(--text-faint); font-size: 0.88rem; }
.ad-footnote { margin-top: 2.5rem; }

/* --------------------------------------------------------------------------- the cards */

.ad-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.ad-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ad-card h3 { font-size: 1.02rem; margin: 0.1rem 0 0.3rem; color: var(--text); }
.ad-card p { margin: 0; color: var(--text-dim); font-size: 0.93rem; }
.ad-card .ad-only { margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-faint); }

.ad-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 2px solid #3a3122;
  outline: 1px solid var(--ad-frame);
  background: var(--bg-inset);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 2px 6px rgba(0, 0, 0, 0.45);
  object-fit: cover;
}
.ad-icon.is-placeholder {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ad-gold);
}
.ad-new {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* --------------------------------------------------------------- the tooltip examples */

.ad-example-row { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.ad-example { margin: 0; flex: 1 1 18rem; max-width: 26rem; }
.ad-example figcaption { margin-top: 0.5rem; color: var(--text-faint); font-size: 0.86rem; }
.wow-tip {
  background: rgba(5, 9, 28, 0.94);
  border: 1px solid #8a8f9c;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #20263d, 0 6px 16px rgba(0, 0, 0, 0.5);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #fff;
}
.wow-tip p { margin: 0; }
.wow-tip .wow-tip-gap { height: 0.6rem; }
.wow-tip-name { font-size: 1.02rem; }
.wow-tip-label { color: #ffd100; }
.wow-tip-source { color: #8cc7f2; }
.wow-tip-done { color: #40ff40; }
.wow-tip-active { color: #ffd100; }
.wow-tip-open { color: #9e9ea8; }

/* ----------------------------------------------------------------------------- the games */

.ad-games {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.ad-game {
  padding: 0.85rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: 3px solid var(--game);
  border-radius: var(--radius);
}
.ad-game.is-current { box-shadow: 0 0 0 1px var(--game); }
.ad-game p { margin: 0 0 0.4rem; color: var(--text-dim); font-size: 0.92rem; }
.ad-game .ad-game-name { margin-bottom: 0.55rem; }
.ad-here { font-size: 0.8rem; color: var(--text-faint); }
.ad-folder { font-size: 0.82rem; overflow-wrap: anywhere; }
.ad-folder code, .ad-steps code { overflow-wrap: anywhere; }

/* ----------------------------------------------------------------------------- the steps */

.ad-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 0.8rem; max-width: 52rem; }
.ad-steps li {
  counter-increment: step;
  position: relative;
  padding: 0.8rem 1rem 0.8rem 3.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ad-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 0.8rem;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a3, var(--ad-gold) 45%, var(--ad-gold-dim));
  color: #2a1d02;
  font-weight: 800;
  box-shadow: 0 0 0 2px #3a3122;
}
.ad-steps h3 { font-size: 1rem; margin: 0.15rem 0 0.3rem; }
.ad-steps p { margin: 0; color: var(--text-dim); font-size: 0.93rem; }

/* -------------------------------------------------------------------------- the releases */

.ad-releases { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.ad-release { padding: 0.85rem 1rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); }
.ad-release h3 { margin: 0 0 0.45rem; font-size: 1rem; display: flex; gap: 0.6rem; align-items: baseline; }
.ad-release-version { color: var(--ad-gold); font-variant-numeric: tabular-nums; }
.ad-release time { color: var(--text-faint); font-size: 0.84rem; font-weight: 400; }
.ad-release ul { margin: 0; padding-left: 1.1rem; color: var(--text-dim); font-size: 0.92rem; }
.ad-release li { margin: 0.2rem 0; }
.ad-area { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------------------ the FAQ */

.ad-faq { display: grid; gap: 0.5rem; max-width: 52rem; }
.ad-faq details { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.1rem 1rem; }
.ad-faq summary { cursor: pointer; padding: 0.7rem 0; font-weight: 600; color: var(--text); }
.ad-faq summary:hover { color: var(--ad-gold); }
.ad-faq details[open] summary { color: var(--ad-gold); }
.ad-faq details p { margin: 0 0 0.8rem; color: var(--text-dim); }

@media (prefers-reduced-motion: no-preference) {
  .ad-card { transition: border-color 0.15s ease, transform 0.15s ease; }
  .ad-card:hover { border-color: color-mix(in srgb, var(--ad-gold) 40%, var(--border)); transform: translateY(-1px); }
}

.ad-game-logo { display: block; width: min(240px, 100%); height: 120px; object-fit: contain; }
.ad-game-logo.is-inline { display: inline-block; width: 130px; height: 65px; vertical-align: middle; }

.ad-game-logo.game-logo-era { object-fit: cover; }
