/* ===================================================================
   Shared case-study styles
   - Used by the modal in work/index.html (gallery + .cs-* inner content)
   - Used in full by the standalone case pages (work/<slug>/index.html):
     tokens, base, nav, footer, buttons, logo, .case-page chrome,
     gallery, and .cs-* content.
   =================================================================== */

:root {
  --mist: #E6F1FB;
  --blue: #378ADD;
  --deep: #185FA5;
  --navy: #0C2340;
  --white: #FFFFFF;
  --cloud: #F4F6F9;
  --border: rgba(12, 35, 64, 0.12);
  --border-soft: rgba(12, 35, 64, 0.08);
  --body: #3A4756;
  --success: #1D9E75;
  --maxw: 1200px;
}

/* ---------- Base (standalone pages) ---------- */
.case-doc * { box-sizing: border-box; margin: 0; padding: 0; }
.case-doc {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--navy); background: var(--white); line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.case-doc h1, .case-doc h2, .case-doc h3 { line-height: 1.15; letter-spacing: -0.01em; color: var(--navy); }
.case-doc p { color: var(--body); }
.case-doc a { color: var(--deep); text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0.02em;
  padding: 14px 26px; border-radius: 6px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  border: 1.5px solid transparent; white-space: nowrap;
}
.case-doc a.btn-primary, .btn-primary { background: var(--deep); color: var(--white); border-color: var(--deep); }
.btn-primary:hover { background: #134e87; border-color: #134e87; }
.case-doc a.btn-secondary, .btn-secondary { background: transparent; color: var(--deep); border-color: var(--deep); }
.btn-secondary:hover { background: rgba(24, 95, 165, 0.06); }
.case-doc a.btn-light, .btn-light { background: var(--white); color: var(--deep); border-color: var(--white); }
.btn-light:hover { background: var(--mist); border-color: var(--mist); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-svg { width: 140px; height: auto; display: block; }
.logo-svg .lm-mark, .logo-svg .lm-line { stroke: #185FA5; }
.logo-svg .lm-h { fill: #0C2340; }
.logo-svg .lm-sub { fill: #185FA5; }
.logo-light .logo-svg .lm-mark, .logo-light .logo-svg .lm-line { stroke: #FFFFFF; }
.logo-light .logo-svg .lm-h { fill: #FFFFFF; }
.logo-light .logo-svg .lm-sub { fill: #378ADD; }

/* ---------- Nav ---------- */
.case-doc header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 0.5px solid var(--border);
}
.case-doc nav { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.nav-links { display: flex; align-items: center; gap: 38px; list-style: none; }
.nav-links a {
  font-size: 13px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--navy); transition: color .15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--deep); }
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-toggle { display: none; }

/* ---------- Case page chrome ---------- */
.case-page { background: var(--cloud); padding: 36px 0 80px; }
.case-page .case-col { max-width: 900px; margin: 0 auto; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--deep); transition: color .15s ease; margin-bottom: 22px;
}
.back-link:hover { color: var(--navy); }
.back-link svg { transition: transform .18s ease; }
.back-link:hover svg { transform: translateX(-3px); }
.case-shell {
  background: var(--white); border: 0.5px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px -40px rgba(12,35,64,0.4);
}
.cs-content { padding: 44px; max-width: 100%; overflow-x: hidden; }

/* ---------- Gallery ---------- */
.gallery { position: relative; background: var(--cloud); }
.gallery-viewport {
  display: flex; gap: 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery-viewport::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: start;
  height: 360px; padding: 14px;
}
.gallery-frame {
  width: 100%; height: 100%;
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
  background: var(--mist);
}
.gallery-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.gallery-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(
    135deg, rgba(24,95,165,0.06) 0, rgba(24,95,165,0.06) 1px,
    transparent 1px, transparent 11px);
}
.gallery-ph span {
  font-family: 'SFMono-Regular', ui-monospace, 'Menlo', monospace;
  font-size: 12px; letter-spacing: 0.04em; color: rgba(24,95,165,0.55);
  text-transform: uppercase; text-align: center; padding: 0 16px;
}
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(12,35,64,0.55); color: var(--white);
  border: none; cursor: pointer; z-index: 3;
  transition: background-color .16s ease, opacity .16s ease;
}
.gallery-arrow:hover { background: rgba(12,35,64,0.8); }
.gallery-arrow--prev { left: 18px; }
.gallery-arrow--next { right: 18px; }
.gallery-arrow[hidden] { display: none; }
.gallery-dots {
  display: flex; justify-content: center; gap: 8px;
  padding: 14px 0 4px; background: var(--white);
}
.gallery-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--deep); background: transparent;
  padding: 0; cursor: pointer; transition: background-color .15s ease;
}
.gallery-dot.active { background: var(--deep); }

/* ---------- Case content (.cs-*) — shared by modal + standalone ---------- */
.cs-tag {
  display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--white); background: var(--deep);
  padding: 5px 12px; border-radius: 100px;
}
.cs-name { font-size: 28px; font-weight: 600; color: var(--navy); margin-top: 12px; letter-spacing: -0.01em; overflow-wrap: break-word; word-break: break-word; white-space: normal; }
.cs-disclaimer { font-style: italic; font-weight: 400; font-size: 13px; color: #888888; margin-top: 8px; }
.cs-badge-live {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--success); background: rgba(29,158,117,0.1);
  padding: 5px 12px; border-radius: 100px;
}
.cs-badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.cs-live-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; margin-left: 10px;
  font-size: 13px; font-weight: 500; color: var(--deep); text-decoration: none;
}
.cs-live-link:hover { text-decoration: underline; }
.cs-divider { height: 1px; background: var(--mist); border: 0; margin: 24px 0; }
.cs-overview { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; max-width: 100%; }
.cs-overview > * { min-width: 0; max-width: 100%; }
.cs-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--deep); overflow-wrap: break-word; white-space: normal; }
.cs-body { font-size: 14px; font-weight: 400; color: #444444; line-height: 1.8; margin-top: 12px; overflow-wrap: break-word; word-break: break-word; white-space: normal; }
.cs-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cs-meta-item { min-width: 0; }
.cs-meta-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #888888; overflow-wrap: break-word; white-space: normal; }
.cs-meta-value { font-size: 14px; font-weight: 500; color: var(--navy); margin-top: 3px; overflow-wrap: anywhere; word-break: break-word; white-space: normal; max-width: 100%; }
.cs-built-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; max-width: 100%; }
.cs-feat-pill {
  font-size: 13px; font-weight: 400; color: var(--navy);
  background: var(--cloud); border: 1px solid var(--mist); border-radius: 4px;
  padding: 8px 14px; min-width: 0; overflow-wrap: break-word; word-break: break-word; white-space: normal;
}
.cs-action { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; max-width: 100%; }
.cs-action-text { font-size: 14px; font-weight: 400; color: #444444; overflow-wrap: break-word; word-break: break-word; white-space: normal; min-width: 0; }
.case-doc a.cs-cta, .cs-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--deep); color: var(--white);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  padding: 10px 22px; border-radius: 3px;
  transition: background-color .16s ease;
}
.cs-cta:hover { background: #134e87; }

/* ---------- Footer ---------- */
.case-doc footer { background: var(--navy); border-top: 0.5px solid rgba(255,255,255,0.1); padding: 60px 0 40px; }
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap; padding-bottom: 44px;
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
}
.footer-tagline { color: rgba(230,241,251,0.7); font-size: 15px; margin-top: 18px; max-width: 280px; }
.footer-nav { display: flex; gap: 52px; flex-wrap: wrap; }
.footer-col h4 {
  color: var(--white); font-size: 12px; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: rgba(230,241,251,0.72); font-size: 14.5px; transition: color .15s ease; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { color: rgba(230,241,251,0.55); font-size: 13.5px; }
.footer-bottom a { color: rgba(230,241,251,0.72); transition: color .15s ease; }
.footer-bottom a:hover { color: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 26px; }
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .gallery-slide { height: 240px; }
  .gallery-arrow { display: none; }
  .cs-content { padding: 26px; }
  .cs-overview { grid-template-columns: 1fr; gap: 22px; }
  .cs-built-grid { grid-template-columns: 1fr; }
  .cs-action { flex-direction: column; align-items: flex-start; }
}
