:root{
  --bg:#0c1116;--panel:#111820;--panel2:#17212a;--line:#293844;
  --text:#f4f7f9;--muted:#a8b4bd;--accent:#4da3ff;--accent2:#79bcff;
  --max:1440px;
}
*{box-sizing:border-box}
html{background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif}
body{margin:0;background:linear-gradient(180deg,#0b1015 0,#0c1116 300px)}
button,select{font:inherit}
.wrap{width:min(var(--max),calc(100% - 40px));margin:auto}
.hero{border-bottom:1px solid var(--line);background:radial-gradient(circle at 80% 10%,#18324a 0,transparent 38%),#0d141b}
.hero-inner{min-height:235px;display:flex;align-items:center;justify-content:space-between;gap:40px;padding:42px 0}
.hero-logo{
  flex:0 0 170px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}
.hero-logo img{
  display:block;
  width:auto;
  max-width:170px;
  max-height:150px;
  object-fit:contain;
}
.hero-copy{flex:1 1 auto;min-width:0}
.hero-main-link{
  display:inline-block;
  margin-top:18px;
  color:#dcecff;
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  border-bottom:1px solid #52718a;
  padding-bottom:3px;
}
.hero-main-link:hover{color:#fff;border-color:#9bcfff}
.mobile-sitebar{display:none}
.eyebrow{text-transform:uppercase;letter-spacing:.14em;font-size:12px;font-weight:700;color:var(--accent2);margin-bottom:10px}
h1,h2,h3,p{margin-top:0}
h1{font-size:clamp(38px,6vw,72px);line-height:.98;margin-bottom:18px;letter-spacing:-.035em}
h2{font-size:clamp(26px,3vw,38px);margin-bottom:7px}
.intro{max-width:760px;color:#c4ced5;font-size:17px;line-height:1.65;margin-bottom:0}
.hero-stat{min-width:180px;padding:24px;border:1px solid #31516a;background:rgba(17,24,32,.8);text-align:center}
.hero-stat strong{display:block;font-size:42px}
.hero-stat span{display:block;color:var(--muted);font-size:13px;margin-top:5px}
.tabs{display:flex;gap:8px;padding:28px 0 20px;border-bottom:1px solid var(--line)}
.tab,.secondary{border:1px solid #3a4d5c;background:#111820;color:#dfe8ee;padding:10px 15px;cursor:pointer}
.tab:hover,.secondary:hover{border-color:#66829a}
.tab.active{background:#e9f4ff;color:#071019;border-color:#e9f4ff;font-weight:700}
.toolbar{display:grid;grid-template-columns:2fr .85fr 1fr 1.5fr 1.15fr;gap:14px;padding:24px 0 8px}
.field span{display:block;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.08em;margin:0 0 7px 2px}
.field select{width:100%;background:#111820;color:var(--text);border:1px solid #3a4d5c;padding:12px}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:20px;padding:24px 0 18px}
.muted{color:var(--muted);line-height:1.5;margin-bottom:0}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}
.card{background:var(--panel);border:1px solid var(--line);min-width:0}
.imgbox{height:300px;background:#050708;display:flex;align-items:center;justify-content:center;overflow:hidden;cursor:zoom-in;position:relative}
.imgbox img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block;transition:transform .18s ease}
.imgbox:hover img{transform:scale(1.015)}
.zoom-hint{position:absolute;right:8px;bottom:8px;background:rgba(0,0,0,.7);padding:5px 7px;font-size:11px;color:#fff;opacity:0;transition:opacity .15s}
.imgbox:hover .zoom-hint{opacity:1}
.card-body{padding:15px 16px 17px}
.card-title{font-size:18px;line-height:1.25;margin-bottom:6px;overflow-wrap:anywhere}
.member{color:#dce8ef;font-size:14px;margin-bottom:10px}
.meta{color:var(--muted);font-size:12px;line-height:1.55}
.result{display:inline-block;margin-top:10px;padding:4px 7px;border:1px solid #3c5264;color:#d7e6f1;font-size:11px}
.result.award{border-color:#8a7435;color:#ffe8a4;background:#2a2517}
.empty{padding:70px 20px;text-align:center;color:var(--muted);border:1px dashed #354754}
footer{margin-top:50px;border-top:1px solid var(--line);padding:25px 0 40px;color:#7f8d97;font-size:12px;line-height:1.5}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.9);display:none;align-items:center;justify-content:center;z-index:9999;padding:22px;backdrop-filter:blur(4px)}
.lightbox.open{display:flex}
.lightbox-inner{max-width:96vw;max-height:96vh;background:#080b0e;border:1px solid #344653;box-shadow:0 25px 90px rgba(0,0,0,.8);padding:14px;display:flex;flex-direction:column;align-items:center}
.lightbox img{max-width:92vw;max-height:80vh;width:auto;height:auto;object-fit:contain;display:block}
.lightbox-caption{width:100%;padding:12px 5px 2px;text-align:center;color:#cbd6dd;font-size:13px;line-height:1.5}
.lightbox-title{color:#fff;font-size:18px;font-weight:700;margin-bottom:4px}
.lightbox-close,.lightbox-nav{position:fixed;color:#fff;background:rgba(0,0,0,.55);border:1px solid #65727b;cursor:pointer;z-index:10000}
.lightbox-close{top:16px;right:20px;font-size:38px;line-height:1;padding:1px 10px 5px}
.lightbox-nav{top:50%;transform:translateY(-50%);font-size:40px;line-height:1;padding:11px 14px}
.lightbox-prev{left:18px}.lightbox-next{right:18px}
@media(max-width:800px){
  .hero-inner{min-height:0;padding:36px 0}.hero-logo{flex-basis:130px}.hero-logo img{max-width:130px;max-height:120px}.hero-stat{display:none}
  .toolbar{grid-template-columns:1fr}.section-heading{align-items:start}
  .gallery{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
  .imgbox{height:330px}
}
@media(max-width:520px){
  .wrap{width:min(100% - 24px,var(--max))}
  .gallery{grid-template-columns:1fr}.imgbox{height:430px}
  .section-heading{display:block}.secondary{margin-top:14px}
  .lightbox{padding:8px}.lightbox-inner{padding:7px}.lightbox img{max-width:96vw;max-height:78vh}
  .lightbox-nav{font-size:28px;padding:9px 10px}.lightbox-prev{left:5px}.lightbox-next{right:5px}
}


/* Incremental gallery rendering */
.load-more-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:28px 0 8px;
}
.load-more-status{
  color:var(--muted);
  font-size:13px;
}
.load-more{
  min-width:190px;
  border:1px solid #52718a;
  background:#172737;
  color:#f4f7f9;
  padding:12px 20px;
  cursor:pointer;
  font-weight:700;
}
.load-more:hover{
  background:#20384d;
  border-color:#79a7c9;
}

/* Zenfolio iframe mode: ?embed=1
   Keeps the WCC page header/footer outside the iframe and makes the gallery
   read as native content inside the Zenfolio Custom Page. */
body.embed-mode{
  background:var(--bg);
}
body.embed-mode .hero{
  background:var(--bg);
  border-bottom:1px solid var(--line);
}
body.embed-mode .hero-inner{
  min-height:0;
  padding:22px 0 18px;
}
body.embed-mode .hero .eyebrow,
body.embed-mode .hero-logo,
body.embed-mode .hero-main-link,
body.embed-mode .hero-stat,
body.embed-mode footer{
  display:none;
}
body.embed-mode h1{
  font-size:clamp(30px,4vw,42px);
  margin-bottom:8px;
  letter-spacing:-.02em;
}
body.embed-mode .intro{
  font-size:15px;
  line-height:1.5;
  max-width:900px;
}
body.embed-mode .tabs{
  padding-top:18px;
}
body.embed-mode .wrap{
  width:min(var(--max),calc(100% - 24px));
}

@media(max-width:520px){
  .load-more-wrap{padding-top:20px}
  .load-more{width:100%}
}


/* Ensure the Load More block is genuinely removed when no more images remain.
   This is required because .load-more-wrap sets display:flex. */
.load-more-wrap[hidden]{
  display:none !important;
}


/* Zenfolio iframe lightbox:
   In embed mode the outer Zenfolio page does the scrolling. A viewport-fixed
   overlay inside a tall iframe can therefore appear far below the clicked
   thumbnail. Anchor the overlay to the clicked gallery row instead. */
body.embed-mode .lightbox{
  position:absolute;
  left:0;
  right:0;
  bottom:auto;
  width:100%;
  height:auto;
  min-height:720px;
  padding:22px;
  align-items:center;
  justify-content:center;
}

body.embed-mode .lightbox-inner{
  max-width:calc(100% - 80px);
  max-height:680px;
}

body.embed-mode .lightbox img{
  max-width:calc(100vw - 120px);
  max-height:580px;
}

body.embed-mode .lightbox-close,
body.embed-mode .lightbox-nav{
  position:absolute;
}

body.embed-mode .lightbox-close{
  top:14px;
  right:20px;
}

body.embed-mode .lightbox-nav{
  top:50%;
}

body.embed-mode .lightbox-prev{left:18px}
body.embed-mode .lightbox-next{right:18px}

@media(max-width:700px){
  body.embed-mode .lightbox{
    min-height:620px;
    padding:10px;
  }
  body.embed-mode .lightbox-inner{
    max-width:calc(100% - 28px);
    max-height:590px;
  }
  body.embed-mode .lightbox img{
    max-width:calc(100vw - 48px);
    max-height:500px;
  }
}


/* v10: In Zenfolio embed mode the enlarged image should begin at the clicked
   row, not be vertically centred hundreds of pixels lower inside the overlay. */
body.embed-mode .lightbox{
  justify-content:flex-start !important;
  align-items:center !important;
  min-height:0 !important;
  height:auto !important;
  padding:8px 22px 22px !important;
}

body.embed-mode .lightbox-inner{
  margin-top:0 !important;
  max-height:none !important;
}

body.embed-mode .lightbox img{
  max-height:650px !important;
}

body.embed-mode .lightbox-nav{
  top:325px !important;
}

@media(max-width:700px){
  body.embed-mode .lightbox{
    padding:6px 10px 16px !important;
  }
  body.embed-mode .lightbox img{
    max-height:540px !important;
  }
  body.embed-mode .lightbox-nav{
    top:270px !important;
  }
}


/* v12: correct flex-axis alignment for the Zenfolio embedded lightbox.
   .lightbox is a flex ROW. Therefore:
   - justify-content controls horizontal alignment
   - align-items controls vertical alignment
   Keep the viewer centred horizontally and aligned to the top vertically. */
body.embed-mode .lightbox{
  justify-content:center !important;
  align-items:flex-start !important;
}

body.embed-mode .lightbox-inner{
  margin-left:auto !important;
  margin-right:auto !important;
}

body.embed-mode .lightbox img{
  margin-left:auto !important;
  margin-right:auto !important;
}




/* v17 refined pagination */
.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  margin:34px 0 6px;
  padding:0;
}

.pagination[hidden]{
  display:none !important;
}

.page-button{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid #3c5a70;
  background:#111c25;
  color:#f3f6f8;
  min-width:118px;
  height:42px;
  padding:0 18px;
  border-radius:3px;
  font:inherit;
  font-size:14px;
  font-weight:700;
  line-height:40px;
  text-align:center;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}

.page-button:hover:not(:disabled){
  background:#183044;
  border-color:#5faee3;
  transform:translateY(-1px);
}

.page-button:focus-visible{
  outline:2px solid #5faee3;
  outline-offset:3px;
}

.page-button:disabled{
  opacity:.35;
  cursor:default;
  transform:none;
}

.page-status{
  min-width:290px;
  text-align:center;
  color:#c2ccd4;
  font-size:13px;
  line-height:1.4;
  letter-spacing:.01em;
}

@media(max-width:650px){
  .pagination{
    gap:10px;
    flex-wrap:wrap;
    margin-top:26px;
  }

  .page-status{
    order:-1;
    width:100%;
    min-width:0;
    margin-bottom:2px;
  }

  .page-button{
    flex:1 1 140px;
    max-width:180px;
  }
}

/* v20: purpose-built mobile experience for the standalone GitHub gallery. */
.mobile-filter-bar{display:none}

@media(max-width:768px){
  body:not(.embed-mode){
    background:#080b0e;
  }

  body:not(.embed-mode) .wrap{
    width:100%;
    padding-left:12px;
    padding-right:12px;
  }

  body:not(.embed-mode) main.wrap{
    padding-bottom:10px;
  }

  body:not(.embed-mode) .tabs{
    position:sticky;
    top:0;
    z-index:40;
    gap:6px;
    padding:10px 0;
    background:rgba(8,11,14,.96);
    backdrop-filter:blur(10px);
    border-bottom:1px solid #25313a;
  }

  body:not(.embed-mode) .tab{
    flex:1 1 50%;
    min-height:44px;
    padding:9px 8px;
    font-size:14px;
    border-radius:4px;
  }

  body:not(.embed-mode) .mobile-filter-bar{
    display:block;
    padding:12px 0 0;
  }

  body:not(.embed-mode) .filter-toggle{
    width:100%;
    min-height:44px;
    border:1px solid #3a5367;
    border-radius:4px;
    background:#121c24;
    color:#eef5fa;
    font-weight:700;
    font-size:14px;
  }

  body:not(.embed-mode) .toolbar{
    grid-template-columns:1fr 1fr;
    gap:10px;
    padding:12px 0 4px;
  }

  body:not(.embed-mode) .toolbar.mobile-collapsed{
    display:none;
  }

  body:not(.embed-mode) .field:first-child,
  body:not(.embed-mode) .field:nth-child(4){
    grid-column:1 / -1;
  }

  body:not(.embed-mode) .field span{
    margin-bottom:5px;
    font-size:10px;
  }

  body:not(.embed-mode) .field select{
    min-height:44px;
    padding:9px 10px;
    border-radius:4px;
    font-size:14px;
  }

  body:not(.embed-mode) .section-heading{
    display:flex;
    align-items:center;
    gap:10px;
    padding:16px 0 12px;
  }

  body:not(.embed-mode) .section-heading h2{
    font-size:22px;
    line-height:1.15;
    margin-bottom:3px;
  }

  body:not(.embed-mode) .section-heading .muted{
    font-size:12px;
    line-height:1.35;
  }

  body:not(.embed-mode) .secondary{
    min-height:40px;
    margin:0 0 0 auto;
    padding:8px 11px;
    font-size:12px;
    white-space:nowrap;
    border-radius:4px;
  }

  body:not(.embed-mode) .gallery{
    display:block;
  }

  body:not(.embed-mode) .card{
    margin:0 0 16px;
    border:0;
    border-radius:6px;
    overflow:hidden;
    background:#11171c;
    box-shadow:0 1px 0 rgba(255,255,255,.04);
  }

  body:not(.embed-mode) .imgbox{
    height:auto;
    min-height:0;
    display:block;
    background:#050607;
  }

  body:not(.embed-mode) .imgbox img{
    width:100%;
    max-width:none;
    height:auto;
    max-height:none;
    object-fit:contain;
  }

  body:not(.embed-mode) .imgbox:hover img{
    transform:none;
  }

  body:not(.embed-mode) .zoom-hint{
    display:none;
  }

  body:not(.embed-mode) .card-body{
    padding:11px 12px 13px;
  }

  body:not(.embed-mode) .card-title{
    font-size:17px;
    line-height:1.22;
    margin-bottom:3px;
  }

  body:not(.embed-mode) .member{
    font-size:13px;
    margin-bottom:6px;
    color:#e1e8ed;
  }

  body:not(.embed-mode) .meta{
    font-size:11px;
    line-height:1.45;
  }

  body:not(.embed-mode) .result{
    margin-top:7px;
    padding:3px 6px;
    font-size:10px;
    border-radius:3px;
  }

  body:not(.embed-mode) .pagination{
    margin:20px 0 4px;
    gap:8px;
  }

  body:not(.embed-mode) .page-status{
    font-size:12px;
  }

  body:not(.embed-mode) .page-button{
    min-height:44px;
    height:44px;
    line-height:42px;
    max-width:none;
    border-radius:4px;
  }

  body:not(.embed-mode) footer{
    display:none;
  }

  /* Full-screen mobile viewer. */
  body:not(.embed-mode) .lightbox{
    padding:0;
    background:#000;
    align-items:stretch;
    justify-content:stretch;
    backdrop-filter:none;
  }

  body:not(.embed-mode) .lightbox-inner{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:none;
    padding:52px 0 0;
    border:0;
    background:#000;
    box-shadow:none;
    justify-content:center;
  }

  body:not(.embed-mode) .lightbox img{
    width:100%;
    max-width:100vw;
    height:auto;
    max-height:calc(100dvh - 155px);
    object-fit:contain;
  }

  body:not(.embed-mode) .lightbox-caption{
    margin-top:auto;
    padding:10px 44px calc(12px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.92) 24%);
    font-size:11px;
    line-height:1.35;
  }

  body:not(.embed-mode) .lightbox-title{
    font-size:16px;
    margin-bottom:2px;
  }

  body:not(.embed-mode) .lightbox-close{
    top:calc(8px + env(safe-area-inset-top));
    right:10px;
    width:42px;
    height:42px;
    padding:0;
    border:0;
    border-radius:50%;
    background:rgba(20,20,20,.78);
    font-size:34px;
    line-height:38px;
  }

  body:not(.embed-mode) .lightbox-nav{
    width:42px;
    height:54px;
    padding:0;
    border:0;
    border-radius:4px;
    background:rgba(20,20,20,.58);
    font-size:28px;
  }

  body:not(.embed-mode) .lightbox-prev{left:4px}
  body:not(.embed-mode) .lightbox-next{right:4px}

  body:not(.embed-mode) #iotySection .section-heading{
    padding-top:18px;
  }

  body:not(.embed-mode) #iotySection .eyebrow{
    margin-bottom:5px;
  }
}

@media(max-width:390px){
  body:not(.embed-mode) .toolbar{
    grid-template-columns:1fr;
  }

  body:not(.embed-mode) .field:first-child,
  body:not(.embed-mode) .field:nth-child(4){
    grid-column:auto;
  }
}

/* v21: mobile standalone branding and route back to the main Zenfolio site. */
@media(max-width:768px){
  body:not(.embed-mode) .mobile-sitebar{
    position:sticky;
    top:0;
    z-index:60;
    height:54px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:6px 12px;
    padding-left:max(12px,env(safe-area-inset-left));
    padding-right:max(12px,env(safe-area-inset-right));
    background:rgba(8,11,14,.98);
    border-bottom:1px solid #26343e;
    backdrop-filter:blur(10px);
  }

  body:not(.embed-mode) .mobile-brand{
    height:42px;
    min-width:54px;
    display:flex;
    align-items:center;
    text-decoration:none;
  }

  body:not(.embed-mode) .mobile-brand img{
    display:block;
    width:auto;
    max-width:128px;
    max-height:42px;
    object-fit:contain;
  }

  body:not(.embed-mode) .mobile-main-link{
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 11px;
    border:1px solid #3a5367;
    border-radius:4px;
    color:#eef5fa;
    background:#121c24;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
  }

  body:not(.embed-mode) .hero{
    display:none;
  }

  body:not(.embed-mode) .tabs{
    top:54px;
  }
}
