@import url("https://fonts.googleapis.com/css2?family=Varela&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
ul li {
  list-style: none;
}
body {
  font-family: "Varela", sans-serif;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}
div.box {
  padding-bottom: 5px;
  text-align: center;
  color: hsla(0, 0%, 100%, 0.65);
  border-bottom: 2px solid hsla(0, 0%, 100%, 0.65);
  margin-bottom: 2em;
}
#time {
  margin-bottom: 20px;
  font-size: 90px;
}
#greeting {
  font-size: 30px;
}
#temperature {
  margin: 1rem auto;
}
.night {
  background-image: url("https://images.unsplash.com/photo-1488415032361-b7e238421f1b?q=80&w=1769&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
}
.morning {
  background-image: url("https://images.unsplash.com/photo-1511717220991-7aacf148fd88?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
}
.afternoon {
  background-image: url("https://images.unsplash.com/photo-1661435891212-6a69c22b9455?q=80&w=1933&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
}
.evening {
  background-image: url("https://images.unsplash.com/photo-1525848737975-98abfe205efc?q=80&w=1770&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
}
ul.links {
  position: absolute;
  bottom: 20px;
  width: 30%;
  border-radius: 16px;
  padding: 0.5em;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-around;
}
ul li {
  width: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  padding: 10px;
  transition: all 200ms ease-in-out;
}
ul li:hover {
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.05);
}
ul.links li a {
  display: flex;
  justify-content: center;
}
ul.links li a img {
  width: 100%;
}

@media screen and (max-width: 500px) {
  #time {
    font-size: 70px;
  }
  #greeting {
    font-size: 20px;
  }
}

/* ... existing styles ... */

/* Mobile mobile-friendly navigation adjustments */
.front-page {
  /* Adjust layout for smaller screens */
  padding: 1rem;
  gap: 2rem;
}

/* Modified navigation styling */
nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

nav a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.5rem;
  margin: 0 0.5rem;
}

nav a:hover {
  text-decoration: underline;
}

/* Responsive navigation for smaller screens */
@media (max-width: 600px) {
  .front-page {
    flex-direction: column;
    align-items: stretch;
  }

  nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #f5f5f5;
  }

  nav a {
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
  }
}

/* Navigation toggle for extreme small screens */
#nav-toggle {
  display: none;
}

/* Hamburger icon styling */
.nav-toggle-label {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0.5rem;
}

/* Mobile navigation - default hide links */
.nav-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Responsive adjustments for small screens */
@media (max-width: 600px) {
  /* Show hamburger icon */
  .nav-toggle-label {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  /* Hide navigation by default on mobile */
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    gap: 0.75rem;
    border-radius: 8px;
  }

  /* Show navigation when checkbox is checked */
  #nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  /* Improve link spacing on mobile */
  .nav-links a {
    padding: 0.75rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
  }
}

/* -------------------------------------------------
   Mobile navigation fixes – address icon positioning,
   vertical stretching, and background overflow.
   ------------------------------------------------- */

/* Hide navigation by default on mobile */
.nav-links {
  display: none;                     /* Hidden until toggled */
  flex-direction: column;            /* Stack vertically */
  align-items: center;               /* Center icons/text horizontally */
  width: 100%;                       /* Full width of viewport */
  max-width: 100%;                   /* Prevent horizontal overflow */
  background-color: rgba(0, 0, 0, 0.9); /* Dark semi‑transparent backdrop */
  padding: 1rem 0;                   /* Space above/below items */
  gap: 0.75rem;                      /* Even spacing between items */
  border-radius: 8px;                /* Rounded corners */
}

/* Ensure each link keeps its tap target intact */
.nav-links a {
  display: flex;
  align-items: center;               /* Vertically center icons */
  justify-content: center;           /* Horizontally center icons */
  width: 100%;                       /* Full width for easy tapping */
  text-align: center;                /* Center any accompanying text */
  padding: 0.75rem 0.5rem;           /* Adequate vertical/horizontal padding */
}

/* Preserve image aspect ratio – prevent vertical stretch */
.nav-links a img {
  width: 32px;                         /* Fixed tap‑friendly size */
  height: auto;                      /* Keep original proportion */
  max-height: 32px;                    /* Limit height if needed */
}

/* -------------------------------------------------
   Show navigation when the checkbox is checked.
   ------------------------------------------------- */
#nav-toggle:checked ~ .nav-links {
  display: flex;                     /* Toggle visibility */
}

/* Mobile navigation - default hide links */
.nav-links {
  display: none;
  width: 90%;
  max-width: 500px;
  background-color: rgba(0, 0, 0, 0.9);
  padding: 1rem;
  border-radius: 8px;
  overflow: hidden;
}

/* Show navigation when checkbox is checked */
#nav-toggle:checked ~ .nav-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}

/* Improve link styling for mobile */
.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 0.5rem;
  transition: all 200ms ease-in-out;
}

.nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Preserve image aspect ratio - make them larger */
.nav-links a img {
  width: 28px;
  height: auto;
  max-height: 28px;
  object-fit: contain;
}

/* Adjust for smaller screens */
@media (max-width: 400px) {
  #nav-toggle:checked ~ .nav-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
  }
  
  .nav-links a {
    aspect-ratio: 1;
  }
  
  .nav-links a img {
    width: 24px;
    max-height: 24px;
  }
}
