/* =======================================================
   ODO SALON - HOME PAGE STYLES
======================================================= */

/* -----------------------------------------------------
   LAYOUT - MAIN CONTAINER
----------------------------------------------------- */
.container {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  max-height: 895px;
  background-color: var(--cream);
  margin: 0 auto; /* Centers the container horizontally */
  padding: 72px;
  padding-top: 102px;
  max-width: 1736px;
}

/* -----------------------------------------------------
   CENTRAL IMAGE
----------------------------------------------------- */
.center-gif {
  /* Positioning */
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: center;
}

/* -----------------------------------------------------
   NAVIGATION LINKS - COMMON STYLES
----------------------------------------------------- */
.nav-link {
  /* Typography */
  font-family: var(--font-plastic-line);
  font-weight: var(--weight-light);
  font-size: 40px;
  color: var(--odo-red);
  line-height: 0.9;
  
  /* Display properties */
  text-decoration: none;
  transition: opacity 0.2s;
  position: relative;
  grid-row: 2; /* All nav links are in the middle row */
}

.nav-link:hover {
  opacity: 0.7;
}

/* Japanese/English text toggle on hover */
.nav-link .text-en,
.nav-link .text-jp {
  white-space: nowrap; /* Prevent text from wrapping */
  transition: opacity 0.3s ease;
}

.nav-link .text-en {
  display: block;
}

.nav-link .text-jp {
  position: absolute;
  top: 0;
  opacity: 0;
}

.nav-link:hover .text-en {
  opacity: 0;
}

.nav-link:hover .text-jp {
  opacity: 1;
}

/* -----------------------------------------------------
   NAVIGATION LINKS - POSITIONING
----------------------------------------------------- */
/* Left-aligned links (About, Prices) */
.nav-link.about,
.nav-link.prices {
  grid-column: 1;
  justify-self: start;
  text-align: left;
}

.nav-link.about .text-jp,
.nav-link.prices .text-jp {
  left: 0;
}

/* Right-aligned links (Info, Book) */
.nav-link.info,
.nav-link.book {
  grid-column: 3;
  justify-self: end;
  text-align: right;
}

.nav-link.info .text-jp,
.nav-link.book .text-jp {
  right: 0;
}

/* Top links */
.nav-link.about,
.nav-link.info {
  align-self: start;
}

/* Bottom links */
.nav-link.prices,
.nav-link.book {
  align-self: end;
  line-height: normal;
}

/* =======================================================
   RESPONSIVE STYLES
======================================================= */

/* -----------------------------------------------------
   LARGE SCREENS (1201px+)
----------------------------------------------------- */
/* Base styles above apply to large screens */

/* -----------------------------------------------------
  TABLETS (769px-1180px)
----------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1180px) {

  .container {
    padding: 71px;
    padding-top: 92px;
  }

  /* Central image */
  .center-gif {
    width: 556px;
    height: 681px;
  }
  
  .center-gif img {
    width: 100%;
    height: 100%;
  }
  
  /* Navigation */
  .nav-link {
    font-size: 32px;
  }
  
  /* Disable Japanese hover effect on tablet */
  .nav-link .text-jp {
    display: none;
  }
  
  .nav-link:hover .text-en {
    opacity: 1;
  }
}

/* Tablet portrait layout mirrors mobile portrait but keeps tablet font sizes */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: portrait) {
  body {
    min-height: 1500px;
  }
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "about info"
      "image image"
      "prices book";
    padding-top: 105px;
    padding-bottom: 105px;
    padding-left: 71px;
    padding-right: 71px;
    gap: 34px;
  }

  .center-gif {
    grid-area: image;
    width: 100%;
    height: auto;
    max-width: 100%;
    padding-top: 15px;
  }
  
  .nav-link.about,
  .nav-link.info {
    order: 1;
  }

  .nav-link.about {
    grid-area: about;
    justify-self: start;
    align-self: start;
  }

  .nav-link.info {
    grid-area: info;
    justify-self: end;
    align-self: start;
  }

  .nav-link.prices {
    grid-area: prices;
    justify-self: start;
    align-self: start;
    order: 3;
  }

  .nav-link.book {
    grid-area: book;
    justify-self: end;
    align-self: start;
    order: 3;
  }
  
  /* Navigation - maintain tablet font size */
  .nav-link {
    font-size: 32px;
  }
  
  /* Disable Japanese hover effect on tablet portrait */
  .nav-link .text-jp {
    display: none;
  }
  
  .nav-link:hover .text-en {
    opacity: 1;
  }
}

/* -----------------------------------------------------
   LANDSCAPE ORIENTATION - TABLETS AND MOBILE ONLY
----------------------------------------------------- */
@media (orientation: landscape) and (max-width: 1366px) {
  /* Hide Japanese text only on tablets and mobile in landscape orientation */
  .text-jp {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(100%) !important;
  }

  /* Ensure English text is always visible */
  .nav-link:hover .text-en {
    opacity: 1 !important;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .text-jp {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(100%) !important;
  }

  .nav-link:hover .text-en {
    opacity: 1 !important;
  }
}

/* -----------------------------------------------------
   TABLET LANDSCAPE (768px-1024px)
----------------------------------------------------- */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) {
  .container {
    padding: 71px;
    padding-top: 92px;
  }

  /* Central image */  
  .center-gif img {
    width: 100%;
    height: 100%;
  }
  
  /* Navigation */
  .nav-link {
    font-size: 32px;
  }
}

/* -----------------------------------------------------
   MOBILE DEVICES (320px-768px)
----------------------------------------------------- */
@media (max-width: 768px), (orientation: landscape) and (max-width: 932px) {
  /* Mobile container layout using grid template areas */
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "about info"
      "image image"
      "prices book";
    row-gap: 41px;
    column-gap: 20px;
    padding: 0 45px 45px;
    box-sizing: border-box;
    justify-items: center;
  }

  /* Central image */
  .center-gif {
    grid-area: image;
    width: 100%;
    max-width: min(80vw, 350px);
    margin: 0 auto;
    padding-top: 10px;
    order: 2;
  }
  
  .center-gif img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  
  /* Navigation */
  .nav-link {
    font-size: 22px;
  }
  
  /* Disable Japanese hover effect on mobile */
  .nav-link .text-jp {
    display: none;
  }
  
  .nav-link:hover .text-en {
    opacity: 1;
  }
  
  /* Position each element in its grid area with proper alignment */
  .nav-link.about,
  .nav-link.info {
    margin-top: 49px;
    order: 1;
  }
  
  .nav-link.about {
    grid-area: about;
    justify-self: start;
    align-self: start;
  }
  
  .nav-link.info {
    grid-area: info;
    justify-self: end;
    align-self: start;
  }
  
  .nav-link.prices {
    grid-area: prices;
    justify-self: start;
    align-self: start;
    order: 3;
  }
  
  .nav-link.book {
    grid-area: book;
    justify-self: end;
    align-self: start;
    order: 3;
  }
}

/* -----------------------------------------------------
   MOBILE LANDSCAPE (320px-768px and landscape)
----------------------------------------------------- */
@media (orientation: landscape) and (max-width: 932px) {
  /* Mobile landscape container layout */
  .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    padding: 42px;
    height: 100vh;
    max-height: 100vh;
    align-items: center;
    justify-content: space-between;
    row-gap: 0;
  }

  /* Central image */
  .center-gif {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: auto;
    height: calc(100vh - 40px);
    max-width: none;
    max-height: 100%;
    padding: 0;
    margin: 0;
    justify-self: center;
    align-self: center;
    order: 1;
  }
  
  .center-gif img {
    height: 100%;
    width: auto;
    max-height: calc(100vh - 40px);
    object-fit: contain;
  }
  
  /* Navigation */
  .nav-link {
    font-size: 22px;
  }
  
  /* Position each element in its grid area */
  .nav-link.about {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: start;
    margin-top: 0;
    order: 2;
  }
  
  .nav-link.info {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    margin-top: 0;
    order: 3;
  }
  
  .nav-link.prices {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: end;
    order: 4;
  }
  
  .nav-link.book {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    order: 5;
  }
}
