/* ============================================
   Xtreme HD IPTV - Blog Post Styles (REFINED)
   - Premium editorial rhythm (spacing + type)
   - Cleaner TOC + better active/hover
   - Sharper cards + subtle depth
   - Improved tables (still lightweight)
   - Keeps ALL existing class names intact
   ============================================ */

:root {
  --brand: #095393;
  --brand-light: #0b91cf;

  --text: #0f172a;
  --text-muted: #64748b;

  --bg: #f8fafc;
  --white: #ffffff;

  --border: #e2e8f0;
  --border-soft: rgba(226, 232, 240, 0.75);

  --shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 40px rgba(15, 23, 42, 0.12);

  --radius: 12px;
  --radius-lg: 16px;

  /* Tables */
  --table-bg: #ffffff;
  --table-head-bg: #f8fafc;
  --table-row-alt: #fbfdff;
  --table-hover: #f3f7ff;
  --table-border: #e6edf6;
  --table-head-text: #0f172a;
  --table-cell-text: #0f172a;
  --table-caption: #64748b;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Selection */
::selection { background: rgba(11,145,207,0.18); }

/* Focus */
:focus-visible {
  outline: 3px solid rgba(11,145,207,0.35);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Reading Progress */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img { height: 36px; width: auto; }

.desktop-nav {
  display: flex;
  gap: 32px;
}

.desktop-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  opacity: 0.9;
}

.desktop-nav a:hover { opacity: 1; }

.desktop-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.2s;
}

.desktop-nav a:hover::after,
.desktop-nav a.active::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: white;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 8px 18px rgba(9, 83, 147, 0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 10px 24px rgba(9, 83, 147, 0.24);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
}

.mobile-menu.active { display: block; }

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 550;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-cta { margin-top: 8px; }

/* ============================================
   MAIN CONTENT WRAPPER
   ============================================ */

.main-content { padding-top: 72px; }

/* ============================================
   HERO
   ============================================ */

.article-hero {
  background:
    radial-gradient(1200px 380px at 20% 0%, rgba(11,145,207,0.22), transparent 60%),
    radial-gradient(900px 340px at 90% 10%, rgba(9,83,147,0.18), transparent 55%),
    linear-gradient(135deg, rgba(11,145,207,0.12), rgba(9,83,147,0.14));
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 44px 24px 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.breadcrumb span { opacity: 0.7; }

.hero-breadcrumb {
  justify-content: flex-start;
  opacity: 1;
}

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

.hero-breadcrumb a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.category {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(9,83,147,0.18);
}

.dot {
  width: 4px;
  height: 4px;
  background: rgba(100,116,139,0.55);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 850;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hero-excerpt {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 760px;
  margin-bottom: 18px;
}

.hero-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-author img {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(9,83,147,0.14);
  box-shadow: 0 10px 18px rgba(15,23,42,0.08);
}

.author-info { text-align: left; }

.author-name {
  display: block;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
}

.author-role {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

/* Hero share buttons (if you keep them there) */
.article-hero .share-buttons {
  margin-top: 16px;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.article-hero .share-btn {
  width: auto;
}

/* ============================================
   ARTICLE BODY
   ============================================ */

.article-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
}

.mobile-toc { display: none; }

.article-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 52px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.7);
}

/* Prevent long text/urls from breaking mobile layout */
.article-content,
.article-content p,
.article-content li,
.article-content a,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Cover image inserted into content */
.post-cover { margin: 0 0 28px; }
.post-cover img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 0;
}

/* Typography rhythm */
.article-content h1 {
  font-size: 34px;
  font-weight: 850;
  line-height: 1.2;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.article-content h2 {
  font-size: 28px;
  font-weight: 750;
  margin: 52px 0 18px;
  color: var(--text);
  scroll-margin-top: 100px;
  letter-spacing: -0.01em;
}

.article-content h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(11,145,207,0.55), rgba(9,83,147,0.75));
  opacity: 0.55;
}

.article-content h3 {
  font-size: 22px;
  font-weight: 650;
  margin: 34px 0 14px;
  color: var(--text);
  scroll-margin-top: 100px;
}

.article-content p {
  font-size: 17px;
  line-height: 1.85;
  margin-bottom: 18px;
  color: var(--text);
}

.article-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-content a:hover { color: var(--brand-light); }

.article-content ul,
.article-content ol {
  margin: 18px 0 18px;
  padding-left: 28px;
}

.article-content li {
  font-size: 17px;
  line-height: 1.85;
  margin-bottom: 8px;
}

.article-content ul li::marker { color: var(--brand); }

.article-content strong {
  font-weight: 650;
  color: var(--text);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 28px 0;
}

.article-content figure { margin: 28px 0; }

.article-content figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.article-content blockquote {
  border-left: 4px solid var(--brand);
  padding: 16px 22px;
  margin: 30px 0;
  background: #f8fafc;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.article-content blockquote p { margin: 0; }

.article-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 46px 0;
}

.article-content code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
}

.article-content pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 22px 0;
  box-shadow: 0 10px 24px rgba(15,23,42,0.14);
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Callout boxes */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 22px 0;
  border-left: 4px solid;
}

.callout.info { background: #eff6ff; border-color: var(--brand); }
.callout.warning { background: #fffbeb; border-color: #f59e0b; }
.callout.success { background: #ecfdf5; border-color: #10b981; }

.callout-title { font-weight: 650; margin-bottom: 8px; }

/* ============================================
   TABLES
   ============================================ */

.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--table-bg);
  border: 1px solid var(--table-border);
  border-radius: 14px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.article-content table thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-weight: 750;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 16px;
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
  text-align: left;
  line-height: 1.35;
}

.article-content table tbody td,
.article-content table tbody th {
  color: var(--table-cell-text);
  font-size: 15px;
  line-height: 1.55;
  padding: 14px 16px;
  border-bottom: 1px solid var(--table-border);
  vertical-align: top;
}

.article-content table tbody tr:last-child td,
.article-content table tbody tr:last-child th { border-bottom: 0; }

.article-content table tbody tr:nth-child(even) td,
.article-content table tbody tr:nth-child(even) th { background: var(--table-row-alt); }

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

.article-content table th + th,
.article-content table td + td { border-left: 1px solid var(--table-border); }

.article-content table caption {
  caption-side: bottom;
  padding-top: 10px;
  font-size: 13px;
  color: var(--table-caption);
}

@media (max-width: 768px) {
  .article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .article-content table thead th,
  .article-content table tbody td,
  .article-content table tbody th {
    white-space: normal;
    min-width: 180px;
  }
}

/* ============================================
   POST FOOTER META (optional)
   ============================================ */

.post-footer-meta {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.post-footer-meta h3 {
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 14px;
  color: var(--text);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar-sticky {
  position: sticky;
  top: 96px;
}

.sidebar-box {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.7);
}

.sidebar-box h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: rgba(15,23,42,0.9);
}

/* TOC */
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.toc-nav a:hover {
  color: var(--text);
  background: rgba(11,145,207,0.08);
  border-color: rgba(11,145,207,0.18);
}

.toc-nav a.active {
  color: var(--brand);
  background: rgba(11,145,207,0.10);
  border-color: rgba(9,83,147,0.22);
  font-weight: 650;
}

.toc-nav a.h3 {
  padding-left: 22px;
  font-size: 13px;
  opacity: 0.95;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,0.10);
  border-color: rgba(9,83,147,0.22);
}

.share-btn.twitter:hover { background: #000; color: white; border-color: #000; }
.share-btn.facebook:hover { background: #1877f2; color: white; border-color: #1877f2; }
.share-btn.linkedin:hover { background: #0a66c2; color: white; border-color: #0a66c2; }

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

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a {
  display: inline-block;
  padding: 7px 12px;
  background: #f1f5f9;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,0.8);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.tag-list a:hover {
  background: rgba(11,145,207,0.10);
  border-color: rgba(11,145,207,0.22);
  transform: translateY(-1px);
}

/* ============================================
   RELATED ARTICLES
   ============================================ */

.related-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  border-top: 1px solid var(--border);
}

.related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.related-header h2 {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.view-all {
  color: var(--brand);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
}

.view-all:hover { text-decoration: underline; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1px solid rgba(226,232,240,0.7);
}

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

.related-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #eef2ff;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.related-card-content { padding: 20px; }

.related-card-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.related-card-title {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: #0f172a;
  color: white;
  padding: 64px 24px 0;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand img { height: 32px; margin-bottom: 16px; }

.footer-brand p {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.85;
  max-width: 340px;
}

.footer-links h4,
.footer-payments h4 {
  font-size: 14px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.footer-links nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 15px;
  opacity: 0.85;
  transition: opacity 0.18s;
}

.footer-links a:hover { opacity: 1; }

.payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-badges span {
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  opacity: 0.7;
}

.footer-bottom nav { display: flex; gap: 24px; }

.footer-bottom a {
  color: white;
  text-decoration: none;
}

.footer-bottom a:hover { text-decoration: underline; }

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .article-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .mobile-toc { display: block; order: 0; }

  .article-content { order: 1; }
  .post-footer-meta { order: 2; }
  .article-sidebar { order: 3; }

  .article-sidebar .share-box,
  .article-sidebar .tags-box { display: none; }

  .article-sidebar .toc-box { display: none; }

  .sidebar-sticky {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .sidebar-box { margin-bottom: 0; }

  .toc-nav { max-height: 240px; overflow-y: auto; }

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

  .footer-container { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .header-actions .btn-primary { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero-inner { padding: 30px 20px 28px; }

  .hero-title { font-size: 28px; }
  .hero-excerpt { font-size: 16px; }

  .article-wrapper { padding: 24px 20px; }
  .article-content { padding: 30px; }

  .article-content h2 { font-size: 22px; }
  .article-content h3 { font-size: 19px; }
  .article-content p,
  .article-content li { font-size: 16px; }

  .sidebar-sticky { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }

  .related-section { padding: 32px 20px 48px; }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .post-footer-meta { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-meta { gap: 8px; }
  .hero-meta .dot:nth-of-type(2) { display: none; }

  .article-content {
    padding: 24px 20px;
    border-radius: var(--radius);
  }

  /* Only affects hero share buttons (if present) */
  .article-hero .share-buttons { gap: 8px; }
  .article-hero .share-btn { flex: 1; justify-content: center; min-width: 140px; }
}