/* ==========================================================================
   RPGZine - Custom Dark Fantasy / OSR Theme
   Revisão: escala tipográfica consolidada, sem regras duplicadas/conflitantes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Lora:ital,wght@0,400;0,600;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Yrsa:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

:root {
  --bg-dark: #0d0e12;
  --bg-surface: #151720;
  --bg-card: #1c1e2b;
  --bg-card-hover: #242738;
  --border-gold: rgba(212, 175, 55, 0.2);
  --border-gold-glow: rgba(212, 175, 55, 0.5);
  --accent-gold: #d4af37;
  --accent-amber: #e5a93c;
  --accent-ruby: #c93b47;
  --accent-emerald: #3fa373;
  --text-main: #f6f3eb;
  --text-muted: #9aa1b2;
  --text-heading: #e3dec3;
  --font-heading: 'Yrsa', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Type Scale — única fonte de verdade para tamanhos */
  --fs-body: 1.25rem;
  /* 20px */
  --fs-lead: 1.4rem;
  --fs-h1: 2.8rem;
  --fs-h2: 2.1rem;
  --fs-h3: 1.7rem;
  --fs-h4: 1.4rem;
  --fs-h5: 1.2rem;
  --fs-h6: 1rem;
  --fs-brand: 2rem;
  --fs-hero-h1: 2.6rem;
  --fs-post-title: 1.85rem;
  --fs-meta: 1rem;
  --fs-tag: 0.85rem;
}

/* Global Reset & Base */
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  margin: 0;
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#wrap {
  flex: 1 0 auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6,
.brand-title {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 0.4em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text-heading);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
}

h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
  color: var(--text-heading);
}

h5 {
  font-size: var(--fs-h5);
  font-weight: 600;
  color: var(--text-heading);
}

h6 {
  font-size: var(--fs-h6);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover,
a:focus {
  color: var(--accent-amber);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Navigation Bar */
.navbar-rpg {
  background: rgba(15, 16, 21, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  padding: 12px 0;
  transition: all 0.3s ease;
}

.navbar-rpg .navbar-brand {
  font-family: var(--font-heading);
  font-size: var(--fs-brand);
  font-weight: 400;
  color: var(--accent-gold) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.05em;
}

.navbar-rpg .navbar-brand i,
.navbar-rpg .navbar-brand span.d20-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-ruby));
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(229, 169, 60, 0.4);
}

.navbar-rpg .nav>li>a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.navbar-rpg .nav>li>a:hover,
.navbar-rpg .nav>li>a:focus,
.navbar-rpg .nav>li.active>a {
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 2px solid var(--accent-gold);
}

/* Hero Section */
.rpg-hero {
  background: linear-gradient(180deg, rgba(28, 30, 43, 0.8) 0%, rgba(13, 14, 18, 0.95) 100%),
    radial-gradient(circle at center, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 45px 30px;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.rpg-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.rpg-hero h1 {
  font-size: var(--fs-hero-h1);
  font-weight: 400;
  border-bottom: none;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-heading);
}

.brand-title {
  font-weight: 400;
}

.rpg-hero p.lead {
  font-family: var(--font-sans);
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 24px;
}

/* Section Headers */
.section-header {
  background: linear-gradient(180deg, var(--bg-card) 0%, transparent 100%);
  padding: 12px 30px 0px;
  margin-bottom: 30px;
  border-radius: var(--radius-sm);
  display: none;
}

.section-header h2,
.section-header h3 {
  margin: 0;
  color: var(--text-muted);
  border: none;
  padding: 0;
}

/* Post Cards */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 30px;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow-card);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold-glow);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(212, 175, 55, 0.15);
}

.post-card h2.post-title {
  margin-top: 0;
  font-size: var(--fs-post-title);
  font-weight: 700;
}

.post-card h2.post-title a {
  color: var(--text-heading);
}

.post-card h2.post-title a:hover {
  color: var(--accent-amber);
}

.post-meta {
  font-family: var(--font-sans);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.15);
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tag Badges */
.tag-badge {
  display: inline-block;
  background: rgba(229, 169, 60, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(229, 169, 60, 0.3);
  font-family: var(--font-sans);
  font-size: var(--fs-tag);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-right: 6px;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  background: var(--accent-amber);
  color: var(--bg-dark);
  box-shadow: 0 0 10px rgba(229, 169, 60, 0.4);
}

/* Article Page */
.article-header {
  margin-bottom: 35px;
  text-align: center;
}

.article-header h1 {
  border-bottom: none;
  font-size: var(--fs-h1);
  font-weight: 700;
  margin-bottom: 16px;
}

.article-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

/* Discrete Horizontal Dividers */
hr,
.article-content hr {
  border: 0;
  height: 1px;
  background: var(--border-gold);
  margin: 16px 0 12px 0;
  opacity: 0.6;
}

/* Article Lists & References (Override asciidoctor.css margin-left: 1.5em) */
.article-content ul,
.article-content ol {
  margin-left: 0 !important;
  padding-left: 1.2rem !important;
  margin-bottom: 24px;
}

.article-content ul li,
.article-content ol li {
  margin-left: 0 !important;
  padding-left: 0 !important;
  margin-bottom: 8px;
}

/* Reference / Source list following hr (Aligned 100% flush to left edge) */
.article-content hr+ul,
.article-content hr+ol,
.article-content hr+p {
  margin-left: 0 !important;
  padding-left: 0 !important;
  list-style: none !important;
  list-style-type: none !important;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 18px;
}

.article-content hr+ul li,
.article-content hr+ol li {
  margin-left: 0 !important;
  padding-left: 0 !important;
  list-style: none !important;
  list-style-type: none !important;
}

/* Blockquotes (Grimoire / Parchment style) */
blockquote {
  background: rgba(28, 30, 43, 0.6);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 24px;
  margin: 24px 0;
  font-style: italic;
  font-size: 1.2rem;
  color: #efe8d8;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Pre & Code */
pre {
  background-color: #0b0c10 !important;
  border: 1px solid var(--border-gold) !important;
  border-radius: var(--radius-sm);
  color: #dcdcdc;
  padding: 18px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  overflow-x: auto;
}

code {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-amber);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

/* Dice Roller Widget Component */
.dice-roller-btn {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(201, 59, 71, 0.2));
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold) !important;
  border-radius: 20px;
  padding: 6px 16px !important;
  margin-left: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700 !important;
}

.dice-roller-btn:hover {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-ruby)) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(229, 169, 60, 0.5);
}

.dice-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.dice-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dice-modal {
  background: var(--bg-card);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 450px;
  padding: 30px;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
  text-align: center;
  position: relative;
}

.dice-modal h3 {
  font-size: var(--fs-h3);
}

.dice-modal .close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.dice-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: var(--text-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dice-chip:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.15);
  transform: scale(1.05);
}

.dice-result-box {
  background: #0d0e12;
  border: 1px dashed var(--accent-amber);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 15px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dice-result-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

/* Footer */
#footer {
  background: #090a0d;
  border-top: 1px solid var(--border-gold);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  padding: 35px 0;
  margin-top: 60px;
  text-align: center;
}

#footer a {
  color: var(--accent-gold);
}

/* Pagination / Read More */
.btn-rpg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-rpg:hover {
  background: var(--accent-gold);
  color: var(--bg-dark);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

/* Comments Section & Pageclip Form */
.rpg-comments-container {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-top: 45px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.rpg-comments-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.rpg-comments-header {
  margin-bottom: 24px;
}

.rpg-comments-header h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: var(--fs-h3);
  color: var(--text-heading);
}

.comments-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

/* Contact page intro text */
.rpg-contact-intro {
  margin-bottom: 32px;
}

.rpg-contact-intro p {
  font-size: var(--fs-body);
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0;
}

/* Anti-spam: Honeypot field — visually hidden, accessible */
.rpg-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Anti-spam: Math CAPTCHA */
.rpg-captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpg-captcha-question {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
}

.rpg-captcha-input {
  max-width: 100px;
}

.rpg-captcha-refresh {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.rpg-captcha-refresh:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.rpg-captcha-error {
  color: var(--accent-ruby);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Contact page - success message */
.rpg-contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  gap: 12px;
  transition: opacity 0.4s ease;
}

.contact-success-icon {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.5));
  animation: float 3s ease-in-out infinite;
}

.rpg-contact-success h2 {
  font-size: var(--fs-h2);
  color: var(--accent-gold);
  margin: 8px 0 0;
  border-bottom: none;
}

.rpg-contact-success p {
  color: var(--text-muted);
  font-size: var(--fs-body);
  max-width: 480px;
  margin: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.rpg-comments-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rpg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rpg-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpg-form-group label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

.required-star {
  color: var(--accent-ruby);
}

.optional-text {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: none;
}

.rpg-input {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.rpg-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.rpg-input::placeholder {
  color: #6b7280;
}

textarea.rpg-input {
  resize: vertical;
  min-height: 110px;
}

.rpg-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 5px;
}

/* Pageclip Submit Button Integration & Styling */
.btn-rpg-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-rpg-submit:hover {
  background: var(--accent-gold);
  color: var(--bg-dark);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
}

.pageclip-form__submit--loading {
  background: rgba(212, 175, 55, 0.2) !important;
  color: var(--accent-gold) !important;
  border-color: var(--accent-gold) !important;
}

.pageclip-form__submit--success {
  background: rgba(63, 163, 115, 0.2) !important;
  color: var(--accent-emerald) !important;
  border-color: var(--accent-emerald) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --fs-body: 1.15rem;
    --fs-h1: 2.1rem;
    --fs-h2: 1.7rem;
    --fs-h3: 1.4rem;
    --fs-brand: 1.6rem;
    --fs-hero-h1: 2rem;
    --fs-post-title: 1.5rem;
  }

  body {
    padding-top: 70px;
  }

  .article-content {
    padding: 20px;
  }

  .rpg-form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .rpg-comments-container {
    padding: 20px;
  }

  .dice-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}