/* Work page additions — matches elisaleco.com minimal style */

.work-top {
  /* keep section tight under navbar */
  padding-top: 0;
}

/* Webflow default adds 8rem top/bottom; for Work we want it tighter */
.work-top .padding-section-large {
  /* add more breathing room above WORK */
  padding-top: 7.5rem;
  padding-bottom: 3.5rem;
}

/* keep the divider line, but tighten the empty band above */
.work-top .container-large > .divider-line:first-child {
  display: block;
}

/* Title animation (inspired by /contact) */
.work-header {
  /* more white space below WORK */
  margin-bottom: 5.5rem;
  text-align: center;
  overflow: hidden;
}

.work-header .heading-style-h2 {
  margin-bottom: 0;
  display: inline-block;
  transform: translate3d(0, 120%, 0);
  opacity: 0;
}

html.w-mod-js .work-header .heading-style-h2 {
  animation: workTitleIn 950ms cubic-bezier(.16, 1, .3, 1) 140ms forwards;
}

@keyframes workTitleIn {
  0% { transform: translate3d(0, 120%, 0); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .work-header .heading-style-h2 {
    transform: none;
    opacity: 1;
    animation: none !important;
  }
}

@media (max-width: 479px) {
  .work-top { padding-top: 0; }
  .work-top .padding-section-large { padding-top: 3rem; padding-bottom: 2.75rem; }
  .work-header { margin-bottom: 2rem; }
  .work-header .heading-style-h2 { font-size: 44px; }
}

/* Footer: re-assert Webflow layout on /work (some caches/scripts were overriding) */
.page-wrapper .footer .footer-component-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 28px auto auto;
  grid-row-gap: 2.1rem;
  grid-column-gap: 2.1rem;
  margin-bottom: 5rem;
}

.page-wrapper .footer .footer-content-block {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.8rem;
}

.page-wrapper .footer .footer-content-block a.social-link {
  display: inline-flex;
}
/* tighter, more "film strip" */
.work-grid {
  display: grid;
  /* reels grid: force 3 columns for a 3x3 portrait layout */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 991px) {
  /* tablets: reduce columns to 2 */
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 479px) {
  /* phones: force 1 column for narrow screens */
  .work-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 8px;
  }
  .work-tile { border-radius: 10px; }
}

.work-card {
  text-decoration: none;
  color: inherit;
}

/* tile */
.work-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f3f3;
}

.work-tile video,
.work-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* no titles on grid (premium restraint) */
.work-meta { display: none; }

/* Optional very subtle hover (no icons) */
.work-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 160ms ease;
  background: rgba(0,0,0,0.04);
  pointer-events: none;
}

.work-card:hover .work-tile::after {
  opacity: 1;
}

/* Load more */
.work-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.work-loadmore-btn {
  appearance: none;
  border: 1px solid #0a0a0a;
  background: transparent;
  color: #0a0a0a;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.work-loadmore-btn:hover {
  background: rgba(0,0,0,0.04);
}

/* filters can stay but we can hide later */
.work-filters {
  display: none; /* confidence move: no filters initially */
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

.work-filter {
  appearance: none;
  border: 1px solid #0a0a0a;
  background: transparent;
  color: #0a0a0a;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.work-filter.is-active {
  background: #0a0a0a;
  color: #fafafa;
}

/* Modal */

.work-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

/* Backdrop is the only clickable close target (prevents stealing clicks from the video controls) */
.work-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.work-modal.is-open { display: flex; }

.work-modal-panel {
  position: relative;
  z-index: 1;
  /* allow panel to size to content and center items to avoid empty black space */
  width: auto;
  max-width: min(1200px, 95%);
  max-height: 92vh;
  overflow: hidden;
  background: #000;
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 479px) {
  .work-modal { padding: 12px; }
  .work-modal-panel { padding: 12px; border-radius: 14px; }
}

/* Close button removed by request. Modal closes via tapping outside or ESC. */

.work-modal-body.is-simple {
  margin-top: 0;
  display: block;
}

@media (max-width: 991px) {
  /* collapse earlier so 16:9 screens don't waste space */
  .work-modal-body { grid-template-columns: 1fr; }
}

.work-video {
  /* adapt to the real video aspect ratio to avoid side bars */
  aspect-ratio: var(--work-video-ar, 9 / 16);
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.work-video.is-full {
  max-width: min(1100px, 100%);
  /* Fit within the modal viewport height so it never exceeds the screen */
  max-height: calc(92vh - 36px);
  margin: 0 auto;
}

@media (max-width: 479px) {
  .work-video.is-full { max-height: calc(92vh - 24px); }
}

.work-video iframe,
.work-video video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  border: 0;
  display: block;
}

/* show the whole frame (no crop) in the modal */
.work-video video {
  object-fit: contain;
  background: #000;
  /* ensure no extra spacing from inline video sizing */
  display: block;
  max-width: 100%;
}

/* force modal panel to size to content and avoid fixed large black area */
.work-modal-panel {
  width: auto !important;
  max-width: min(1100px, 95%) !important;
  padding: 12px !important;
  box-sizing: border-box !important;
}

.work-video.is-full {
  width: auto !important;
  max-width: 100% !important;
}

.work-modal-body.is-simple {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Ensure iframe/video are centered and never force panel wider */
.work-video iframe,
.work-video video {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Prevent modal panel from expanding beyond content */
.work-modal-panel {
  display: inline-flex !important;
  width: auto !important;
  max-width: 95% !important;
  padding: 60px !important; /* larger side padding requested */
  background: transparent !important; /* keep panel transparent; black bg is on video container only */
}

/* ensure the video wrapper provides the black background */
.work-video.is-full {
  background: #000 !important;
  padding: 0 !important; /* remove inner padding since panel padding creates spacing */
  border-radius: 14px !important;
}

.work-credits {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
}

.work-frames {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.work-frames img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #f3f3f3;
}

html.work-modal-open, html.work-modal-open body {
  overflow: hidden;
}

.work-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10,10,10,.6);
}

/* Make featured grid smaller: two columns x two rows with tighter max width */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.featured-card .featured-video-wrap {
  /* constrain height on large screens so the videos render smaller while keeping 16:9 */
  max-height: 360px; /* adjusts visible size while preserving 16:9 */
}

@media (max-width: 991px) {
  .featured-card .featured-video-wrap { max-height: 320px; }
}

@media (max-width: 479px) {
  .featured-grid { grid-template-columns: 1fr; gap: 18px; max-width: 100%; }
  .featured-card .featured-video-wrap { max-height: 220px; }
}

.featured-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:28px; max-width:900px; margin:0 auto; }
.featured-card .featured-video-wrap { width:100%; aspect-ratio:16/9; overflow:hidden; border-radius:8px; background:#000; }
.featured-caption { font-size:14px; opacity:0.7; margin-top:8px; }
@media (max-width:479px){ .featured-grid{grid-template-columns:1fr;} }


/* landscape tile for featured */
.work-tile.landscape {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.work-tile.landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
