/* ============================================================
   SUBPAGES / CASE-STUDY LAYOUT
   Shared stylesheet for the case-study pages inside /pages/Subpages/
   Link AFTER styles.css and header-footer.css on each case-study page.

   Holds the reusable case-study system (hero, identity card, sections,
   grids, media, results, stats, CTA, responsive) used by all five
   case-study pages: PureNordStudio, Nordic RT, PureDrive-RT,
   ModernStillness, and WindTwin.

   Global site styles (header/nav, resets, typography, buttons) stay in
   styles.css; legacy .subpage overrides for other pages also stay in
   styles.css. This file only holds the shared case-study layout.

   A new case study is created by copying any existing page and replacing
   only text, images/videos, and the identity card title/tags — no new CSS.
   ============================================================ */

/* ---------- Page level ---------- */
.case-study-page {
  background: #ffffff;
  color: var(--home-text);
}

/* ---------- Outer case-study wrapper ----------
   Neutral full-width wrapper (no background, no max-width, no padding).
   The real cards are the individual .case-study-section elements below,
   each separated by a clear white gap. */
.case-study-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ---------- Sections = individual wide cards ----------
   Every case-study section becomes its own almost-full-width card with
   visible white space between cards. Content inside stays constrained
   to the centered .case-study-inner (1200px). */
.case-study-section {
  width: calc(100% - 48px);
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;
  padding: 78px 0;
  border-radius: 14px;
  box-sizing: border-box;
}

.case-study-section:first-of-type {
  margin-top: 40px;
}

.case-study-section:nth-of-type(odd) {
  background: var(--home-panel);
}

.case-study-section:nth-of-type(even) {
  background: transparent;
}

/* Last card: no trailing white gap */
.case-study-panel > .case-study-section:last-child {
  margin-bottom: 0;
}

/* ---------- Container width ----------
   Content width stays centered at 1200px inside each wide card.
   Min side margins ~32px via the calc. */
.case-study-inner {
  width: min(1200px, calc(100% - 64px));
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Hero ----------
   Hero card ends right after its content; the 48px card margin
   below provides the white gap to the next card. */
.case-study-hero {
  background: var(--home-panel, #e8f0ec);
  padding: 82px 0 40px;
}

.case-study-hero-grid {
  display: grid;
  grid-template-columns: 1.03fr 0.97fr;
  gap: 50px;
  align-items: center;
  padding: 52px;
  background: var(--home-panel);
}

.case-study-hero .case-study-heading {
  max-width: 700px;
}

.case-study-eyebrow {
  margin: 0 0 15px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--home-soft);
}

.case-study-hero h1 {
  margin: 0;
  font-size: clamp(3.1rem, 5.5vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--home-text);
}

.case-study-lead {
  max-width: 700px;
  margin: 28px 0 0;
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--home-soft);
}

.case-study-hero-media {
  min-height: 440px;
  overflow: hidden;
  background: #dce6e1;
}

.case-study-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
  display: block;
}

/* Branded case-study identity card inside the hero media box */
.case-study-hero-media.is-identity {
  position: relative;
  padding: 42px;
  box-sizing: border-box;
  overflow: hidden;
  background: #252B29;
  border: 1px solid #252B29;
}

.case-study-identity-header {
  position: absolute;
  top: 42px;
  left: 42px;
  z-index: 1;
}

.case-study-identity-label {
  margin: 0 0 5px;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1;
  text-transform: uppercase;
  color: #C7D2CD;
}

.case-study-identity-meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.3;
  text-transform: uppercase;
  color: #C7D2CD;
}

.case-study-identity-meta::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin-top: 12px;
  background: #9FB7AC;
}

.case-study-identity-body {
  position: absolute;
  top: auto;
  bottom: 42px;
  left: 42px;
  transform: none;
  z-index: 1;
  width: 100%;
  max-width: 72%;
  text-align: left;
}

.case-study-identity-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #F2F5F3;
}

.case-study-identity-divider {
  width: 100%;
  max-width: 100%;
  height: 1px;
  margin: 0 0 10px;
  border: 0;
  background: #768680;
}

.case-study-identity-tags {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-study-identity-tags li {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1.3;
  text-transform: uppercase;
  color: #C7D2CD;
  white-space: nowrap;
}

.case-study-hero-extra {
  grid-column: 1 / -1;
}

.case-study-hero-extra .performance-proof-block {
  padding: 24px 0 0;
  border-top: 1px solid var(--home-line);
}

.case-study-hero-extra .performance-proof-block h3 {
  margin-top: 0;
}

.case-study-hero-extra video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid var(--home-line);
  background: var(--home-panel-soft);
}

/* ---------- Video captions ----------
   Captions sit directly above each video and stay flush with the video's
   left edge (both are children of the same container). */
.case-study-video-caption {
  margin: 0 0 12px;
}

.case-study-video-caption:not(:first-of-type) {
  margin-top: 48px;
}

.case-study-video-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.25;
  color: var(--home-text);
}

.case-study-video-desc {
  margin: 0;
  max-width: 720px;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--home-soft);
}


/* ---------- PureNordStudio hero video card ----------
   The videos are intentionally separated from the hero so the hero card
   ends above them and the standard section margin creates a white gap.
   Background follows the standard odd/even alternation. */
.case-study-video-section {
  padding: 40px 0 52px;
}

.case-study-video-section .case-study-hero-extra {
  width: 100%;
}

@media (max-width: 900px) {
  .case-study-video-section {
    padding: 34px 0 42px;
  }
}

@media (max-width: 739px) {
  .case-study-video-section {
    padding: 26px 0 34px;
  }
}

/* ---------- Standard section: heading + content grid ---------- */
.case-study-grid {
  display: grid;
  grid-template-columns: 0.40fr 0.60fr;
  gap: 50px 60px;
  align-items: start;
}

.case-study-heading h2 {
  margin: 5px 0 0;
  color: var(--home-text);
  font-size: clamp(2rem, 2.8vw, 2.7rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.case-study-content {
  max-width: 700px;
}

.case-study-content > p {
  margin: 0 0 0.85rem;
  color: #5b6560;
  font-size: 1.08rem;
  line-height: 1.7;
}

.case-study-content > p:last-child {
  margin-bottom: 0;
}

.case-study-content h3 {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--home-text);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.case-study-content strong {
  color: var(--home-text);
  font-weight: 700;
}

.case-study-media {
  margin-top: 24px;
}

.case-study-media img,
.case-study-media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid var(--home-line);
  background: var(--home-panel-soft);
}

.case-study-media.is-diagram img {
  object-fit: contain;
}

.case-study-action {
  margin-top: 28px;
}

/* Video section CTA: keep the top gap and trim the empty space below */
.case-study-video-section .case-study-action {
  margin-bottom: 24px;
}

/* Video section CTA arrow: larger, perfectly centered with the text */
.case-study-video-section .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.case-study-video-section .btn-link .cta-arrow svg {
  width: 18px;
  height: 18px;
}

/* ---------- Final (Outcome) section refinement ----------
   Scoped to the last case-study section only. Balances the short heading
   with the taller right column and trims the CTA button width. */
.case-study-section:last-of-type .case-study-heading h2 {
  margin-top: 36px;
  position: relative;
}

.case-study-section:last-of-type .case-study-heading h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin-top: 16px;
  background: var(--home-line);
}

.case-study-section:last-of-type .case-study-action .btn-link {
  padding: 12px 20px;
}

/* ---------- Key results ---------- */
.case-study-results {
  grid-column: 1 / -1;
}

.case-study-results h2 {
  margin: 0 0 34px;
  color: var(--home-text);
  font-size: clamp(1.9rem, 3.2vw, 3.1rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.case-study-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.case-study-result-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 26px;
  background: var(--home-card);
  border: 1px solid var(--home-line);
}

.case-study-result-icon {
  width: 26px;
  height: 26px;
  color: var(--home-accent);
  opacity: 0.72;
  flex-shrink: 0;
}

.case-study-result-text h3 {
  margin: 0 0 6px;
  color: var(--home-text);
  font-size: 1rem;
  letter-spacing: 0;
}

.case-study-result-text p {
  margin: 0;
  color: var(--home-soft);
  font-size: 0.9rem;
  line-height: 1.58;
}

/* ---------- Diagnostic stats ---------- */
.case-study-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 980px);
  margin: 20px 0 18px;
  background: rgba(113, 129, 147, 0.03);
  border-top: 1px solid var(--home-line);
  border-bottom: 1px solid var(--home-line);
}

.case-study-stats p {
  max-width: none;
  margin: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--home-line);
  text-align: center;
}

.case-study-stats p:nth-child(odd) {
  background: rgba(113, 129, 147, 0.02);
}

.case-study-stats p:nth-child(even) {
  background: rgba(232, 240, 236, 0.3);
}

.case-study-stats p:last-child {
  border-right: 0;
}

.case-study-stats strong {
  display: block;
  color: var(--home-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.case-study-stats span {
  display: block;
  margin-top: 5px;
  color: var(--home-text);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .case-study-section {
    width: calc(100% - 32px);
    margin-bottom: 32px;
  }

  .case-study-section:first-of-type {
    margin-top: 24px;
  }

  .case-study-inner {
    width: calc(100% - 40px);
  }

  .case-study-hero {
    padding: 44px 0 34px;
  }

  .case-study-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 38px;
  }

  .case-study-hero-media,
  .case-study-hero-media img {
    min-height: 330px;
  }

  .case-study-hero-media {
    order: -1;
  }

  .case-study-hero-media.is-identity {
    padding: 32px;
  }

  .case-study-identity-header {
    top: 32px;
    left: 32px;
  }

  .case-study-identity-divider {
    max-width: 120px;
  }

  .case-study-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .case-study-results-grid {
    grid-template-columns: 1fr;
  }

  .case-study-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-study-stats p:nth-child(3) {
    border-right: 0;
  }

  .case-study-stats p:nth-child(n + 4) {
    border-top: 1px solid var(--home-line);
  }
}

/* ---------- Identity card — intermediate (≤989px) ----------
   Migrated from the page's inline <style>. Wider than the 900px
   breakpoint, so it also keeps the identity overrides active between
   901px and 989px; placed after the 900px block so it wins at ≤900px. */
@media (max-width: 989px) {
  .case-study-identity-body {
    bottom: 30px;
    left: 32px;
    max-width: 76%;
  }

  .case-study-identity-title {
    font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 739px) {
  .case-study-section {
    width: calc(100% - 16px);
    margin-bottom: 20px;
    padding: 44px 0;
    border-radius: 10px;
  }

  .case-study-section:first-of-type {
    margin-top: 16px;
  }

  .case-study-inner {
    width: calc(100% - 24px);
  }

  .case-study-hero {
    padding: 26px 0 38px;
  }

  .case-study-hero-grid {
    gap: 25px;
    padding: 25px 18px;
  }

  .case-study-hero h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
    line-height: 0.98;
  }

  .case-study-eyebrow {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .case-study-lead {
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .case-study-hero-media,
  .case-study-hero-media img {
    min-height: 240px;
  }

  .case-study-hero-media.is-identity {
    padding: 22px;
    min-height: 280px;
  }

  .case-study-identity-header {
    top: 22px;
    left: 22px;
  }

  .case-study-identity-body {
    bottom: 22px;
    left: 22px;
    max-width: 84%;
  }

  .case-study-identity-title {
    font-size: clamp(1.2rem, 5.2vw, 1.7rem);
  }

  .case-study-identity-divider {
    max-width: 110px;
    margin-bottom: 10px;
  }

  .case-study-identity-tags {
    flex-wrap: wrap;
    gap: 6px 16px;
  }

  .case-study-identity-tags li {
    font-size: clamp(0.45rem, 1.55vw, 0.55rem);
    letter-spacing: 0.2em;
  }

  .case-study-heading h2,
  .case-study-results h2 {
    font-size: 1.85rem;
    line-height: 1.1;
  }

  .case-study-content > p {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .case-study-media {
    margin-top: 20px;
  }

  .case-study-result-item {
    padding: 18px;
  }

  .case-study-result-text h3 {
    font-size: 0.95rem;
  }

  .case-study-result-text p {
    font-size: 0.85rem;
  }

  .case-study-stats {
    grid-template-columns: 1fr;
    margin: 14px 0 16px;
  }

  .case-study-stats p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--home-line);
    text-align: left;
  }

  .case-study-stats p:last-child {
    border-bottom: 0;
  }

  .case-study-stats strong,
  .case-study-stats span {
    margin: 0;
  }

  .case-study-action .btn-link {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}

/* ---------- Subpage tablet ---------- */
@media (min-width: 740px) and (max-width: 900px) {
  .subpage .key-results-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .subpage .ai-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ---------- Subpage mobile ---------- */
@media (max-width: 739px) {
  .subpage .key-results-box h2 {
    margin-bottom: 24px;
  }

  .subpage .exterior-box {
    padding: 0;
  }

  .subpage .exterior-box h1 {
    font-size: clamp(1.5rem, 9vw, 2.2rem);
  }

  .subpage .exterior-box h2 {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  .subpage .exterior-box h3 {
    font-size: 0.9rem;
  }

  .subpage .exterior-box p {
    font-size: 0.95rem;
  }

  .subpage .key-results-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .subpage .ai-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .subpage .hero-grid-vertical h2 {
    font-size: clamp(1.4rem, 8vw, 1.9rem);
  }

  .subpage .hero-grid-vertical {
    gap: 1rem;
  }
}

/* ---------- Behance/external link ---------- */
.ex-more {
  text-align: center;
  margin: 48px 0 0;
  padding: 32px 0;
  border-top: 1px solid var(--home-line);
}

.ex-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--home-text);
  transition: color 0.3s ease;
}

.ex-more a:hover {
  color: var(--home-accent);
}

.ex-more svg {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.ex-more img {
  height: 28px;
  vertical-align: middle;
  margin: 0 4px;
  opacity: 0.6;
}

/* ---------- PureNordStudio: taller header ----------
   Scoped to this page only via the .header-tall class on the
   <header> (subpages.css is loaded only on PureNordStudio).
   Adds vertical breathing room above the hero by increasing the
   header's vertical padding. Logo and nav stay vertically centered
   (nav-center is flex align-items: center). Font sizes untouched. */
.header-tall .nav-center {
  padding: 30px 0;
}

@media (min-width: 740px) and (max-width: 900px) {
  .header-tall .nav-center {
    padding: 28px 16px;
  }
}

@media (max-width: 739px) {
  .header-tall .nav-center {
    padding: 20px 20px;
  }
}