 :root {
        --bg: #ffffff;
        --ink: #1a1a1a;
        --muted: #6d6d6d;
        --line: #e6e2da;
        --frame: #f5f3ef;
        --overlay-bg: rgba(22, 22, 22, 0.94);
        --overlay-ink: #f5f2ec;
        --overlay-muted: #c9c4b8;
      }
      @media screen and (prefers-color-scheme: dark) {
        :root {
          --bg: #141414;
          --ink: #f0ede7;
          --muted: #a49d90;
          --line: #2e2c28;
          --frame: #1e1d1b;
          --overlay-bg: rgba(8, 8, 8, 0.95);
          --overlay-ink: #f5f2ec;
          --overlay-muted: #b8b2a6;
        }
      }
      * { box-sizing: border-box; }
/* .intro { text-align: center; max-width: 680px; margin: 40px auto 8px; }
      .intro h1 {
        font-family: 'robotolight';
        font-weight: 400;
        font-size: clamp(19px, 3vw, 28px);
        letter-spacing: 0.22em;
        text-transform: uppercase;
        margin: 0 0 18px;
      }
      .intro p { font-size: 17px; line-height: 1.65; color: var(--muted); margin: 0; } */
      .hint {
        text-align: center;
        font-family: 'robotolight';
        font-size: 12.5px;
        /* letter-spacing: 0.28em; */
        text-transform: uppercase;
        color: var(--muted);
        margin: 26px 0 30px;
      }
      .grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 30px 80px;
      }
	  .card { margin: 0; outline: none; min-width: 0; }
      .pub {
        font-family: 'robotolight';
        font-size: 12px;
        /* letter-spacing: 0.16em; */
        text-transform: uppercase;
        text-align: center;
        color: var(--muted);
        margin: 12px 4px 0;
        line-height: 1.5;
        overflow-wrap: break-word;
      }
      .pub-pdf {
        display: block;
        text-align: center;
        margin-top: 7px;
        font-family: 'robotolight';
        font-size: 11.5px; font-weight: 500;
		letter-spacing: 0px !important;
        /* letter-spacing: 0.18em; */ text-transform: uppercase;
        color: var(--ink);
        text-decoration: underline;
        text-underline-offset: 3px;
      }
      .pdf-badge {
        position: absolute; top: 8px; right: 8px; z-index: 2;
        font-family: 'robotolight';
        font-size: 10px; font-weight: 500;
        /* letter-spacing: 0.18em; */ text-transform: uppercase;
        background: var(--ink); color: var(--bg);
        padding: 3px 7px 2px;
        pointer-events: none;
      }
/* Image cover */
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--frame);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px;
  transition: transform 0.3s ease;
}

.cover:hover img {
  transform: scale(1.03);
}

/* Hide the original text overlay inside each image card */
.cover .overlay {
  display: none;
}

/* Full-screen popup background */
.content-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Show popup */
.content-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Popup content box */
.content-modal-box {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 35px;
  background: var(--overlay-bg);
  color: var(--overlay-ink);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.content-modal.active .content-modal-box {
  transform: translateY(0);
}

/* Popup heading */
.content-modal-box h3 {
  font-family: 'robotolight', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  text-transform: uppercase;
  margin: 0 35px 18px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(245, 242, 236, 0.28);
}

/* Popup description */
.content-modal-box p {
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  color: var(--overlay-ink);
}

/* Close button */
.content-modal-close {
  position: absolute;
  top: 12px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--overlay-ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.content-modal-close:hover {
  opacity: 0.7;
}

/* Prevent page scrolling while popup is open */
body.modal-open {
  overflow: hidden;
}
  @media screen and (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
 @media screen and (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Mobile styling */
@media screen and (max-width: 620px) {
  .content-modal {
    padding: 16px;
  }

  .content-modal-box {
    max-height: 85vh;
    padding: 25px 20px;
  }

  .content-modal-box h3 {
    font-size: 16px;
  }

  .content-modal-box p {
    font-size: 14px;
    line-height: 1.7;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cover img,
  .content-modal,
  .content-modal-box {
    transition: none;
  }
}