:root{
  --bg:#0b0b0c; --fg:#eee; --muted:#9a9a9a; --card:#141416; --border:#242427;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;background:var(--bg);color:var(--fg);
  font-family:-apple-system,"Segoe UI",Helvetica,Arial,sans-serif;}
/* NOTE: overflow-x must be CLIP here, never HIDDEN — "hidden" forces overflow-y to
   compute as "auto", turning body into a scroll container and breaking position:sticky
   on .jd-topbar (this happened once already). "clip" trims the wall's deliberate 110%
   edge-bleed without creating a scroll container, so sticky keeps working. */
body{overflow-x:clip;}
/* watermark: the JD logo fixed dead-center behind everything, scaled to 25% of the
   viewport width so it fits every device proportionally.
   The upload is the black/transparent version — filter:invert() flips it to white. */
body::before{
  content:'';position:fixed;inset:0;z-index:0;pointer-events:none;
  background:url('https://jandanek.com/wp-content/uploads/2020/02/czarne-bez-tla-jd-logo-scaled.png') center center no-repeat;
  background-size:25vw auto;
  filter:invert(1);
  opacity:.15;
}
svg{display:block;}
a{color:inherit;}

/* ---------- header / nav ----------
   The header and search bar are wrapped together in .jd-topbar so they stick to the
   viewport as one unit — the search bar stays attached under the nav whether or not
   it's open, instead of scrolling away on its own. */
.jd-topbar{
  position:sticky;top:0;z-index:30;
  background:#0b0b0cf7;backdrop-filter:blur(6px);
}
.jd-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:20px 40px;
}
.jd-name{font-size:15px;letter-spacing:.14em;text-transform:uppercase;font-weight:600;white-space:nowrap;text-decoration:none;color:var(--fg);}
.jd-nav{display:flex;align-items:center;}
.jd-nav ul{list-style:none;display:flex;margin:0;padding:0;}
.jd-nav a{color:var(--muted);text-decoration:none;margin-left:26px;font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;transition:color .2s;}
.jd-nav a:hover{color:var(--fg);}
.jd-search-toggle{background:none;border:none;color:var(--muted);cursor:pointer;padding:6px;margin-left:18px;display:flex;}
.jd-search-toggle:hover{color:var(--fg);}
.jd-search-toggle svg{width:18px;height:18px;}
.jd-search-bar{
  display:none;align-items:center;gap:10px;max-width:900px;margin:0 auto;padding:0 40px 18px;
}
.jd-search-bar.open{display:flex;}
.jd-search-bar input{
  flex:1;background:var(--card);border:1px solid var(--border);border-radius:8px;
  padding:12px 16px;color:var(--fg);font-size:14px;
}
.jd-search-bar input:focus{outline:none;border-color:#555;}
.jd-search-close{background:none;border:none;color:var(--muted);font-size:22px;cursor:pointer;padding:4px 8px;}
.jd-search-results{padding:0 34px 40px;font-size:13px;color:var(--muted);}
.jd-search-results .jd-sr-status{padding:10px 0 20px;}
.jd-search-results .jd-sr-grid{column-count:4;column-gap:34px;}
/* search results reuse .jd-item markup but live in a column-count flow, not the wall's
   fixed-height grid — neutralize the wall's cell sizing/stagger here */
.jd-sr-grid .jd-item{display:block;height:auto;transform:none !important;break-inside:avoid;margin-bottom:26px;}
.jd-sr-grid .jd-item .jd-thumb-wrap{height:auto;display:block;}
.jd-sr-grid .jd-item img{width:100%;max-height:none;}
.jd-sr-grid .jd-item .jd-cap{position:static;opacity:1;transform:none;padding:8px 0 0;justify-content:flex-start;text-align:left;}
@media (max-width:1100px){ .jd-search-results .jd-sr-grid{column-count:3; column-gap:28px;} }
@media (max-width:700px){ .jd-search-results .jd-sr-grid{column-count:2; column-gap:16px;} }
@media (max-width:700px){
  .jd-search-bar{padding:0 16px 14px;}
  .jd-search-results{padding:0 14px 30px;}
}

.jd-burger{display:none;flex-direction:column;gap:5px;background:none;border:none;cursor:pointer;padding:6px;}
.jd-burger span{width:22px;height:2px;background:#eee;display:block;}
.jd-mobile-nav{
  display:flex;position:fixed;inset:0 0 0 auto;width:78%;max-width:320px;
  background:#111113;z-index:40;padding:80px 30px 30px;flex-direction:column;
  transform:translateX(100%);transition:transform .3s ease;border-left:1px solid var(--border);
}
.jd-mobile-nav.open{transform:translateX(0);}
.jd-mobile-nav ul{list-style:none;margin:0;padding:0;}
.jd-mobile-nav a{color:#eee;text-decoration:none;font-size:15px;letter-spacing:.06em;text-transform:uppercase;padding:14px 0;border-bottom:1px solid var(--border);display:block;}
.jd-mobile-nav-close{position:absolute;top:22px;right:24px;font-size:26px;background:none;border:none;color:#eee;cursor:pointer;}
.jd-scrim{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:35;}
.jd-scrim.open{display:block;}

/* ---------- generic content page (O mnie, Sprzedaż zdjęć, itp.) ---------- */
.jd-page, .jd-single-fallback{padding:60px 20px 100px;}
.jd-page-inner{max-width:720px;margin:0 auto;}
.jd-page-inner h1{font-size:28px;margin-bottom:8px;}
.jd-single-date{margin:0 0 24px;font-size:12px;letter-spacing:.04em;color:var(--muted);}
.jd-single-tags{margin:28px 0 4px;display:flex;flex-wrap:wrap;gap:8px;}
.jd-single-tags a{font-size:10.5px;color:#333;text-decoration:none;letter-spacing:.02em;}
.jd-single-tags a:hover{color:#666;}
.jd-back-link{font-size:10px;color:#444 !important;text-decoration:none;}
.jd-back-link:hover{color:#777 !important;}
.jd-page-content{font-size:15px;line-height:1.8;color:#d5d5d5;}
.jd-page-content a{color:#fff;text-decoration:underline;}
.jd-page-content img{max-width:100%;height:auto;}
.jd-page-content iframe{max-width:100%;}

/* ---------- photo wall (gregorcollienne.com-style scattered grid) ----------
   Their actual technique, replicated properly this time: a real CSS Grid with a FIXED
   cell height (a fraction of the viewport), images centered inside the cell and CONTAINED
   (max-width/max-height, never stretched to fill), very large row gaps, and alternate
   columns pushed down by half a row+gap so nothing lines up in neat rows.
   The earlier Grid attempt failed because cells had no fixed height, so Grid's row-height
   matching stretched tiles and exposed the tile background as a visible "frame". With a
   fixed --cell height and contained images there is nothing to stretch and no frame:
   each photo simply floats centered in its invisible cell. */
.jd-wall{
  --cell:42vh;      /* photo cell height */
  --rgap:18vh;      /* vertical distance between rows */
  display:grid;
  column-gap:5vw;
  row-gap:var(--rgap);
  /* edge-to-edge: no side padding, and the outermost columns' photos are flush with
     the viewport edges (see the nth-child justify rules per breakpoint below) —
     nothing is cut off, but there's zero margin at the sides, like the reference */
  width:100%;
  padding:8vh 0 calc(var(--cell)/2 + var(--rgap)); /* extra bottom room for the shifted columns */
}
/* column count + which columns get the half-row downward shift, per breakpoint.
   Each media query carries its own nth-child rules because the shift pattern is tied
   to the column count — a 4-column pattern applied at 3 columns would shift wrong tiles. */
/* each breakpoint: column count, the half-row downward shift for alternating columns,
   and edge-pinning — photos in the first column stick to the left viewport edge,
   photos in the last column to the right edge (cells are wider than most photos,
   which are otherwise centered) */
@media (min-width:1701px){
  .jd-wall{grid-template-columns:repeat(5,1fr);}
  .jd-wall .jd-item:nth-child(5n+2), .jd-wall .jd-item:nth-child(5n+4){transform:translateY(calc((var(--cell) + var(--rgap))/2));}
  .jd-wall .jd-item:nth-child(5n+1){justify-content:flex-start;}
  .jd-wall .jd-item:nth-child(5n){justify-content:flex-end;}
}
@media (min-width:1101px) and (max-width:1700px){
  .jd-wall{grid-template-columns:repeat(4,1fr);}
  .jd-wall .jd-item:nth-child(4n+2), .jd-wall .jd-item:nth-child(4n+4){transform:translateY(calc((var(--cell) + var(--rgap))/2));}
  .jd-wall .jd-item:nth-child(4n+1){justify-content:flex-start;}
  .jd-wall .jd-item:nth-child(4n){justify-content:flex-end;}
}
@media (min-width:701px) and (max-width:1100px){
  .jd-wall{--cell:30vh;grid-template-columns:repeat(3,1fr);column-gap:6vw;}
  .jd-wall .jd-item:nth-child(3n+2){transform:translateY(calc((var(--cell) + var(--rgap))/2));}
  .jd-wall .jd-item:nth-child(3n+1){justify-content:flex-start;}
  .jd-wall .jd-item:nth-child(3n){justify-content:flex-end;}
}
@media (max-width:700px){
  .jd-wall{--cell:20vh;--rgap:8vh;grid-template-columns:repeat(3,1fr);column-gap:4vw;padding:10vh 0 calc(var(--cell)/2 + var(--rgap));}
  .jd-wall .jd-item:nth-child(3n+2){transform:translateY(calc((var(--cell) + var(--rgap))/2));}
  .jd-wall .jd-item:nth-child(3n+1){justify-content:flex-start;}
  .jd-wall .jd-item:nth-child(3n){justify-content:flex-end;}
}

.jd-item{ position:relative;cursor:pointer;height:var(--cell);background:transparent;display:flex;align-items:center;justify-content:center; }
/* the wrap shrink-wraps the photo (img gets max-height from the --cell value directly,
   not a % chain), so anything positioned inside it — caption, play button — sits exactly
   on the photo, not somewhere in the mostly-empty grid cell */
/* overflow:hidden matters: the hover zoom scales the img beyond the wrap's box, and
   without clipping the photo grew past the caption gradient, leaving an ugly margin */
.jd-item .jd-thumb-wrap{ position:relative;max-width:100%;overflow:hidden; }
.jd-item img{max-width:100%;max-height:var(--cell);width:auto;height:auto;display:block;transition:transform .5s ease;}
.jd-item:hover img{transform:scale(1.04);}
/* caption is an overlay gradient anchored to .jd-thumb-wrap (which hugs the photo),
   so it sits exactly on the photo's bottom edge regardless of the cell's extra space */
.jd-item .jd-cap{
  position:absolute;left:0;right:0;bottom:0;padding:14px 12px 10px;
  background:linear-gradient(to top, rgba(0,0,0,.8), transparent);
  opacity:0;transform:translateY(8px);transition:all .25s ease;font-size:12.5px;line-height:1.4;
  display:flex;justify-content:space-between;align-items:flex-end;gap:8px;
}
.jd-item:hover .jd-cap{opacity:1;transform:translateY(0);}
/* touch devices: no hover, so keep the grid clean — captions/likes only appear once you open the post */
@media (hover:none){
  .jd-item .jd-cap{display:none;}
}
.jd-cap .jd-pl{color:#fff;font-weight:500;}
.jd-cap .jd-en{color:#b7b7b7;font-style:italic;}
.jd-cap .jd-mini-likes{display:flex;align-items:center;gap:4px;color:#ddd;font-size:11.5px;white-space:nowrap;flex-shrink:0;}
.jd-cap .jd-mini-likes svg{width:12px;height:12px;}

/* video post tile */
.jd-item.jd-video-post .jd-thumb-wrap{position:relative;}
.jd-item.jd-video-post .jd-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;}
.jd-item.jd-video-post .jd-play span{
  width:52px;height:52px;border-radius:50%;background:rgba(0,0,0,.45);border:1.5px solid rgba(255,255,255,.7);
  display:flex;align-items:center;justify-content:center;transition:transform .2s;
}
.jd-item.jd-video-post:hover .jd-play span{transform:scale(1.12);}
.jd-item.jd-video-post .jd-play span:after{content:'';border-style:solid;border-width:8px 0 8px 13px;border-color:transparent transparent transparent #fff;margin-left:3px;}

/* text/article post card */
.jd-item.jd-text-post{ background:var(--card);border:1px solid var(--border);padding:20px 20px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;height:var(--cell,340px); }
@media (max-width:700px){ .jd-item.jd-text-post{padding:16px;} }
.jd-text-post .jd-tp-date{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:10px;}
.jd-text-post h3{margin:0 0 12px;font-size:19px;font-weight:600;line-height:1.3;}
@media (max-width:700px){ .jd-text-post h3{font-size:16px;} }
.jd-text-post .jd-tp-media{width:100%;border-radius:4px;margin-bottom:12px;display:block;max-height:110px;object-fit:cover;}
.jd-text-post .jd-tp-body{position:relative;flex:1;overflow:hidden;font-size:13.5px;line-height:1.6;color:#c9c9c9;}
.jd-text-post .jd-tp-body::after{content:'';position:absolute;left:0;right:0;bottom:0;height:50px;background:linear-gradient(to top, var(--card), transparent);}
.jd-text-post .jd-tp-more{margin-top:14px;font-size:13px;letter-spacing:.04em;color:#fff;display:inline-flex;align-items:center;gap:6px;text-decoration:none;}
.jd-text-post .jd-tp-more:after{content:'→';transition:transform .2s;}
.jd-text-post:hover .jd-tp-more:after{transform:translateX(4px);}

/* ---------- infinite scroll sentinel ---------- */
.jd-loader{display:flex;align-items:center;justify-content:center;gap:10px;padding:30px 0 60px;color:var(--muted);font-size:13px;letter-spacing:.05em;}
.jd-spinner{width:16px;height:16px;border-radius:50%;border:2px solid #333;border-top-color:#aaa;animation:jd-spin .8s linear infinite;}
@keyframes jd-spin{to{transform:rotate(360deg);}}
.jd-loader.done{color:#555;}
.jd-loader.done .jd-spinner{display:none;}

/* ---------- instagram-style feed (fullscreen infinite viewer) ---------- */
.jd-feed{position:fixed;inset:0;background:#000;z-index:200;display:none;}
.jd-feed.open{display:block;}
.jd-feed-close{
  position:absolute;top:18px;right:20px;z-index:5;font-size:28px;color:#fff;background:rgba(0,0,0,.35);
  border:none;border-radius:50%;width:40px;height:40px;cursor:pointer;line-height:1;
}
.jd-feed-hint{
  position:absolute;top:20px;left:20px;z-index:5;color:#ccc;font-size:11.5px;letter-spacing:.04em;
  background:rgba(0,0,0,.35);padding:6px 12px;border-radius:20px;
}
.jd-feed-track{
  height:100%;overflow-y:scroll;scroll-snap-type:y mandatory;scroll-behavior:auto;
  -webkit-overflow-scrolling:touch;scrollbar-width:none;
}
/* scroll-behavior stays 'auto' here on purpose — 'smooth' fought with native mouse-wheel
   scroll-snapping and would freeze mid-scroll until an unrelated event (e.g. a mousemove)
   nudged it loose. JS calls that explicitly want an animated jump (filmstrip clicks) pass
   behavior:'smooth' directly to scrollIntoView, which still animates regardless of this. */
.jd-feed-track::-webkit-scrollbar{display:none;}
.jd-slide{
  height:100%;width:100%;scroll-snap-align:start;scroll-snap-stop:always;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  position:relative;padding:70px 20px 150px;
}
.jd-slide .jd-media{max-width:min(92vw,1200px);max-height:58vh;object-fit:contain;box-shadow:0 20px 60px rgba(0,0,0,.6);position:relative;}
.jd-slide img.jd-media{cursor:zoom-in;}
.jd-slide .jd-video-ph{
  width:min(92vw,900px);aspect-ratio:16/9;background:#000;display:flex;align-items:center;justify-content:center;
  color:#666;font-size:13px;border:1px solid #222;
}
.jd-slide iframe.jd-media, .jd-slide video.jd-media{width:min(92vw,1200px);max-height:58vh;aspect-ratio:16/9;box-shadow:0 20px 60px rgba(0,0,0,.6);}
.jd-slide .jd-cap{margin-top:18px;text-align:center;max-width:640px;}
.jd-slide .jd-cap .jd-pl{font-size:16px;font-weight:500;color:#fff;}
.jd-slide .jd-cap .jd-en{font-size:14px;font-style:italic;color:#9a9a9a;margin-top:4px;}
.jd-slide .jd-cap .jd-story{font-size:13px;color:#aaa;margin-top:10px;line-height:1.6;}
.jd-slide .jd-actions{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:10px;}
.jd-like-btn{display:flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#6e6e6e;font-size:10.5px;padding:3px 5px;}
.jd-like-btn svg{width:13px;height:13px;transition:transform .18s ease;}
.jd-like-btn.liked svg{fill:#ff4d6d;stroke:#ff4d6d;}
.jd-like-btn.pop svg{transform:scale(1.35);}
.jd-share-btn{display:flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#6e6e6e;font-size:10.5px;padding:3px 5px;}
.jd-share-btn svg{width:12px;height:12px;}
.jd-full-btn{display:flex;align-items:center;gap:4px;color:#6e6e6e;font-size:10.5px;padding:3px 5px;text-decoration:none;}
.jd-full-btn svg{width:11px;height:11px;}
.jd-full-btn:hover{color:#999;}
@media (max-width:700px){
  .jd-actions{flex-wrap:wrap;gap:10px 16px;}
  .jd-full-btn span, .jd-share-btn span{display:none;} /* keep the row from wrapping to 3 lines on small screens */
}
.jd-heart-burst{
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);pointer-events:none;
  opacity:0;color:#fff;filter:drop-shadow(0 4px 18px rgba(0,0,0,.5));
}
.jd-heart-burst svg{width:110px;height:110px;fill:#fff;}
.jd-heart-burst.burst{animation:jd-heartburst .7s ease forwards;}
@keyframes jd-heartburst{
  0%{transform:translate(-50%,-50%) scale(0);opacity:0;}
  25%{transform:translate(-50%,-50%) scale(1.15);opacity:1;}
  45%{transform:translate(-50%,-50%) scale(.95);opacity:1;}
  100%{transform:translate(-50%,-50%) scale(1.05);opacity:0;}
}
.jd-slide-counter{position:absolute;top:24px;left:50%;transform:translateX(-50%);z-index:5;font-size:12px;color:#999;letter-spacing:.08em;}

.jd-filmstrip{
  position:absolute;left:0;right:0;bottom:0;z-index:5;display:flex;gap:6px;padding:12px 14px;
  overflow-x:auto;background:linear-gradient(to top, rgba(0,0,0,.85), transparent);
  scrollbar-width:thin;
}
.jd-filmstrip .jd-fs-item{
  /* grows to fill the available row width as long as there's room (up to max-width);
     only once there are enough thumbnails that even the minimum width would overflow
     does the filmstrip's own overflow-x:auto kick in and make it scrollable */
  flex:1 1 0;min-width:52px;max-width:96px;height:52px;
  border-radius:5px;overflow:hidden;opacity:.45;cursor:pointer;
  border:2px solid transparent;transition:opacity .2s, border-color .2s;position:relative;background:#222;
}
.jd-filmstrip .jd-fs-item.active{opacity:1;border-color:#fff;}
.jd-filmstrip .jd-fs-item img{width:100%;height:100%;object-fit:cover;display:block;}

@media (max-width:700px){
  .jd-slide{padding:60px 12px 130px;}
  .jd-slide .jd-media{max-height:52vh;}
  .jd-filmstrip .jd-fs-item{min-width:42px;max-width:72px;height:42px;}
  .jd-feed-hint{font-size:10.5px;padding:5px 10px;}
}

@media (max-width:700px){
  .jd-header{padding:14px 16px;}
  .jd-nav{display:none;}
  .jd-burger{display:flex;}
}

/* ---------- cookie consent banner ---------- */
.jd-cookie-banner{
  display:none;position:fixed;left:0;right:0;bottom:0;z-index:300;
  background:#111113;border-top:1px solid var(--border);
  padding:18px 34px;display:none;align-items:center;justify-content:space-between;gap:24px;
  flex-wrap:wrap;
}
.jd-cookie-banner.show{display:flex;}
.jd-cookie-banner p{margin:0;font-size:13px;line-height:1.6;color:#ccc;max-width:640px;}
.jd-cookie-banner a{color:#fff;text-decoration:underline;}
.jd-cookie-actions{display:flex;gap:10px;flex-shrink:0;}
.jd-cookie-actions button{
  font-size:13px;padding:10px 18px;border-radius:6px;cursor:pointer;border:1px solid var(--border);
}
.jd-cookie-decline{background:none;color:#ccc;}
.jd-cookie-accept{background:#fff;color:#111;border-color:#fff;font-weight:600;}
@media (max-width:700px){
  .jd-cookie-banner{padding:16px;flex-direction:column;align-items:stretch;}
  .jd-cookie-actions{justify-content:flex-end;}
}

/* ---------- fullscreen pinch-zoom / pan image viewer ---------- */
.jd-zoom{
  position:fixed;inset:0;background:#000;z-index:400;display:none;
  overflow:hidden;touch-action:none;
}
.jd-zoom.open{display:block;}
.jd-zoom-stage{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
}
.jd-zoom-stage img{
  max-width:96vw;max-height:96vh;object-fit:contain;user-select:none;-webkit-user-drag:none;
  will-change:transform;transform-origin:center center;cursor:grab;
}
.jd-zoom-stage img.dragging{cursor:grabbing;}
.jd-zoom-close{
  position:absolute;top:18px;right:20px;z-index:5;font-size:28px;color:#fff;background:rgba(0,0,0,.35);
  border:none;border-radius:50%;width:40px;height:40px;cursor:pointer;line-height:1;
}
@media (max-width:700px){
  .jd-zoom-close{top:14px;right:14px;}
}
