/* styles.css - extracted from index.html
   Contains layout, carousel and page styles.
*/

/* Page base */
body {
  margin: 0;
  min-height: 100vh; /* ensure body fills viewport */
  display: flex; /* make column layout so footer can stick to bottom */
  flex-direction: column;
  font-family: Georgia, 'Times New Roman', Times, serif;
  background-color: #ffffff;
  color: #000;
}

/* Carousel styles (scoped) */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 400px;
  margin: auto;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-container .overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  /* allow up to two lines while keeping consistent height */
  line-height: 1.2;
  padding: 8px 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 1.02em;
  font-weight: bold;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: calc(1.2em * 2 + 16px); /* ensure space for two lines */
}

/* Two-line truncation for overlay text */
.carousel-container .overlay-text .overlay-inner {
  display: -webkit-box; /* Fallback for WebKit */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* WebKit clamping */
  line-clamp: 2; /* standard property (where supported) */
  overflow: hidden;
  width: 100%;
}

/* Header */
header {
  background-color: #f1f1f6;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.login-form {
  display: flex;
  align-items: center;
  margin-left: 40px;
  flex-wrap: wrap;
}

.login-form label {
  margin-right: 5px;
}

.login-form input[type="text"], .login-form input[type="password"] {
  margin-right: 10px;
  padding: 4px;
  border: 1px solid #999;
}

.login-form input[type="checkbox"] {
  margin-left: 5px;
}

.login-form button {
  background-color: #fff;
  border: 1px solid #666;
  padding: 4px 8px;
  cursor: pointer;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 40px;
}

.logo img {
  height: 60px;
  margin-right: 10px;
}

.logo h1 {
  margin: 0;
  font-size: 32px;
  color: #0047ff;
  letter-spacing: 1px;
}

/* Main Section */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #fff;
  padding: 40px 20px;
  flex: 1 0 auto; /* allow main to grow and push footer to bottom */
}

.content-wrapper {
  display: flex;
  max-width: 1100px;
  width: 100%;
  justify-content: space-between;
  align-items: center; /* vertically center children (carousel + address) */
  gap: 40px;
}

/* Generic image section used elsewhere on the page (not carousel) */
.image-section {
  position: relative;
  flex: 1;
}

.image-section img {
  width: 100%;
  border: 1px solid #ccc;
  display: block;
}

/* Address */
.address-section {
  width: 320px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center the address content */
}

.address-section img {
  width: 100%;
  display: block;
  margin-bottom: 10px;
}

.address-section strong {
  font-size: 16px;
}

.address-section a {
  color: #0047ff;
  text-decoration: none;
}

/* Footer */
footer {
  background-color: #f1f1f6;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  border-top: 1px solid #ccc;
}

/* Responsive: stack carousel above address image on small screens */
@media (max-width: 720px) {
  .content-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .carousel-container {
    max-width: 100%;
    height: 280px; /* slightly smaller on phones */
  }

  .carousel-container .overlay-text {
    /* make text smaller but allow wrapping so full caption is visible */
    font-size: 0.75em;
    padding: 6px 10px;
    box-sizing: border-box;
    /* allow overlay to grow to show full text on small screens */
    min-height: auto;
    max-height: 50%;
    overflow: auto;
  }

  .carousel-container .overlay-text .overlay-inner {
    display: block;
    white-space: normal;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    width: 100%;
  }

  .address-section {
    width: 100%;
    text-align: center;
    padding: 0 12px;
  }

  .address-section img {
    max-width: 160px;
    height: auto;
    margin: 0 auto;
    display: block;
  }
  
  /* Center top logo on small screens */
  header {
    justify-content: center;
  }

  .logo {
    margin-right: 0;
  }
  .logo img {
    margin: 0 auto;
    display: block;
  }
}
