/*
Theme Name: TrendWave Pro
Theme URI: https://yoursite.com
Author: TrendWave
Author URI: https://yoursite.com
Description: A premium trending content WordPress theme designed for maximum AdSense revenue. Features real-time trending posts, dark mode, mobile-first design, and full AdSense compliance.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trendwave-pro
Tags: blog, news, magazine, adsense, trending, dark-mode, responsive
*/

/* ============================================
   CSS CUSTOM PROPERTIES (THEME VARIABLES)
   ============================================ */
:root {
  /* Brand Colors */
  --color-primary: #e53e3e;
  --color-primary-dark: #c53030;
  --color-primary-light: #fc8181;
  --color-secondary: #1a202c;
  --color-accent: #f6ad55;
  --color-accent-dark: #ed8936;

  /* Semantic Colors - Light Mode */
  --bg-body: #f7fafc;
  --bg-surface: #ffffff;
  --bg-surface-2: #f0f4f8;
  --bg-surface-3: #e2e8f0;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --border-color-strong: #cbd5e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 320px;
  --container-max: 1280px;
  --container-wide: 1440px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-index Stack */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-body: #0f1117;
  --bg-surface: #1a1d27;
  --bg-surface-2: #242837;
  --bg-surface-3: #2d3148;
  --text-primary: #f0f4f8;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --text-inverse: #1a202c;
  --border-color: #2d3748;
  --border-color-strong: #4a5568;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.5);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::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(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--color-primary-dark);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

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

.section {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.5rem;
  background: var(--color-primary);
  border-radius: 2px;
}

.view-all-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.view-all-link::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.view-all-link:hover::after {
  transform: translateX(4px);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.posts-grid {
  display: grid;
  gap: 1.5rem;
}

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

@media (max-width: 1024px) {
  .posts-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .posts-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .posts-grid-4,
  .posts-grid-3,
  .posts-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================
   MAIN LAYOUT (Content + Sidebar)
   ============================================ */
.site-main-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
  padding: 2rem 0;
}

@media (max-width: 1024px) {
  .site-main-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   POST CARD COMPONENT
   ============================================ */
.post-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
}

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

.post-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-surface-3);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-badge.trending {
  background: linear-gradient(135deg, #e53e3e, #f56565);
}

.post-card-badge.hot {
  background: linear-gradient(135deg, #ed8936, #f6ad55);
}

.post-card-badge.new {
  background: linear-gradient(135deg, #48bb78, #68d391);
}

.post-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-title a {
  color: inherit;
  transition: color var(--transition-fast);
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.post-card-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-card-views {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-card-read-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Featured post card (large) */
.post-card-featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.618fr 1fr;
}

.post-card-featured .post-card-image {
  aspect-ratio: auto;
  height: 100%;
  min-height: 280px;
}

.post-card-featured .post-card-body {
  padding: 2rem;
}

.post-card-featured .post-card-title {
  font-size: 1.5rem;
  -webkit-line-clamp: 4;
}

@media (max-width: 768px) {
  .post-card-featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TRENDING LIST ITEM
   ============================================ */
.trending-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--border-color-strong);
  min-width: 2rem;
  text-align: center;
  line-height: 1;
}

.trending-item:nth-child(1) .trending-number { color: var(--color-primary); }
.trending-item:nth-child(2) .trending-number { color: var(--color-accent); }
.trending-item:nth-child(3) .trending-number { color: #a0aec0; }

.trending-item-image {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-surface-3);
}

.trending-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trending-item-content {
  flex: 1;
  min-width: 0;
}

.trending-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.trending-item-title a {
  color: inherit;
}

.trending-item-title a:hover {
  color: var(--color-primary);
}

.trending-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================
   CATEGORY TABS
   ============================================ */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.category-tab:hover,
.category-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ============================================
   AD PLACEHOLDER STYLES
   ============================================ */
.ad-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  border: 2px dashed var(--border-color-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  text-align: center;
}

.ad-unit-label {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header Banner Ad: 728x90 desktop / 320x50 mobile */
.ad-unit-header-banner {
  min-height: 90px;
  width: 100%;
  margin: 0.5rem 0;
}

/* In-content ad: 728x90 */
.ad-unit-in-content {
  min-height: 90px;
  width: 100%;
  margin: 2rem 0;
}

/* Rectangle ad: 336x280 */
.ad-unit-rectangle {
  min-height: 280px;
  min-width: 280px;
  margin: 1.5rem auto;
}

/* Sidebar ads: 300x250, 300x600 */
.ad-unit-sidebar-medium {
  min-height: 250px;
  width: 300px;
  max-width: 100%;
  margin: 0 auto 1.5rem;
}

.ad-unit-sidebar-large {
  min-height: 600px;
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

/* Native/In-feed ad */
.ad-unit-native {
  min-height: 120px;
  width: 100%;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.btn-ghost {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary { background: rgba(229, 62, 62, 0.15); color: var(--color-primary); }
.badge-hot { background: rgba(246, 173, 85, 0.2); color: #c05621; }
.badge-new { background: rgba(72, 187, 120, 0.15); color: #276749; }
.badge-trending { background: rgba(229, 62, 62, 0.1); color: var(--color-primary); }

[data-theme="dark"] .badge-hot { color: var(--color-accent); }
[data-theme="dark"] .badge-new { color: #68d391; }

/* ============================================
   READING PROGRESS BAR
   ============================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */
.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.share-btn-twitter { background: #1da1f2; }
.share-btn-facebook { background: #1877f2; }
.share-btn-whatsapp { background: #25d366; }
.share-btn-telegram { background: #0088cc; }
.share-btn-copy { background: var(--bg-surface-3); color: var(--text-secondary) !important; }

/* ============================================
   SEARCH BAR
   ============================================ */
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.375rem 0.375rem 0.375rem 1.25rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  gap: 0.5rem;
}

.search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form button {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.search-form button:hover {
  background: var(--color-primary-dark);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.pagination a:hover,
.pagination .current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.comment {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-surface-3);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 0.75rem;
}

.comment-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   WIDGETS
   ============================================ */
.widget {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
  color: var(--text-primary);
}

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

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

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

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.toc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
}

.toc-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.toc-list li a {
  color: var(--text-secondary);
}

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

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-surface-2) 25%,
    var(--bg-surface-3) 50%,
    var(--bg-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   BACK TO TOP
   ============================================ */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: var(--z-sticky);
  cursor: pointer;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: var(--z-toast);
  transition: transform var(--transition-base);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .section { padding: 2rem 0; }
  .container { padding: 0 1rem; }
  .post-card-featured { grid-column: span 1; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ============================================
   SINGLE POST ARTICLE STYLES
   ============================================ */
.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.article-content p { margin-bottom: 1.25rem; }

.article-content ul,
.article-content ol {
  list-style: revert;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-content ul li,
.article-content ol li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  background: var(--bg-surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-style: italic;
  font-size: 1.125rem;
}

.article-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem auto;
}

.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(229, 62, 62, 0.3);
  text-underline-offset: 3px;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--color-primary);
}

.article-content pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .site-header,
  .site-sidebar,
  .ad-unit,
  #back-to-top,
  #reading-progress,
  .share-buttons { display: none !important; }

  body { background: white; color: black; }
  .container { max-width: 100%; }
}
