/* BODY */

body {
  background-color: black;
  color: rgba(255, 255, 255, 0.858);
  font-family: "Work Sans";
  font-size: 15px;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* HEADER */

header {
  max-width: 100%;
  margin: 0 auto;
  background-image: linear-gradient(rgba(0, 0, 0, 0.452), rgb(0, 0, 0)),
    url("../images/herobg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: none;
  padding: 70px 0;
}
header h1 {
  color: rgba(255, 173, 173, 0.398);
  font-family: "Montserrat Alternates";
  font-size: 190px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0px;
  text-align: end;
  margin-bottom: -45px;
}

/* INTRO BOXES */

.grid-3-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 0 auto;
  grid-gap: 20px;
  padding: 20px;
}

.intro-section {
  background-color: rgba(255, 173, 173, 0.144);
  padding: 20px;
}

.intro-section p {
  font-family: "Work Sans";
  font-size: 22px;
  font-weight: 300;
}

.intro-section a {
  color: rgba(255, 173, 173, 0.803); 
  text-decoration: none;
  transition: opacity 0.3s ease; 
    font-family: "Work Sans";
  font-size: 22px;
  font-weight: 300;
}

a:hover {
  opacity: 0.6; 
}

.intro-section hr {
  border: 0; 
  height: 1px; 
  background-color: rgba(255, 255, 255, 0.11);
}


.best-time-section {
  background-color: #25252587;
  padding: 20px;
}

.good-to-know-section {
  background-color: #25252587;
  padding: 20px;
}

/* MEDIA + BUCKETLIST */

.grid-2-col-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  margin: 0 auto;
  grid-gap: 20px;
  padding: 20px;
}

section.secondary {
  background-color: #25252587;
  padding: 20px;
}

.grid.grid-3-columns {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 cards in a row */
  gap: 10px; /* spacing between cards */
}

.img-responsive {
  width: 100%;
  height: 350px;
  object-fit: cover;
  display: block;
}

.card {
  background: white;
  margin: 30px 0;
  overflow: hidden;
}

.card-body {
  padding: 0px;
  color: #000000;
  font-family: "Montserrat Alternates";
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  text-transform: uppercase;
  text-align: center;
}

.card p {
  color: #000000;
  font-family: "Montserrat Alternates";
  font-weight: 500;
  font-size: clamp(8px, 2vw, 18px);
  line-height: 1.5;
  text-transform: uppercase;
  text-align: center;
}

/* CITY SECTION */

.city-section {
  display: grid;
  grid-template-columns: 2fr;
  grid-gap: 20px;
  padding: 20px;
}

.city-header {
  display: grid;
  margin: 0 auto;
  grid-template-columns: 2fr;
  background-color: #3c3c3cdd;
  color: #ffffff;
  padding: 20px;
  position: relative;
  grid-gap: 20px;
  margin: 0;
  background-repeat: no-repeat;
  background-size: cover;
}

.city-header.tokyo {
  background-image: linear-gradient(rgba(0, 0, 0, 0.745), rgba(0, 0, 0, 0.745)),
    url("../images/tokyobg2.jpg");
}

.city-header.kyoto {
  background-image: linear-gradient(rgba(0, 0, 0, 0.745), rgba(0, 0, 0, 0.745)),
    url("../images/kyotobg.jpg");
}

.city-header.osaka {
  background-image: linear-gradient(rgba(0, 0, 0, 0.745), rgba(0, 0, 0, 0.745)),
    url("../images/osakabg.jpg");
}

.city-header.hiroshima {
  background-image: linear-gradient(rgba(0, 0, 0, 0.745), rgba(0, 0, 0, 0.745)),
    url("../images/hiroshimabg.jpg");
}

.city-header p {
  font-family: "Work Sans";
  font-size: 22px;
  font-weight: 300;
}

.city-header h4 {
  font-size: 40px;
  font-family: "Montserrat Alternates";
  font-weight: 700;
  color: rgba(255, 173, 173, 0.803);
  margin: 0;
}

/* CITY INFO GRID */

.city-grid {
  display: grid;
  grid-template-columns: 2fr 2fr;
  grid-gap: 20px;
  padding: 20px;
}

.city-box {
  background-color: #25252587;
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}

.city-box h3 {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.858);
  font-size: 35px;
}

.city-box p {
  line-height: 1.6;
}

/* POLAROID */

.polaroid {
  width: 100%; /* Let grid control width */
  margin: 0; /* Remove inline-block spacing */
}

.frame {
  position: relative;
  background-image: url("../images/polaroid-frame.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  aspect-ratio: 4 / 5;
  padding: 10% 7% 27% 7%;
  box-sizing: border-box;
  overflow: hidden;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay text */
.caption {
  position: absolute;
  bottom: 8%;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(0.7rem, 1vw, 1rem);
  color: rgb(69, 69, 69);
  padding: 4px 0;
  font-family: "Montserrat Alternates";
  text-transform: uppercase;
}

/* FOOTER */

.grid-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 0 auto;
  grid-gap: 64px;
  padding: 20px;
}

footer {
  color: white;
  background-image: linear-gradient(rgba(0, 0, 0, 0.925), rgb(0, 0, 0, 0.925)),
    url("../images/footerbg1.jpg");
  background-repeat: no-repeat;
  background-size: cover;
}

footer h6 {
  color: rgba(255, 255, 255, 0.858);
  font-family: "Montserrat Alternates";
  text-transform: uppercase;
  font-weight: 300;
  font-size: 25px;
}

footer p {
  color: rgba(255, 255, 255, 0.858);
  font-family: "Work Sans";
  font-weight: 300;
  font-size: 17px;
}

footer ul {
  padding: 0;
}

footer li {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer a {
  color: white;
}

/* MAIN */

.main {
  background-color: black;
}

main h2 {
  color: rgb(255, 196, 196);
  font-family: "Montserrat Alternates";
  font-size: 27px;
  font-weight: 300;
  text-transform: uppercase;
  margin: 0;
}

main h3 {
  color: rgba(255, 255, 255, 0.858);
  font-family: "Montserrat Alternates";
  font-size: 40px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}

main h4 {
  color: rgb(0, 0, 0);
  font-family: "Work Sans";
  font-weight: 200;
  font-size: 25px;
  line-height: 1.5;
}

main h5 {
  color: rgba(255, 255, 255, 0.858);
  font-family: "Work Sans";
  font-weight: 200;
  font-size: 25px;
  line-height: -1.5px;
}

/* IMAGE GRIDS */

/* 3 or more 4:6 boxes */
.img-grid-box {
  display: flex;
  justify-content: center; /* Center images horizontally */
  gap: 1px;
  flex-wrap: nowrap; /* Prevent images from wrapping to a new row */
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.img-grid-box img {
  width: calc(33.33% - 5px);
  aspect-ratio: 4 / 6; /* Maintain 4:6 aspect ratio */
  object-fit: cover;
  display: block;
  max-width: 100%; /* Ensure the images stay within the container */
}

/* 2 - 4:6 boxes */
.img-grid-box-two {
  display: flex;
  justify-content: center; /* Center images horizontally */
  align-items: center; /* Center images vertically */
  gap: 1px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0 auto;
}

.img-grid-box-two img {
  width: 100%;
  max-width: calc(50% - 5px); /* 2 images: 50% minus half the gap */
  aspect-ratio: 4 / 6;
  object-fit: cover;
  display: block;
}

/* 3x3 food grid */
.img-grid-box-small {
  display: grid;
  grid-template-columns: repeat(
    3,
    minmax(0, 1fr)
  ); /* 3 equal, flexible columns */
  gap: 1px;
  max-width: 100%; /* limit the overall width */
  margin: 0 auto; /* center the grid */
  width: 100%; /* allow full container scaling */
}

.img-grid-box-small img {
  width: 100%;
  aspect-ratio: 1 / 1; /* keep square */
  object-fit: cover;
  display: block;
}

/* POLAROID GRID */
.polaroid-grid {
  display: grid;
  flex-wrap: nowrap;
  grid-template-columns: repeat(3, 1fr); /* 3 columns */
  gap: 1px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

/* 6x1 1 line grid - tiny */
.img-grid-box-tiny {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  overflow: visible;
}

.img-wrapper {
  position: relative;
  overflow: visible;
}

/* Image label */
.img-wrapper label img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  cursor: pointer;
  z-index: 1;
  position: relative;
}

/* Expanded image styles (generalized) */
.img-wrapper input[type="radio"]:checked ~ label img {
  transform: scale(3);
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Show close button on active image */
.img-wrapper input[type="radio"]:checked ~ .close-btn {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInScale 0.3s ease forwards;
}

/* Fade + scale animation for close button */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Close button */
.close-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 196, 196, 0);
  color: white;
  font-size: 1.5rem; /* slightly larger symbol */
  line-height: 48px; /* match height to center vertically */
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
  z-index: 20;
}

.close-btn:hover {
  background: rgba(255, 196, 196, 0.413);
  transform: translate(-50%, -50%) scale(1.1);
}

.centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Show close button only when expanded */
#img1:checked ~ .close-btn,
#img2:checked ~ .close-btn,
#img3:checked ~ .close-btn,
#img4:checked ~ .close-btn,
#img5:checked ~ .close-btn,
#img6:checked ~ .close-btn {
  opacity: 1;
  pointer-events: auto;
}

/* MEDIA QUERIES */

@media (max-width: 960px) {
  header {
    padding: 60px 0;
  }

  header h1 {
    font-size: 90px;
  }

  .grid {
    grid-template-columns: 1fr;
    grid-gap: 20px;
  }

  section {
    padding: 30px 0;
  }

  .grid-3-col-section {
    grid-template-columns: 1fr;
    grid-gap: 10px;
  }

  .grid-2-col-section {
    grid-template-columns: 1fr;
  }

  .city-grid {
    grid-template-columns: 1fr;
  }

  .city-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 65px;
  }

  .grid-3-col-section {
    grid-template-columns: 1fr;
  }

  .grid-2-col-section {
    grid-template-columns: 1fr;
  }
  .city-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .img-grid-box-small {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on medium screens */
  }
}

@media (max-width: 400px) {
  .img-grid-box-small {
    grid-template-columns: 1fr; /* 1 column on small screens */
  }
}

@media (max-width: 600px) {
  .img-grid-box-tiny {
    grid-template-columns: repeat(6, 1fr); /* 3 columns on medium screens */
  }
}

@media (max-width: 400px) {
  .img-grid-box-tiny {
    grid-template-columns: 1fr; /* 1 column on small screens */
  }
}

@media (max-width: 600px) {
  .img-wrapper input[type="radio"]:checked + img {
    transform: scale(1.5);
  }
}
