/* ============================================================
   Hamat Projects Manager - Elementor Widgets Styling
   ============================================================ */

:root {
  --hm-navy: #0B1F33;
  --hm-gold: #C9A24D;
  --hm-white: #FFFFFF;
  --hm-soft: #F5F7FA;
  --hm-text: #2B2B2B;
  --hm-muted: #6B7280;
  --hm-border: #E5E7EB;
  --hm-shadow: 0 18px 45px rgba(11, 31, 51, 0.10);
  --hm-radius: 18px;
  --hm-radius-lg: 28px;
}

/* Container */
.hm-container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.hm-section {
  padding: 80px 0;
}

.hm-section--soft {
  background: var(--hm-soft);
}

.hm-section-head {
  max-width: 720px;
  margin: 0 auto 42px;
  text-align: center;
}

.hm-section-head--side {
  margin: 0;
  text-align: right;
  position: sticky;
  top: 120px; /* Spacing for sticky header */
}

.hm-section-head h2,
.hm-cta h2,
.hm-single-hero h1,
.hm-hero h1 {
  margin: 10px 0 14px;
  color: var(--hm-navy);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hm-hero h1,
.hm-single-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
}

.hm-section-head h2,
.hm-cta h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
}

.hm-section-head p,
.hm-hero p,
.hm-single-hero p,
.hm-cta p {
  margin: 0;
  color: var(--hm-muted);
  font-size: 17px;
  line-height: 1.8;
}

.hm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hm-gold);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.hm-eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
}

.hm-eyebrow--dark {
  color: var(--hm-gold);
}

.hm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 15px 26px;
  border-radius: 10px;
  font-weight: 800;
  transition: 0.25s ease;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.hm-btn--primary {
  background: var(--hm-gold);
  color: var(--hm-navy) !important;
  box-shadow: 0 12px 25px rgba(201, 162, 77, 0.24);
}

.hm-btn--secondary {
  background: transparent;
  color: var(--hm-gold) !important;
  border-color: var(--hm-gold);
}

.hm-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(11,31,51,0.15);
}

/* Projects Hero */
.hm-hero {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
  background: linear-gradient(rgba(11,31,51,0.77), rgba(11,31,51,0.88));
  color: var(--hm-white);
  border-radius: var(--hm-radius-lg);
  overflow: hidden;
  padding: 60px 20px;
  box-shadow: var(--hm-shadow);
}

.hm-hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.hm-hero h1 {
  color: var(--hm-white);
}

.hm-hero p {
  color: rgba(255,255,255,0.82);
  margin-bottom: 28px;
}

.hm-hero .hm-actions {
  justify-content: center;
}

/* Filter */
.hm-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}

.hm-filter__btn {
  appearance: none;
  border: 1px solid rgba(11,31,51,0.12);
  background: var(--hm-white);
  color: var(--hm-navy);
  padding: 12px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s ease;
}

.hm-filter__btn:hover,
.hm-filter__btn.is-active {
  background: var(--hm-navy);
  color: var(--hm-white);
  border-color: var(--hm-navy);
}

/* Project Grid */
.hm-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

@media (min-width: 1025px) {
  /* Asymmetric layout - every 5th card spans 2 columns horizontally */
  .hm-project-card:nth-child(5n+1) {
    grid-column: span 2;
    flex-direction: row;
  }
  .hm-project-card:nth-child(5n+1) .hm-project-card__gallery {
    width: 48%;
    height: auto;
    border-radius: 0 16px 16px 0; /* RTL right side rounded */
  }
  [dir="ltr"] .hm-project-card:nth-child(5n+1) .hm-project-card__gallery {
    border-radius: 16px 0 0 16px;
  }
  .hm-project-card:nth-child(5n+1) .hm-project-card__body {
    width: 52%;
  }
}

/* Project Card */
.hm-project-card {
  display: flex;
  flex-direction: column;
  background: var(--hm-white);
  border: 1px solid rgba(11, 31, 51, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(11, 31, 51, 0.05), 0 1px 3px rgba(11, 31, 51, 0.02);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.hm-project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 162, 77, 0.35);
  box-shadow: 0 20px 40px -15px rgba(11, 31, 51, 0.12);
}

/* Hover Gallery */
.hm-project-card__gallery {
  position: relative;
  display: block;
  height: 250px;
  overflow: hidden;
  background: #0B1F33;
}

.hm-gallery-zones {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 10;
}

.hm-gallery-zone {
  flex: 1;
  height: 100%;
  cursor: pointer;
}

.hm-gallery-slides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hm-gallery-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.hm-gallery-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.hm-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hm-project-card:hover .hm-gallery-slide.is-active img {
  transform: scale(1.05);
}

/* Slide Tags */
.hm-gallery-slide__tag {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  z-index: 3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

[dir="ltr"] .hm-gallery-slide__tag {
  right: auto;
  left: 14px;
}

.tag--before { background: rgba(239, 68, 68, 0.85); }
.tag--during { background: rgba(201, 162, 77, 0.9); }
.tag--after { background: rgba(16, 185, 129, 0.85); }

/* Indicators */
.hm-gallery-indicators {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 11;
}

.hm-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.hm-indicator.is-active {
  background: var(--hm-gold);
  width: 16px;
  border-radius: 3px;
}

.hm-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  background: var(--hm-gold);
  color: var(--hm-navy);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  z-index: 11;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

[dir="ltr"] .hm-badge {
  right: auto;
  left: 14px;
}

/* Card Body */
.hm-project-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hm-project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.hm-meta-item {
  font-size: 12px;
  font-weight: 700;
}

.hm-meta-item.location {
  color: var(--hm-muted);
}

.hm-meta-item.service {
  color: var(--hm-gold);
  background: rgba(201, 162, 77, 0.08);
  border: 1px solid rgba(201, 162, 77, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.hm-project-card h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.hm-project-card h3 a {
  color: var(--hm-navy);
  text-decoration: none;
  transition: color 0.3s ease;
}

.hm-project-card:hover h3 a {
  color: var(--hm-gold);
}

/* Story Stepper */
.hm-project-story {
  background: #F9FAFB;
  border: 1px solid rgba(11, 31, 51, 0.04);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.hm-story-tabs {
  display: flex;
  border-bottom: 1px solid rgba(11, 31, 51, 0.06);
  padding-bottom: 8px;
  margin-bottom: 10px;
  gap: 6px;
}

.hm-story-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--hm-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.25s ease;
}

.hm-story-tab:hover {
  color: var(--hm-navy);
  background: rgba(11, 31, 51, 0.03);
}

.hm-story-tab[data-tab="problem"].is-active {
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
}

.hm-story-tab[data-tab="solution"].is-active {
  background: rgba(201, 162, 77, 0.08);
  color: var(--hm-gold);
}

.hm-story-tab[data-tab="result"].is-active {
  background: rgba(16, 185, 129, 0.08);
  color: #10B981;
}

.hm-story-content {
  position: relative;
  min-height: 68px;
}

.hm-story-pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.hm-story-pane.is-active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hm-story-pane p {
  margin: 0;
  font-size: 13px;
  color: var(--hm-muted);
  line-height: 1.6;
}

/* Card Link */
.hm-project-card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(11, 31, 51, 0.06);
  padding-top: 14px;
  margin-top: auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--hm-navy);
  text-decoration: none;
  transition: color 0.3s ease;
}

.hm-project-card__link .arrow {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.hm-project-card:hover .hm-project-card__link {
  color: var(--hm-gold);
}

.hm-project-card:hover .hm-project-card__link .arrow {
  transform: translateX(-6px);
}

/* Single Hero */
.hm-single-hero {
  padding: 60px 0;
  background: radial-gradient(circle at 10% 10%, rgba(201,162,77,0.08), transparent 30%);
  border-bottom: 1px solid var(--hm-border);
}

.hm-single-hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}

.hm-back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--hm-muted);
  font-weight: 800;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.hm-back-link:hover {
  color: var(--hm-gold);
}

.hm-single-hero p {
  max-width: 680px;
  margin-bottom: 28px;
  font-size: 16px;
}

.hm-single-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hm-single-stats div {
  padding: 16px;
  border-radius: var(--hm-radius);
  background: var(--hm-white);
  border: 1px solid var(--hm-border);
  box-shadow: 0 10px 24px rgba(11,31,51,0.03);
  text-align: center;
}

.hm-single-stats span {
  display: block;
  color: var(--hm-muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.hm-single-stats strong {
  color: var(--hm-navy);
  font-size: 16px;
  font-weight: 800;
}

.hm-single-hero__image {
  position: relative;
  min-height: 400px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--hm-shadow);
  background: var(--hm-navy);
}

.hm-single-hero__image img {
  height: 100%;
  width: 100%;
  min-height: 400px;
  object-fit: cover;
}

/* Two Col layout for details */
.hm-two-col {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 48px;
  align-items: start;
}

.hm-detail-list {
  display: grid;
  gap: 18px;
}

.hm-detail-card {
  position: relative;
  padding: 28px;
  background: var(--hm-white);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-lg);
  box-shadow: 0 10px 26px rgba(11,31,51,0.03);
}

.hm-detail-card__num {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--hm-gold);
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.hm-detail-card h3 {
  margin: 0 0 10px;
  color: var(--hm-navy);
  font-size: 20px;
  font-weight: 800;
}

.hm-detail-card p {
  margin: 0;
  color: var(--hm-muted);
  line-height: 1.8;
  font-size: 15.5px;
}

/* Gallery switcher */
.hm-gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
}

.hm-gallery__viewer {
  position: relative;
  min-height: 440px;
  border-radius: var(--hm-radius-lg);
  overflow: hidden;
  background: var(--hm-navy);
  box-shadow: var(--hm-shadow);
}

.hm-gallery__viewer img {
  height: 100%;
  width: 100%;
  min-height: 440px;
  object-fit: cover;
}

.hm-gallery__caption {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(11,31,51,0.85);
  color: var(--hm-white);
  backdrop-filter: blur(12px);
  font-weight: 800;
  font-size: 14px;
}

.hm-gallery__tabs {
  display: grid;
  gap: 12px;
}

.hm-gallery__tab {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 96px;
  padding: 18px 22px;
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius);
  background: var(--hm-white);
  color: var(--hm-navy);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
  transition: 0.25s ease;
}

.hm-gallery__tab span {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(201,162,77,0.1);
  color: var(--hm-gold);
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.hm-gallery__tab:hover,
.hm-gallery__tab.is-active {
  background: var(--hm-navy);
  color: var(--hm-white);
  border-color: var(--hm-navy);
}

.hm-gallery__tab.is-active span {
  background: var(--hm-gold);
  color: var(--hm-navy);
}

/* Process Grid */
.hm-process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.hm-process-grid article {
  padding: 24px;
  border-radius: var(--hm-radius-lg);
  border: 1px solid var(--hm-border);
  background: var(--hm-white);
  transition: 0.25s ease;
}

.hm-process-grid article:hover {
  transform: translateY(-5px);
  border-color: var(--hm-gold);
  box-shadow: var(--hm-shadow);
}

.hm-process-grid span {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--hm-gold);
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.hm-process-grid h3 {
  margin: 0 0 10px;
  color: var(--hm-navy);
  font-size: 18px;
  font-weight: 800;
}

.hm-process-grid p {
  margin: 0;
  color: var(--hm-muted);
  line-height: 1.7;
  font-size: 13.5px;
}

/* CTA */
.hm-cta {
  padding: 60px 0;
  background: var(--hm-navy);
  color: var(--hm-white);
  border-radius: var(--hm-radius-lg);
  overflow: hidden;
  box-shadow: var(--hm-shadow);
  margin: 30px 0;
}

.hm-cta__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
}

.hm-cta h2 {
  color: var(--hm-white);
}

.hm-cta p {
  color: rgba(255,255,255,0.75);
  max-width: 650px;
  font-size: 16px;
}

.hm-cta .hm-btn--secondary {
  color: var(--hm-white) !important;
}

/* ============================================================
   RESPONSIVE STYLING (TESTED & VERIFIED)
   ============================================================ */
@media (max-width: 1024px) {
  .hm-project-grid,
  .hm-process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-single-hero__grid,
  .hm-two-col,
  .hm-gallery {
    grid-template-columns: 1fr;
  }

  .hm-section-head--side {
    position: static;
    margin-bottom: 30px;
  }
}

@media (max-width: 767px) {
  .hm-container {
    width: min(100% - 24px, 1200px);
  }

  .hm-section {
    padding: 50px 0;
  }

  .hm-hero {
    min-height: auto;
    padding: 50px 15px;
  }

  .hm-project-grid,
  .hm-process-grid,
  .hm-single-stats {
    grid-template-columns: 1fr;
  }

  .hm-project-card__media,
  .hm-gallery__viewer,
  .hm-gallery__viewer img,
  .hm-single-hero__image,
  .hm-single-hero__image img {
    min-height: auto;
    height: 280px;
  }

  .hm-cta__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }

  .hm-actions,
  .hm-btn {
    width: 100%;
  }
}
