/* ============================================================
   Smart Drugs Site — Dark Warm Premium Theme
   ============================================================ */

/* 1. CSS VARIABLES
   ============================================================ */
:root {
  --bg: #1c1612;
  --bg-secondary: #13100d;
  --surface: #2a2320;
  --surface-hover: #352d28;
  --text: #f0e8e0;
  --text-secondary: #a89888;
  --text-muted: #7a6b5c;
  --accent: #e8a838;
  --accent-hover: #d49530;
  --accent-light: rgba(232, 168, 56, 0.12);
  --accent-glow: rgba(232, 168, 56, 0.25);
  --terracotta: #d4785c;
  --border: #3d3430;
  --border-light: #4a3f38;
  --warning: #e85050;
  --success: #5cb85c;
  --max-width: 1200px;
  --content-width: 720px;
  --font: 'DM Sans', sans-serif;
  --radius: 0.625rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font);
}

/* 3. CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

/* 4. NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 2px 20px var(--accent-glow);
}

.nav-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.nav-logo:hover {
  color: var(--accent-hover);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.25rem;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background 0.2s ease;
}

.nav-hamburger:hover span {
  background: var(--accent);
}

/* Mobile nav open state */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  gap: 1.25rem;
  align-items: flex-start;
}

/* 5. HERO SECTION
   ============================================================ */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 580px;
  margin: 0 auto 2.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.hero-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  border: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px var(--accent-glow);
}

/* 6. ARTICLE GRID
   ============================================================ */
.article-grid-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card-tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.card h3 a {
  color: var(--text);
  transition: color 0.2s ease;
}

.card h3 a:hover {
  color: var(--accent);
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.card-read-time {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* 7. TAG FILTER BUTTONS
   ============================================================ */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tag-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.tag-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* 8. ARTICLE PAGE LAYOUT
   ============================================================ */
.article-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

.article-page h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.article-page h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-page h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.article-page h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.article-page p {
  margin-bottom: 1rem;
  color: var(--text);
}

.article-page a {
  color: var(--accent);
  text-decoration: none;
  transition: text-decoration 0.2s ease;
}

.article-page a:hover {
  text-decoration: underline;
}

.article-page ul,
.article-page ol {
  list-style: initial;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.article-page ol {
  list-style: decimal;
}

.article-page li {
  margin-bottom: 0.4rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-meta-tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

/* 9. FAQ ACCORDION
   ============================================================ */
.faq-list {
  margin: 2rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s ease;
  gap: 1rem;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-question::after {
  content: '+';
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.97rem;
  line-height: 1.7;
}

/* 10. CTA BLOCKS
   ============================================================ */
.cta-block {
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 2rem 0;
}

.cta-block h3,
.cta-block h4 {
  color: var(--text);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.cta-block p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  transition: background 0.2s ease;
}

.btn-cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* 11. BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumbs a {
  color: var(--accent);
  transition: text-decoration 0.2s ease;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

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

/* 12. RELATED POSTS
   ============================================================ */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  margin-top: 0;
}

.related-posts ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.related-posts li a {
  color: var(--accent);
  font-size: 0.97rem;
  transition: text-decoration 0.2s ease;
}

.related-posts li a:hover {
  text-decoration: underline;
}

/* 13. DISCLAIMER
   ============================================================ */
.disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 2rem 0;
}

.disclaimer strong {
  color: var(--text);
}

/* 14. FOOTER
   ============================================================ */
.footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* 15. 404 PAGE
   ============================================================ */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 2rem 1.5rem;
}

.page-404 h1 {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

.page-404 p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 400px;
}

.page-404 a {
  color: var(--accent);
  font-weight: 600;
  transition: text-decoration 0.2s ease;
}

.page-404 a:hover {
  text-decoration: underline;
}

/* 16. SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 17. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 1.75rem;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .article-page h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding-top: 5.5rem;
  }

  .hero-stats {
    gap: 1.25rem;
  }

  .article-page h1 {
    font-size: 1.75rem;
  }

  .page-404 h1 {
    font-size: 3rem;
  }

  .tag-filter {
    gap: 0.4rem;
  }
}

/* 18. TABLES
   ============================================================ */
.article-page table,
table.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.article-page table th,
table.content-table th {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--accent);
}

.article-page table td,
table.content-table td {
  padding: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.article-page table tr:hover td,
table.content-table tr:hover td {
  background: var(--surface-hover);
}

/* Overflow wrapper for mobile tables */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}

.table-wrapper table {
  margin: 0;
  min-width: 520px;
}

/* ============================================================
   UTILITY / MISC
   ============================================================ */

/* Section container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section headings */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Inline code */
code {
  background: var(--surface);
  color: var(--terracotta);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Fira Code', 'Courier New', monospace;
}

/* Code blocks */
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 0.9rem;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Warning / alert boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.alert-warning {
  background: rgba(232, 80, 80, 0.1);
  border: 1px solid rgba(232, 80, 80, 0.3);
  color: var(--warning);
}

.alert-success {
  background: rgba(92, 184, 92, 0.1);
  border: 1px solid rgba(92, 184, 92, 0.3);
  color: var(--success);
}

.alert-info {
  background: var(--accent-light);
  border: 1px solid rgba(232, 168, 56, 0.3);
  color: var(--accent);
}
