/**
 * Mediaholic Theme - SEO and Content Management Styles
 */

/* Breadcrumb Navigation */
.breadcrumb-navigation {
  background-color: #f8f9fa;
  padding: 10px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb-navigation ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
}

.breadcrumb-navigation li {
  display: flex;
  align-items: center;
  margin-right: 5px;
}

.breadcrumb-navigation li:not(:last-child)::after {
  content: ">";
  margin-left: 5px;
  color: #6c757d;
}

.breadcrumb-navigation a {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb-navigation a:hover {
  text-decoration: underline;
}

.breadcrumb-navigation span {
  color: #6c757d;
}

/* Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.comparison-table thead {
  background-color: #f8f9fa;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.comparison-table th {
  font-weight: 600;
  background-color: #e9ecef;
}

.comparison-table tbody tr:hover {
  background-color: #f8f9fa;
}

.comparison-table td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.comparison-table .product-thumbnail {
  height: 36px;
  width: auto;
  max-width: none;
  margin: 0;
  vertical-align: middle;
  object-fit: contain;
}

.comparison-table .product-title {
  font-weight: 500;
}

.comparison-table .rating-display {
  color: #ffc107;
  font-size: 1.2rem;
}

.comparison-table .annual-fee {
  font-size: 0.9rem;
  color: #6c757d;
}

.comparison-table .button {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgb(var(--primary-color-rgb, 11,94,215));
  color: var(--primary-contrast, #fff) !important; /* override global link color rules */
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: filter 0.2s;
  border: 1px solid rgba(0,0,0,0.05);
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.comparison-table .button:hover,
.comparison-table .button:focus {
  filter: brightness(0.92);
  outline: none;
}

/* Responsive styles */
@media (max-width: 768px) {
  .comparison-table th,
  .comparison-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .comparison-table .product-thumbnail { height: 28px; }
}

/* Stack comparison rows on narrow screens */
@media (max-width: 600px) {
  .comparison-table {
    border: 0;
  }
  .comparison-table thead {
    display: none;
  }
  .comparison-table tbody tr {
    display: block;
    margin: 0 0 12px 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    overflow: hidden;
  }
  .comparison-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid #f1f3f5;
  }
  .comparison-table td:last-child {
    border-bottom: 0;
  }
  .comparison-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    flex: 0 0 40%;
    max-width: 45%;
  }
  .comparison-table td[data-label] > * {
    max-width: 55%;
  }
  .comparison-table td:nth-child(1) {
    align-items: center;
  }
  .comparison-table .product-thumbnail {
    height: 28px;
  }
  .comparison-table .product-title {
    display: inline-block;
    font-weight: 600;
    word-break: break-word;
  }
  /* Hide the empty Details column on mobile (3rd column) */
  .comparison-table td:nth-child(3) {
    display: none;
  }
  /* Make the CTA button full-width for easy tap */
  .comparison-table .button {
    width: 100%;
    text-align: center;
  }
}

/* Comparison Cards (modern layout) */
.comparison-cards {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

/*
 * Responsive Tables (Option A)
 * - Horizontal scroll confined to the table container
 * - Sticky first column to keep row context while panning
 * - Scoped to Gutenberg wrapper and our server-side wrapper (.mh-table-scroll)
 */
figure.wp-block-table,
.mh-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #fff;
  /* No overlay anchoring needed; keep container simple */
}
figure.wp-block-table table,
.mh-table-scroll > table {
  /* Fill container if content is small, but grow to content to allow horizontal scroll */
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* content-driven widths */
}
/* Sticky first column (RTL-safe via logical property) */
/* Sticky first column removed per UX decision */

/* Zebra striping for readability */
figure.wp-block-table tbody tr:nth-child(odd) td,
.mh-table-scroll tbody tr:nth-child(odd) td {
  background: #fafafa;
}
/* Optional sticky header for better context */
figure.wp-block-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
/* Align headers with body cells */
figure.wp-block-table th,
.mh-table-scroll th {
  text-align: left;
}
/* Density and readability on small screens */
@media (max-width: 480px) {
  figure.wp-block-table th,
  figure.wp-block-table td,
  .mh-table-scroll th,
  .mh-table-scroll td {
    padding: .55rem .7rem !important;
    font-size: .96rem;
    line-height: 1.55;
    hyphens: auto;
  }
}

/* Visible horizontal scrollbar styling (affordance without overlays) */
.mh-table-scroll,
figure.wp-block-table {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(0,0,0,0.38) rgba(0,0,0,0.08);
}
.mh-table-scroll::-webkit-scrollbar,
figure.wp-block-table::-webkit-scrollbar {
  height: 8px; /* horizontal scrollbar height */
}
.mh-table-scroll::-webkit-scrollbar-track,
figure.wp-block-table::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.08);
  border-radius: 8px;
}
.mh-table-scroll::-webkit-scrollbar-thumb,
figure.wp-block-table::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.38);
  border-radius: 8px;
}
.mh-table-scroll:hover::-webkit-scrollbar-thumb,
figure.wp-block-table:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.55);
}
.compare-card {
  display: grid;
  grid-template-columns: 120px 1fr 260px;
  align-items: center;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: 16px;
}
.compare-card .cc-left { display:flex; align-items:center; justify-content:center; }
.compare-card .card-logo { width: 120px; height: 76px; object-fit: contain; border-radius: 8px; background: #f5f7fa; }
.compare-card .card-logo.placeholder { background: #f0f2f5; }
.compare-card .cc-main { padding: 0 16px; }
.compare-card .cc-title { margin: 0 0 6px 0; font-size: 1.1rem; }
.compare-card .cc-badge { display:inline-block; font-size: 12px; background: rgba(var(--primary-color-rgb, 11,94,215), 0.12); color: rgb(var(--primary-color-rgb, 11,94,215)); padding:2px 6px; border-radius:6px; }
.compare-card .cc-bullets { margin: 8px 0 0 0; padding-left: 18px; }
.compare-card .cc-bullets li { margin: 2px 0; }
.compare-card .cc-right { display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.compare-card .cc-stars { color:#f5a623; letter-spacing: 1px; }
.compare-card .cc-score { margin-left:8px; font-weight:600; }
.compare-card .cc-editor-note { color:#6c757d; font-size:12px; margin-top:2px; }
.compare-card .cc-cta {
  background: rgb(var(--primary-color-rgb, 11,94,215));
  color: var(--primary-contrast, #fff) !important; /* ensure readable text on themed background */
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
  padding:10px 14px;
  border-radius:8px;
  text-decoration:none;
  display:inline-block;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  /* Normalize font size so translations don’t inflate CTAs */
  font-size: 0.95rem;
  line-height: 1.2;
}
.compare-card .cc-cta:hover,
.compare-card .cc-cta:focus { filter: brightness(0.92); outline: none; }
.compare-card .cc-details { font-size:12px; color: rgb(var(--primary-color-rgb, 11,94,215)); text-decoration:none; }
.compare-card .cc-disclaimer { font-size:11px; color:#98a2b3; }

@media (max-width: 900px) {
  .compare-card { grid-template-columns: 110px 1fr 220px; }
  .compare-card .card-logo { width: 110px; height: 70px; }
}
@media (max-width: 700px) {
  .compare-card { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; }
  .compare-card .card-logo { width: 96px; height: 64px; }
  .compare-card .cc-right { grid-column: 1 / -1; align-items:flex-start; margin-top: 10px; }
  .compare-card .cc-cta { width:100%; text-align:center; font-size: 1rem; }
}
