/* ========== Reset & Base ========== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #111;
  background: #fff;
  line-height: 1.5;
}
a { color: #0a58ca; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Layout Helpers ========== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section-alt { background: #f7f7f8; }
.section-title { font-size: 32px; margin: 0 0 16px 0; }

/* ========== Header / Hero ========== */
.site-header {
  background: #0b0b0c url('../img/hero.jpg') center/cover no-repeat;
  color: #fff;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
.brand { color: #fff; font-weight: 800; font-size: 20px; }
.nav-links { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.nav-links a { color: #fff; opacity: 0.9; }
.nav-links a:hover { opacity: 1; }

.hero { padding: 80px 0 120px; max-width: 900px; }
.hero h1 { font-size: 44px; margin: 0 0 12px; }
.hero p { font-size: 18px; opacity: 0.95; margin: 0 0 24px; }

/* ========== Buttons ========== */
.btn {
  display: inline-block; background: #0a58ca; color: #fff;
  padding: 10px 16px; border: 0; border-radius: 6px;
  cursor: pointer; font-weight: 600;
}
.btn:hover { filter: brightness(1.05); }
.btn-light { background: #e9ecef; color: #111; }
.btn-light:hover { filter: brightness(0.98); }

/* ========== Filters ========== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn {
  padding: 8px 12px; border-radius: 20px; border: 1px solid #ddd;
  background: #fff; cursor: pointer;
}
.filter-btn.active { background: #111; color: #fff; border-color: #111; }

/* ========== Grid / Cards ========== */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card {
  grid-column: span 12;
  background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: transform .1s;
}
.card:hover { transform: translateY(-2px); }
.card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.card-body { padding: 12px; }
.card-title { margin: 0 0 6px; font-size: 18px; }
.card-meta { margin: 0 0 12px; color: #666; font-size: 14px; }
.shadow { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

@media (min-width: 640px) { .card { grid-column: span 6; } }
@media (min-width: 960px) { .card { grid-column: span 4; } }

/* Clickable cards */
.card.open-modal { cursor: pointer; }
.card.open-modal:focus-visible {
  outline: 2px solid #0a58ca;
  outline-offset: 2px;
}

/* ========== Empty Note ========== */
.empty-note {
  margin-top: 8px; padding: 12px 14px;
  border: 1px dashed #ccc; border-radius: 8px;
  color: #444; background: #fafafa;
}

/* Video aspect ratio helper + click-out fix */
.video-responsive {
    position: relative;
    padding-top: 56.25%;   /* 16:9 container */
    pointer-events: none;  /* container ignores clicks */
  }
  .video-responsive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 102px;
    pointer-events: auto;  /* only the player receives clicks */
  }
  


/* ========== About ========== */
.about {
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center;
}
.about-img {
  width: 100%; max-width: 420px;
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.bullets { margin: 8px 0 0; padding: 0 0 0 16px; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1.2fr; } }

/* ========== Contact ========== */
.contact-box {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  border: 1px solid #eee; border-radius: 12px; padding: 16px; background: #fff;
}
.muted { color: #666; }
@media (min-width: 640px) { .contact-box { grid-template-columns: 1fr 1fr; } }

/* ========== Footer ========== */
.site-footer { padding: 32px 0; background: #0b0b0c; color: #aaa; text-align: center; }

/* ========== Modal (single source of truth) ========== */
.modal {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px; /* outer gutter around dialog */
}
.modal[aria-hidden="false"] { display: flex; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  cursor: pointer; /* click outside to close */
}

.modal-dialog {
  position: relative; z-index: 1;
  width: min(1100px, 90vw);
  margin: 0 auto;
  padding: 24px; /* inner gutter inside the dialog */
}

.modal-close {
  position: absolute; right: -8px; top: -44px;
  font-size: 28px; background: transparent; color: #fff;
  border: 0; cursor: pointer;
}


#reel { display: none !important; }
.nav a[href="#reel"] { display: none !important; } /* optional */

/* Two-row horizontal scroller for "All" while keeping card size */
.grid.horizontal {
    display: grid;
    grid-auto-flow: column;                 /* fill rows first, then new column */
    grid-auto-columns: var(--col-width, 360px);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  
  .grid.horizontal .card {
    grid-column: auto;                      /* ignore span rules from vertical layout */
    width: var(--col-width, 360px);         /* match computed width from JS */
    scroll-snap-align: start;
  }
  
  /* Small screens fall back to normal vertical grid */
  @media (max-width: 639.98px) {
    .grid.horizontal {
      grid-auto-flow: row;
      overflow-x: visible;
      scroll-snap-type: none;
    }
    .grid.horizontal .card {
      width: auto;
      grid-column: span 12;
    }
  }
  
  
  /* Optional: slimmer horizontal scrollbar */
  .grid.horizontal::-webkit-scrollbar { height: 8px; }
  

 /* Two-row horizontal mode stays as you have it */
.grid.horizontal {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--col-width, 360px);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .grid.horizontal .card {
    grid-column: auto;
    width: var(--col-width, 360px);
    scroll-snap-align: start;
  }
  
/* Sticky edge fades on wrapper (softer) */
.hscroll {
    position: relative;
    /* If your section bg is white, keep this. If it's the gray alt section, use 247,247,248 */
    --fade-rgb: 255,255,255;  /* change to 247,247,248 for #f7f7f8 */
    --fade-w: 200px;          /* wider = softer */
    --fade-edge: 0.55;        /* max opacity at the very edge (0 to 1) */
  }
  
  .hscroll::before,
  .hscroll::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: var(--fade-w);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 2;
  }
  
  /* Left fade: strong at edge, smooth to 0 by ~75% */
  .hscroll::before {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(var(--fade-rgb), var(--fade-edge)) 0%,
      rgba(var(--fade-rgb), 0.35) 40%,
      rgba(var(--fade-rgb), 0) 75%
    );
  }
  
  /* Right fade: mirror of left */
  .hscroll::after {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(var(--fade-rgb), var(--fade-edge)) 0%,
      rgba(var(--fade-rgb), 0.35) 40%,
      rgba(var(--fade-rgb), 0) 75%
    );
  }
  
  .hscroll.show-left-fade::before  { opacity: 1; }
  .hscroll.show-right-fade::after  { opacity: 1; }
  
  
  /* Outline button for dark hero */
.btn-outline {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.75);
  }
  .btn-outline:hover { background: rgba(255,255,255,.08); }
  
  /* Space between hero buttons */
  .hero .btn + .btn { margin-left: 12px; }

  /* Full-bleed wrapper: make the scroller span the entire viewport width */
.hscroll {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0 12px; /* tiny gutter so cards don't kiss the bezel */
  }
  
  /* Two-row horizontal scroller (default for "All") */
  .grid.horizontal {
    display: grid;
    grid-auto-flow: column;                 /* fill rows, then create new column */
    grid-auto-columns: var(--col-width, 360px);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .grid.horizontal .card {
    grid-column: auto;
    width: var(--col-width, 360px);
    scroll-snap-align: start;
  }
  
  /* One-row mode for individual categories */
  .grid.horizontal.one-row {
    grid-template-rows: 1fr;
  }
  
  /* Small screens: fall back to normal vertical grid */
  @media (max-width: 639.98px) {
    .grid.horizontal { grid-auto-flow: row; overflow-x: visible; scroll-snap-type: none; }
    .grid.horizontal .card { width: auto; grid-column: span 12; }
  }
  
  /* Sticky edge fades on the full-bleed wrapper (soft) */
  .hscroll {
    --fade-rgb: 255,255,255;  /* use 247,247,248 if section bg is #f7f7f8 */
    --fade-w: 200px;          /* wider = softer */
    --fade-edge: 0.5;         /* 0..1 edge opacity */
  }
  .hscroll::before,
  .hscroll::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: var(--fade-w);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 2;
  }
  .hscroll::before {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(var(--fade-rgb), var(--fade-edge)) 0%,
      rgba(var(--fade-rgb), 0.35) 40%,
      rgba(var(--fade-rgb), 0) 75%
    );
  }
  .hscroll::after {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(var(--fade-rgb), var(--fade-edge)) 0%,
      rgba(var(--fade-rgb), 0.35) 40%,
      rgba(var(--fade-rgb), 0) 75%
    );
  }
  .hscroll.show-left-fade::before  { opacity: 1; }
  .hscroll.show-right-fade::after  { opacity: 1; }
  
  /* Dark theme for the Work section */
#work { background: #000; color: #fff; }

/* Headline */
#work .section-title { color: #fff; }

/* Filters on dark bg */
#work .filter-btn {
  background: #111;
  color: #eee;
  border: 1px solid rgba(255,255,255,.2);
}
#work .filter-btn.active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

/* Cards pop a bit more on black */
#work .card { box-shadow: 0 6px 18px rgba(0,0,0,.35); }

/* Empty state, just in case */
#work .empty-note {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
  color: #ddd;
}

/* Make the edge fades match black */
#work .hscroll { --fade-rgb: 0,0,0; }


/* Fix titles and body text inside white cards on black section */
#work .card { background: #fff; }
#work .card-body { color: #111; }
#work .card-title { color: #111; }
#work .card-meta { color: #666; } /* keep the lighter meta */


/* Category chip shown in "All" */
.cat-chip{
    display:inline-block;
    font-size:12px;
    font-weight:600;
    line-height:1;
    padding:6px 10px;
    border-radius:999px;
    background:#eee;
    color:#111;
    margin-bottom:8px;
    letter-spacing:.2px;
  }
  #work .cat-chip{ background:#e6e6e6; }      /* reads well on white cards */
  
  /* Modal video: true 16:9, no crop, fits viewport */
.modal-dialog { padding: 0; }            /* remove extra padding around the player */

.video-responsive{
  width: min(1200px, 92vw);              /* cap width */
  max-height: 88vh;                      /* cap height so it never runs off-screen */
  aspect-ratio: 16 / 9;                  /* exact 16:9 box */
  position: relative;
  margin: 0 auto;
  pointer-events: none;                   /* clicking outside iframe still closes */
}
.video-responsive iframe{
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 12px;                    /* soften corners; change to 0 if you want square */
  pointer-events: auto;                   /* keep video controls clickable */
}
