/* =============================================
 SINGLE POST — Premium Sidebar & H2-ONLY TOC
 ============================================= */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

/* HERO SECTION - 160px top padding eliminates fixed header overlap */
.sp-hero {
  background: var(--grad-hero, linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%));
  padding: 160px 0 40px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.sp-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -8%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 79, 97, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.sp-hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.sp-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 28px;
}

.sp-breadcrumb a {
  color: var(--primary, #004F61);
  font-weight: 500;
  text-decoration: none;
  transition: var(--t-fast, all 0.2s ease);
}

.sp-breadcrumb a:hover {
  color: var(--primary-light, #0284c7);
}

.sp-breadcrumb-sep {
  opacity: 0.5;
}

.sp-cat-badge {
  display: inline-block;
  background: var(--primary, #004F61);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: var(--radius-full, 50px);
  text-decoration: none;
  margin-bottom: 24px;
  transition: var(--t-fast, all 0.2s ease);
}

.sp-cat-badge:hover {
  background: var(--primary-light, #0284c7);
}

.sp-title {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.sp-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

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

.sp-author-chip img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--shadow-xs, 0 2px 4px rgba(0, 0, 0, 0.05));
}

.sp-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
}

.sp-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted, #64748b);
}

.sp-meta-item {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* FEATURED COVER IMAGE */
.sp-cover-wrap {
  max-width: 1000px;
  margin: -20px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 5;
}

.sp-cover {
  width: 100%;
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.1));
  display: block;
}

/* BODY & LAYOUT */
.sp-body {
  padding: 40px 0 60px;
  position: relative;
}

.sp-body-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 24px;
}

.sp-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  align-items: start;
}

.sp-main {
  min-width: 0;
}

.sp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: sticky;
  top: 110px;
}

/* FLOATING SHARE BAR */
.sp-share-float {
  position: fixed;
  left: calc(50% - 620px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.sp-share-float .sp-share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text-secondary, #475569);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--t-base, all 0.3s ease);
  box-shadow: var(--shadow-xs, 0 2px 4px rgba(0, 0, 0, 0.05));
  text-decoration: none;
}

.sp-share-float .sp-share-btn:hover {
  background: var(--primary, #004F61);
  color: #fff;
  border-color: var(--primary, #004F61);
  transform: scale(1.1);
  box-shadow: var(--shadow-sm, 0 4px 8px rgba(0, 0, 0, 0.1));
}

.sp-share-float .sp-share-divider {
  width: 20px;
  height: 1px;
  background: var(--border-light, #e2e8f0);
  margin: 4px auto;
}

/* RIGHT SIDEBAR TOC WIDGET BOX */
.sp-toc-widget {
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 28px 24px;
  box-shadow: var(--shadow-xs, 0 2px 4px rgba(0, 0, 0, 0.04));
}

.sp-toc-nav {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 16px;
}

.sp-toc-nav::-webkit-scrollbar {
  width: 4px;
}

.sp-toc-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

.sp-toc-nav::-webkit-scrollbar-thumb {
  background: var(--primary, #004F61);
  border-radius: 4px;
}

.sp-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-toc-item {
  margin: 0;
}

.sp-toc-link {
  font-size: 0.9rem;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.45;
  display: block;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  padding-left: 10px;
}

.sp-toc-link:hover,
.sp-toc-link.active {
  color: var(--primary, #004F61);
  font-weight: 700;
  border-left-color: var(--primary, #004F61);
  padding-left: 14px;
  background: rgba(0, 79, 97, 0.04);
  border-radius: 0 4px 4px 0;
}

/* ARTICLE CONTENT */
.sp-content {
  font-family: 'Roboto', sans-serif;
}

.sp-content>*:first-child {
  margin-top: 0;
}

.sp-content h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin: 40px 0 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sp-content h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 32px 0 12px;
  line-height: 1.25;
}

.sp-content h4 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 24px 0 12px;
  line-height: 1.3;
}

.sp-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-secondary, #475569);
  margin-bottom: 20px;
}

.sp-content a {
  color: var(--primary, #004F61);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 79, 97, 0.3);
  font-weight: 500;
  transition: var(--t-fast, all 0.2s ease);
}

.sp-content a:hover {
  text-decoration-color: var(--primary, #004F61);
}

.sp-content ul,
.sp-content ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.sp-content ul {
  list-style: disc;
}

.sp-content ol {
  list-style: decimal;
}

.sp-content li {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary, #475569);
  margin-bottom: 8px;
}

.sp-content blockquote {
  margin: 32px 0;
  padding: 32px 32px 32px 28px;
  border-left: 4px solid var(--primary, #004F61);
  background: linear-gradient(135deg, rgba(0, 79, 97, 0.03) 0%, rgba(0, 115, 142, 0.02) 100%);
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  position: relative;
}

.sp-content blockquote p {
  font-family: 'Roboto', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary, #0f172a);
  font-style: italic;
  margin-bottom: 0;
}

.sp-content pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 24px;
  border-radius: var(--radius-md, 8px);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 24px 0;
}

/* TABLE STYLES IN BLOG DETAIL CONTENT */
.sp-content .wp-block-table,
.sp-content table {
  width: 100%;
  margin: 32px 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  background: #ffffff;
}

.sp-content figure.wp-block-table {
  margin: 32px 0;
  overflow-x: auto;
  border-radius: 12px;
}

.sp-content table thead th,
.sp-content table th,
.sp-content table tr:first-child th {
  background: #004F61;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
  padding: 16px 20px;
  border-bottom: 2px solid #003643;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.01em;
}

.sp-content table thead th:last-child,
.sp-content table th:last-child {
  border-right: none;
}

/* Fallback header for tables using TD in first row without TH elements */
.sp-content table:not(:has(th)) tr:first-child td {
  background: #004F61;
  color: #ffffff;
  font-weight: 700;
  border-bottom: 2px solid #003643;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.sp-content table:not(:has(th)) tr:first-child td:first-child {
  color: #ffffff;
}

.sp-content table td {
  padding: 14px 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}

.sp-content table td:first-child {
  font-weight: 600;
  color: #0f172a;
}

.sp-content table td:last-child {
  border-right: none;
}

.sp-content table tr:last-child td {
  border-bottom: none;
}

.sp-content table tbody tr:nth-child(even),
.sp-content table tr:nth-child(even) {
  background-color: #f8fafc;
}

.sp-content table tbody tr:hover,
.sp-content table tr:hover {
  background-color: rgba(0, 79, 97, 0.04);
  transition: background-color 0.15s ease;
}

@media (max-width: 768px) {

  .sp-content figure.wp-block-table,
  .sp-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
  }
}

/* SIDEBAR WIDGETS */
.sp-widget {
  background: var(--bg-section, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 32px 28px;
}

.sp-widget-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 12px;
}

.sp-widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary, #004F61);
  border-radius: var(--radius-full, 50px);
}

/* ORIGINAL UNTOUCHED AUTHOR WIDGET */
.sp-author-widget {
  text-align: center;
}

.sp-author-widget img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow-sm, 0 4px 8px rgba(0, 0, 0, 0.05));
  margin: 0 auto 16px;
  display: block;
}

.sp-author-widget-name {
  font-family: 'Roboto', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 8px;
}

.sp-author-widget-bio {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary, #475569);
  margin-bottom: 16px;
}

.sp-author-widget-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #004F61);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: var(--t-fast, all 0.2s ease);
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-full, 50px);
  background: rgba(0, 79, 97, 0.06);
}

.sp-author-widget-link:hover {
  background: var(--primary, #004F61);
  color: #fff;
}

/* RECENT POSTS WIDGET */
.sp-recent-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sp-recent-item {
  display: flex;
  gap: 16px;
  align-items: center;
  text-decoration: none;
}

.sp-recent-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light, #e2e8f0);
  transition: var(--t-fast, all 0.2s ease);
}

.sp-recent-item:hover .sp-recent-img {
  border-color: var(--primary, #004F61);
  transform: scale(1.05);
}

.sp-recent-body {
  flex: 1;
}

.sp-recent-title {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.3;
  margin-bottom: 4px;
  transition: var(--t-fast, all 0.2s ease);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-recent-item:hover .sp-recent-title {
  color: var(--primary, #004F61);
}

.sp-recent-date {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

/* CTA BANNER WIDGET */
.sp-cta-widget {
  background: var(--grad-primary, linear-gradient(135deg, #004F61 0%, #002d38 100%));
  border-radius: var(--radius-xl, 16px);
  text-align: center;
  position: sticky;
  top: 100px;
  padding: 40px 32px;
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.15));
}

.sp-cta-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  line-height: 1.3;
}

.sp-cta-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* POST NAV */
.sp-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 40px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--border-light, #e2e8f0);
}

.sp-post-nav-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: var(--radius-md, 8px);
  transition: var(--t-fast, all 0.2s ease);
}

.sp-post-nav-link:hover {
  background: var(--bg-section, #f8fafc);
}

.sp-post-nav-dir {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary, #004F61);
}

.sp-post-nav-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.4;
  transition: var(--t-fast, all 0.2s ease);
}

.sp-post-nav-link:hover .sp-post-nav-title {
  color: var(--primary, #004F61);
}

.sp-post-nav-next {
  text-align: right;
  margin-left: auto;
}

/* RELATED POSTS */
.sp-related {
  padding: 60px 0;
  background: var(--bg-section, #f8fafc);
  border-top: 1px solid var(--border-light, #e2e8f0);
}

.sp-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.sp-related-title {
  font-family: 'Roboto', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.02em;
}

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

.sp-rcard {
  background: #fff;
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  border: 1px solid var(--border-light, #e2e8f0);
  transition: var(--t-base, all 0.3s ease);
  display: flex;
  flex-direction: column;
}

.sp-rcard:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, 0.08));
  border-color: var(--border, #cbd5e1);
}

.sp-rcard-img-link {
  display: block;
  height: 200px;
  overflow: hidden;
}

.sp-rcard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.sp-rcard:hover .sp-rcard-img {
  transform: scale(1.06);
}

.sp-rcard-body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sp-rcard-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary, #004F61);
  margin-bottom: 10px;
}

.sp-rcard-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
}

.sp-rcard-title a {
  color: var(--text-primary, #0f172a);
  text-decoration: none;
  transition: var(--t-fast, all 0.2s ease);
}

.sp-rcard:hover .sp-rcard-title a {
  color: var(--primary, #004F61);
}

.sp-rcard-date {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .sp-share-float {
    display: none;
  }
}

@media (max-width: 992px) {
  .sp-layout {
    grid-template-columns: 1fr;
  }

  .sp-sidebar {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-light, #e2e8f0);
    position: static;
  }
}

@media (max-width: 768px) {
  .sp-hero {
    padding: 130px 0 40px;
  }

  .sp-related-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sp-post-nav {
    grid-template-columns: 1fr;
  }

  .sp-post-nav-next {
    text-align: left;
  }
}

/* TOAST NOTIFICATION */
.sp-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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