/* ============================================
   ViveTips.com - Main Stylesheet
   Editorial/Magazine Style - Clean & Readable
   ============================================ */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
:root {
  /* Colors */
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --border: #2e2e2e;
  --text-primary: #f0ede8;
  --text-secondary: #9a9690;
  --accent: #d4a853;
  --accent-hover: #e8c070;
  --error: #e85d5d;
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --container: 720px;
  --container-wide: 1100px;
  --gap: 2rem;
  --gap-sm: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

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

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5rem;
  max-width: 70ch;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

em {
  font-style: italic;
  color: var(--text-secondary);
}

blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--surface-2);
  font-style: italic;
  color: var(--text-secondary);
}

code {
  background: var(--surface-2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

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

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

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

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

.nav-link {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.hero-card {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  transition: transform 0.3s ease;
}

.hero-card:hover {
  transform: translateY(-4px);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-category {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-excerpt {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================
   ARTICLE GRID
   ============================================ */
.articles-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 1.25rem;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 600;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-content {
  padding: 1.5rem;
}

.article-category {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.article-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */
.load-more-container {
  text-align: center;
  margin: 3rem 0;
}

.btn {
  font-family: var(--font-ui);
  padding: 0.875rem 2rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* ============================================
   ARTICLE PAGE LAYOUT
   ============================================ */
.article-page {
  padding: 3rem 0;
}

.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb-separator {
  color: var(--border);
}

.article-header {
  margin-bottom: 3rem;
  text-align: left;
}

.article-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.article-meta-bar {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   ARTICLE BODY
   ============================================ */
.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.article-body h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
  margin: 1.5rem 0 1.5rem 2rem;
}

.article-body li {
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.article-body ul li::marker {
  color: var(--accent);
}

.article-body ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--accent-hover);
}

/* ============================================
   AD CONTAINERS
   ============================================ */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2.5rem auto;
  padding: 1rem;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.ad-container iframe {
  border: none;
}

.ad-leaderboard {
  max-width: 728px;
}

.ad-rectangle {
  max-width: 300px;
  float: right;
  margin: 0 0 1.5rem 1.5rem;
}

@media (max-width: 768px) {
  .ad-leaderboard {
    display: none;
  }
  
  .ad-rectangle {
    float: none;
    margin: 2rem auto;
  }
}

/* ============================================
   ARTICLE FOOTER
   ============================================ */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-tags {
  margin-bottom: 2rem;
}

.tag-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: block;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.tag:hover {
  background: var(--accent);
  color: var(--bg);
}

.share-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.share-btn {
  font-family: var(--font-ui);
  padding: 0.75rem 1.5rem;
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ============================================
   RELATED ARTICLES
   ============================================ */
.related-articles {
  margin-top: 4rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.related-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-family: var(--font-ui);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 968px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
  
  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid var(--border);
  }
  
  .site-nav.active {
    display: flex;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .articles-section {
    padding: 2rem 0;
  }
  
  .article-body {
    font-size: 1.05rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
  display: none;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  border: 3px solid var(--surface-2);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--surface-2);
  z-index: 9999;
}

.reading-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s ease;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.table-of-contents {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.table-of-contents h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--accent);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
}

.toc-list a:hover {
  color: var(--accent);
}

/* ============================================
   STICKY SIDEBAR AD
   ============================================ */
.sidebar-ad-sticky {
  position: fixed;
  top: 120px;
  right: 20px;
  z-index: 100;
  background: var(--surface-2);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.sidebar-ad-sticky iframe {
  border: none;
  display: block;
}

@media (max-width: 1400px) {
  .sidebar-ad-sticky {
    display: none;
  }
}

/* ============================================
   IN-FEED ADS (Between Articles)
   ============================================ */
.ad-in-feed {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  background: var(--surface-2);
  border-radius: 8px;
  margin: 1rem 0;
}

.ad-in-feed iframe {
  border: none;
}
