/* ===== WORDPRESS SPECIFIC ===== */

.page-content,
.entry-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

.entry-content h1,
.entry-content h3,
.entry-content h4 {
  margin-bottom: 16px;
}

.entry-content > :is(h1, h2, h3, h4):not(:first-child),
.page-content > :is(h1, h2, h3, h4):not(:first-child) {
  margin-top: 32px;
}

.entry-content > h2:first-child,
.page-content > h2:first-child {
  margin: 10px 0 20px;
}

.entry-content p {
  color: var(--c-muted);
  margin-bottom: 18px;
  line-height: 1.8;
}

:where(.entry-content, .page-content) .wp-block-buttons {
  margin: 30px 0;
}

/* Keep Gutenberg containers inside article column width (pages/posts with sidebar). */
.page-layout .page-layout__content .entry-content > .container {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 3em;
}

.page-layout .page-layout__content .entry-content .isoftcore-selected-posts {
  max-width: 100%;
  min-width: 0;
}

/* Lists: native markers — see interactions.css for revert */
.entry-content ul,
.entry-content ol,
.page-content ul,
.page-content ol {
  color: var(--c-muted);
  margin-bottom: 18px;
}

.entry-content img {
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.entry-content blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(37, 99, 235, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-muted);
  font-style: italic;
}

/* Page header */
.page-header {
  position: relative;
  padding: 20px 0 24px;
}

.page-header .hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.06), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(8, 145, 178, 0.04), transparent 40%);
  filter: blur(10px);
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-title {
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 18px;
  color: var(--c-muted);
  max-width: 600px;
}

/* Blog archive */
.blog-archive {
  padding: 40px 0 80px;
}

/* --- Post cards --- */
/* --- Shared post-card styles --- */
.post-card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-blue-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
}

/* Card-link: whole card clickable, stretch to fill card height */
.post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Thumbnail */
.post-card__thumb {
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
  aspect-ratio: 16 / 9;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.06);
}

/* Gradient overlay on hover */
.post-card__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(37, 99, 235, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.post-card:hover .post-card__thumb::after {
  opacity: 1;
}

.post-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-bg) 0%, rgba(37, 99, 235, 0.06) 100%);
}

/* Body */
.post-card__body {
  padding: 20px;
  padding-bottom: 48px;
  position: relative;

}

.post-card__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-card__date {
  font-size: 12px;
  color: var(--c-muted);
}

.post-card h3 {
  margin-bottom: 0;
  line-height: 1.35;
  transition: color 0.25s;
}

.post-card:hover h3 {
  color: var(--c-primary);
}

.post-card__excerpt {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--c-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read-more arrow — pinned to bottom of card body */
.post-card__more {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-primary);
  transition: gap 0.25s ease;
}

.post-card__more svg {
  transition: transform 0.25s ease;
}

.post-card:hover .post-card__more {
  gap: 10px;
}

.post-card:hover .post-card__more svg {
  transform: translateX(3px);
}

/* --- GRID layout --- */
.posts-grid--grid {
  display: grid;
  grid-template-columns: repeat(var(--blog-columns, 3), 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Card stretches full grid-cell height; link fills card */
.post-card--grid {
  display: flex;
  flex-direction: column;
}

.post-card--grid>.post-card__link {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card--grid .post-card__thumb {
  height: 150px;
  flex-shrink: 0;
}

.post-card--grid .post-card__body {
  flex: 1;
}

/* --- LIST layout --- */
.posts-grid--list {
  display: grid;
  gap: 20px;
}

.post-card--list .post-card__link {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: stretch;
}

.post-card--list .post-card__thumb {
  height: 100%;
  min-height: 180px;
}

/* --- CLASSIC layout --- */
.posts-grid--classic {
  display: grid;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.post-card--classic {
  display: flex;
  flex-direction: column;
}

.post-card--classic .post-card__thumb {
  height: 320px;
  flex-shrink: 0;
}

.post-card--classic .post-card__body {
  padding: 24px 20px;
}

/* Single post */
.single-post-hero {
  position: relative;
  padding: 20px 0 24px;
  margin-bottom: 40px;
}

.single-post-hero .hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.05), transparent 45%);
  filter: blur(10px);
  z-index: 0;
}

.single-post-hero--fallback {
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.2), transparent 32%),
    radial-gradient(circle at 86% 14%, rgba(8, 145, 178, 0.16), transparent 30%),
    radial-gradient(circle at 72% 78%, rgba(59, 130, 246, 0.1), transparent 34%),
    linear-gradient(135deg, #edf3ff 0%, #f5f8ff 42%, #eef5fb 100%);
  border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.single-post-hero--fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.2) 48%, rgba(255, 255, 255, 0.58) 100%),
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.52), transparent 28%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(8, 145, 178, 0.04));
  z-index: 0;
}

.single-post-hero--fallback .hero__bg {
  display: none;
}

.single-post-hero--has-image {
  padding: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #f0f4f8;
}

.single-post-hero--has-image::before {
  content: '';
  position: absolute;
  inset: -24px;
  background: inherit;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: blur(28px) brightness(1.5) saturate(0.3);
  z-index: 0;
}

.single-post-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.80);
  z-index: 1;
}

.single-post-hero .container {
  position: relative;
  z-index: 2;
}

.single-post-hero--fallback .container {
  padding-top: 48px;
  padding-bottom: 32px;
}

.single-post-hero--has-image .container {
  padding-top: 48px;
  padding-bottom: 32px;
}

#main-content > .page-header + .section,
#main-content > .page-header + .toc-mobile + .section,
#main-content > .single-post-hero + .section,
#main-content > .single-post-hero + .toc-mobile + .section {
  padding-top: 0;
}

.post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--c-muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .single-post-hero--has-image::before {
    background-attachment: scroll;
  }

  .single-post-hero--has-image .container {
    padding-top: 36px;
    padding-bottom: 24px;
  }

  .single-post-hero--fallback .container {
    padding-top: 36px;
    padding-bottom: 24px;
  }
}

@media (max-width: 900px) {
  .single-post-hero {
    margin-bottom: 0;
  }
}

.post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0;
  max-height: 400px;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-navigation {
  margin-top: 40px;
  padding-top: 8px;
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  min-width: 0;
  display: flex;
}

.post-navigation__link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 80px;
  padding: 14px 18px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  color: var(--c-text);
  text-decoration: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.post-navigation__link::before {
  content: none;
}

.post-navigation__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--c-primary), var(--c-cyan));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  clip-path: circle(0% at var(--cx, 50%) var(--cy, 50%));
  transition: clip-path 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 1;
  will-change: clip-path;
}

.post-navigation .nav-previous .post-navigation__link::before {
  inset: -34px auto auto -34px;
}

.post-navigation .nav-previous .post-navigation__link {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff, #fcfdff);
}

.post-navigation .nav-next .post-navigation__link {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  align-items: flex-end;
  text-align: right;
}

.post-navigation__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.post-navigation .nav-next .post-navigation__meta {
  justify-content: flex-end;
}

.post-navigation__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: var(--c-primary);
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.post-navigation__eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(38, 54, 82, 0.72);
}

.post-navigation__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-text);
  text-decoration: none;
  padding-left: 0;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  position: relative;
  z-index: 2;
}

.post-navigation .nav-next .post-navigation__title {
  margin-left: 0;
  padding-right: 0;
}

.post-navigation__link:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.post-navigation__link:hover::after,
.post-navigation__link:focus-visible::after {
  clip-path: circle(150% at var(--cx, 50%) var(--cy, 50%));
}

.post-navigation__link:hover .post-navigation__title {
  color: var(--c-primary);
}

.post-navigation .nav-previous .post-navigation__link:hover .post-navigation__arrow {
  transform: translateX(-3px);
  background: rgba(37, 99, 235, 0.14);
}

.post-navigation .nav-next .post-navigation__link:hover .post-navigation__arrow {
  transform: translateX(3px);
  background: rgba(37, 99, 235, 0.14);
}

/* Pagination */
.pagination {
  padding: 32px 0 0;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pagination .nav-links > * {
  flex: 0 0 auto;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--c-text);
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.pagination a.page-numbers:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.pagination .dots {
  min-width: 0;
  width: auto;
  padding: 0 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--c-muted);
  pointer-events: none;
}

.pagination .current {
  background: linear-gradient(120deg, var(--c-primary), var(--c-cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
}

.pagination .prev,
.pagination .next {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 760px) {
  .post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .post-navigation .nav-next .post-navigation__link {
    align-items: flex-end;
    text-align: right;
  }

  .post-navigation .nav-next .post-navigation__title {
    margin-left: auto;
  }

  .post-navigation__link {
    padding: 12px 16px;
    border-radius: 16px;
  }

  .post-navigation__title {
    font-size: 14px;
    width: 100%;
  }

  .pagination .nav-links {
    gap: 8px;
  }

  .pagination .page-numbers {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
  }
}

/* Contact forms: CF7 styles below (search "Contact Form 7") */

/* Prices */
.prices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.price-card {
  background: #fff;
  border: 1px solid var(--c-blue-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.price-card--featured {
  border-color: var(--c-primary);
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.04), #fff);
}

.price-card h3 {
  margin-bottom: 8px;
}

.price-amount {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 700;
  color: var(--c-primary);
  margin: 16px 0;
}

.price-amount small {
  font-size: 14px;
  color: var(--c-muted);
  font-weight: 400;
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  text-align: left;
}

.price-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-features li::before {
  content: var(--list-marker, "\25CF");
  flex-shrink: 0;
  font-size: var(--list-marker-size, 8px);
  color: var(--list-marker-color, #7b9fc4);
}

/* Promos */
.promos-grid {
  display: grid;
  gap: 24px;
}

.promo-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-blue-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.promo-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, var(--c-accent), #f97316);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 12px;
}

.promo-card h3 {
  margin-bottom: 10px;
}

.promo-card p {
  color: var(--c-muted);
}

/* About */
.about-section {
  padding: 40px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
}

.about-grid p {
  color: var(--c-muted);
  line-height: 1.8;
}

/* WordPress alignment */
.alignleft {
  float: left;
  margin: 0 24px 18px 0;
}

.alignright {
  float: right;
  margin: 0 0 18px 24px;
}

.aligncenter {
  display: block;
  margin: 18px auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  text-align: center;
  font-size: 13px;
  color: var(--c-muted);
  margin-top: 6px;
}

/* 404 */
.error-404 {
  text-align: center;
  padding: 80px 0;
}

.error-404 h1 {
  font-size: clamp(60px, 10vw, 120px);
  background: linear-gradient(120deg, var(--c-primary), var(--c-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-404 p {
  color: var(--c-muted);
  font-size: 18px;
  margin: 16px 0 32px;
}

/* Comments */
.comments-area {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--c-border);
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment {
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}

.comment-author {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--c-text);
}

.comment-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-bottom: 10px;
}

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

@media (max-width: 900px) {
  .entry-content h2 {
    margin-top: 24px;
  }
}

/* ===== TABLES ===== */
/* ====================================================================
   TABLES: entry-content & Gutenberg block
   ==================================================================== */
.entry-content table,
.wp-block-table table {
  width: 100%;
  min-width: 720px;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
  margin: 24px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--c-blue-border);
  box-shadow: inset 0 -1px 0 var(--c-blue-border);
}

/* Wide tables: start horizontal scroll earlier instead of over-compressing columns */
.entry-content .wp-block-table:has(table tr > *:nth-child(5)) table,
.wp-block-table:has(table tr > *:nth-child(5)) table {
  min-width: 980px;
}

.entry-content .wp-block-table:has(table tr > *:nth-child(6)) table,
.wp-block-table:has(table tr > *:nth-child(6)) table {
  min-width: 1160px;
}

.wp-block-table {
  margin: 30px 0 50px;
}

.entry-content .wp-block-table,
.wp-block-table {
  border: 1px solid var(--c-blue-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  overflow-y: hidden;
}

.entry-content .wp-block-table table,
.wp-block-table table {
  margin: 0;
  border: none;
  box-shadow: none;
}

.entry-content table thead,
.wp-block-table table thead {
  background: rgba(37, 99, 235, 0.08);
  color: var(--c-heading);
  border-bottom: 1px solid var(--c-blue-border) !important;
}

.entry-content table th,
.wp-block-table table th {
  padding: 12px 14px;
  font-weight: 700;
  font-family: var(--font-head);
  font-size: clamp(12px, calc(0.25vw + 11px), 16px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  border: none;
  border-bottom: none;
}

.entry-content table th:not(:first-child),
.entry-content table td:not(:first-child),
.wp-block-table table th:not(:first-child),
.wp-block-table table td:not(:first-child) {
  text-align: center;
}

.entry-content table td,
.wp-block-table table td {
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--c-blue-border);
  color: var(--c-text);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.entry-content table th:first-child,
.entry-content table td:first-child,
.wp-block-table table th:first-child,
.wp-block-table table td:first-child {
  text-align: left;
  width: auto;
  min-width: 0;
}

/* Homepage tables only: all columns left-aligned */
.home .codex-tables2-homepage .wp-block-table table th:not(:first-child),
.home .codex-tables2-homepage .wp-block-table table td:not(:first-child) {
  text-align: left;
}

.entry-content table tbody tr:nth-child(even),
.wp-block-table table tbody tr:nth-child(even) {
  background: rgba(37, 99, 235, 0.03);
}

/* Override WP default stripes (grey #f0f0f0 on odd → our blue tint on even) */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: transparent;
}

.entry-content table tbody tr:hover,
.wp-block-table table tbody tr:hover {
  background: rgba(37, 99, 235, 0.07);
}

.entry-content table tbody tr:last-child td,
.wp-block-table table tbody tr:last-child td {
  border-bottom: 1px solid var(--c-blue-border) !important;
}

/* WP stripes border override */
.wp-block-table.is-style-stripes {
  border-bottom: none;
}

.wp-block-table.is-style-stripes td,
.wp-block-table.is-style-stripes th {
  border-color: var(--c-blue-border);
}

/* Responsive table scroll */
.entry-content .wp-block-table,
.entry-content .table-scroll-wrap {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-gutter: auto;
}

/* ===== RELATED POSTS ===== */
/* ── Related Posts section ── */
.related-posts {
  padding: 50px 0 30px;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
  min-width: 0;
}

.related-posts__grid>.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.related-posts__grid>.post-card>.post-card__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 1240px) {
  .related-posts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-posts__grid > .post-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .related-posts__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== MOBILE TOC ===== */
/* ── Mobile TOC bar ── */
.toc-mobile {
  display: none;
  /* shown only < 900px */
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 60px;
  /* below mobile header */
  z-index: 90;
}

.toc-mobile__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 4%;
  border: none;
  background: none;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  cursor: pointer;
}

.toc-mobile__toggle svg {
  transition: transform 0.25s;
}

.toc-mobile__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.toc-mobile__nav {
  display: none;
  padding: 0 4% 12px;
  flex-direction: column;
  gap: 4px;
}

.toc-mobile__nav.is-open {
  display: flex;
}

.toc-mobile__nav a {
  display: block;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--c-text);
  text-decoration: none;
  border-left: 2px solid var(--c-border);
  padding-left: 12px;
}

.toc-mobile__nav a:hover,
.toc-mobile__nav a.is-active {
  color: var(--c-primary);
  border-left-color: var(--c-primary);
}

/* ===== VIDEO EMBEDS ===== */
/* Standard Gutenberg blocks: core/embed + core/video */
:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video) {
  max-width: min(100%, var(--embed-max-width, 800px));
}

:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video):not(.alignleft):not(.alignright) {
  margin-left: auto;
  margin-right: auto;
  padding: 0 0 20px;
}

:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video).alignleft {
  margin-left: 0;
  margin-right: auto;
}

:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video).alignright {
  margin-left: auto;
  margin-right: 0;
}

:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video).alignwide,
:where(.entry-content, .page-content) :where(.wp-block-embed, .wp-block-video).alignfull {
  max-width: 100%;
}

:where(.entry-content, .page-content) .wp-block-embed__wrapper {
  width: 100%;
  max-width: 100%;
}

:where(.entry-content, .page-content) .wp-block-embed__wrapper iframe,
:where(.entry-content, .page-content) .wp-block-video video {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto;
}

:where(.entry-content, .page-content) .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper {
  position: relative;
  overflow: hidden;
}

:where(.entry-content, .page-content) .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  height: 100% !important;
}

/* ===== CONTACT FORM 7 ===== */
/* ── Contact Form 7 Modern V2 Styling ── */
.wpcf7 {
  margin: 0 auto;
  animation: fadeSlide 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Grid Layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Field Group & Floating Labels */
.field-group {
  position: relative;
  margin-bottom: 8px;
  animation: fieldSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.field-group:nth-child(1) {
  animation-delay: 0.1s;
}

.field-group:nth-child(2) {
  animation-delay: 0.15s;
}

.field-group:nth-child(3) {
  animation-delay: 0.2s;
}

.field-group:nth-child(4) {
  animation-delay: 0.25s;
}

@keyframes fieldSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wpcf7-form p {
  margin: 0;
}

/* Base Input Styles */
.wpcf7-form .floating-input {
  width: 100%;
  padding: 30px 18px 10px !important;
  /* Space for label */
  border: 2px solid #f1f5f9;
  border-radius: 16px;
  background: #fff;
  /* Solid white for maximum contrast */
  font-family: inherit;
  font-size: 16px;
  color: var(--c-text-deep);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.01);
  appearance: none;
}

.wpcf7-form .floating-input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -4px rgba(37, 99, 235, 0.05);
  transform: translateY(-1px);
}

/* Floating Label Logic */
.floating-label {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 15px;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 10;
}

/* Label behavior on focus or content —
   CF7 wraps inputs in <span.wpcf7-form-control-wrap>,
   so the adjacent sibling of .floating-label is the <span>, not the <input>.
   We use :has() and :focus-within to handle both cases. */
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label,
.floating-input.has-value ~ .floating-label,
.wpcf7-form-control-wrap:focus-within + .floating-label,
.wpcf7-form-control-wrap:has(.floating-input:not(:placeholder-shown)) + .floating-label,
.wpcf7-form-control-wrap:has(.floating-input.has-value) + .floating-label,
.field-group.is-focused > .floating-label,
.field-group.has-value > .floating-label {
  top: 10px;
  left: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-primary);
}

.wpcf7-form textarea.floating-input {
  height: 140px;
  resize: vertical;
}

/* Modern Button Styling */
.form-footer {
  margin-top: 12px;
}

.wpcf7-submit {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--c-primary) 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.wpcf7-submit:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
}

.wpcf7-submit:active {
  transform: translateY(0) scale(0.98);
}

/* Spinner adjustment */
.wpcf7 .wpcf7-spinner {
  position: absolute;
  bottom: 20px;
  right: 20px;
  margin: 0;
}

/* Validation messages */
.wpcf7-not-valid-tip {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
}

/* Success/Error output design */
.wpcf7-response-output {
  margin: 12px 0 0 !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border: 1px solid transparent !important;
  text-align: center;
  transition: all 0.3s ease;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unconfirmed .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
  animation: softShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes softShake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.wpcf7-mail-sent-ok {
  background-color: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
}

.wpcf7-validation-errors {
  background-color: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

/* ===== MODAL ===== */
/* ── Modal Popup Styling ── */
.modal-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  padding: 20px;
  transition: all 0.3s ease;
}

.modal-form.is-active {
  visibility: visible;
  opacity: 1;
}

.modal-form__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.modal-form__content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  background: #f8fafc;
  /* Light slate background to make white inputs pop */
  border-radius: 20px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.4);
  padding: 30px 24px;
  transform: scale(0.9) translateY(30px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  max-height: min(84vh, 760px);
}

.modal-form__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.9) rgba(37, 99, 235, 0.08);
  overscroll-behavior: contain;
}

.modal-form__body::-webkit-scrollbar {
  width: 6px;
}

.modal-form__body::-webkit-scrollbar-track {
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px;
}

.modal-form__body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-primary), var(--c-cyan));
  border-radius: 999px;
}

.modal-form__body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #1d4ed8, #0891b2);
}

@media (max-width: 768px) {
  .modal-form {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-form__content {
    max-width: 560px;
    margin: 12px auto;
    padding: 22px 16px;
    border-radius: 16px;
    max-height: calc(100dvh - 24px);
  }

  .modal-form__body {
    padding-right: 6px;
    margin-right: -2px;
  }

  .modal-form__header {
    margin-bottom: 18px;
  }

  .modal-form .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-form .wpcf7-form .floating-input {
    padding: 22px 14px 10px !important;
    border-radius: 14px;
    font-size: 15px;
  }

  .modal-form .floating-label {
    top: 14px;
    left: 14px;
    font-size: 14px;
  }

  .modal-form .wpcf7-form textarea.floating-input {
    height: 120px;
  }

  .modal-form .wpcf7-submit {
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .modal-form {
    padding: 8px;
  }

  .modal-form__content {
    margin: 8px auto;
    padding: 18px 12px;
    border-radius: 14px;
    max-height: calc(100dvh - 16px);
  }

  .modal-form__title {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .modal-form__subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .modal-form__close {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 22px;
  }

  .modal-form .wpcf7-form .floating-input {
    padding: 20px 13px 9px !important;
    border-radius: 12px;
  }

  .modal-form .floating-label {
    top: 12px;
    left: 13px;
    font-size: 13px;
  }

  .modal-form .wpcf7-form textarea.floating-input {
    height: 96px;
  }

  .modal-form .wpcf7-submit {
    border-radius: 12px;
    font-size: 14px;
  }
}

.modal-form.is-active .modal-form__content {
  transform: scale(1) translateY(0);
}

.modal-form__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-form__close:hover {
  color: #fff;
  background: #ef4444;
}

.modal-form__header {
  text-align: center;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.modal-form__title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--c-text-deep);
  letter-spacing: -0.02em;
}

.modal-form__subtitle {
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
}

/* ===== FAQ INLINE ===== */
/* ============================================
   FAQ Inline Section (full-width pages)
   Reuses .faq-item styles from sidebar widget
   ============================================ */
.faq-section {
  background: var(--c-bg-alt, #f8fafc);
}

.faq-inline-widget {
  max-width: 800px;
  margin: 0 auto;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-blue-border, rgba(37, 99, 235, 0.12));
  border-radius: 14px;
  padding: 8px 0;
}

.faq-inline-widget .faq-item__header {
  padding: 16px 24px;
}

.faq-inline-widget .faq-item__text {
  font-size: 15px;
}

.faq-inline-widget .faq-item__inner {
  padding: 0 24px 16px;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .faq-inline-widget .faq-item__header {
    padding: 14px 18px;
  }
  .faq-inline-widget .faq-item__inner {
    padding: 0 18px 14px;
  }
}
