
/* ============================================================
   PROJECTS PAGE — uses global emc-style.css header/footer.
   Keep projects.css scoped to .projects-page to avoid collisions.
============================================================ */
.projects-page .site-header,
.projects-page .site-footer{
  /* styles come from emc-style.css */
}

/* ============================================================
   PROJECTS PAGE ONLY – EMC GROUP
   File: projects.css
   Scope: .projects-page ONLY
============================================================ */

/* ============================================================
   PAGE SAFETY
============================================================ */
.projects-page {
  isolation: isolate;
}

/* ============================================================
   CATEGORY FILTER MENU
============================================================ */
.projects-page .projects-filter {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.projects-page .filter-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emc-grey-mid);
  cursor: pointer;
  position: relative;
  padding-bottom: 0.6rem;
}

.projects-page .filter-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--emc-burgundy);
  transition: width 0.3s ease;
}

.projects-page .filter-btn.is-active {
  color: var(--emc-burgundy-dark);
}

.projects-page .filter-btn.is-active::after {
  width: 100%;
}

/* ============================================================
   PROJECT STRIPS (HORIZONTAL)
============================================================ */
.projects-page .projects-strip {
  display: none;
  gap: 1.6rem;
  overflow-x: auto;
  padding: 1rem 0 1.5rem;
  scroll-snap-type: x mandatory;
}

.projects-page .projects-strip.is-active {
  display: flex;
}

/* Hide scrollbar but keep scrolling */
.projects-page .projects-strip::-webkit-scrollbar {
  display: none;
}
.projects-page .projects-strip {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* ============================================================
   PROJECT TILE – HORIZONTAL VISUAL TAB
============================================================ */
.projects-page .project-tile-horizontal {
  flex: 0 0 320px;
  height: 220px;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;

  text-decoration: none;
  color: #ffffff;

  background-image:
    linear-gradient(
      rgba(0,0,0,0.35),
      rgba(0,0,0,0.7)
    ),
    var(--bg);
  background-size: cover;
  background-position: center;

  filter: grayscale(100%);
  transition:
    filter 0.45s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Hover / focus reveal */
.projects-page .project-tile-horizontal:hover,
.projects-page .project-tile-horizontal:focus-visible {
  filter: grayscale(0%);
  transform: translateY(-6px);
  box-shadow: 0 26px 55px rgba(0,0,0,0.35);
}

/* ============================================================
   PROJECT TITLE OVERLAY
============================================================ */
.projects-page .project-tile-horizontal span {
  position: absolute;
  bottom: 1.2rem;
  left: 1.2rem;
  right: 1.2rem;

  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  z-index: 2;
}

/* Subtle vignette for legibility */
.projects-page .project-tile-horizontal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at bottom,
    rgba(0,0,0,0.25),
    transparent 60%
  );
  z-index: 1;
}

/* ============================================================
   EMPTY STATE (FUTURE SAFE)
============================================================ */
.projects-page .projects-strip:empty::before {
  content: "Projects coming soon.";
  font-style: italic;
  color: var(--emc-grey-mid);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 960px) {
  .projects-page .project-tile-horizontal {
    flex: 0 0 280px;
    height: 200px;
  }
}

@media (max-width: 640px) {
  .projects-page .projects-filter {
    gap: 1.5rem;
  }

  .projects-page .project-tile-horizontal {
    flex: 0 0 240px;
    height: 180px;
  }
}


/* ============================================================
   OPTIONAL SEARCH (projects.html)
============================================================ */
.projects-page .projects-controls .projects-search{
  display:flex;
  justify-content:center;
  margin-top: 1.25rem;
}

.projects-page .projects-controls input[type="search"]{
  width: min(560px, 100%);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(10px);
  font: inherit;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.projects-page .projects-controls input[type="search"]:focus{
  border-color: rgba(139,31,43,0.55);
  box-shadow: 0 0 0 4px rgba(139,31,43,0.12);
}

/* Screen-reader only */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}


/* ============================================================
   CONTROLS: TOOLBAR + SORT
============================================================ */
.projects-controls .projects-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin-top:14px;
  flex-wrap:wrap;
}
.projects-controls .projects-search{
  flex: 1 1 320px;
}
.projects-controls .projects-search input{
  width:100%;
}
.projects-controls .projects-sort{
  flex: 0 0 auto;
}
.projects-controls .projects-sort select{
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10, 10, 12, 0.35);
  color: #fff;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============================================================
   COLLAPSIBLE FILTER DRAWER
============================================================ */
.filter-drawer {
  margin-top: 14px;
}

.filter-drawer__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.filter-drawer__toggle:hover {
  background: rgba(139,31,43,0.04);
  border-color: rgba(139,31,43,0.2);
}
.filter-drawer__toggle[aria-expanded="true"] {
  background: rgba(139,31,43,0.06);
  border-color: rgba(139,31,43,0.25);
  box-shadow: 0 2px 8px rgba(139,31,43,0.08);
}

.filter-drawer__chevron {
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.filter-drawer__toggle[aria-expanded="true"] .filter-drawer__chevron {
  transform: rotate(180deg);
}

.filter-drawer__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--emc-burgundy, #8b1f2b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.filter-drawer__count:empty {
  display: none;
}

.filter-drawer__body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 0.3s ease;
  overflow: hidden;
}
.filter-drawer__body.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.filter-drawer__grid {
  min-height: 0;
  overflow: hidden;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-top: 14px;
}

.filter-drawer__body .chip-clear {
  margin-top: 10px;
  margin-bottom: 4px;
}

/* ============================================================
   FILTER CHIPS
============================================================ */
.chip-group{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
}
.chip-group__label{
  font-size: 0.8rem;
  color: #666;
  min-width: 44px;
  padding-top: 3px;
  font-weight: 600;
}
.chip-group__chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  max-width: min(720px, 68vw);
}
.chip{
  appearance:none;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.05);
  color: #555;
  padding: 7px 10px;
  border-radius: 999px;
  cursor:pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.chip:hover{
  transform: translateY(-1px);
  border-color: rgba(139,31,43,0.35);
  color: #333;
}
.chip.is-active{
  background: var(--emc-burgundy, #8b1f2b);
  border-color: var(--emc-burgundy, #8b1f2b);
  color: #fff;
}
.chip-clear{
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: #555;
  cursor:pointer;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}
.chip-clear:hover{
  background: rgba(139,31,43,0.08);
  color: var(--emc-burgundy, #8b1f2b);
}

/* ============================================================
   FEATURED
============================================================ */
.projects-featured{
  padding-top: clamp(34px, 4vw, 54px);
  padding-bottom: clamp(20px, 3vw, 34px);
}
.featured-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap:wrap;
}
.featured-head h2{
  margin:0;
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
}
.featured-head p{
  margin:0;
  opacity:0.85;
  max-width: 680px;
}
.projects-featured-strip{
  display:flex;
  gap: 14px;
  overflow:auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 14px;
}
.projects-featured-strip .project-tile-horizontal{
  min-width: clamp(240px, 26vw, 340px);
  scroll-snap-align: start;
}
.projects-featured-strip::-webkit-scrollbar{ height: 10px; }
.projects-featured-strip::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* ============================================================
   PERFORMANCE: reduce layout shift on images
============================================================ */
.project-tile-horizontal{
  will-change: transform;
}


.filters-inner{display:flex;gap:10px;flex-wrap:wrap;}


/* Generated categories container */
#categoryFilters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.projects-empty{
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  opacity: 0.9;
}

/* Active nav hint (smart header links) */
.site-header .main-nav a.is-active{
  position: relative;
}
.site-header .main-nav a.is-active::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-10px;
  height:2px;
  background: var(--emc-burgundy, #8b1f2b);
  border-radius: 999px;
  opacity: 0.9;
}

.projects-page .projects-strips{
  display:block;
}



/* ============================================================
   HORIZONTAL STRIP UX (smooth + grab)
============================================================ */
.projects-page .projects-strip,
.projects-page .projects-featured-strip{
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  cursor: grab;
}
.projects-page .projects-strip.dragging,
.projects-page .projects-featured-strip.dragging{
  cursor: grabbing;
}

/* ============================================================
   SCROLL ARROWS — Apple-style
============================================================ */
.strip-scroll-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--cat-bg, #e0e0e0) 45%, transparent) 0%,
    transparent 18%
  );
}

/* ============================================================
   ROTATED CATEGORY SIDEBAR
============================================================ */
.strip-category-sidebar {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  min-height: 220px;
  background: linear-gradient(
    180deg,
    var(--cat-accent, #555) 0%,
    color-mix(in srgb, var(--cat-accent, #555) 72%, #000) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px 0 0 14px;
  overflow: hidden;
}

.strip-category-sidebar__text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  padding: 1rem 0;
  user-select: none;
}

/* Subtle top/bottom fade on the sidebar accent strip */
.strip-category-sidebar::before,
.strip-category-sidebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 1;
  pointer-events: none;
}
.strip-category-sidebar::before {
  top: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
}
.strip-category-sidebar::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.12), transparent);
}

/* Ensure the strip fills remaining space */
.strip-scroll-wrapper .projects-strip,
.strip-scroll-wrapper .projects-featured-strip {
  flex: 1;
  min-width: 0;
  padding-left: 1rem;
}

/* Adjust arrow positions to account for sidebar */
.strip-scroll-wrapper .strip-scroll-arrow--left {
  left: 44px;
}

/* Featured strip in dark section — lighter sidebar */
.projects-featured .strip-category-sidebar {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.05) 100%
  );
}
.projects-featured .strip-category-sidebar__text {
  color: rgba(255,255,255,0.7);
}

/* No sidebar variant (featured strip) */
.strip-scroll-wrapper--no-sidebar {
  background: none;
}
.strip-scroll-wrapper--no-sidebar .strip-scroll-arrow--left {
  left: -6px;
}
.strip-scroll-wrapper--no-sidebar .projects-strip,
.strip-scroll-wrapper--no-sidebar .projects-featured-strip {
  padding-left: 0;
}

/* Hide sidebar on small screens — just too narrow */
@media (max-width: 640px) {
  .strip-category-sidebar {
    display: none;
  }
  .strip-scroll-wrapper {
    background: none;
  }
  .strip-scroll-wrapper .strip-scroll-arrow--left {
    left: -6px;
  }
  .strip-scroll-wrapper .projects-strip,
  .strip-scroll-wrapper .projects-featured-strip {
    padding-left: 0;
  }
}

.strip-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.25s ease;
}

.strip-scroll-arrow.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.strip-scroll-arrow:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: translateY(-50%) scale(1.08);
}

.strip-scroll-arrow:active {
  transform: translateY(-50%) scale(0.95);
  transition-duration: 0.1s;
}

.strip-scroll-arrow--left {
  left: -6px;
}

.strip-scroll-arrow--right {
  right: -6px;
}

.strip-scroll-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Featured strip sits on dark background — lighter arrows */
.projects-featured .strip-scroll-arrow {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.projects-featured .strip-scroll-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* On mobile, shrink arrows slightly and tuck them in */
@media (max-width: 768px) {
  .strip-scroll-arrow {
    width: 36px;
    height: 36px;
  }
  .strip-scroll-arrow--left { left: 2px; }
  .strip-scroll-arrow--right { right: 2px; }
  .strip-scroll-arrow svg {
    width: 15px;
    height: 15px;
  }
}


/* ============================================================
   VIEW TOGGLE (List / Map)
============================================================ */
.view-toggle{
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10,10,12,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.view-toggle__btn{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 44px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.view-toggle__btn:hover{
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.view-toggle__btn.is-active{
  background: var(--emc-burgundy, #8b1f2b);
  color: #fff;
}
.view-toggle__btn svg{
  flex-shrink: 0;
}

/* ============================================================
   INTERACTIVE MAP
============================================================ */
.projects-map-section{
  padding-top: clamp(20px, 3vw, 40px);
  padding-bottom: clamp(20px, 3vw, 40px);
}
.map-wrapper{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 16px 60px rgba(0,0,0,0.12);
}
.projects-map{
  width: 100%;
  height: 600px;
  background: #1a1a2e;
}
@media (max-width: 768px){
  .projects-map{ height: 450px; }
}
.map-caption{
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* Map legend */
.map-legend{
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.78rem;
  line-height: 1.6;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-width: 200px;
}
.map-legend__item{
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-legend__dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Leaflet popup overrides for EMC brand */
.emc-popup .leaflet-popup-content-wrapper{
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.emc-popup .leaflet-popup-content{
  margin: 0;
  width: 320px !important;
}
.emc-popup .leaflet-popup-tip{
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.popup-aerial{
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.popup-body{
  padding: 14px 16px;
}
.popup-title{
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--emc-dark, #202020);
  margin: 0 0 4px;
}
.popup-meta{
  font-size: 0.82rem;
  color: #666;
  margin: 0 0 10px;
}
.popup-link{
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--emc-burgundy, #8b1f2b);
  text-decoration: none;
  transition: opacity 180ms;
}
.popup-link:hover{ opacity: 0.7; }

/* ============================================================
   AERIAL HOVER CROSSFADE ON TILES
============================================================ */
.projects-page .project-tile-horizontal{
  position: relative;
}
.projects-page .project-tile-horizontal .tile-aerial-overlay{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
  border-radius: inherit;
}
.projects-page .project-tile-horizontal:hover .tile-aerial-overlay,
.projects-page .project-tile-horizontal:focus-visible .tile-aerial-overlay{
  opacity: 1;
}
/* Ensure text stays above aerial overlay */
.projects-page .project-tile-horizontal span{
  z-index: 3;
}
.projects-page .project-tile-horizontal::after{
  z-index: 2;
}

/* Aerial badge on tiles */
.tile-aerial-badge{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.projects-page .project-tile-horizontal:hover .tile-aerial-badge{
  opacity: 1;
}

/* ============================================================
   HERO CANVAS HEATMAP OVERLAY
============================================================ */
.hero--projects{
  position: relative;
  overflow: hidden;
  background: url('images/hero/ggh_hero_map.jpg') center center / cover no-repeat !important;
}
#heroMapCanvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}
.hero--projects .hero-inner{
  position: relative;
  z-index: 1;
}

/* ============================================================
   PROJECT COUNT STAT BAR
============================================================ */
.projects-stat-bar{
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 60px);
  padding: 18px 0;
  margin-top: -1px;
  background: var(--emc-burgundy-dark, #60121b);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.stat-item{
  text-align: center;
  color: #fff;
}
.stat-number{
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}
.stat-label{
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-top: 2px;
}
