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

img {
  max-inline-size: 100%;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #070707;
  padding: 3rem;

  background: fixed
      linear-gradient(#070707, #070707 6px, transparent 6px, transparent),
    fixed linear-gradient(transparent, #fff 90%),
    fixed
      repeating-linear-gradient(
        #efefef,
        #efefef 1px,
        transparent 1px,
        transparent 40px
      ),
    fixed
      repeating-linear-gradient(
        to right,
        #efefef,
        #efefef 1px,
        transparent 1px,
        transparent 40px
      )
      white;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.5;
  text-align: center;
  margin-block-end: 1em;
}



.collage {
  max-width: 800px;
  margin-inline: auto;
  display: grid;
  gap: 0.5rem;
  grid-template-rows: repeat(5, 1fr);
  grid-template-columns: repeat(8, 1fr);

  grid-template-areas:
    "i  a  a  a  c  d  .. .."
    "j  a  a  a  e  e  f  .."
    ".. a  a  a  e  e  g  h"
    ".. .. b  b  k  k  .. .."
    ".. .. b  b  k  k  .. ..";
}


.collage > div {
  overflow: hidden;
  border-radius: 0.5rem;
}

.collage img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  transition: all 0.5s ease-in-out;
}

.collage img:hover {
  scale: 1.15;
  rotate: 3deg;
}

.collage-item {
  position: relative;
   padding: 0 !important; /* Forces container padding to zero */
  margin: 0;
  overflow: hidden;      /* Keeps text perfectly clipped to the image boundaries */
  display: grid; /* Stacks image and text over each other */
}

.overlay-text {
  position: absolute;
  bottom: 0;         /* Anchors text to the bottom */
  left: 0;
  width: 100%;       /* Spans across the entire image width */
  font-size: 0.65rem;
  line-height: 1.1;
  /* Text and background styling */
  background: rgba(0, 0, 0, 0.5); /* Dark background for text readability */
  color: rgb(255, 255, 255);
  /*padding: 0.75rem;   /* Adds spacing inside the text box */
  text-align: center; /* Horizontally centers text */
  box-sizing: border-box; /* Prevents padding from breaking layout width */
}