/* Main colors, basics */
:root {
  --brand: #1d0a65;
  /* My main color for the whole site */
}

html,
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Makes the sizes easier to deal with */
  font-family: Inter, system-ui, Arial, sans-serif;
  /* Default text font */
  line-height: 1.6;
  color: #333;
  /* Dark gray text */
  background: linear-gradient(135deg, #e0f7fa, #80deea);
  /* Pretty background gradient */
}

/* Makes the box-sizing work for all elements */
*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Headings use a different font so they stand out */
h1,
h2,
h3 {
  font-family: Poppins, Inter, Arial, sans-serif;
}

/* Top navigation bar */
.main-nav {
  background-color: var(--brand);
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.main-nav ul {
  list-style: none;
  /* no bullets */
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
  justify-content: space-evenly;
  /* spread links across bar */
  flex-wrap: nowrap;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  display: inline-block;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
  background-color: #4a3fbf;
  /* darker color when mouse over */
  outline: none;
}

/* Container of main page */
main {
  max-width: 1000px;
  margin: 0 auto;
  /* center the main content */
  padding: 1rem;
  background-color: #ffffffcc;
  /* slightly see-through white */
  border: 2px solid var(--brand);
  border-radius: 12px;
}

/* Hero section in the homepage */
.hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  min-height: 40vh;
  /* this makes it tall enough */
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .35), rgba(0, 0, 0, .45)),
    url('images/Mt.Raineir.jpg') center/cover no-repeat;
  /* dark layer + picture */
}

.hero-inner {
  color: #fff;
  padding: clamp(1rem, 4vw, 3rem);
  max-width: 900px;
}

.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  margin: 0 0 .5rem;
}

.hero p {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  margin: 0 0 1rem;
  max-width: 60ch;
  /* this keeps text from getting too wide */
}

/*  Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  /* makes the button round */
  text-decoration: none;
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
  transition: background .2s ease, transform .2s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateY(-1px);
  /* tiny lift effect */
}

.btn.primary {
  background: #4a3fbf;
  border-color: #4a3fbf;
}

.btn.primary:hover {
  background: #3a31a0;
}

/* puts hero buttons in the bottom right corner, use clamp also found outside our book */
.hero-actions--bottom-right {
  position: absolute;
  right: clamp(0.75rem, 3vw, 1.25rem);
  bottom: clamp(0.75rem, 3vw, 1.25rem);
}

/* Lists and inline images for homepage */
.home-list {
  margin-top: 1rem;
}

.home-list ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.home-list li {
  margin-bottom: .4rem;
}

/* side-by-side small image + text */
.inline-media {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.inline-media img.inline-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 3px solid var(--brand);
  border-radius: 12px;
  margin: 0;
}

/* Text styles */
h1.main-title,
main h1 {
  font-size: 2rem;
  color: var(--brand);
  margin-bottom: 1rem;
}

main h2 {
  font-size: 1.5rem;
  color: #333;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.main-text,
main p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

a {
  color: #0077cc;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/*  Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border: 3px solid var(--brand);
  border-radius: 8px;
}

/* Frames to make fixed shapes for images */
.frame-4x3 {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.frame-16x9 {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* About page layout */
.about-flex {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-top: 1.5rem;
}

.about-text,
.about-image {
  flex: 1;
}

.about-alt {
  flex-direction: row-reverse;
  /* switches picture to the left */
}

.about-image img {
  border-radius: 8px;
}

/* Travel page photo gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 across */
  gap: 1rem;
  margin-top: 1rem;
}

.gallery figure {
  margin: 0;
  background: #ffffffdd;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* picture on top, caption below */
  transition: transform .2s ease, box-shadow .2s ease;
}

.gallery figure:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.gallery img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 0;
  display: block;
  /* rule to make pics the same height */
}

.gallery figcaption {
  font-size: .9rem;
  padding: .5rem .75rem;
  background: #fff;
  text-align: center;
  border-top: 1px solid #e6e6e6;
}

/* Footer */
footer {
  text-align: center;
  font-size: .9rem;
  color: #555;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

/* Media queries for mobile and tablets */
@media (max-width: 1024px) {
  main {
    padding: 0.75rem;
    border-width: 1px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    /* 3 across on smaller screens */
  }
}

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    /* 2 across */
  }
}

@media (max-width: 768px) {
  .main-nav ul {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  main {
    padding: 0.5rem;
    border-width: 1px;
  }

  .about-flex,
  .about-alt {
    flex-direction: column;
    /* stacks text and picture */
  }

  .inline-media {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
    /* 1 across (full width) */
  }
}

@media (max-width: 480px) {
  body {
    /* no top padding so the nav can sit at the very top */
    padding: 0 0.5rem 0.5rem;
  }

  main {
    margin: 0 0.5rem;
    padding: 0.75rem;
    border-width: 1px;
  }

  /* nav bar alignment fix */
  .main-nav {
    margin-top: 0;
    padding-top: 0.5rem;
  }

  .main-nav ul {
    justify-content: center;
    margin-top: 0;
  }

  .main-nav a {
    padding: 0.5rem;
  }

  .hero {
    min-height: 32vh;
  }
}


/* Gallery layout tweak for auto fit */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  /* fits pictures nicely on all screens */
  gap: 1rem;
}

/* Thumbnail container with same shape for all , to keep it visually better*/
.gallery .thumb {
  aspect-ratio: 4 / 3;
  /* all pics same shape */
  width: 100%;
  overflow: hidden;
}

/* Makes the picture fill the box without stretching */
.gallery .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* Slight zoom when mouse is over */
.gallery .thumb img:hover {
  transform: scale(1.05);
}

/* Captions in the gallery */
.gallery figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  margin-top: 0.5rem;
}

/* --- Expenses Table Styling (Matches Site Brand) --- */
.expenses-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 0 10px rgba(29, 10, 101, 0.3);
  /* brand color shadow */
}

.expenses-table caption {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--brand);
  padding: 10px;
}

.expenses-table th {
  background-color: var(--brand);
  /* matches main site color */
  color: white;
  padding: 10px;
  text-align: left;
}

.expenses-table td {
  border: 1px solid #ccc;
  padding: 10px;
}

.expenses-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.expenses-table tfoot td {
  font-weight: bold;
  background-color: #e8e4f7;
  /* light purple to match */
}

/* --- Responsive Video Section Styling (Matches Site Brand) --- */
.video-wrap {
  position: relative;
  padding-bottom: 50%;
  /* slightly shorter than 16:9 */
  height: 0;
  overflow: hidden;
  border: 4px solid var(--brand);
  /* brand color border */
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(29, 10, 101, 0.4);
  margin: 20px auto;
  max-width: 640px;
  /* limits width so video is smaller */
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

