/* ================================================================
   RUMDIGI v2 — Base Styles (Reset + Typography)
   ================================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--rd-font);
  font-size: var(--rd-text-base);
  font-weight: var(--rd-fw-normal);
  line-height: var(--rd-lh-normal);
  color: var(--rd-text);
  background-color: var(--rd-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--rd-fw-bold);
  line-height: var(--rd-lh-tight);
  color: var(--rd-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--rd-text-3xl), 5vw, var(--rd-text-5xl)); }
h2 { font-size: clamp(var(--rd-text-2xl), 4vw, var(--rd-text-4xl)); }
h3 { font-size: clamp(var(--rd-text-xl), 3vw, var(--rd-text-2xl)); }
h4 { font-size: var(--rd-text-xl); }
h5 { font-size: var(--rd-text-lg); font-weight: var(--rd-fw-semi); }
h6 { font-size: var(--rd-text-base); font-weight: var(--rd-fw-semi); }

p {
  color: var(--rd-text-2);
  line-height: var(--rd-lh-loose);
  margin-bottom: var(--rd-space-4);
}
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--rd-fw-semi); color: var(--rd-text); }
em { font-style: italic; }
small { font-size: var(--rd-text-sm); color: var(--rd-text-3); }

/* Gradient text utility */
.rd-gradient-text {
  background: var(--rd-grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rd-blue-text {
  background: var(--rd-grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rd-accent-text { color: var(--rd-accent); }

/* === SECTION LABELS === */
.rd-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--rd-space-2);
  font-size: var(--rd-text-xs);
  font-weight: var(--rd-fw-semi);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rd-primary-light);
  margin-bottom: var(--rd-space-4);
}
.rd-section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--rd-grad-blue);
  border-radius: 2px;
}

.rd-section-title { font-size: clamp(var(--rd-text-2xl), 4vw, var(--rd-text-4xl)); margin-bottom: var(--rd-space-4); }
.rd-section-subtitle { font-size: var(--rd-text-lg); color: var(--rd-text-2); max-width: 580px; line-height: var(--rd-lh-loose); }
.rd-section-header { margin-bottom: var(--rd-space-12); }
.rd-section-header.center { text-align: center; }
.rd-section-header.center .rd-section-subtitle { margin: 0 auto; }
.rd-section-header.center .rd-section-eyebrow { display: flex; justify-content: center; }

/* === DIVIDER === */
.rd-divider {
  border: none;
  border-top: 1px solid var(--rd-border);
  margin: var(--rd-space-8) 0;
}

/* === CODE === */
code {
  font-family: var(--rd-font-mono);
  font-size: 0.875em;
  background: var(--rd-bg-card);
  color: var(--rd-blue-300);
  padding: 2px 6px;
  border-radius: var(--rd-radius-sm);
  border: 1px solid var(--rd-border);
}
pre {
  background: var(--rd-bg-card);
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius-md);
  padding: var(--rd-space-6);
  overflow-x: auto;
  margin: var(--rd-space-6) 0;
}
pre code { background: none; border: none; padding: 0; }

/* === SELECTION === */
::selection { background: rgba(86, 186, 220, 0.2); color: var(--rd-text); }

/* === FOCUS === */
:focus-visible {
  outline: 2px solid var(--rd-primary-light);
  outline-offset: 3px;
  border-radius: var(--rd-radius-sm);
}

/* === UTILITY CLASSES === */
.rd-hidden    { display: none !important; }
.rd-sr-only   { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.rd-container { max-width: var(--rd-container); margin: 0 auto; padding: 0 var(--rd-space-6); }
.rd-section   { padding: var(--rd-section-py) 0; }
.rd-section-alt { padding: var(--rd-section-py) 0; background: var(--rd-bg-2); }
.rd-text-center { text-align: center; }
.rd-flex      { display: flex; }
.rd-flex-center { display: flex; align-items: center; justify-content: center; }
.rd-gap-4     { gap: var(--rd-space-4); }
.rd-gap-6     { gap: var(--rd-space-6); }

/* === BREADCRUMB === */
.rd-breadcrumb { margin-bottom: var(--rd-space-8); }
.rd-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rd-space-2); }
.rd-breadcrumb li { display: flex; align-items: center; gap: var(--rd-space-2); font-size: var(--rd-text-sm); color: var(--rd-text-3); }
.rd-breadcrumb li a { color: var(--rd-text-2); transition: var(--rd-trans-fast); }
.rd-breadcrumb li a:hover { color: var(--rd-primary-light); }
.rd-breadcrumb li svg { color: var(--rd-text-3); }

/* === PAGE HEADER === */
.rd-page-header {
  padding: calc(var(--rd-header-h) + var(--rd-space-12)) 0 var(--rd-space-12);
  background: var(--rd-grad-hero);
  position: relative;
  overflow: hidden;
}
.rd-page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(42,111,151,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* === POST META === */
.rd-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rd-space-4);
  font-size: var(--rd-text-sm);
  color: var(--rd-text-3);
  margin-bottom: var(--rd-space-4);
}
.rd-post-meta span { display: flex; align-items: center; gap: var(--rd-space-1); }
.rd-post-meta a { color: var(--rd-text-2); transition: var(--rd-trans-fast); }
.rd-post-meta a:hover { color: var(--rd-primary-light); }

/* === TOC === */
.rd-toc {
  background: var(--rd-bg-card);
  border: 1px solid var(--rd-border);
  border-left: 3px solid var(--rd-primary);
  border-radius: var(--rd-radius-md);
  padding: var(--rd-space-6);
  margin: var(--rd-space-8) 0;
}
.rd-toc-header {
  display: flex;
  align-items: center;
  gap: var(--rd-space-2);
  font-weight: var(--rd-fw-semi);
  font-size: var(--rd-text-sm);
  color: var(--rd-primary-light);
  margin-bottom: var(--rd-space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rd-toc-list { counter-reset: toc-counter; }
.rd-toc-list li {
  counter-increment: toc-counter;
  margin-bottom: var(--rd-space-2);
  font-size: var(--rd-text-sm);
}
.rd-toc-list li::before {
  content: counter(toc-counter, decimal-leading-zero) ". ";
  color: var(--rd-text-3);
  font-weight: var(--rd-fw-medium);
  margin-right: var(--rd-space-1);
}
.rd-toc-list a { color: var(--rd-text-2); transition: var(--rd-trans-fast); }
.rd-toc-list a:hover { color: var(--rd-primary-light); }

/* === ENTRY CONTENT (Blog) === */
.entry-content {
  font-size: var(--rd-text-base);
  line-height: var(--rd-lh-loose);
  color: var(--rd-text-2);
}
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--rd-text); margin: var(--rd-space-8) 0 var(--rd-space-4); }
.entry-content h2 { font-size: var(--rd-text-2xl); border-bottom: 1px solid var(--rd-border); padding-bottom: var(--rd-space-3); }
.entry-content h3 { font-size: var(--rd-text-xl); }
.entry-content ul, .entry-content ol { padding-left: var(--rd-space-6); margin: var(--rd-space-4) 0; }
.entry-content ul li, .entry-content ol li { margin-bottom: var(--rd-space-2); padding-left: var(--rd-space-2); }
.entry-content ul li::marker { color: var(--rd-primary-light); }
.entry-content ol li::marker { color: var(--rd-primary-light); font-weight: var(--rd-fw-semi); }
.entry-content blockquote {
  border-left: 3px solid var(--rd-accent);
  background: var(--rd-bg-card);
  padding: var(--rd-space-4) var(--rd-space-6);
  border-radius: 0 var(--rd-radius-md) var(--rd-radius-md) 0;
  margin: var(--rd-space-6) 0;
  font-style: italic;
  color: var(--rd-text);
}
.entry-content a { color: var(--rd-primary-light); border-bottom: 1px solid rgba(86,186,220,0.3); transition: var(--rd-trans-fast); }
.entry-content a:hover { color: var(--rd-blue-200); border-bottom-color: var(--rd-primary-light); }
.entry-content img { border-radius: var(--rd-radius-lg); margin: var(--rd-space-6) 0; }
.entry-content table { margin: var(--rd-space-6) 0; }
.entry-content th { background: var(--rd-bg-card); padding: var(--rd-space-3) var(--rd-space-4); text-align: left; font-weight: var(--rd-fw-semi); color: var(--rd-primary-light); font-size: var(--rd-text-sm); }
.entry-content td { padding: var(--rd-space-3) var(--rd-space-4); border-bottom: 1px solid var(--rd-border); color: var(--rd-text-2); font-size: var(--rd-text-sm); }
.entry-content tr:hover td { background: rgba(42,111,151,0.04); }
.entry-content .wp-block-image { margin: var(--rd-space-8) 0; }

/* === PAGINATION === */
.rd-pagination { margin-top: var(--rd-space-12); }
.rd-pagination .page-numbers { display: flex; flex-wrap: wrap; gap: var(--rd-space-2); justify-content: center; }
.rd-pagination .page-numbers li {}
.rd-pagination .page-numbers li a,
.rd-pagination .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--rd-radius-md);
  border: 1px solid var(--rd-border);
  color: var(--rd-text-2);
  font-size: var(--rd-text-sm);
  font-weight: var(--rd-fw-medium);
  transition: var(--rd-trans-fast);
  background: var(--rd-bg-card);
}
.rd-pagination .page-numbers li a:hover { border-color: var(--rd-primary); color: var(--rd-primary-light); background: rgba(42,111,151,0.1); }
.rd-pagination .page-numbers li .current { background: var(--rd-grad-blue); border-color: transparent; color: white; }

/* === TAGS & CATEGORIES === */
.rd-tags { display: flex; flex-wrap: wrap; gap: var(--rd-space-2); margin-top: var(--rd-space-4); }
.rd-tag {
  display: inline-block;
  padding: var(--rd-space-1) var(--rd-space-3);
  background: var(--rd-bg-card);
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius-full);
  font-size: var(--rd-text-xs);
  color: var(--rd-text-2);
  transition: var(--rd-trans-fast);
}
.rd-tag:hover { border-color: var(--rd-primary); color: var(--rd-primary-light); background: rgba(42,111,151,0.1); }
.rd-tag.accent { border-color: var(--rd-border-accent); color: var(--rd-accent); background: rgba(232,101,26,0.08); }
.rd-tag.blue { border-color: var(--rd-border); color: var(--rd-primary-light); background: rgba(86,186,220,0.08); }
