/* ==========================================================================
   Wizards Gate — modernized reinterpretation of the 2017 build
   Palette sampled from the original banner and section artwork.
   Colour/type tokens come from theme.json; this file adds the treatments
   that theme.json cannot express (hero veil, nav underline, card hovers).
   ========================================================================== */

:root {
  --wg-ink:        #0f1117;
  --wg-surface:    #171b25;
  --wg-raised:     #1f2532;
  --wg-line:       #2b3344;
  --wg-text:       #e6e4df;
  --wg-muted:      #9aa0ad;
  --wg-dim:        #6f7686;
  --wg-blue:       #5d82c6;   /* portal blue, from the gate artwork  */
  --wg-blue-lift:  #a1cff4;   /* highlight, from the gate artwork    */
  --wg-blue-deep:  #304b8f;   /* the original 2017 hover colour      */
  --wg-ember:      #a8443a;   /* from the banner's red-brown         */
  --wg-tan:        #b4815d;   /* warm parchment tone from the banner */
  --wg-radius:     14px;
  --wg-shadow:     0 18px 40px -22px rgba(0, 0, 0, .9);
}

/* --------------------------------------------------------------- base --- */

body {
  background: var(--wg-ink);
  -webkit-font-smoothing: antialiased;
}

/* A faint portal glow behind everything, echoing the gate artwork */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgba(93, 130, 198, .16), transparent 70%),
    radial-gradient(40rem 30rem at 100% 0%, rgba(168, 68, 58, .10), transparent 70%);
}

.wp-site-blocks { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------- header --- */

header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--wg-line);
}

.wg-header__inner { min-height: 58px; }

.wp-block-site-title { margin: 0; }
.wp-block-site-title a { color: var(--wg-text); text-decoration: none; }
.wp-block-site-title a:hover { color: #fff; }

/* Nav — the modern read of the original's row of little button GIFs */
.wp-block-navigation { flex-wrap: wrap; }

.wp-block-navigation .wp-block-navigation-item__content {
  position: relative;
  display: block;
  padding: .55rem .95rem;
  border-radius: 8px;
  color: var(--wg-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: var(--wg-text);
  background: rgba(93, 130, 198, .12);
}

.wp-block-navigation .wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: .95rem;
  right: .95rem;
  bottom: .28rem;
  height: 2px;
  border-radius: 2px;
  background: var(--wg-blue);
  transform: scaleX(0);
  transition: transform .22s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after { transform: scaleX(1); }

.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--wg-text); }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--wg-blue), var(--wg-blue-lift));
  box-shadow: 0 0 12px rgba(93, 130, 198, .7);
}

/* Keep the mobile overlay from reserving height while closed */
.wp-block-navigation__responsive-container:not(.is-menu-open) {
  position: static;
  background: transparent;
}

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

.wg-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--wg-line);
}

.wg-hero .wp-block-cover__image-background,
.wg-hero img { object-fit: cover; object-position: center; filter: saturate(1.05); }

/* Replace the default cover dimming with the original's directional veil */
.wg-hero .wp-block-cover__background {
  background:
    linear-gradient(to top, var(--wg-ink) 4%, rgba(15, 17, 23, .55) 45%, rgba(15, 17, 23, .25) 100%),
    linear-gradient(to right, rgba(15, 17, 23, .85), transparent 60%) !important;
  opacity: 1 !important;
}

.wg-hero .wp-block-cover__inner-container { align-self: flex-end; width: 100%; }

.wg-hero h1 { text-shadow: 0 4px 30px rgba(0, 0, 0, .8); margin-bottom: .35rem; }

.wg-hero p { margin: 0; max-width: 46ch; color: var(--wg-muted); }

/* The original's 1px divider GIF, redrawn */
.wg-rule.wp-block-separator {
  width: 84px;
  max-width: 84px;
  height: 2px;
  margin: 1rem 0 0;
  border: 0;
  opacity: 1;
  background: linear-gradient(90deg, var(--wg-blue-lift), var(--wg-blue-deep) 60%, transparent);
}

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

.wg-lede { max-width: 68ch; color: #cfd3da; }

/* Section heading with the trailing hairline.
   The wrapper must span the content column, so force it full width and
   apply the flex row to the inner layout rather than shrink-wrapping. */
.wg-section-head {
  display: flex !important;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  max-width: none !important;
}

.wg-section-head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 2rem;
  background: linear-gradient(90deg, var(--wg-line), transparent);
}

.wg-section-head > h2 {
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- grid --- */

.wg-grid.wp-block-columns { gap: 1.35rem; align-items: stretch; }

.wg-card.wp-block-column {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--wg-surface);
  border: 1px solid var(--wg-line);
  border-radius: var(--wg-radius);
  overflow: hidden;
  box-shadow: var(--wg-shadow);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.wg-card:hover {
  transform: translateY(-4px);
  border-color: rgba(93, 130, 198, .55);
  box-shadow: 0 22px 46px -20px rgba(0, 0, 0, .95),
              0 0 0 1px rgba(93, 130, 198, .18);
}

.wg-card .wp-block-image {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--wg-raised);
  border-bottom: 1px solid var(--wg-line);
}

.wg-card .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.wg-card:hover .wp-block-image img { transform: scale(1.05); }

.wg-card > *:not(.wp-block-image) { padding-inline: 1.35rem; }
.wg-card > .wp-block-image + * { padding-top: 1.25rem; }
.wg-card > *:last-child { padding-bottom: 1.45rem; }

.wg-card h3 { margin-bottom: .45rem; }

.wg-card p { color: var(--wg-muted); font-size: .95rem; line-height: 1.62; }

/* "Enter →" link, and the whole card as a click target */
.wg-card .wg-enter {
  margin-top: auto;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wg-card .wg-enter a::after { content: " \2192"; }
.wg-card .wg-enter a::before { content: ""; position: absolute; inset: 0; }

/* Per-section accent hairline across the top of each card */
.wg-card { --wg-accent: var(--wg-blue); }
.wg-card--ark       { --wg-accent: var(--wg-ember); }
.wg-card--rpg       { --wg-accent: var(--wg-tan); }
.wg-card--artemis   { --wg-accent: var(--wg-blue); }
.wg-card--minecraft { --wg-accent: #6f9b5a; }

.wg-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: var(--wg-accent);
  opacity: .85;
  z-index: 2;
}

/* -------------------------------------------------------------- footer --- */

footer.wp-block-template-part {
  border-top: 1px solid var(--wg-line);
  background: var(--wg-surface);
}

.wg-footer { color: var(--wg-dim); font-size: .85rem; }
.wg-footer a { color: var(--wg-muted); }
.wg-footer a:hover { color: var(--wg-text); }

/* --------------------------------------------------------- page basics --- */

.wg-page-title { margin-bottom: .5rem; }

/* ------------------------------------------------------------ a11y/etc --- */

.skip-link { background: var(--wg-blue-deep) !important; color: #fff !important; }

:focus-visible {
  outline: 2px solid var(--wg-blue-lift);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 781px) {
  .wg-header__inner { min-height: auto; }
  .wp-block-navigation .wp-block-navigation-item__content {
    padding: .5rem .65rem;
    font-size: .72rem;
    letter-spacing: .1em;
  }
  .wp-block-navigation .wp-block-navigation-item__content::after { left: .65rem; right: .65rem; }
}
