/*
 * Shared responsive overrides for every page.
 * Loaded AFTER each page's Silex CSS. Page CSS uses #id selectors, so the
 * overrides below need !important to win against them.
 */

/* ---------- All sizes: things that overflow at any width ---------- */
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* Lazy-image placeholders (js/lazy.js): black / dark gray / gray blocks that
   hold each image's space until it loads, then the photo fades in. */
img.lz { color: transparent; animation: lz-pulse 1.6s ease-in-out infinite; }
img.lz-0 { background-color: #0e0e0e; }
img.lz-1 { background-color: #1c1c1c; }
img.lz-2 { background-color: #2b2b2b; }
img.lz-in { animation: lz-fade .45s ease-out; }
@keyframes lz-pulse { 50% { filter: brightness(1.35); } }
@keyframes lz-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { img.lz, img.lz-in { animation: none; } }
iframe { background-color: #1c1c1c; }

/* Hamburger button (injected by js/menu.js) is phone-only */
.nav-burger { display: none; }

/* Header Instagram icon: the nav was a fixed 411px wide, so the icon got
   squeezed to 0px on desktop. Let the nav size to its content instead. */
[id^="i33qc-2-2"] { width: auto !important; }
[id^="id3tl-2-2"] {
  flex-shrink: 0; margin: 0 0 0 8px !important; min-height: 0 !important;
  display: flex !important; align-items: center;
}
[id^="ir05f-2-2"] { max-width: none; }

/* Mobile-menu extras injected by menu.js — hidden outside the hamburger menu */
.nav-icon, .nav-label { display: none; }

/* WORK dropdown (injected by menu.js) */
.nav-dd { position: relative; display: flex; align-items: center; }
.nav-dd > a { white-space: nowrap; }
.nav-dd > a::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 0 4px 8px;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease;
}
.nav-dd:hover > a::after, .nav-dd:focus-within > a::after { transform: translateY(3px) rotate(-135deg); }
.nav-dd__menu {
  position: absolute; top: 100%; left: 0; z-index: 200; padding-top: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-dd:hover .nav-dd__menu, .nav-dd:focus-within .nav-dd__menu {
  opacity: 1; visibility: visible; transform: none;
}
.nav-dd__panel {
  display: flex; flex-direction: column; min-width: 190px; padding: 8px;
  background: #000; border: 1.5px solid #fff; border-radius: 14px;
}
.nav-dd__panel a {
  padding: 10px 12px; border-radius: 8px;
  color: #fff; font-family: Helvetica, Arial, sans-serif;
  font-size: 20px; font-weight: 700; letter-spacing: -1px; line-height: 1;
  transition: color .15s ease, background .15s ease;
}
.nav-dd__panel a:hover, .nav-dd__panel a:focus-visible { color: #ff6000; background: rgba(255,255,255,0.08); outline: none; }

/* ---------- Text footer (shared by every page) ---------- */
.site-footer {
  background: #000; color: #fff;
  font-family: Helvetica, Arial, sans-serif;
  padding: 56px 24px 40px; text-align: center;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.site-footer__links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 64px;
}
.site-footer__links a {
  display: flex; flex-direction: column; gap: 6px;
  color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -0.5px;
  transition: color .15s ease;
}
.site-footer__links a:hover { color: #ff6000; }
.site-footer__label {
  color: #ff6000; font-size: 12px; letter-spacing: 2px; font-weight: 700;
}
.site-footer__based {
  margin: 36px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 3px;
  color: rgba(255,255,255,0.6);
}

/* Connect banner (fixed 478px tall) */
#i7mzv6 { height: auto !important; width: 1164px; max-width: 94%; }

/* Video page YouTube banner (fixed 77px tall) */
#iabjtl { height: auto !important; width: 467px; max-width: 90%; }

/* ---------- Tablet / narrow laptop ---------- */
@media (max-width: 1000px) {
  /* Header nav had 69px + 160px side margins on a 411px fixed width */
  [id^="i33qc-2-2"] { margin: 0 32px 0 24px !important; width: auto !important; gap: 18px; }
  [id^="iy8ct-2-2"] { margin: 20px 0 20px 24px !important; }
  [id^="iaxo9-2-2"] { width: 220px !important; height: auto !important; }
  [id^="i33qc-2-2"] > .silex-default-text { font-size: 20px !important; }
  [id^="ir05f-2-2"] { width: 34px !important; }

  /* Gallery rows: shrink the 16px image gutters and 75px side margins */
  [id^="i4nwq-6"]:not(#i4nwq-6-6-2-2-2):not(#i4nwq-6-6-2-2) {
    margin-left: 12px !important; margin-right: 12px !important; width: auto !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
  [id^="i4nwq-6"] > img { margin-left: 6px !important; margin-right: 6px !important; }

  /* Athletics section headings (100px) */
  #i2ec24, #il0rvq, #il0rvq-2 { font-size: 10vw !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  /* Fixed backgrounds don't work on iOS and zoom weirdly on Android */
  * { background-attachment: scroll !important; }

  /* ----- Header: logo left, hamburger right, nav drops down ----- */
  [id^="irwdn-2-2"] {
    display: flex !important; flex-direction: row !important;
    justify-content: space-between !important; align-items: center !important;
    position: relative; z-index: 100;
    height: auto !important; min-height: 0 !important;
    padding: 14px 16px; box-sizing: border-box;
  }
  [id^="iy8ct-2-2"] { margin: 0 !important; min-height: 0 !important; }
  [id^="iaxo9-2-2"] { width: 170px !important; }

  /* Only collapse the nav once menu.js has added the button */
  .has-burger [id^="i33qc-2-2"] {
    display: none !important;
    position: absolute; top: 100%; left: 0; right: 0;
    margin: 0 !important; width: auto !important; min-height: 0 !important;
    flex-direction: column !important; align-items: stretch !important; gap: 12px;
    padding: 16px 16px 24px; background: #000;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .has-burger.nav-open [id^="i33qc-2-2"] { display: flex !important; }
  /* Each menu item: full-width outlined pill, label left, icon right */
  .has-burger .nav-dd { display: contents; }
  .has-burger .nav-dd__menu, .has-burger .nav-dd > a::after { display: none; }
  .has-burger [id^="i33qc-2-2"] > a, .has-burger [id^="i33qc-2-2"] > .nav-dd > a {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    width: auto !important; margin: 0 !important; min-height: 0 !important;
    padding: 14px 18px !important;
    border: 1.5px solid #fff; border-radius: 14px;
    color: #fff !important; font-family: Helvetica, Arial, sans-serif !important;
    font-size: 22px !important; font-weight: 700 !important; letter-spacing: -1px !important;
    line-height: 1 !important; text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .has-burger [id^="i33qc-2-2"] > a:active, .has-burger .nav-dd > a:active { background: rgba(255,255,255,0.12); }
  .has-burger [id^="i33qc-2-2"] .nav-label { display: inline; }
  .has-burger [id^="i33qc-2-2"] .nav-icon {
    display: block; width: 24px; height: 24px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  /* Instagram row uses the same SVG icon style as the others */
  .has-burger [id^="i33qc-2-2"] > [id^="id3tl-2-2"] > img { display: none !important; }

  .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 10px; margin: 0;
    background: none; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-burger span {
    display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
  }
  .nav-open .nav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-open .nav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* ----- Footer: stack the contact links ----- */
  .site-footer { padding: 40px 16px 32px; }
  .site-footer__links { flex-direction: column; gap: 22px; }
  .site-footer__links a { font-size: 18px; }

  /* ----- Generic gallery rows -> 2 columns ----- */
  [id^="i4nwq-6"]:not(#i4nwq-6-6-2-2-2):not(#i4nwq-6-6-2-2) {
    flex-wrap: wrap !important; justify-content: center !important;
    align-items: flex-start !important;
    margin: 0 8px !important; padding: 4px 0 !important; min-height: 0 !important;
  }
  [id^="i4nwq-6"] > img {
    width: calc(50% - 8px) !important; height: auto !important;
    margin: 4px !important;
  }
  /* odd one out at the end of a row spans full width */
  [id^="i4nwq-6"] > img:last-child:nth-child(odd) { width: calc(100% - 8px) !important; }
  /* linked thumbnails (reels) */
  [id^="i4nwq-6"] > a { width: 50% !important; padding: 4px !important; min-height: 0 !important; }
  [id^="i4nwq-6"] > a > img { margin: 0 !important; width: 100% !important; }

  /* ----- Work / Index: category tiles 4-across -> 2x2 ----- */
  #i7jrr-2, #i7jrr-2-2 { display: flex !important; flex-wrap: wrap !important; width: 100%; min-height: 0 !important; }
  #i7jrr-2 > a, #i7jrr-2-2 > a { width: 50% !important; min-height: 0 !important; }
  #i4nwq-6-6-2-2 { display: none !important; }

  /* ----- Index ----- */
  /* hero: show the whole 4:5 image instead of a 1759px-tall crop */
  #i4nwq-6-6-2-2-2 { height: auto !important; aspect-ratio: 4 / 5; }
  #i52qxy { flex-direction: column !important; padding: 24px 0; gap: 12px; }
  #in7s56-2 { width: 75% !important; margin: 0 !important; }
  #igmdgc { width: 100% !important; margin: 0 !important; min-height: 0 !important; }
  #igmdgc { padding: 0 16px; box-sizing: border-box; }
  #imdd6w { height: 50vh !important; background-size: cover; }

  /* ----- About ----- */
  #i32elj { height: 75vh !important; height: 75svh !important; min-height: 480px; }
  #ixu9ld {
    margin: 0 20px !important; font-size: 21px !important;
    line-height: 1.15 !important; letter-spacing: -0.3px !important;
  }
  #iuq6vk { height: 220px !important; }

  /* ----- Athletics ----- */
  #ib1qkn { height: 70vh !important; height: 70svh !important; }
  #i2ec24, #il0rvq, #il0rvq-2 { font-size: 10.5vw !important; margin-left: 4px !important; }
  #iymc3i, #iymc3i-2 { height: 35vh !important; }

  /* ----- Projects ----- */
  #ir0ahj { font-size: 17vw !important; letter-spacing: -0.05em !important; }
}

/* ---------- Photo lightbox (js/lightbox.js) ---------- */
.lb-thumb { cursor: zoom-in; }
.lb-thumb:focus-visible { outline: 2px solid #ff6000; outline-offset: -2px; }
html.lb-lock, html.lb-lock body { overflow: hidden; }

.lb {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease;
}
.lb[hidden] { display: none; }
.lb.lb-open { opacity: 1; }

.lb-stage {
  margin: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 72px 96px; box-sizing: border-box;
}
.lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  opacity: 0; transition: opacity .18s ease;
  user-select: none; -webkit-user-drag: none;
}
.lb-img.lb-ready { opacity: 1; }

.lb-btn {
  position: absolute; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0;
  background: rgba(0,0,0,0.35); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.85); border-radius: 50%;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: #fff; color: #000; }
.lb-btn:focus-visible { outline: 2px solid #ff6000; outline-offset: 3px; }
.lb-btn svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lb-close { top: 18px; right: 18px; width: 46px; height: 46px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-next svg { transform: scaleX(-1); }
.lb-single .lb-prev, .lb-single .lb-next, .lb-single .lb-count { display: none; }

.lb-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.75); font: 700 13px/1 Helvetica, Arial, sans-serif;
  letter-spacing: 3px;
}

@media (max-width: 700px) {
  .lb-stage { padding: 64px 12px 84px; }
  /* arrows move under the photo on phones; swiping works too */
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; width: 46px; height: 46px; }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-count { bottom: 30px; }
  .lb-close { top: 12px; right: 12px; }
}
