/* color vars injected by home.php from Kirby site fields */

/* ── New Computer Modern Serif ── */
@font-face {
  font-family: 'NewCM';
  src: url('/assets/fonts/NewCM10-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NewCM';
  src: url('/assets/fonts/NewCM10-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'NewCM';
  src: url('/assets/fonts/NewCM10-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NewCM';
  src: url('/assets/fonts/NewCM10-BoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'NewCM', Georgia, serif;
  background: var(--color-1);
  min-height: 100vh;
}

#grid {
  position: fixed;
  inset: var(--margin);
  display: grid;
  gap: var(--gap-size);
  background: #dcd3bd;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

@media (min-width: 768px) {
  #grid { grid-template-columns: repeat(5, 1fr); }
}

.cell {
  transition: background-color 0.12s ease-in-out;
  position: relative;
  overflow: hidden;
}

.cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 12px 12px;
  pointer-events: none;
}

.cell .photo-content {
  display: none;
  width: 100%;
  height: 100%;
}

.cell .photo-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cell .bio-content {
  display: none;
  width: 100%;
  box-sizing: border-box;
  height: 100%;
  align-items: center;
  padding: 1.4rem 1.2rem;
  overflow-y: auto;
  flex-direction: column;
  justify-content: center;
}

.cell .bio-content p {
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  color: rgb(35, 35, 35);
  margin-bottom: 0.75em;
}

.cell .bio-content p:last-child {
  margin-bottom: 0;
}

.cell .bio-content a {
  color: inherit;
  text-decoration: underline;
}

.cell.revealed-photo {
  background: #c8c8c8 !important;
  transition: none;
}

.cell.revealed-photo::after { display: none; }

.cell.revealed-photo .photo-content { display: block; }

.cell.revealed-bio {
  background: var(--color-8) !important;
  transition: none;
  overflow: hidden;
}

.cell.revealed-bio::after { display: none; }

.cell.revealed-bio .bio-content { display: flex; }

/* ── nav cells ── */
.cell.revealed-nav {
  transition: background-color 0.12s ease-in-out;
  overflow: hidden;
}

.cell .nav-content {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  font-family: 'NewCM', Georgia, serif;
  font-size: clamp(12px, 2vw, 35px);
  text-align: center;
  padding: 1rem;
  gap: 0.15em;
}

.cell.revealed-nav .nav-content {
  display: flex;
}

.cell .nav-label {
  text-decoration: none;
}

.cell.revealed-nav:hover .nav-label {
  text-decoration: underline;
}

.cell .nav-content.is-active .nav-label {
  text-decoration: underline;
}

.cell .nav-arrow {
  font-size: 0.7em;
  font-weight: bold;
  text-decoration: none !important;
  align-self: center;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.cell.revealed-nav:hover .nav-arrow {
  opacity: 1;
}

/* ── work content cell ── */
.cell.revealed-work {
  background: #ffffff !important;
  transition: none;
  overflow: visible;
}

.cell.revealed-work::after { display: none; }

.cell .work-content {
  display: none;
  width: 100%;
  box-sizing: border-box;
  padding: 2.5rem 1.5rem;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .cell .work-content {
    width: calc(100% + 10px);
    margin-right: -10px;
    padding: 4rem 0;
  }

  .cell .work-content > * {
    padding-left: 3rem;
    padding-right: calc(3rem + 10px);
  }
}

.cell.revealed-work .work-content {
  display: block;
}

.cell .work-content h2 {
  font-family: 'NewCM', Georgia, serif;
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: normal;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.cell .work-content h2:first-child {
  margin-top: 0;
}

.cell .work-content p {
  font-family: 'NewCM', Georgia, serif;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  color: rgb(35, 35, 35);
  margin-bottom: 0.75rem;
}

.cell .work-content ul {
  margin: 0.5rem 0 1rem 1.2rem;
}

.cell .work-content li {
  font-family: 'NewCM', Georgia, serif;
  font-size: clamp(12px, 1vw, 16px);
  line-height: 1.7;
  color: rgb(35, 35, 35);
  margin-bottom: 0.4rem;
}

.cell .work-content a {
  color: inherit;
  text-decoration: underline;
}

.cell .work-content a:hover {
  opacity: 0.7;
}

/* ── prevent image dragging / saving ── */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* work page: hidden span cells show no dots */
.cell[style*="visibility: hidden"]::after {
  display: none;
}

/* ── scrollbar ── */
html, body {
  overflow: hidden;
}

.work-content,
.bio-content {
  scrollbar-width: thin;
  scrollbar-color: var(--color-1) var(--gap-color);
}

.work-content::-webkit-scrollbar,
.bio-content::-webkit-scrollbar {
  width: 10px;
}

.work-content::-webkit-scrollbar-track,
.bio-content::-webkit-scrollbar-track {
  background: var(--gap-color);
}

.work-content::-webkit-scrollbar-thumb,
.bio-content::-webkit-scrollbar-thumb {
  background: var(--color-1);
  border-radius: 0;
}

/* ── two column image break block ── */
.block-imagepair {
    display: flex;
    gap: 7%;
    margin: 60px 0;
    justify-content: center;
    padding: 0 !important;
}
@media (min-width: 767px) and (max-width: 1340px) {
.block-imagepair {
      gap: 10px !important;
}
}
@media (max-width: 768px) {
.block-imagepair {
      gap: 5% !important;
}
.block-imagepair img{
      width: 50px !important;
}
}

.block-imagepair img {
  width: 80px;
  height: auto;
  display: block;
}

/* ── MOBILE ── */
@media (max-width: 767px) {
  html, body {
    overflow: hidden;
    height: 100dvh;
  }

  #grid {
    position: fixed;
    inset: var(--margin);
    grid-template-rows: repeat(10, 1fr);
    grid-template-columns: repeat(2, 1fr);
  }

  .cell.nav-cell .nav-content {
    padding: 0.5rem;
    font-size: clamp(12px, 4vw, 18px);
  }

  .cell.revealed-bio,
  .cell.revealed-work {
    overflow-y: auto;
  }

  /* bio: tighter padding, no scroll thumb */
  .cell.revealed-bio .bio-content {
    padding: 1rem;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .cell.revealed-bio::-webkit-scrollbar { display: none; }
  .cell.revealed-bio { scrollbar-width: none; }

  /* photo: 170px wide, centered, 20px above/below, border all around */
  .cell.revealed-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-8) !important;
    overflow: hidden;
  }

  .cell.revealed-photo .photo-content {
    width: 160px;
    height: auto;
    display: block;
    padding: 20px 0;
  }

  .cell.revealed-photo .photo-content img {
    width: 160px;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .cell[style*="visibility: hidden"],
  .cell[style*="visibility:hidden"] {
    background: transparent !important;
  }

  .cell[style*="visibility: hidden"]::after,
  .cell[style*="visibility:hidden"]::after {
    display: none !important;
  }
}
@media (min-width: 2800px) {
.cell .work-content{
  padding: 100px 300px;
}
}