/*==============================================================
# Automotive Case Study Page
# File: assets/css/case-automotive.css
#
# This stylesheet is intentionally loaded after main.css and is scoped to
# body.automotive-case-study-page. It controls only the Automotive case-study
# page and does not change wording, gallery filenames, or other site pages.
==============================================================*/

/*--------------------------------------------------------------
# 1. Page Shell
# Keeps Automotive content inside a stable centered width and prevents the
# shared full-viewport gallery transform from clipping the first/last cards.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-case-content {
  width: min(100% - 32px, 1460px);
  margin-right: auto;
  margin-left: auto;
  padding: 48px 0 28px;
  overflow: visible;
  background: #ffffff;
}

.automotive-case-study-page .automotive-case-content > .container,
.automotive-case-study-page .automotive-case-content > .container-fluid {
  width: 100%;
  max-width: none;
  padding-right: clamp(20px, 3vw, 48px);
  padding-left: clamp(20px, 3vw, 48px);
}

/*--------------------------------------------------------------
# 2. Page Heading
# Uses the shared brand typography while keeping spacing local to this page.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-case-content > .container h1 {
  margin: 0;
  color: var(--heading-color);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 800;
  line-height: 1.2;
}

/*--------------------------------------------------------------
# 3. Project Panel Grid
# CAD and FEA are full-width because their data lengths differ significantly.
# Supporting Reverse Engineering/Prototype and CFD panels share one row.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-primary-projects,
.automotive-case-study-page .automotive-secondary-projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin: 0;
}

.automotive-case-study-page .automotive-secondary-projects {
  margin-top: 24px !important;
}

.automotive-case-study-page .automotive-project-panel {
  width: auto;
  padding: clamp(22px, 2vw, 30px);
  border: 1px solid rgba(11, 45, 117, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.automotive-case-study-page .automotive-project-panel > :last-child {
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# 4. Project Headings
# Separate selectors avoid relying on generic heading rules from other pages.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-project-panel .section-title,
.automotive-case-study-page .automotive-project-panel .orange-heading {
  margin: 0 0 22px;
  color: var(--accent-color);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

.automotive-case-study-page .automotive-project-panel .black-heading {
  margin: 28px 0 18px;
  color: #111111;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

/*--------------------------------------------------------------
# 5. Project Lists
# Every existing sentence remains a separate item. Plain list items receive a
# generated check icon; items already containing an icon are not duplicated.
--------------------------------------------------------------*/
.automotive-case-study-page .project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.automotive-case-study-page .project-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  color: #111111;
  font-size: 16px;
  line-height: 1.58;
  break-inside: avoid;
}

.automotive-case-study-page .project-list li:not(.list-item)::before {
  content: "\f058";
  flex: 0 0 auto;
  margin-top: 5px;
  color: var(--accent-color);
  font-family: "Font Awesome 6 Free";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.automotive-case-study-page .project-list .list-item i {
  flex: 0 0 auto;
  margin-top: 5px;
  color: var(--accent-color);
  font-size: 18px;
}

/* Long CAD and FEA lists use two balanced columns on desktop. */
@media (min-width: 992px) {
  .automotive-case-study-page .automotive-cad-panel .project-list,
  .automotive-case-study-page .automotive-fea-panel > .project-list {
    column-count: 2;
    column-gap: clamp(36px, 4vw, 64px);
  }

  .automotive-case-study-page .automotive-secondary-projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*--------------------------------------------------------------
# 6. Automotive Gallery Section
# This section owns its width. It does not use the shared viewport breakout,
# negative positioning, or transforms that previously clipped card borders.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-gallery-section {
  width: min(100% - 32px, 1560px) !important;
  margin: 0 auto !important;
  padding: 34px clamp(16px, 2vw, 30px) 64px !important;
  overflow: visible;
  background: #ffffff;
}

.automotive-case-study-page .automotive-gallery-section h2 {
  margin-bottom: 10px;
  color: var(--heading-color);
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 800;
  line-height: 1.2;
}

/* Seven compact cards on desktop. Bootstrap column widths are reset locally. */
.automotive-case-study-page .automotive-gallery-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
}

.automotive-case-study-page .automotive-gallery-grid > [class*="col-"] {
  width: auto;
  max-width: none;
  padding: 0;
}

/*--------------------------------------------------------------
# 7. Automotive Gallery Cards
# Each image stays inside one complete square box. object-fit: contain shows
# the entire engineering image without stretching, cropping, or overflow.
--------------------------------------------------------------*/
.automotive-case-study-page .automotive-gallery-grid .gallery-card {
  display: flex;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  align-items: center;
  justify-content: center;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--accent-color);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.automotive-case-study-page .automotive-gallery-grid .gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.automotive-case-study-page .automotive-gallery-grid .gallery-card:hover,
.automotive-case-study-page .automotive-gallery-grid .gallery-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

/*--------------------------------------------------------------
# 8. Tablet
# Three gallery cards per row and single-column project panels.
--------------------------------------------------------------*/
@media (max-width: 991px) {
  .automotive-case-study-page .automotive-case-content {
    width: min(100% - 24px, 1460px);
    padding-top: 38px;
  }

  .automotive-case-study-page .automotive-project-panel {
    padding: 24px;
  }

  .automotive-case-study-page .automotive-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

/*--------------------------------------------------------------
# 9. Mobile
# Two gallery cards per row with compact spacing and readable project text.
--------------------------------------------------------------*/
@media (max-width: 575px) {
  .automotive-case-study-page .automotive-case-content,
  .automotive-case-study-page .automotive-gallery-section {
    width: 100% !important;
  }

  .automotive-case-study-page .automotive-case-content > .container,
  .automotive-case-study-page .automotive-case-content > .container-fluid {
    padding-right: 18px;
    padding-left: 18px;
  }

  .automotive-case-study-page .automotive-project-panel {
    padding: 20px 18px;
    border-radius: 8px;
  }

  .automotive-case-study-page .project-list li {
    font-size: 15px;
  }

  .automotive-case-study-page .automotive-gallery-section {
    padding: 28px 12px 44px !important;
  }

  .automotive-case-study-page .automotive-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .automotive-case-study-page .automotive-gallery-grid .gallery-card {
    padding: 7px;
  }
}
