/**
 * Child Theme: HCMC Dental Case Studies Page Stylesheet
 * Location: inc/case-studies.css
 */

.hcmc-cs {
  --cs-bg: #f8fafc;
  --cs-text: #0f172a;
  --cs-muted: #475569;
  --cs-line: #dbe3ee;
  --cs-accent: #0f766e;
  --cs-accent-2: #0b5ed7;
  --transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hcmc-cs-full {
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  width: 100vw !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* ─── Fix Astra container flex layout conflict ─── */
.page-id-6727 .site-content .ast-container,
.page-template-page-case-studies .site-content .ast-container,
.hcmc-fullwidth-template .site-content .ast-container,
.ast-page-builder-template .site-content .ast-container {
  display: block !important;
  max-width: 100% !important;
}

.page-id-6727 #primary,
.hcmc-fullwidth-template #primary,
.ast-page-builder-template #primary {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

.page-id-6727 #secondary,
.hcmc-fullwidth-template #secondary {
  display: none !important;
}

.hcmc-cs {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.hcmc-cs-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ─── Hero Section ─── */
.hcmc-cs-hero {
  background: linear-gradient(135deg, #ecfeff 0%, #eef2ff 100%);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hcmc-cs-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(15, 118, 110, 0.08) 1px, transparent 0);
  background-size: 20px 20px;
  pointer-events: none;
}

.hcmc-cs-eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  font-weight: 700;
  color: var(--cs-accent);
}

.hcmc-cs h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.5vw, 54px);
  line-height: 1.15;
  color: var(--cs-text);
  font-weight: 800;
}

.hcmc-cs-hero p {
  margin: 0 auto;
  max-width: 800px;
  color: var(--cs-muted);
  font-size: 19px;
  line-height: 1.6;
}

.hcmc-cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
}

.hcmc-cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  transition: var(--transition);
  cursor: pointer;
}

.hcmc-cs-btn--wa { background: #25d366; color: #fff; }
.hcmc-cs-btn--ms { background: #0b5ed7; color: #fff; }
.hcmc-cs-btn--line { background: #fff; color: var(--cs-text); border-color: #cbd5e1; }
.hcmc-cs-btn--wa:hover { background: #20ba5a; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.2); }
.hcmc-cs-btn--ms:hover { background: #084cae; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 94, 215, 0.2); }
.hcmc-cs-btn--line:hover { background: #f8fafc; border-color: #94a3b8; }

/* ─── Category Filter chips ─── */
.hcmc-cs-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 40px auto 20px;
  justify-content: center;
  max-width: 900px;
}

.hcmc-cs-filter-chip {
  background: #ffffff;
  border: 1px solid var(--cs-line);
  color: var(--cs-muted);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.hcmc-cs-filter-chip:hover,
.hcmc-cs-filter-chip.active {
  background: var(--cs-accent);
  color: #ffffff;
  border-color: var(--cs-accent);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  transform: translateY(-1px);
}

/* ─── Case Cards Grid & Layout ─── */
.hcmc-cs-section {
  padding: 60px 0;
  background: #fff;
}

.hcmc-cs-section--soft {
  background: var(--cs-bg);
  border-top: 1px solid var(--cs-line);
  border-bottom: 1px solid var(--cs-line);
}

.hcmc-cs-layout-list {
  display: flex;
  flex-direction: column;
  align-items: stretch !important;
  gap: 40px;
  margin-top: 30px;
  margin-bottom: 0;
  margin-left: auto !important;
  margin-right: auto !important;
}

.hcmc-cs-card {
  display: grid !important;
  grid-template-columns: 320px 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  gap: 30px !important;
  border: 1px solid var(--cs-line);
  border-radius: 16px;
  background: #fff;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hcmc-cs-card > div:first-child {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.hcmc-cs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, .08);
  border-color: rgba(15, 118, 110, 0.15);
}

/* Image zoom box */
.hcmc-cs-image-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid var(--cs-line);
  height: max-content;
  width: 100% !important;
  max-width: 100% !important;
}

.hcmc-cs-image,
.hcmc-cs-image-wrapper img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  transition: transform 0.4s ease !important;
  aspect-ratio: 1/1 !important;
  object-fit: cover !important;
}

.hcmc-cs-image-wrapper:hover .hcmc-cs-image,
.hcmc-cs-image-wrapper:hover img {
  transform: scale(1.04) !important;
}

.hcmc-cs-zoom-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.hcmc-cs-image-wrapper:hover .hcmc-cs-zoom-overlay {
  opacity: 1;
}

/* Clinical Tabs */
.cs-tabs-container {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  width: 100% !important;
  min-width: 0 !important;
}

.cs-tabs-container h2 {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--cs-text);
  line-height: 1.3;
}

.cs-tabs-header {
  display: flex;
  border-bottom: 2px solid var(--cs-line);
  margin-bottom: 20px;
  overflow-x: auto;
  gap: 8px;
  scrollbar-width: none; /* Firefox */
}

.cs-tabs-header::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ─── Tab triggers: override Astra global button styles ─── */
.cs-tab-trigger,
button.cs-tab-trigger,
.hcmc-cs button.cs-tab-trigger {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  padding: 10px 16px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--cs-muted) !important;
  cursor: pointer !important;
  margin-bottom: -2px !important;
  transition: var(--transition) !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  line-height: 1.4 !important;
}

.cs-tab-trigger:hover,
.cs-tab-trigger:focus,
button.cs-tab-trigger:hover,
button.cs-tab-trigger:focus,
.hcmc-cs button.cs-tab-trigger:hover,
.hcmc-cs button.cs-tab-trigger:focus {
  color: var(--cs-accent) !important;
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

.cs-tab-trigger.active,
button.cs-tab-trigger.active,
.hcmc-cs button.cs-tab-trigger.active {
  color: var(--cs-accent) !important;
  border-bottom-color: var(--cs-accent) !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.cs-tab-pane {
  display: none;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cs-muted);
}

.cs-tab-pane.active {
  display: block;
  animation: csFadeIn 0.25s ease-out;
}

@keyframes csFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badges */
.cs-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  margin-right: 6px;
}
.cs-badge--implants { background: #e0f2fe; color: #0369a1; }
.cs-badge--all-on-4 { background: #fee2e2; color: #b91c1c; }
.cs-badge--veneers { background: #fae8ff; color: #a21caf; }
.cs-badge--crowns { background: #fef3c7; color: #b45309; }
.cs-badge--whitening { background: #ecfdf5; color: #047857; }
.cs-badge--gum-treatment { background: #e0f2f1; color: #00796b; }
.cs-badge--tmj { background: #f3e5f5; color: #7b1fa2; }
.cs-badge--invisalign { background: #eef2ff; color: #4338ca; }
.cs-badge--retainers { background: #e0f2fe; color: #0369a1; }

.hcmc-cs-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.hcmc-cs-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 50px;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none !important;
  background: #fff;
  transition: var(--transition);
}

.hcmc-cs-links a:hover {
  border-color: var(--cs-accent);
  background: rgba(15, 118, 110, 0.03);
  color: var(--cs-accent);
}

/* E-E-A-T Disclaimer */
.hcmc-cs-disclaimer {
  background: var(--cs-bg);
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  padding: 30px;
  margin: 50px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cs-muted);
}

.hcmc-cs-disclaimer h3 {
  margin: 0 0 12px;
  color: var(--cs-text);
  font-size: 1.3rem;
  font-weight: 800;
}

/* FAQ list */
.hcmc-cs-faq {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.hcmc-cs-faq__item {
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: var(--transition);
}

.hcmc-cs-faq__item:hover {
  border-color: rgba(15, 118, 110, 0.25);
}

.hcmc-cs-faq__q {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--cs-text);
  cursor: pointer;
  transition: var(--transition);
}

.hcmc-cs-faq__q:hover {
  color: var(--cs-accent);
  background: rgba(15, 118, 110, 0.01);
}

.hcmc-cs-faq__q span { transition: transform .2s ease; font-size: 14px; color: var(--cs-muted); }
.hcmc-cs-faq__q[aria-expanded="true"] span { transform: rotate(180deg); color: var(--cs-accent); }

.hcmc-cs-faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: #f8fafc40;
}

.hcmc-cs-faq__q[aria-expanded="true"] + .hcmc-cs-faq__a {
  max-height: 500px;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

.hcmc-cs-faq__a p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--cs-muted);
  line-height: 1.6;
}

/* Lightbox Modal */
.hcmc-cs-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hcmc-cs-lightbox[hidden] {
  display: none;
}

.hcmc-cs-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
}

.hcmc-cs-lightbox__content {
  position: relative;
  z-index: 10;
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
}

.hcmc-cs-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hcmc-cs-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 12;
  background: #ffffff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.hcmc-cs-lightbox__close:hover {
  transform: scale(1.08);
}

/* ─── Responsive adjustments ─── */
@media (max-width: 980px) {
  .hcmc-cs-card {
    grid-template-columns: 280px 1fr !important;
    gap: 20px !important;
    padding: 20px !important;
  }
}

@media (max-width: 768px) {
  .hcmc-cs-card {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 20px !important;
  }
  .hcmc-cs-card > div:first-child {
    width: 100% !important;
  }
  .hcmc-cs-image-wrapper {
    max-width: 320px !important;
    margin: 0 auto !important;
  }
  .hcmc-cs-hero h1 {
    font-size: 32px;
  }
  .hcmc-cs-hero p {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .hcmc-cs-hero {
    padding: 60px 0 45px;
  }
  .hcmc-cs-container {
    width: min(1180px, calc(100% - 24px));
  }
  .hcmc-cs-filter-chips {
    gap: 8px;
  }
  .hcmc-cs-filter-chip {
    padding: 6px 14px;
    font-size: 12.5px;
  }
}
