/* CS104 - using CSS classes (CS104 rubric requirement) */

/* Global box-sizing rule for easier sizing of elements. Box-sizing is set to 
border-box which includes padding and border in the element's total width and height */
* { box-sizing: border-box; }

/* Basic body styles including background color and font settings. These are kept simple for 
consistency but will be improved for readability in later assignments */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.6;
  background: #f7f3ee;
  color: #222;

  /* Adds a full-page background image for a more modern, branded look */
  background-image: url("/media/coffeecup.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* Keeps the background steady while scrolling for a subtle premium effect */
  background-attachment: fixed;
}

/* Adds a light overlay so page text stays readable on top of the background image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(247, 243, 238, 0.86);
  z-index: -1;
}

/* Constrains content width and adds padding so the page doesnt get crazy wide on large displays */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

/* Accessibility: skip link appears when focused tabbing through the site using keyboard navigation */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #f97316;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 6px;
}
.skip-link:focus { left: 16px; }

/* Header styles including navigation */
.header {
  background: #fff;
  border-bottom: 3px solid #f97316;

  /* Allows the optional decorative background video/image to be positioned behind the header content */
  position: relative;

  /* Prevents the background video/image from overflowing outside the header */
  overflow: hidden;
}

/* Brand styles including flexbox for layout */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  margin-bottom: 8px;
}

/* Logo image styles , give it a border radius and allow it to scale with the container */
.logo {
  display: block;
  border-radius: 10px;
  height: 96px;
  width: auto;

  /* Prevents the logo from being squished by flexbox when screen space is tight */
  flex-shrink: 0;
}

/* Brand text styles */
.title { margin: 0; font-size: 1.25rem; }
.tagline { margin: 0; color: #555; }

/* Navigation list styles including flexbox for layout */
.nav {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Navigation link styles including hover and current states */
.nav a {
  color: #222;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav a:hover { background: #ffe6d5; }
.nav a[aria-current="page"] { background: #ffd3b3; font-weight: 700; }

/* Styles the added the new home page photo so it looks clean and stays responsive */
.hero-visual {
  margin: 12px 0 0;

  /* Slightly increases spacing so the image feels less cramped under the intro paragraph */
  margin-top: 16px;
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;

  /* Prevents the image from becoming overly tall on large screens */
  max-height: 420px;
  object-fit: cover;
}

.hero-visual figcaption {
  margin-top: 8px;
  color: #555;
  font-style: italic;

  /* Slightly reduces caption size so the image stays the focus */
  font-size: 0.95rem;
}

/* Main content styles including cards, lists, and other elements */
.card {
  background: #fff;
  padding: 16px;
  margin: 16px 0;
  border-radius: 10px;
  border: 1px solid #ddd;
}

/* Enhances unordered lists by replacing default bullets with coffee icons */
.list {
  margin: 0;
  list-style: none; /* Removes default browser bullets */
  padding-left: 0;
}

/* Adds a coffee emoji before each list item */
.list li {
  position: relative;
  padding-left: 1.6em;
}

/* Coffee icon used as a decorative bullet */
.list li::before {
  content: "☕";
  position: absolute;
  left: 0;
}

/* Footer styles, change color a bit to match the header and draw its border */
.footer {
  margin-top: 24px;
  padding: 12px 0;
  border-top: 1px solid #ddd;
  background: #f0e8df;
}

/* Background media container used for a decorative header video on desktop and a static image on mobile */
.video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Video fills the header area and moves slowly so it feels "alive" without being distracting */
.video-bg video {
  width: 120%;
  height: 120%;
  object-fit: cover;

  /* Slow movement for subtle animation (no JavaScript needed) */
  animation: slow-pan 30s ease-in-out infinite alternate;

  /* Darken the video so header text stays readable */
  filter: brightness(0.6);
}

/* Keeps the header content (logo/text/nav) above the background video/image */
.header .wrap {
  position: relative;
  z-index: 1;

  /* Improves readability of the header content when a busy background image/video is behind it */
  background: rgba(247, 243, 238, 0.92);
  border-radius: 12px;
  padding: 12px 16px;

  /* Adds a subtle shadow so the header content stands out from the background */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Defines the slow background motion animation used on the header video */
@keyframes slow-pan {
  from { transform: translate(-5%, -5%) scale(1.05); }
  to   { transform: translate(5%, 5%) scale(1.10); }
}
/* Keeps “screen reader only” text accessible while hiding it visually (used for gallery aria-live updates) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Styles the gallery thumbnail strip so thumbnails do not render as giant full-size images */
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

/* Thumbnail button: small, clickable, and consistent size */
.thumb {
  width: 84px;
  height: 56px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}

/* Ensures thumbnail images fit the thumbnail box without distortion */
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Clear visual indicator for the selected thumbnail (aria-current is set by JS) */
.thumb[aria-current="true"] {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

/* Keeps the Prev/Next controls from looking cramped */
.gallery-controls {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

/* Simple button styling used by gallery controls*/
.button {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.button:hover { background: #ffe6d5; }
/* Improves the FAQ button styling so it looks like a modern clickable control */
.faq-q {
  width: 100%;
  text-align: left;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

.faq-q:hover { background: #ffe6d5; }

/* Adds spacing between FAQ items for readability */
.faq-item + .faq-item {
  margin-top: 10px;
}

/* Styles the FAQ answer area so it reads like content, not raw text */
.faq-a {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f7f3ee;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* 
   Responsive Design (CS104 Assignment 2 requirement)
   ------------------------------------------------------------
   This media query adjusts the navigation layout for small
   screens such as phones. The navigation links stack vertically
   instead of staying in a horizontal row.
 */
@media (max-width: 600px) {

  /* Stack navigation links vertically for easier tapping on mobile devices */
  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  /* Increase clickable area and center text for mobile usability */
  .nav a {
    text-align: center;
    padding: 10px;
  }

  /* Mobile fallback: hide the video and show a static image instead (better performance on phones) */
  .video-bg video {
    display: none;
  }

  /* Uses a still image on mobile; make sure /media/coffee.jpg exists */
  .video-bg {
    background-image: url("/media/coffee.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Darken the image as well so text remains readable */
    filter: brightness(0.6);
  }

  /* Improves header spacing on very small screens by stacking logo and text */
  .brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  /* Reduces logo height on small screens so the header does not feel cramped */
  .logo {
    height: 72px;
  }

  /* Slightly reduces title size so it fits cleanly on small screens */
  .title {
    font-size: 1.1rem;
  }

  /* Reduces the home page image height on phones so it does not push content too far down */
  .hero-visual img {
    height: 220px;
    object-fit: cover;
  }

  /* Improves performance on mobile by avoiding fixed background attachment */
  body {
    background-attachment: scroll;
  }
}
/* Makes form validation feedback visible and easy to understand (used by script.js) */
[data-form-status] {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}

/* Shows success messages in a friendly way */
.status-success {
  border-color: #86efac;
}

/* Shows error messages clearly */
.status-error {
  border-color: #fca5a5;
}

/* Styles individual field error messages (name-error, email-error, message-error) */
#name-error, #email-error, #message-error {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

/* End of styles.css */
