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

img {
  max-inline-size: 100%;
}
.logo:hover{
    transform: scale(1.1);
}
.logo{
      display: flex;
      justify-content: center;
      font-size: 2rem;
      color: #b74b4b;
      font-weight: 800;
      cursor: pointer;
      transition: 0.5s ease;
}
body {
  font-family: system-ui, sans-serif;
  color: #070707;
  background-image: url("../background/bg.png");
  background-size: cover;
  min-height: 100vh;
  margin: 0;
  /* REMOVE display: grid and grid-template-columns from here */
}

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


.sidebar {
    /* grid-column: sidebar; <--- REMOVE THIS */
    width: 260px;
    height: 100vh;
     background-color: #343a40;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000; /* Keeps it above the images */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
}

.sidebar .logo img {
    width: 180px;   /* or 160–220px */
    height: auto;
}
.sidebar .logo {
    display: block;
    text-align: center;
}
.main {
    margin-left: 260px; 
    padding: 40px;
    color: white;
    
}
/* Photo Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  grid-auto-rows: 12.5rem;
  grid-auto-flow: dense;
  gap: 0.75rem;
}

.gallery figure {
  /* container-type: inline-size; */
  container: figure / inline-size;
  overflow: hidden;

  display: grid;
  /* grid-template-columns: 1fr; */
  /* grid-template-rows: 1fr; */

  /*
    Because 1fr = minmax(auto, 1fr),
    to prevent the grid blowout,
    set the minimum to zero.
  */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.gallery img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;

  /* grid-row: 1 / -1; */
  /* grid-column: 1 / -1; */
  grid-area: 1 / 1 / -1 / -1;

  transition: scale 1s ease-in-out;
}

.gallery figure:hover img {
  scale: 1.125;
}

.gallery figcaption {
  grid-area: 1 / 1 / -1 / -1;
  align-self: end;
  z-index: 1;

  padding: 3em 15% 1em 1em;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.3;
  background: linear-gradient(transparent 25%, rgb(0 0 0 / 0.75));
  display: none;
}

@container figure (width > 20rem) {
  .gallery figcaption {
    display: block;
  }
}

.gallery figcaption h3 {
  font-size: 1.0625rem;
}

.gallery figcaption p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (width > 600px) {
  .gallery figure:nth-child(1) {
    grid-area: span 2 / span 2;
  }

  .gallery figure:nth-child(4n + 1) {
    grid-row: span 2;
  }

  .gallery figure:nth-child(4n + 2) {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: 70px;
        position: fixed;
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 20px;
    }

    .sidebar .logo img {
        width: 140px;
    }

    .main {
        margin-left: 0;
        margin-top: 70px;
    }
}
