/* style.css — BISCOTTO portfolio */

/* ─── Reset ─────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}
*::-webkit-scrollbar { display: none; }

/* ─── Base ──────────────────────────────────────────────────── */

body {
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  line-height: 1.2;
  background: #fff;
  color: #000;
}

pre {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Layout ────────────────────────────────────────────────── */

.text-block { padding: 0 10px; }

/* Project rows: padding shifts to .proj-row-wrap so the full
   row width is clickable. Info keeps its .text-block padding. */
.text-block.proj-title-project { padding: 0; }
.proj-title-project .proj-row-wrap { padding: 0 10px; }

/* ─── Accordion rows ────────────────────────────────────────── */

.proj-row-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.proj-row-wrap:hover .proj-row {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.proj-row-wrap.is-open:hover .proj-row { text-decoration: none; }

.proj-row { flex: 1; }
.proj-row.open { font-weight: bold; }

.proj-desc { padding: 0 0 6px; }

/* ─── Gallery ───────────────────────────────────────────────── */

.proj-gallery-wrap {
  width: 100%;
  padding: 0 10px;
  margin-bottom: 10px;
}
.proj-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (pointer: fine) {
  .proj-gallery { grid-template-columns: repeat(12, 1fr); }
}
@media (pointer: coarse) {
  .proj-gallery { grid-template-columns: 1fr !important; }
}
.proj-gallery img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}
@media (pointer: coarse) {
  .proj-gallery img { cursor: default; }
}

/* ─── Lightbox ──────────────────────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--lbbg, #fff);
  z-index: 100;
}
#lb-img {
  width: 100%;
  height: calc(100% - 80px);
  object-fit: contain;
  display: block;
  margin: 40px 0;
}
#lb-counter {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 2;
}
#lb-prev, #lb-next {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
}
#lb-prev { left: 0;  cursor: w-resize; }
#lb-next { right: 0; cursor: e-resize; }

/* ─── Keyboard legend ───────────────────────────────────────── */

#kbd-legend {
  position: fixed;
  bottom: 10px;
  right: 12px;
  color: #000;
  z-index: 200;
}
body.t-black #kbd-legend { color: #fff; }

#zoom-hint { display: none; }
#esc-hint  { display: none; }

#zoom-btn, #esc-btn, #theme-btn { cursor: pointer; }
#zoom-btn:hover, #esc-btn:hover, #theme-btn:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Dim inactive rows when a project is open ──────────────── */

body.has-open .proj-row-wrap:not(.is-open) .proj-row { color: #999; }
body.t-black.has-open .proj-row-wrap:not(.is-open) .proj-row { color: #555; }

/* ─── Themes ────────────────────────────────────────────────── */

:root { --lbbg: #fff; }

body.t-black {
  background: #000;
  color: #fff;
  --lbbg: #000;
}
body.t-black a { color: #fff; }

body.t-beige {
  background: #b0b0b0;
  --lbbg: #b0b0b0;
}

/* ─── Hover thumbnail ───────────────────────────────────────── */

#hover-thumb {
  position: fixed;
  pointer-events: none;
  z-index: 300;
  display: none;
  width: var(--thumb-w, 80px);
  height: auto;
}

/* ─── Live dot ──────────────────────────────────────────────── */

@keyframes blink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.dot-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: blink 1s step-start infinite;
}

/* ─── Mobile ────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .text-block { padding: 0 14px; }
}
