/* Additions for markup the WordPress theme didn't have to style. */

/* Code blocks (replaces Code Block Pro) */
.entry-content .code-block {
  margin: 0 0 var(--sp-6, 1.5rem);
  font-family: var(--font-mono);
  font-size: .875rem;
  line-height: 1.25rem;
}
.entry-content .code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f2f2f2;
  color: #2f363c;
}
.entry-content .code-copy {
  width: 24px;
  height: 24px;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f363c' stroke-width='2'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.entry-content .code-copy:hover { opacity: .8; }
.entry-content .code-copy.copied { opacity: 1; }
.entry-content .code-block pre.shiki {
  margin: 0;
  padding: 16px 16px 16px 0;
  border-radius: 0;
  overflow-x: auto;
  tab-size: 2;
  counter-reset: line;
}
.entry-content .code-block pre.shiki code { background: none; padding: 0; font-size: inherit; border: 0; }
.entry-content .code-block .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: calc(2 * .6 * .875rem + 16px);
  padding-right: 12px;
  text-align: right;
  color: #24292e;
  opacity: .5;
  user-select: none;
}

.entry-content .gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.entry-content .gallery img { flex: 1 1 200px; max-width: calc(50% - 6px); height: auto; }
.entry-content figcaption { font-size: var(--text-sm); color: var(--c-text-muted); text-align: center; }

/* Buttons: <a class="button"> (was the WordPress button block) */
.entry-content a.button {
  display: inline-block;
  color: #fff;
  background-color: #32373c;
  border-radius: 9999px;
  padding: calc(.667em + 2px) calc(1.333em + 2px);
  text-decoration: none;
}
.entry-content a.button:hover { color: #fff; opacity: .9; }

/* Home page carousel of project banners (src/site/banners.tsx) */
.banners { position: relative; margin-bottom: var(--sp-8); }
.banners-track {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-xl);
}
.banners-track::-webkit-scrollbar { display: none; }
.banner {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: var(--sp-6);
  min-height: 300px;
  padding: 40px 32px 0 40px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  text-decoration: none;
}
.banner:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -3px; }
/* Hover: a glow rising from the bottom edge; colour per theme via --banner-glow */
.banner::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to top, var(--banner-glow, rgba(255, 255, 255, .3)), transparent 45%);
  transform: translateY(100%); transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.banner:hover::before, .banner:focus-visible::before { transform: translateY(0); }
.banner > * { position: relative; z-index: 1; }
.banner-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 40px; }
.banner-eyebrow { font: 600 12px/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.banner-title { font-size: clamp(28px, 3.3vw, 40px); font-weight: 800; line-height: 1.22; letter-spacing: -.025em; }
.banner-accent { display: block; }
.banner-text { font-size: var(--text-base); line-height: 1.55; max-width: 46ch; }
.banner-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 6px;
  padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: var(--text-base); white-space: nowrap;
  transition: transform .2s, box-shadow .2s;
}
.banner-cta span { transition: transform .2s; }
.banner:hover .banner-cta { transform: translateY(-1px); }
.banner:hover .banner-cta span { transform: translateX(3px); }
.banner-art { position: relative; align-self: end; }
/* The landing's phone (phone.css), 200px wide, sunk below the bottom edge like the landing's hero phone */
.banner-art { perspective: 1200px; }
.banner-art .phone {
  font-size: 7.15px;
  margin-bottom: -45%;
  transform: rotateY(-14deg) rotateX(4deg) rotateZ(3deg) translateY(8px);
  transition: transform .4s;
}
.banner:hover .banner-art .phone { transform: rotateY(-8deg) rotateX(2deg) rotateZ(1.5deg) translateY(0); }
.banner-badge {
  z-index: 3;
  position: absolute; top: 215px; left: -46px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  backdrop-filter: blur(8px);
  animation: banner-float 4s ease-in-out infinite;
}
@keyframes banner-float { 50% { transform: translateY(-6px); } }
.banners-dots { position: absolute; left: 40px; bottom: 14px; display: flex; gap: 6px; }
.banners-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .35); transition: width .2s, background .2s;
}
.banners-dots button[aria-current="true"] { width: 22px; background: #fff; }

/* TrackLab: the landing's dark palette, so the banner looks like the place it leads to */
.banner-tracklab {
  background:
    radial-gradient(420px 260px at 88% 10%, rgba(34, 211, 238, .28), transparent 70%),
    radial-gradient(520px 320px at 0% 110%, rgba(59, 130, 246, .38), transparent 70%),
    radial-gradient(300px 200px at 55% 120%, rgba(139, 92, 246, .3), transparent 70%),
    #070b14;
  color: #eef2f8;
  --banner-glow: rgba(34, 211, 238, .48);
}
.banner-tracklab:hover, .banner-tracklab:focus { color: #eef2f8; }
.banner-tracklab .banner-eyebrow { color: #22d3ee; }
.banner-tracklab .banner-title { color: #fff; }
.banner-tracklab .banner-accent {
  background: linear-gradient(100deg, #60a5fa 0%, #22d3ee 45%, #34d399 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.banner-tracklab .banner-text { color: #a9b4c6; }
.banner-tracklab .banner-cta { background: linear-gradient(100deg, #60a5fa, #22d3ee); color: #04121f; box-shadow: 0 10px 30px rgba(34, 211, 238, .3); }
.banner-tracklab:hover .banner-cta { box-shadow: 0 14px 40px rgba(34, 211, 238, .45); }
.banner-tracklab .banner-badge { background: rgba(34, 197, 94, .16); border: 1px solid rgba(74, 222, 128, .45); color: #4ade80; }

@media (max-width: 600px) {
  .banner { grid-template-columns: 1fr; min-height: 0; padding: 28px 24px 0; }
  .banner-body { padding-bottom: 36px; }
  .banner-art { display: none; }
  .banner-title { font-size: 26px; }
  .banner-cta { font-size: 15px; padding: 11px 16px; }
  .banners-dots { left: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .banner-badge { animation: none; }
  .banner-cta, .banner-cta span, .banner-art .phone { transition: none; }
}

/* Sidebar "News" widget (micro posts) */
.widget-news .news-item { display: flex; gap: 12px; align-items: flex-start; }
.widget-news .news-item a { display: inline; }
.widget-news .news-thumb { flex: none; display: block !important; }
.widget-news .news-thumb img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); }
.widget-news .news-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.widget-news .news-title { font-weight: 600; color: var(--c-text); }
.widget-news .news-body { color: var(--c-text-muted); line-height: 1.5; }
.widget-news .news-body p { margin: 0; }
.widget-news .news-body a { color: var(--c-accent); }
.widget-news time { font-size: var(--text-xs); color: var(--c-text-light); }

/* "Write to me" form (src/site/write.tsx) */
.write-form { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin-top: 8px; }
.write-form label { font-weight: 600; color: var(--c-text); margin-top: 10px; }
.write-form textarea, .write-form input[type="email"] {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: var(--c-text);
  background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--radius);
}
.write-form textarea { resize: vertical; min-height: 140px; }
.write-form textarea:focus, .write-form input[type="email"]:focus { outline: 2px solid var(--c-secondary); outline-offset: 1px; }
.write-form .write-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.write-form .write-privacy { font-size: var(--text-xs); color: var(--c-text-muted); margin: 4px 0 8px; }
.write-form button {
  align-self: flex-start; padding: 10px 22px; font: inherit; font-weight: 600; color: #fff;
  background: var(--c-accent); border: 0; border-radius: var(--radius); cursor: pointer;
}
.write-form button:hover { background: var(--c-accent-hover); }
.write-error { color: #b42318; background: #fef3f2; border-radius: var(--radius); padding: 8px 12px; }
.write-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Photo viewer (site.js) */
img.lb-zoomable { cursor: zoom-in; }
html.lb-lock, html.lb-lock body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; display: none; }
.lb.on { display: block; }
.lb.closing { opacity: 0; transition: opacity .2s; pointer-events: none; }
.lb-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .95); transition: opacity .2s; }
.lb-track {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-x;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box;
}
.lb-fig { display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; transition: transform .2s; }
.lb-fig img, .lb-fig video { display: block; max-width: 100%; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-cap { color: #ddd; font-size: 14px; line-height: 1.4; text-align: center; margin-top: 10px; max-width: 640px; }
@media (max-width: 700px) { .lb-slide { padding: 0; } .lb-cap { padding: 0 16px; } }

/* Spoilers: <details><summary> in post bodies */
.entry-content details {
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--c-bg-card);
  transition: border-color .2s;
}
.entry-content details:hover,
.entry-content details[open] { border-color: var(--c-secondary); border-left-color: var(--c-accent); }
.entry-content details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--c-primary);
  user-select: none;
}
.entry-content details > summary::-webkit-details-marker { display: none; }
.entry-content details > summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
  color: var(--c-accent);
  transition: transform .25s;
}
.entry-content details[open] > summary::after { content: "\2212"; }
.entry-content details > summary:focus-visible { outline: 2px solid var(--c-secondary); outline-offset: 2px; }
.entry-content details > :not(summary) { margin: 0 var(--sp-6) var(--sp-4); }
.entry-content details > :not(summary):last-child { margin-bottom: var(--sp-6); }

/* Video gallery in a post: a row of vertical thumbs, tap = the video full screen in the viewer. */
.video-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 1.5em 0; }
@media (max-width: 700px) { .video-gallery { grid-template-columns: repeat(2, 1fr); } }
.video-gallery .vg-item { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #000; }
.video-gallery img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; margin: 0; cursor: pointer; }
.video-gallery .vg-item::after { content: ''; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; pointer-events: none;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23fff'/%3E%3C/svg%3E") center / 28px no-repeat; transition: transform .15s; }
.video-gallery .vg-item:hover::after { transform: scale(1.1); }
.video-gallery img.lb-zoomable { cursor: pointer; }
.lb-fig video { height: calc(100vh - 96px); height: calc(100dvh - 96px); background: #000; }
