/*
 * File: case-study.css
 * Purpose: Style the public case study content inside the existing PPN site shell.
 * Requires: case-study.php adds the .case-study wrapper; the site's own CSS supplies its header and footer.
 */

/* All selectors stay inside the article wrapper so website navigation is unaffected. */
.case-study {
  --cs-primary: #0d2b45;
  --cs-accent: #f26522;
  --cs-light: #f8fafc;
  --cs-text: #1e293b;
  --cs-muted: #64748b;
  --cs-border: #e2e8f0;
  --cs-success: #10b981;
  background: var(--cs-light);
  color: var(--cs-text);
  font-family: Inter, Roboto, Arial, sans-serif;
  line-height: 1.6;
  padding: 1px 0 3rem;
}
.case-study *, .case-study *::before, .case-study *::after { box-sizing: border-box; }
.case-study h1, .case-study h2, .case-study h3, .case-study h4,
.case-study p, .case-study ul, .case-study figure { margin-top: 0; }
.case-study a { color: var(--cs-accent); text-decoration: none; }
.case-study a:hover { text-decoration: underline; }
.case-study .container { width: min(100%, 1200px); max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Breadcrumb and hero treatment follows the existing static case study demos. */
.case-study .breadcrumbs { color: var(--cs-muted); font-size: .875rem; margin-bottom: 1rem; }
.case-study .breadcrumbs a { color: var(--cs-muted); }
.case-study .hero {
  background: #fff; border: 1px solid var(--cs-border); border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 5%); padding: 2.5rem; margin-bottom: 2rem;
}
.case-study .badge-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.case-study .badge {
  display: inline-block; background: #e0f2fe; color: #0369a1; border-radius: 20px;
  padding: .25rem .75rem; font-size: .8rem; font-weight: 700;
  line-height: 1.5; letter-spacing: .5px; text-transform: uppercase;
}
.case-study .badge.accent { background: #fff7ed; color: #c2410c; }
.case-study .badge.success { background: #dcfce7; color: #15803d; }
.case-study .hero h1 { color: var(--cs-primary); font-size: 2.2rem; font-weight: 800; line-height: 1.25; margin: 0 0 1rem; }
.case-study .hero .subtitle { color: var(--cs-muted); font-size: 1.15rem; max-width: 900px; margin-bottom: 0; }
.case-study .highlights-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem;
  border-top: 1px solid var(--cs-border); padding-top: 1.5rem; margin-top: 2rem;
}
.case-study .metric-card .value { color: var(--cs-accent); font-size: 1.6rem; font-weight: 800; }
.case-study .metric-card .label { color: var(--cs-muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; }

/* Main narrative and profile sidebar keep the two-column demo layout. */
.case-study .layout-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 2rem; }
.case-study .layout-grid > main, .case-study .layout-grid > aside { min-width: 0; }
.case-study .content-card, .case-study .widget {
  background: #fff; border: 1px solid var(--cs-border); border-radius: 12px;
  margin-bottom: 2rem;
}
.case-study .content-card { padding: 2rem; }
.case-study .content-card h2 {
  color: var(--cs-primary); font-size: 1.4rem; font-weight: 700; line-height: 1.3;
  border-bottom: 2px solid #f1f5f9; padding-bottom: .5rem; margin-bottom: 1.25rem;
}
.case-study .content-card h3 { color: var(--cs-primary); font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 .7rem; }
.case-study .content-card p { margin-bottom: 1rem; }
.case-study .content-card > p:last-child { margin-bottom: 0; }
.case-study .challenge-list { padding-left: 1.5rem; margin-bottom: 0; }
.case-study .challenge-list li { margin-bottom: .7rem; }
.case-study .equipment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1rem; }
.case-study .eq-box { background: var(--cs-light); border: 1px solid var(--cs-border); border-left: 4px solid var(--cs-primary); border-radius: 6px; padding: 1rem; }
.case-study .eq-box.new { border-left-color: var(--cs-accent); }
.case-study .eq-box.recon { border-left-color: var(--cs-success); }
.case-study .eq-box.rental { border-left-color: #3b82f6; }
.case-study .eq-box h4 { color: var(--cs-text); font-size: .95rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin-bottom: .5rem; }
.case-study .eq-box ul { color: var(--cs-muted); font-size: .9rem; list-style: none; padding: 0; margin: 0; }
.case-study .eq-box li { position: relative; padding-left: 1rem; margin-bottom: .3rem; }
.case-study .eq-box li::before { content: '•'; position: absolute; left: 0; color: var(--cs-accent); font-weight: 700; }
.case-study .timeline { border-left: 2px solid var(--cs-border); padding-left: 1.5rem; margin-top: 1rem; }
.case-study .timeline-item { position: relative; margin-bottom: 1.5rem; }
.case-study .timeline-item::before { content: ''; position: absolute; left: -1.95rem; top: .25rem; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--cs-accent); }
.case-study .timeline-item h4 { color: var(--cs-primary); font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.case-study .timeline-item p { color: var(--cs-muted); font-size: .9rem; margin-bottom: 0; }
.case-study .results-list { padding: 0; margin: 0; list-style: none; }
.case-study .results-list li { position: relative; padding-left: 25px; margin-bottom: 1rem; }
.case-study .results-list li::before { content: '✓'; position: absolute; left: 0; color: var(--cs-success); font-weight: 700; }
.case-study .testimonial-box { color: #fff; background: linear-gradient(135deg, #0d2b45, #1e3a5f); border-radius: 12px; padding: 2rem; margin-top: 1.5rem; }
.case-study .testimonial-box p { font-size: 1.05rem; font-style: italic; margin-bottom: 1rem; }
.case-study .testimonial-author { color: var(--cs-accent); font-weight: 700; }
.case-study .testimonial-role { color: #cbd5e1; font-size: .85rem; }
.case-study .sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.case-study .widget { padding: 1.5rem; margin-bottom: 0; }
.case-study .widget h3 { color: var(--cs-primary); font-size: 1.1rem; font-weight: 700; border-bottom: 1px solid var(--cs-border); padding-bottom: .5rem; margin-bottom: 1rem; }
.case-study .meta-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.case-study .meta-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--cs-border); padding: .5rem 0; }
.case-study .meta-list li:last-child { border-bottom: 0; }
.case-study .meta-list .label { color: var(--cs-muted); font-weight: 500; white-space: nowrap; }
.case-study .meta-list .val { color: var(--cs-text); font-weight: 600; text-align: right; }
.case-study .btn { display: inline-flex; justify-content: center; align-items: center; width: 100%; padding: .85rem 1rem; border-radius: 6px; font-weight: 700; }
.case-study .btn-primary { color: #fff; background: var(--cs-accent); border: 1px solid var(--cs-accent); }
.case-study .btn-primary:hover { color: #fff; background: #d85416; text-decoration: none; }
.case-study .btn-outline { color: var(--cs-accent); background: #fff; border: 1px solid var(--cs-accent); }
.case-study .tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.case-study .tag { background: #f1f5f9; color: var(--cs-muted); border-radius: 4px; padding: .25rem .5rem; font-size: .8rem; }

/* Media panels appear only for visible nodes with usable image or video URLs. */
.case-study .media-container { background: #fff; border: 1px solid var(--cs-border); border-radius: 12px; overflow: hidden; margin-bottom: 2rem; }
.case-study .media-tabs { display: flex; overflow-x: auto; background: #f1f5f9; border-bottom: 1px solid var(--cs-border); }
.case-study .tab-btn { flex: 0 0 auto; display: flex; align-items: center; background: transparent; color: var(--cs-muted); border: 0; border-bottom: 3px solid transparent; padding: 1rem 1.25rem; font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.case-study .tab-btn.active { color: var(--cs-accent); background: #fff; border-bottom-color: var(--cs-accent); }
.case-study .tab-content { display: none; align-items: center; justify-content: center; flex-direction: column; color: #fff; background: #000; padding: 1rem; min-height: 300px; text-align: center; }
.case-study .tab-content.active { display: flex; }
.case-study .tab-content[hidden], .case-study .gallery-stage [hidden] { display: none !important; }
.case-study .media-gallery { width: 100%; min-width: 0; }
.case-study .gallery-stage { display: grid; place-items: center; min-height: 260px; }
.case-study .gallery-stage img, .case-study .gallery-stage video { width: 100%; max-width: 100%; max-height: 500px; object-fit: contain; }
.case-study .gallery-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1rem 0; }
.case-study .gallery-button, .case-study .gallery-choice { color: #fff; background: #172f45; border: 1px solid #9aaabd; border-radius: 5px; padding: .5rem .75rem; cursor: pointer; }
.case-study .gallery-button:disabled { opacity: .4; cursor: default; }
.case-study .gallery-thumbnails { display: flex; justify-content: center; gap: .5rem; overflow-x: auto; }
.case-study .gallery-choice[aria-pressed='true'] { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
.case-study .gallery-counter { white-space: nowrap; }
.case-study .gallery-error { color: #ffceba; font-size: .85rem; }
.case-study .tab-btn:focus-visible, .case-study .gallery-button:focus-visible, .case-study .gallery-choice:focus-visible { outline: 3px solid var(--cs-accent); outline-offset: 2px; }

/* Narrow layouts stack the narrative and sidebar without changing site chrome. */
@media (max-width: 992px) {
  .case-study .layout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .case-study .container { padding: 1.25rem 1rem; }
  .case-study .hero, .case-study .content-card { padding: 1.5rem; }
  .case-study .hero h1 { font-size: 1.8rem; }
  .case-study .gallery-stage { min-height: 180px; }
}
