/* ============================================
   TheRuleBook.com — Main Stylesheet
   Navy + Gold — game night premium vibes
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Navy scale */
  --color-navy:        #1A2744;
  --color-navy-mid:    #243560;
  --color-navy-light:  #2F4480;

  /* Gold scale */
  --color-gold:        #C9A84C;
  --color-gold-light:  #DDB96A;
  --color-gold-pale:   #F7EEDB;

  /* Backgrounds */
  --color-bg:          #F8F7F4;
  --color-bg-alt:      #EFEDE6;
  --color-card:        #FFFFFF;

  /* Text */
  --color-text:        #1C1C2C;
  --color-text-light:  #4A4A5C;
  --color-text-muted:  #8A8A9A;

  /* Borders */
  --color-border:      #E0DDD4;
  --color-border-light:#EDEAE2;

  /* Semantic aliases */
  --color-primary:        var(--color-navy-mid);
  --color-primary-dark:   var(--color-navy);
  --color-accent:         var(--color-gold);
  --color-accent-light:   var(--color-gold-light);
  --color-green:          #2D6A4F;

  /* Shadows */
  --color-shadow:     rgba(26, 39, 68, 0.07);
  --color-shadow-med: rgba(26, 39, 68, 0.14);

  /* Type */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px  var(--color-shadow);
  --shadow-md: 0 4px 20px var(--color-shadow-med);
  --shadow-lg: 0 8px 36px var(--color-shadow-med);

  --transition: 0.2s ease;
  --max-width:  1200px;
  --nav-height: 64px;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-navy-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-gold); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }

/* ============ Typography ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-navy);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ============ Layout ============ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 0.5rem; }
.section-subtitle { text-align: center; color: var(--color-text-muted); font-size: 1.05rem; margin-bottom: 2.5rem; }

/* ============ Navigation ============ */
.nav {
  background: var(--color-navy);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--color-gold); }
.nav-logo:hover { color: #FFFFFF; opacity: 0.9; }
.nav-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; padding: 0; }
.nav-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: #FFFFFF;
  background: rgba(201,168,76,0.2);
}
.nav-hamburger { display: none; background: none; border: none; color: #FFF; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(140deg, var(--color-navy) 0%, var(--color-navy-mid) 55%, #1F3A7A 100%);
  color: #FFFFFF;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(201,168,76,0.06) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(201,168,76,0.04) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  border: 1px solid rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.1);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}
.hero h1 { color: #FFFFFF; margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.4rem); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,0.75); max-width: 560px; margin: 0 auto 2rem; }
.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  border: 1px solid rgba(201,168,76,0.3);
}
.hero-search input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  border: none;
  font-size: 0.98rem;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.97);
  color: var(--color-text);
  outline: none;
}
.hero-search input::placeholder { color: var(--color-text-muted); }
.hero-search button {
  padding: 0.85rem 1.4rem;
  background: var(--color-gold);
  color: var(--color-navy);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--transition);
  white-space: nowrap;
}
.hero-search button:hover { background: var(--color-gold-light); }
.hero-stats { display: flex; justify-content: center; gap: 3rem; margin-top: 2.75rem; }
.hero-stat { text-align: center; }
.hero-stat-num { display: block; font-size: 1.8rem; font-weight: 700; font-family: var(--font-serif); color: var(--color-gold); }
.hero-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.08em; }

/* ============ Section Labels ============ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}
.section-label::before, .section-label::after {
  content: '';
  display: block;
  height: 1px;
  width: 32px;
  background: var(--color-gold);
  opacity: 0.4;
}

/* ============ Category Cards ============ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-gold);
  color: var(--color-text);
}
.category-icon { font-size: 2.2rem; line-height: 1; }
.category-name { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; color: var(--color-navy); }
.category-count { font-size: 0.76rem; color: var(--color-text-muted); }

/* ============ Game Cards — Image Style ============ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.game-card {
  background: var(--color-card);
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-text);
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-gold);
  color: var(--color-text);
}
.game-card-img {
  height: 180px;
  background-size: cover;
  background-position: center top;
  background-color: var(--color-navy);
  position: relative;
  flex-shrink: 0;
}
.game-card-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(26,39,68,0.7) 0%, transparent 100%);
}
.game-card-emoji {
  height: 180px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  flex-shrink: 0;
}
.game-card-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.game-card-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
}
.game-card-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--color-navy); line-height: 1.3; }
.game-card-meta { display: flex; gap: 0.75rem; font-size: 0.76rem; color: var(--color-text-muted); }
.game-card-desc { font-size: 0.86rem; color: var(--color-text-light); line-height: 1.5; margin-top: 0.2rem; flex: 1; }
.game-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-navy-mid);
  transition: color var(--transition);
}
.game-card:hover .game-card-link { color: var(--color-gold); }
.game-card-footer {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--color-navy); color: #FFFFFF; }
.btn-primary:hover { background: var(--color-navy-mid); color: #FFFFFF; }
.btn-gold { background: var(--color-gold); color: var(--color-navy); font-weight: 700; }
.btn-gold:hover { background: var(--color-gold-light); color: var(--color-navy); }
.btn-amazon { background: #FF9900; color: #111; }
.btn-amazon:hover { background: #FFB84D; color: #111; }
.btn-outline { background: transparent; color: var(--color-navy); border: 1.5px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-navy); background: var(--color-bg-alt); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

/* ============ Badges ============ */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-difficulty-easy   { background: #D4F0DC; color: #1A6B30; }
.badge-difficulty-medium { background: #FFF0D4; color: #8B6000; }
.badge-difficulty-hard   { background: #FFD4D4; color: #8B0000; }

/* ============ TCG Banner ============ */
.tcg-section {
  background: linear-gradient(140deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.tcg-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 90% 50%, rgba(201,168,76,0.08) 0%, transparent 60%);
}
.tcg-section .section-label { color: var(--color-gold); }
.tcg-section .section-label::before, .tcg-section .section-label::after { background: var(--color-gold); }
.tcg-section h2 { color: #FFFFFF; }
.tcg-section p { color: rgba(255,255,255,0.7); }

.tcg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}
.tcg-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tcg-card:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(201,168,76,0.5);
  transform: translateY(-2px);
}
.tcg-card-icon { font-size: 2rem; }
.tcg-card-name { font-family: var(--font-serif); font-weight: 700; color: #FFFFFF; font-size: 1rem; }
.tcg-card-desc { font-size: 0.8rem; color: rgba(255,255,255,0.6); line-height: 1.5; }
.tcg-card-link { font-size: 0.78rem; font-weight: 600; color: var(--color-gold); margin-top: 0.25rem; }

/* ============ Best Of section ============ */
.best-section { background: var(--color-bg-alt); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.best-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.best-card {
  background: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.best-card:hover { border-color: var(--color-gold); transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--color-text); }
.best-card-num {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-gold);
  opacity: 0.6;
  min-width: 2rem;
  text-align: center;
  line-height: 1;
}
.best-card-title { font-family: var(--font-serif); font-size: 0.95rem; font-weight: 700; color: var(--color-navy); line-height: 1.3; }
.best-card-sub { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.2rem; }

/* ============ Breadcrumb ============ */
.breadcrumb { padding: 0.85rem 0; font-size: 0.85rem; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border-light); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-navy); }
.breadcrumb-sep { margin: 0 0.4rem; opacity: 0.5; }

/* ============ Footer ============ */
.footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.65);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand .nav-logo { font-size: 1.3rem; display: inline-block; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; }
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.85rem;
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col a { color: rgba(255,255,255,0.6); font-size: 0.88rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--color-gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; flex-wrap: wrap; gap: 0.5rem; }
.footer-bottom p { margin: 0; }
.affiliate-disclosure { background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-size: 0.76rem; line-height: 1.6; margin-top: 1rem; color: rgba(255,255,255,0.45); }

/* ============ Featured Section ============ */
.featured-section { background: var(--color-bg-alt); border-top: 1.5px solid var(--color-border); border-bottom: 1.5px solid var(--color-border); }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--color-navy); flex-direction: column; align-items: stretch; padding: 1rem; gap: 0.25rem; border-bottom: 2px solid rgba(255,255,255,0.08); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 1rem; border-radius: var(--radius-sm); }
  .nav-hamburger { display: block; }
  .nav { position: relative; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .tcg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { flex-wrap: wrap; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr 1fr; }
  .game-card-img, .game-card-emoji { height: 140px; }
}
