/*
Theme Name: RunedForge
Theme URI: https://runedforge.com
Author: RunedForge
Description: Dark forge theme for the RunedForge TCG affiliate storefront. Ported from the customised Shopify Dawn theme.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: runedforge
WC requires at least: 8.0
*/

/* ---------- Tokens (from Dawn colour schemes) ---------- */
:root {
  --rf-bg: #1a1a1a;          /* scheme-1 */
  --rf-surface: #242424;     /* scheme-2 — cards */
  --rf-deep: #111111;        /* scheme-4 — hero, header, footer */
  --rf-warm: #2a2520;        /* scheme-5 */
  --rf-text: #e8e2d6;
  --rf-muted: rgba(232, 226, 214, 0.7);
  --rf-faint: rgba(232, 226, 214, 0.5);
  --rf-gold: #c4973b;
  --rf-gold-hover: #d6aa4e;
  --rf-line: rgba(196, 151, 59, 0.2);
  --rf-line-strong: rgba(196, 151, 59, 0.4);
  --rf-font-head: 'Playfair Display', Georgia, serif;
  --rf-font-body: 'Assistant', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rf-width: 1200px;
  --rf-gutter: 16px;

  /* Used by the ported calendar/calculator CSS (Dawn's RGB-triplet convention) */
  --color-foreground: 232, 226, 214;
  --color-background: 26, 26, 26;
}

@media (min-width: 750px) {
  :root { --rf-gutter: 40px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--rf-bg);
  color: var(--rf-text);
  font-family: var(--rf-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rf-gold); text-underline-offset: 3px; }
a:hover { color: var(--rf-gold-hover); }

h1, h2, h3, h4 {
  font-family: var(--rf-font-head);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--rf-text);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--rf-gold); outline-offset: 2px; }

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

.skip-link:focus {
  clip: auto; width: auto; height: auto;
  top: 8px; left: 8px; z-index: 100;
  background: var(--rf-gold); color: var(--rf-deep);
  padding: 8px 16px;
}

.page-width {
  max-width: var(--rf-width);
  margin: 0 auto;
  padding: 0 var(--rf-gutter);
}

.section { padding: 48px 0; }
@media (min-width: 750px) { .section { padding: 72px 0; } }

.section--surface { background: var(--rf-surface); }
.section--warm { background: var(--rf-warm); }

.section-title { text-align: center; margin-bottom: 1.5em; }

/* ---------- Buttons ---------- */
.button,
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-block;
  padding: 14px 28px;
  border: 1px solid var(--rf-gold);
  border-radius: 0;
  background: var(--rf-gold);
  color: var(--rf-deep);
  font-family: var(--rf-font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover,
.wp-element-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--rf-gold-hover);
  border-color: var(--rf-gold-hover);
  color: var(--rf-deep);
}
.button--secondary {
  background: transparent;
  color: var(--rf-gold);
}
.button--secondary:hover {
  background: rgba(196, 151, 59, 0.12);
  color: var(--rf-gold-hover);
}

/* ---------- Announcement + header ---------- */
.announcement-bar {
  background: var(--rf-gold);
  color: var(--rf-deep);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px var(--rf-gutter);
}

.site-header {
  background: var(--rf-surface);
  border-bottom: 1px solid var(--rf-line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--rf-text);
  text-decoration: none;
}
.site-logo:hover { color: var(--rf-text); }
.site-logo img { width: 44px; height: auto; }
.site-logo__name {
  font-family: var(--rf-font-head);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}
.site-nav a {
  color: var(--rf-text);
  text-decoration: none;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--rf-gold);
  border-bottom-color: var(--rf-gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rf-line-strong);
  color: var(--rf-text);
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle svg { width: 22px; height: 22px; margin: auto; display: block; }

@media (max-width: 899px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--rf-surface);
    border-bottom: 1px solid var(--rf-line);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--rf-gutter) 16px;
  }
  .site-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgba(232, 226, 214, 0.08);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  text-align: center;
  background-color: var(--rf-deep);
  background-image: url('assets/img/hero-2000.webp');
  background-size: cover;
  background-position: center 30%;
  overflow: hidden;
}
@media (max-width: 749px) {
  .hero {
    min-height: 460px;
    background-image: url('assets/img/hero-1000.webp');
  }
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.7) 100%);
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 64px var(--rf-gutter);
}
.hero h1 {
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: 2em;
}
.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Tool cards / game strip ---------- */
.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 750px) { .card-grid--2 { grid-template-columns: 1fr 1fr; } }

.tool-card {
  background: var(--rf-surface);
  border: 1px solid var(--rf-line);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--rf-line-strong); }
.tool-card p { color: var(--rf-muted); flex: 1; }
.tool-card__link {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.875rem;
  text-decoration: none;
}
.tool-card__link::after { content: ' \2192'; }

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.game-list li {
  border: 1px solid var(--rf-line-strong);
  padding: 8px 16px;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.coming-soon {
  text-align: center;
  border: 1px dashed var(--rf-line-strong);
  padding: 48px 24px;
  color: var(--rf-muted);
}

/* ---------- Content pages ---------- */
.page-header {
  background: var(--rf-deep);
  border-bottom: 1px solid var(--rf-line);
  padding: 48px 0 40px;
  text-align: center;
}
.page-header h1 { margin: 0; }
.page-header p { color: var(--rf-muted); margin: 12px auto 0; max-width: 640px; }

.entry-content {
  max-width: 760px;
  margin: 0 auto;
}
.entry-content h2 { margin-top: 1.6em; font-size: 1.5rem; }
.entry-content ul, .entry-content ol { padding-left: 1.25em; margin: 0 0 1em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.entry-content th, .entry-content td { border: 1px solid var(--rf-line); padding: 8px 12px; text-align: left; }
.entry-content--wide { max-width: none; }

.post-list { display: grid; gap: 24px; }
@media (min-width: 750px) { .post-list { grid-template-columns: repeat(3, 1fr); } }
.post-card { background: var(--rf-surface); border: 1px solid var(--rf-line); padding: 24px; }
.post-card h2 { font-size: 1.25rem; }
.post-card h2 a { color: var(--rf-text); text-decoration: none; }
.post-card h2 a:hover { color: var(--rf-gold); }
.post-meta { color: var(--rf-faint); font-size: 0.875rem; margin-bottom: 0.75em; }

.pagination { margin-top: 40px; text-align: center; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--rf-line); margin: 0 2px; text-decoration: none; }
.pagination .current { background: var(--rf-gold); color: var(--rf-deep); border-color: var(--rf-gold); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="search"], input[type="number"], textarea, select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--rf-line-strong);
  border-radius: 0;
  color: var(--rf-text);
  font: inherit;
  padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: var(--rf-faint); }
select option { background: var(--rf-surface); color: var(--rf-text); }

.search-form { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.search-form input[type="search"] { flex: 1; min-width: 0; }

/* ---------- Affiliate disclosure ---------- */
.affiliate-note {
  font-size: 0.8125rem;
  color: var(--rf-faint);
  border-left: 2px solid var(--rf-gold);
  padding: 8px 12px;
  margin: 16px 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--rf-deep);
  border-top: 2px solid rgba(196, 151, 59, 0.3);
  padding: 56px 0 24px;
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 750px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-heading {
  font-family: var(--rf-font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rf-gold);
  margin-bottom: 1em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5em; }
.site-footer a { color: var(--rf-text); text-decoration: none; }
.site-footer a:hover { color: var(--rf-gold); }
.footer-company { color: var(--rf-muted); font-size: 0.875rem; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(232, 226, 214, 0.08);
  color: var(--rf-faint);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* ---------- WooCommerce ---------- */
.woocommerce-breadcrumb {
  font-size: 0.875rem;
  color: var(--rf-faint);
  margin-bottom: 24px;
}
.woocommerce-breadcrumb a { color: var(--rf-muted); }

.woocommerce-products-header { margin-bottom: 24px; }
.woocommerce-products-header__title { margin: 0; }
.term-description { color: var(--rf-muted); }

.woocommerce-result-count { color: var(--rf-faint); font-size: 0.875rem; }
.woocommerce-ordering select { padding: 8px 10px; }

.woocommerce ul.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 750px) { .woocommerce ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  background: var(--rf-surface);
  border: 1px solid var(--rf-line);
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.woocommerce ul.products li.product:hover { transform: translateY(-2px); border-color: var(--rf-line-strong); }
.woocommerce ul.products li.product a img { aspect-ratio: 1; object-fit: contain; background: #fff; margin-bottom: 12px; width: 100%; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--rf-font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--rf-text);
  margin: 0 0 6px;
}
.woocommerce ul.products li.product > a:first-child { text-decoration: none; flex: 1; }
.woocommerce ul.products li.product .price { color: var(--rf-gold); font-weight: 700; display: block; margin-bottom: 12px; }
.woocommerce ul.products li.product .button { padding: 10px 12px; font-size: 0.75rem; text-align: center; }

.woocommerce .price del { color: var(--rf-faint); font-weight: 400; }
.woocommerce .price ins { text-decoration: none; }
.woocommerce span.onsale {
  position: absolute;
  background: var(--rf-gold);
  color: var(--rf-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  z-index: 2;
}
.woocommerce ul.products li.product { position: relative; }

/* Single product */
.woocommerce div.product { display: grid; gap: 32px; position: relative; }
@media (min-width: 900px) { .woocommerce div.product { grid-template-columns: 1fr 1fr; gap: 48px; } }
.woocommerce div.product div.images,
.woocommerce div.product div.summary { width: auto !important; float: none !important; margin: 0 !important; }
.woocommerce div.product div.images img { background: #fff; }
.woocommerce div.product .woocommerce-product-gallery__trigger { display: none; }
.woocommerce div.product .flex-control-thumbs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.woocommerce div.product .flex-control-thumbs img { cursor: pointer; opacity: 0.6; }
.woocommerce div.product .flex-control-thumbs img.flex-active,
.woocommerce div.product .flex-control-thumbs img:hover { opacity: 1; }
.woocommerce div.product .product_title { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.woocommerce div.product p.price { color: var(--rf-gold); font-size: 1.5rem; font-weight: 700; }
.woocommerce div.product form.cart { margin: 24px 0; }
.woocommerce div.product .single_add_to_cart_button { width: 100%; padding: 18px 28px; font-size: 1rem; text-align: center; }
.woocommerce div.product .product_meta { font-size: 0.875rem; color: var(--rf-faint); }
.woocommerce div.product .product_meta > span { display: block; margin-bottom: 4px; }
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells { grid-column: 1 / -1; }
.woocommerce div.product .woocommerce-tabs ul.tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--rf-line);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 12px 0;
  color: var(--rf-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--rf-gold); border-bottom-color: var(--rf-gold); }
.woocommerce div.product .woocommerce-tabs .panel h2:first-child { display: none; }
.woocommerce div.product .related > h2 { margin-top: 24px; }

.woocommerce-pagination { margin-top: 40px; text-align: center; }
.woocommerce-pagination ul { list-style: none; padding: 0; display: inline-flex; gap: 4px; }
.woocommerce-pagination .page-numbers { display: block; padding: 6px 12px; border: 1px solid var(--rf-line); text-decoration: none; }
.woocommerce-pagination .current { background: var(--rf-gold); color: var(--rf-deep); }

.woocommerce-info, .woocommerce-message, .woocommerce-error {
  list-style: none;
  background: var(--rf-surface);
  border-left: 3px solid var(--rf-gold);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.woocommerce .star-rating { display: none; }

/* ---------- Ported tool tweaks ---------- */
.release-calendar__game-badge { border-color: var(--rf-line-strong) !important; }
.release-calendar button { font-family: var(--rf-font-body); letter-spacing: 0.06em; }
.storage-calculator__results { scroll-margin-top: 110px; }
.storage-calculator__form select,
.storage-calculator__form input { width: 100%; }
