/* ==========================================================================
   Plague Brasil - Base / Global Styles
   Body, scrollbar, grain overlay, vignette, typography fundamentals
   ========================================================================== */

/* ---- Google Fonts Import ---- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---- Body ---- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--jet-black);
  overflow-x: hidden;
  position: relative;
}

/* ---- Film Grain Overlay ---- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- Vignette Overlay ---- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 65%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

/* ---- Scrollbar (Webkit) ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--jet-black);
}

::-webkit-scrollbar-thumb {
  background: var(--smoke-gray);
  border-radius: var(--radius-full);
  border: 2px solid var(--jet-black);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dust-gray);
}

::-webkit-scrollbar-corner {
  background: var(--jet-black);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--smoke-gray) var(--jet-black);
}

/* ---- Selection ---- */
::selection {
  background: rgba(139, 0, 0, 0.4);
  color: var(--bone-white);
}

/* ---- Focus Styles ---- */
:focus-visible {
  outline: 2px solid var(--amber-glow);
  outline-offset: 2px;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--amber-glow);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--scarlet-red);
}

strong, b {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--surface-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--aged-bronze);
  padding-left: var(--space-4);
  color: var(--text-secondary);
  font-style: italic;
}

hr {
  border: none;
  height: 1px;
  background: var(--border-default);
  margin: var(--space-8) 0;
}

/* ---- Section Title Pattern ---- */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  text-align: center;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-4);
  color: var(--bone-white);
  text-shadow: 0 0 30px rgba(139, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--crimson-blood), var(--scarlet-red), var(--crimson-blood), transparent);
  margin: var(--space-3) auto 0;
  border-radius: var(--radius-full);
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: rgba(245, 240, 225, 0.85);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-12);
}

/* ---- Accent Underline ---- */
.accent-line {
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--crimson-blood), var(--scarlet-red));
  margin: var(--space-3) auto var(--space-6);
  border-radius: var(--radius-full);
}

/* ---- Text Utilities ---- */
.text-accent {
  color: var(--amber-glow);
}

.text-crimson {
  color: var(--scarlet-red);
}

.text-bronze {
  color: var(--aged-bronze);
}

.text-muted {
  color: var(--text-tertiary);
}

.text-center {
  text-align: center;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

/* ---- Image Utilities ---- */
.img-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ---- Main Content Area ---- */
main,
.main-content {
  position: relative;
  z-index: var(--z-base);
  min-height: calc(100vh - var(--header-height));
  padding-top: var(--header-height);
}

/* ---- Grain/Vignette overlay divs (alternative to ::before/::after) ---- */
.grain-overlay,
.vignette-overlay {
  display: none; /* Effects already applied via body::before/::after */
}

/* ---- Page Header ---- */
.page-header {
  padding-top: var(--space-8);
  padding-bottom: var(--space-4);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* ---- Error Pages ---- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: var(--weight-bold);
  color: var(--crimson-blood);
  line-height: 1;
  text-shadow: 0 0 60px rgba(139, 0, 0, 0.3);
}

.error-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 400px;
}

/* ---- Table Responsive ---- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

/* ---- Text mono ---- */
.text-mono {
  font-family: var(--font-mono);
}
