/**
 * WordPress Block Styles for Post Content
 *
 * Styles for WordPress core blocks displayed within post/page content.
 * This ensures Gutenberg blocks render properly within the theme.
 *
 * @package HomeFix_Pro
 * @since 1.0.0
 */

/* ==========================================================================
   GENERAL BLOCK SPACING
   ========================================================================== */

/* Add vertical rhythm between all blocks */
.entry-content>*,
.post-content>*,
.single-post-content>* {
  margin-bottom: 1.5rem;
}

.entry-content>*:last-child,
.post-content>*:last-child,
.single-post-content>*:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   TYPOGRAPHY - HEADINGS
   ========================================================================== */

.entry-content h1,
.post-content h1,
.single-post-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--homefix-heading-color, #111827);
}

.entry-content h2,
.post-content h2,
.single-post-content h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.75rem;
  margin-bottom: 0.875rem;
  color: var(--homefix-heading-color, #111827);
}

.entry-content h3,
.post-content h3,
.single-post-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--homefix-heading-color, #111827);
}

.entry-content h4,
.post-content h4,
.single-post-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 1.25rem;
  margin-bottom: 0.625rem;
  color: var(--homefix-heading-color, #111827);
}

.entry-content h5,
.post-content h5,
.single-post-content h5 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--homefix-heading-color, #111827);
}

.entry-content h6,
.post-content h6,
.single-post-content h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--homefix-heading-color, #111827);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ==========================================================================
   TYPOGRAPHY - TABLES
   ========================================================================== */

.entry-content table,
.post-content table,
.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.5rem;
  overflow: hidden;
}

.entry-content th,
.post-content th,
.single-post-content th {
  background: var(--homefix-primary-color, #2563eb);
  color: var(--homefix-base-color, #ffffff);
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--homefix-primary-color, #1d4ed8);
}

.entry-content td,
.post-content td,
.single-post-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--homefix-dark-color, #e5e7eb);
  color: var(--homefix-text-color, #374151);
}

.entry-content tr:last-child td,
.post-content tr:last-child td,
.single-post-content tr:last-child td {
  border-bottom: none;
}

.entry-content tr:nth-child(even),
.post-content tr:nth-child(even),
.single-post-content tr:nth-child(even) {
  background: var(--homefix-light-color, #f8fafc);
}

.entry-content tr:hover,
.post-content tr:hover,
.single-post-content tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

/* ==========================================================================
   TYPOGRAPHY - BLOCKQUOTES
   ========================================================================== */

.entry-content blockquote,
.post-content blockquote,
.single-post-content blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--homefix-primary-color, #2563eb);
  background: var(--homefix-light-color, #f8fafc);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: var(--homefix-text-color, #4b5563);
}

.entry-content blockquote p,
.post-content blockquote p,
.single-post-content blockquote p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.entry-content blockquote cite,
.post-content blockquote cite,
.single-post-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 600;
  color: var(--homefix-heading-color, #111827);
}

.entry-content blockquote cite::before,
.post-content blockquote cite::before,
.single-post-content blockquote cite::before {
  content: '— ';
}

/* ==========================================================================
   TYPOGRAPHY - LISTS
   ========================================================================== */

.entry-content ul,
.post-content ul,
.single-post-content ul {
  list-style-type: disc;
  padding-left: 1.75rem;
  margin: 1rem 0;
}

.entry-content ol,
.post-content ol,
.single-post-content ol {
  list-style-type: decimal;
  padding-left: 1.75rem;
  margin: 1rem 0;
}

.entry-content li,
.post-content li,
.single-post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--homefix-text-color, #374151);
}

.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul,
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.entry-content ul ul,
.post-content ul ul {
  list-style-type: circle;
}

.entry-content ul ul ul,
.post-content ul ul ul {
  list-style-type: square;
}

/* Definition Lists */
.entry-content dl,
.post-content dl,
.single-post-content dl {
  margin: 1.5rem 0;
}

.entry-content dt,
.post-content dt,
.single-post-content dt {
  font-weight: 700;
  color: var(--homefix-heading-color, #111827);
  margin-bottom: 0.25rem;
}

.entry-content dd,
.post-content dd,
.single-post-content dd {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--homefix-text-color, #4b5563);
}

/* ==========================================================================
   TYPOGRAPHY - CODE BLOCKS
   ========================================================================== */

.entry-content code,
.post-content code,
.single-post-content code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--homefix-light-color, #f1f5f9);
  color: var(--homefix-primary-color, #2563eb);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  border: 1px solid var(--homefix-dark-color, #e2e8f0);
}

.entry-content pre,
.post-content pre,
.single-post-content pre {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #334155;
}

.entry-content pre code,
.post-content pre code,
.single-post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: 1em;
}

/* ==========================================================================
   TYPOGRAPHY - INLINE ELEMENTS
   ========================================================================== */

.entry-content strong,
.post-content strong,
.single-post-content strong {
  font-weight: 700;
  color: var(--homefix-heading-color, #111827);
}

.entry-content em,
.post-content em,
.single-post-content em {
  font-style: italic;
}

.entry-content mark,
.post-content mark,
.single-post-content mark {
  background: rgba(250, 204, 21, 0.4);
  padding: 0.1em 0.25em;
  border-radius: 0.125rem;
}

.entry-content abbr,
.post-content abbr,
.single-post-content abbr {
  text-decoration: underline dotted;
  cursor: help;
}

.entry-content address,
.post-content address,
.single-post-content address {
  font-style: italic;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--homefix-light-color, #f8fafc);
  border-left: 3px solid var(--homefix-primary-color, #2563eb);
  border-radius: 0 0.375rem 0.375rem 0;
}

.entry-content cite,
.post-content cite,
.single-post-content cite {
  font-style: italic;
  color: var(--homefix-text-color, #6b7280);
}

.entry-content small,
.post-content small,
.single-post-content small {
  font-size: 0.875em;
  color: var(--homefix-text-color, #6b7280);
}

.entry-content sub,
.post-content sub,
.single-post-content sub {
  font-size: 0.75em;
  vertical-align: sub;
}

.entry-content sup,
.post-content sup,
.single-post-content sup {
  font-size: 0.75em;
  vertical-align: super;
}

/* ==========================================================================
   TYPOGRAPHY - HORIZONTAL RULE
   ========================================================================== */

.entry-content hr,
.post-content hr,
.single-post-content hr {
  border: none;
  border-top: 2px solid var(--homefix-dark-color, #e5e7eb);
  margin: 2rem 0;
}

/* ==========================================================================
   TYPOGRAPHY - IMAGES AND FIGURES
   ========================================================================== */

.entry-content figure,
.post-content figure,
.single-post-content figure {
  margin: 1.5rem 0;
}

.entry-content figcaption,
.post-content figcaption,
.single-post-content figcaption {
  font-size: 0.875rem;
  color: var(--homefix-text-color, #6b7280);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* ==========================================================================
   NAVIGATION BLOCK
   ========================================================================== */

/* Navigation wrapper */
.wp-block-navigation {
  margin: 1.5rem 0;
}

/* Navigation list - both horizontal and vertical */
.wp-block-navigation__container,
.wp-block-navigation .wp-block-navigation__container {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* Page list within navigation */
.wp-block-navigation .wp-block-page-list,
.wp-block-page-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* Navigation items */
.wp-block-navigation-item,
.wp-block-navigation .wp-block-navigation-item {
  margin: 0;
  padding: 0;
}

/* Navigation links */
.wp-block-navigation-item__content,
.wp-block-navigation a,
.wp-block-page-list a {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--homefix-primary-color, #2563eb) !important;
  text-decoration: none;
  background: var(--homefix-base-color, #f8fafc) !important;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--homefix-primary-color, #2563eb) !important;
}

.wp-block-navigation-item__content:hover,
.wp-block-navigation a:hover,
.wp-block-page-list a:hover {
  background: var(--homefix-primary-color, #2563eb) !important;
  color: var(--homefix-base-color, #fff) !important;
  text-decoration: none;
  border-color: var(--homefix-base-color, #f8fafc) !important;
}

/* Submenu styling - Comprehensive fixes for WordPress block navigation */

/* Parent item with children - needs relative positioning */
.wp-block-navigation-item.has-child,
.wp-block-navigation .wp-block-navigation-item.has-child {
  position: relative;
}

/* Submenu container base styles - use high specificity to override WordPress core */
.entry-content .wp-block-navigation .wp-block-navigation__submenu-container,
.post-content .wp-block-navigation .wp-block-navigation__submenu-container,
.wp-block-navigation .wp-block-navigation__submenu-container {
  /* Positioning */
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  padding-top: 0.25rem;

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  height: auto;
  width: auto;
  overflow: visible;

  /* Visual styling */
  background: var(--homefix-base-color, #ffffff);
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  min-width: 220px;
  z-index: 9999;

  /* Smooth transition */
  transition: opacity 0.2s ease, visibility 0.2s ease;

  /* Layout */
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem;
}

/* Invisible bridge to prevent hover loss when moving to submenu */
.wp-block-navigation-item.has-child::after,
.wp-block-navigation .wp-block-navigation-item.has-child::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.5rem;
  background: transparent;
}

/* Show submenu on hover - high specificity selectors */
.entry-content .wp-block-navigation-item.has-child:hover>.wp-block-navigation__submenu-container,
.entry-content .wp-block-navigation-item.has-child:focus-within>.wp-block-navigation__submenu-container,
.post-content .wp-block-navigation-item.has-child:hover>.wp-block-navigation__submenu-container,
.post-content .wp-block-navigation-item.has-child:focus-within>.wp-block-navigation__submenu-container,
.wp-block-navigation .wp-block-navigation-item.has-child:hover>.wp-block-navigation__submenu-container,
.wp-block-navigation .wp-block-navigation-item.has-child:focus-within>.wp-block-navigation__submenu-container {
  opacity: 1;
  visibility: visible;
}

/* Submenu items styling - high specificity */
.entry-content .wp-block-navigation__submenu-container .wp-block-navigation-item,
.post-content .wp-block-navigation__submenu-container .wp-block-navigation-item,
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

/* Submenu anchor styling */
.entry-content .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.entry-content .wp-block-navigation__submenu-container a,
.post-content .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.post-content .wp-block-navigation__submenu-container a,
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation__submenu-container a {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  margin: 2px 0 !important;
  color: var(--homefix-text-color, #374151);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Submenu anchor hover - only on anchor, not li */
.entry-content .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.entry-content .wp-block-navigation__submenu-container a:hover,
.post-content .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.post-content .wp-block-navigation__submenu-container a:hover,
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation__submenu-container a:hover {
  background: var(--homefix-primary-color, #2563eb);
  color: #ffffff;
}

/* Nested submenu positioning (Level 2+) 
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
  top: 0;
  left: 100%;
  margin-left: 0.25rem;
  margin-top: 0;
  padding-top: 0;
} */

/* Hide the WordPress core dropdown button/icon */
.wp-block-navigation-submenu__toggle,
.wp-block-navigation__submenu-icon,
.wp-block-navigation-item__content+button,
.wp-block-navigation-item .wp-block-navigation__submenu-icon,
.wp-block-navigation-item__content svg {
  display: none;
}

/* Add our own CSS arrow indicator INSIDE the link */
.wp-block-navigation-item.has-child>.wp-block-navigation-item__content::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5rem;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  border-bottom: none;
  vertical-align: middle;
}

/* Submenu items arrow points right */
.wp-block-navigation__submenu-container .has-child>.wp-block-navigation-item__content::after,
.wp-block-navigation__submenu-container .has-child>a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5rem;
  border-left: 5px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: none;
  vertical-align: middle;
}

/* ==========================================================================
   QUERY LOOP / POST LISTS
   ========================================================================== */

/* Query loop container */
.wp-block-query {
  margin: 2rem 0;
}

/* Post template - list of posts */
.wp-block-post-template {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Individual post in query loop */
.wp-block-post {
  padding: 1.25rem;
  background: var(--homefix-base-color, #ffffff);
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.5rem;
  transition: border-color 0.2s ease;
}

.wp-block-post:hover {
  border-color: var(--homefix-primary-color, #2563eb);
}

/* Post title block */
.wp-block-post-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.wp-block-post-title a {
  color: var(--homefix-heading-color, #111827);
  text-decoration: none;
  transition: color 0.2s ease;
}

.wp-block-post-title a:hover {
  color: var(--homefix-primary-color, #2563eb);
}

/* Post date block */
.wp-block-post-date {
  color: var(--homefix-text-color, #6b7280);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Post excerpt block */
.wp-block-post-excerpt {
  margin: 0.75rem 0 0 0;
}

.wp-block-post-excerpt__excerpt {
  color: var(--homefix-text-color, #4b5563);
  line-height: 1.6;
  margin: 0;
}

.wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--homefix-primary-color, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

.wp-block-post-excerpt__more-link:hover {
  text-decoration: underline;
}

/* Post featured image */
.wp-block-post-featured-image {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.wp-block-post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Post author */
.wp-block-post-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.wp-block-post-author__avatar {
  border-radius: 50%;
  overflow: hidden;
}

.wp-block-post-author__name {
  font-weight: 600;
  color: var(--homefix-heading-color, #111827);
}

/* ==========================================================================
   PAGINATION BLOCK
   ========================================================================== */

.wp-block-query-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--homefix-dark-color, #e5e7eb);
}

.wp-block-query-pagination-numbers {
  display: flex;
  gap: 0.25rem;
}

.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-numbers a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.375rem;
  color: var(--homefix-text-color, #4b5563);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--homefix-base-color, #ffffff);
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-numbers a:hover {
  background: var(--homefix-primary-color, #2563eb);
  color: #fff;
  border-color: var(--homefix-primary-color, #2563eb);
}

.wp-block-query-pagination-numbers .page-numbers.current {
  background: var(--homefix-primary-color, #2563eb);
  color: #fff;
  border-color: var(--homefix-primary-color, #2563eb);
}

.wp-block-query-pagination-numbers .page-numbers.dots {
  border: none;
  background: transparent;
  cursor: default;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--homefix-base-color, #ffffff) !important;
  border: 1px solid var(--homefix-primary-color, #2563eb) !important;
  border-radius: 0.375rem;
  color: var(--homefix-primary-color, #f8fafc) !important;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  background: var(--homefix-primary-color, #2563eb) !important;
  color: var(--homefix-base-color, #f8fafc) !important;
  border-color: var(--homefix-base-color, #2563eb) !important;
}

/* ==========================================================================
   AVATAR BLOCK
   ========================================================================== */

.wp-block-avatar {
  display: inline-block;
  margin: 0.5rem 0;
}

.wp-block-avatar img {
  border-radius: 50%;
  display: block;
}

/* ==========================================================================
   SITE IDENTITY BLOCKS
   ========================================================================== */

/* Site logo */
.wp-block-site-logo {
  margin: 1rem 0;
}

.wp-block-site-logo img {
  max-height: 60px;
  width: auto;
}

/* Site title */
.wp-block-site-title {
  margin: 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.wp-block-site-title a {
  color: var(--homefix-heading-color, #111827);
  text-decoration: none;
}

.wp-block-site-title a:hover {
  color: var(--homefix-primary-color, #2563eb);
}

/* Site tagline */
.wp-block-site-tagline {
  margin: 0.25rem 0;
  color: var(--homefix-text-color, #6b7280);
  font-size: 0.875rem;
}

/* ==========================================================================
   GROUP BLOCKS
   ========================================================================== */

.wp-block-group {
  margin: 1.5rem 0;
}

.wp-block-group.has-background {
  padding: 1.5rem;
  border-radius: 0.5rem;
}

/* ==========================================================================
   COLUMNS BLOCK
   ========================================================================== */

.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.wp-block-column {
  flex: 1;
  min-width: 200px;
}

/* ==========================================================================
   SEPARATOR BLOCK
   ========================================================================== */

.wp-block-separator {
  border: none;
  border-top: 2px solid var(--homefix-dark-color, #e5e7eb);
  margin: 2rem 0;
}

.wp-block-separator.is-style-wide {
  width: 100%;
}

.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
}

.wp-block-separator.is-style-dots::before {
  content: '···';
  color: var(--homefix-text-color, #6b7280);
  font-size: 1.5rem;
  letter-spacing: 1rem;
}

/* ==========================================================================
   SPACER BLOCK
   ========================================================================== */

.wp-block-spacer {
  display: block;
}

/* ==========================================================================
   COVER BLOCK
   ========================================================================== */

.wp-block-cover {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 1.5rem 0;
}

.wp-block-cover__inner-container {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
}

/* ==========================================================================
   TEMPLATE LABELS (from test data)
   ========================================================================== */

/* Style the plain text labels that appear before blocks in test data */
.entry-content p:has(+ .wp-block-navigation),
.entry-content p:has(+ .wp-block-query),
.entry-content p:has(+ .wp-block-avatar),
.entry-content p:has(+ .wp-block-site-logo),
.entry-content p:has(+ .wp-block-site-title),
.entry-content p:has(+ .wp-block-post-featured-image) {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--homefix-text-color, #6b7280);
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--homefix-light-color, #f8fafc);
  border-radius: 0.25rem;
  display: inline-block;
}

/* ==========================================================================
   TEMPLATE PARTS
   ========================================================================== */

.wp-block-template-part {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px dashed var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.5rem;
}

/* ==========================================================================
   LISTS WITHIN BLOCKS
   ========================================================================== */

.entry-content ul,
.entry-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.entry-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   DARK MODE ADJUSTMENTS
   ========================================================================== */

[data-theme="dark"] .wp-block-navigation-item__content,
[data-theme="dark"] .wp-block-navigation a,
[data-theme="dark"] .wp-block-page-list a {
  background: var(--homefix-dark-color, #1f2937);
  border-color: var(--homefix-dark-color, #374151);
}

[data-theme="dark"] .wp-block-post {
  background: var(--homefix-dark-color, #1f2937);
  border-color: var(--homefix-dark-color, #374151);
}

[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers,
[data-theme="dark"] .wp-block-query-pagination-numbers a,
[data-theme="dark"] .wp-block-query-pagination-previous,
[data-theme="dark"] .wp-block-query-pagination-next {
  background: var(--homefix-dark-color, #1f2937);
  border-color: var(--homefix-dark-color, #374151);
  color: var(--homefix-light-color, #d1d5db);
}

/* ==========================================================================
   COMMENT SECTION STYLES
   ========================================================================== */

/* Comments Area Container */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--homefix-dark-color, #e5e7eb);
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--homefix-heading-color, #111827);
  margin-bottom: 1.5rem;
}

/* Comment List */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list .comment {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--homefix-light-color, #f8fafc);
  border-radius: 0.5rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Nested Comments */
.comment-list .children {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 1rem;
  border-left: 3px solid var(--homefix-primary-color, #2563eb);
}

.comment-list .children .comment {
  background: var(--homefix-base-color, #ffffff);
}

/* Comment Author Info */
.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.comment-author .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--homefix-primary-color, #2563eb);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-author .fn {
  font-weight: 600;
  color: var(--homefix-heading-color, #111827);
  font-size: 1rem;
}

.comment-author .fn a {
  color: var(--homefix-primary-color, #2563eb);
  text-decoration: none;
}

.comment-author .fn a:hover {
  text-decoration: underline;
}

.comment-author .says {
  display: none;
}

/* Comment Metadata */
.comment-metadata {
  font-size: 0.8125rem;
  color: var(--homefix-text-color, #6b7280);
  margin-bottom: 0.75rem;
}

.comment-metadata a {
  color: var(--homefix-text-color, #6b7280);
  text-decoration: none;
}

.comment-metadata a:hover {
  color: var(--homefix-primary-color, #2563eb);
}

/* Comment Content */
.comment-content {
  color: var(--homefix-text-color, #374151);
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.comment-content p {
  margin-bottom: 0.75rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.comment-content dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.comment-content dt {
  font-weight: 600;
  color: var(--homefix-heading-color, #111827);
}

/* Comment Content Typography */
.comment-content h1,
.comment-content h2,
.comment-content h3,
.comment-content h4,
.comment-content h5,
.comment-content h6 {
  font-weight: 600;
  color: var(--homefix-heading-color, #111827);
  margin: 1rem 0 0.5rem 0;
}

.comment-content h1 {
  font-size: 1.5rem;
}

.comment-content h2 {
  font-size: 1.375rem;
}

.comment-content h3 {
  font-size: 1.25rem;
}

.comment-content h4 {
  font-size: 1.125rem;
}

.comment-content h5 {
  font-size: 1rem;
}

.comment-content h6 {
  font-size: 0.9375rem;
}

.comment-content ul,
.comment-content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.comment-content ul {
  list-style-type: disc;
}

.comment-content ol {
  list-style-type: decimal;
}

.comment-content li {
  margin-bottom: 0.375rem;
}

.comment-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--homefix-primary-color, #2563eb);
  background: var(--homefix-base-color, #ffffff);
  font-style: italic;
  border-radius: 0 0.25rem 0.25rem 0;
}

.comment-content code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--homefix-base-color, #f1f5f9);
  color: var(--homefix-primary-color, #2563eb);
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  border: 1px solid var(--homefix-dark-color, #e2e8f0);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.comment-content pre {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8125rem;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin: 1rem 0;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
}

.comment-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
  display: block;
  overflow-x: auto;
}

.comment-content th,
.comment-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  text-align: left;
}

.comment-content th {
  background: var(--homefix-primary-color, #2563eb);
  color: var(--homefix-base-color, #ffffff);
  font-weight: 600;
}

/* Reply Link */
.reply {
  margin-top: 0.75rem;
}

.reply .comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--homefix-primary-color, #2563eb);
  background: var(--homefix-base-color, #ffffff);
  border: 1px solid var(--homefix-primary-color, #2563eb);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.reply .comment-reply-link:hover {
  background: var(--homefix-primary-color, #2563eb);
  color: var(--homefix-base-color, #ffffff) !important;
}

/* Comment Form */
.comment-respond {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--homefix-light-color, #f8fafc);
  border-radius: 0.5rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
}

.comment-reply-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--homefix-heading-color, #111827);
  margin-bottom: 1rem;
}

.comment-reply-title small {
  font-size: 0.875rem;
  font-weight: 400;
}

.comment-reply-title small a {
  color: var(--homefix-primary-color, #2563eb);
  text-decoration: none;
}

.comment-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--homefix-heading-color, #111827);
  margin-bottom: 0.375rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-radius: 0.375rem;
  background: var(--homefix-base-color, #ffffff);
  color: var(--homefix-text-color, #374151);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--homefix-primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .comment-form-comment,
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url {
  margin-bottom: 1rem;
}

.comment-form .form-submit {
  margin-top: 1rem;
}

.comment-form .submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--homefix-base-color, #ffffff);
  background: var(--homefix-primary-color, #2563eb);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-form .submit:hover {
  background: var(--homefix-primary-color, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Comment Navigation */
.comment-navigation {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--homefix-dark-color, #e5e7eb);
  border-bottom: 1px solid var(--homefix-dark-color, #e5e7eb);
}

.comment-navigation .nav-links {
  display: flex;
  gap: 1rem;
}

.comment-navigation a {
  color: var(--homefix-primary-color, #2563eb);
  text-decoration: none;
  font-weight: 500;
}

.comment-navigation a:hover {
  text-decoration: underline;
}

/* Pingback and Trackback */
.comment-list .pingback,
.comment-list .trackback {
  padding: 0.75rem 1rem;
  background: var(--homefix-light-color, #f8fafc);
  border-left: 3px solid var(--homefix-primary-color, #2563eb);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.comment-list .pingback a,
.comment-list .trackback a {
  color: var(--homefix-primary-color, #2563eb);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {

  .wp-block-navigation__container,
  .wp-block-page-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .wp-block-navigation-item__content,
  .wp-block-navigation a,
  .wp-block-page-list a {
    width: 100%;
    text-align: center;
  }

  .wp-block-columns {
    flex-direction: column;
  }

  .wp-block-column {
    width: 100%;
  }

  .wp-block-query-pagination {
    justify-content: center;
  }
}