/* ============================================
   PROJECT DETAIL MODAL — Lightbox overlay
   ============================================ */

/* --- Overlay wrapper --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* --- Dark backdrop --- */
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(73, 62, 38, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

/* --- Container card --- */
.modal__container {
  position: relative;
  width: 90%;
  max-width: 880px;
  max-height: 85vh;
  background: var(--bg-cream);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(73, 62, 38, 0.25);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-spring);
  scrollbar-width: thin;
  scrollbar-color: var(--beige) transparent;
}

.modal.is-open .modal__container {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal__container::-webkit-scrollbar {
  width: 6px;
}

.modal__container::-webkit-scrollbar-track {
  background: transparent;
}

.modal__container::-webkit-scrollbar-thumb {
  background: var(--beige);
  border-radius: 3px;
}

/* --- Close button --- */
.modal__close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  width: 46px;
  height: 46px;
  border: none;
  background: var(--bg-white);
  border-radius: var(--radius-round);
  font-size: 1.2rem;
  color: var(--brown);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease-spring), background 0.2s;
  z-index: 10;
}

.modal__close:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--accent-orange);
  color: var(--white);
}

/* --- Content wrapper --- */
.modal__content {
  padding: 0 var(--space-2xl) var(--space-2xl);
  margin-top: -20px;
}

/* --- Header area --- */
.modal__header {
  margin-bottom: var(--space-xl);
}

.modal__accent-bar {
  height: 4px;
  width: 60px;
  border-radius: 2px;
  margin-bottom: var(--space-lg);
}

.modal__accent-bar--orange { background: var(--accent-orange); }
.modal__accent-bar--olive { background: var(--olive); }

.modal__year {
  display: none;
}

.modal__title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--brown);
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.modal__subtitle {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--brown-light);
  line-height: 1.6;
}

/* --- Stats grid --- */
.modal__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.modal__stat {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: 0 2px 8px rgba(73, 62, 38, 0.06);
  border: 1px solid rgba(229, 217, 196, 0.5);
}

.modal__stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.2;
}

.modal__stat-value--orange { color: var(--accent-orange); }
.modal__stat-value--olive { color: var(--olive); }

.modal__stat-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--brown-light);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Details section --- */
.modal__details {
  margin-bottom: var(--space-xl);
}

.modal__details-title {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--brown);
  margin-bottom: var(--space-md);
}

.modal__bullets {
  list-style: none;
  padding: 0;
}

.modal__bullets li {
  position: relative;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--brown);
  line-height: 1.7;
  padding-left: 24px;
  margin-bottom: var(--space-sm);
}

.modal__bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-orange);
  font-weight: 700;
}

/* --- Reels / Media section --- */
.modal__media {
  margin-bottom: var(--space-lg);
}

.modal__media-title {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--brown);
  margin-bottom: var(--space-md);
}

/* Reels container — 3 reels side by side on desktop */
.modal__reels {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--beige) transparent;
}

.modal__reels::-webkit-scrollbar {
  height: 5px;
}

.modal__reels::-webkit-scrollbar-track {
  background: transparent;
}

.modal__reels::-webkit-scrollbar-thumb {
  background: var(--beige);
  border-radius: 3px;
}

.modal__reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

/* Instagram iframe embed container */
.modal__reel-embed {
  width: 100%;
  max-height: 550px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-white);
  border: 2px solid rgba(229, 217, 196, 0.6);
  padding: 24px 0 0 0;
}

.modal__reel-embed iframe {
  display: block;
  width: 100%;
  height: 550px;
  border: none;
}

/* Fallback phone frame for reels without embeds */
.modal__reel-phone {
  aspect-ratio: 9 / 16;
  width: 100%;
  background: var(--beige);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(229, 217, 196, 0.8);
  box-shadow: 0 4px 12px rgba(73, 62, 38, 0.08);
}

.modal__reel-emoji {
  font-size: 2.5rem;
}

.modal__reel-label {
  font-family: var(--font-sans);
  font-size: var(--fs-xxs);
  color: var(--brown-light);
  text-align: center;
  font-weight: 500;
  line-height: 1.3;
}
