/* site.css: our tweaks on top of Pico.
   Pico already styles headings, links, buttons, forms and cards.
   Everything here is something we chose to change. */

/* 1. Colors and fonts. Pico reads these variables everywhere,
      so changing a value here changes it across the whole page.
      (The odd-looking selector matches the one Pico uses, so ours wins.) */
:root:not([data-theme="dark"]) {
  --navy: #1d3f63;
  --rust: #b8462f;
  --sand: #f6f3ec;

  --pico-primary: var(--navy);                    /* links */
  --pico-primary-background: var(--navy);         /* buttons */
  --pico-primary-border: var(--navy);
  --pico-primary-hover: var(--rust);              /* rust red on hover */
  --pico-primary-hover-background: var(--rust);
  --pico-primary-hover-border: var(--rust);
}

/* 2. Headings use the classic serif font loaded in index.html. */
h1, h2, h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--navy);
}

/* 3. The top bar: navy strip with the name and menu.
      "position: sticky" keeps it pinned to the top of the screen while you scroll. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;                  /* keeps the bar on top of photos as they scroll under it */
  background: var(--navy);
  text-align: center;
  padding: 0.75rem 0 0;
}
.topbar .site-name {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.75rem;
  color: white;
  margin: 0;
}
.topbar nav {
  justify-content: center;      /* Pico spreads menu items apart; this pulls them to the middle */
}
.topbar nav a {
  color: white;
}

/* When a menu link jumps to a section, stop a little lower so the heading
   isn't hidden behind the pinned top bar. And glide there instead of jumping. */
html {
  scroll-behavior: smooth;
}
section {
  scroll-margin-top: 7rem;
}

/* The hero: a full-width photo behind the welcome text.
   The dark gradient on top of the photo keeps the white text readable. */
.hero {
  background-image:
    linear-gradient(rgba(10, 25, 45, 0.55), rgba(10, 25, 45, 0.35)),
    url("../images/boat-under-sail.jpg");
  background-size: cover;       /* stretch the photo to fill the space */
  background-position: center;
  text-align: center;
  padding: 8rem 0;
}
.hero h1 {
  color: white;
  font-size: 2rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);  /* soft shadow so the words stand out from the sails */
}

/* 4. Sections: space between them, and a thin line to separate each one. */
main section {
  padding: 3rem 0;
  border-bottom: 1px solid #e3e0d8;
}
main section:last-child {
  border-bottom: none;
}

/* 5. Photos: rounded corners so they match Pico's cards. */
main img {
  border-radius: 8px;
}

/* 6. Cards: the price strip at the bottom is bold and navy. */
article footer {
  font-weight: bold;
  color: var(--navy);
}

/* 7. Footer: a sand-colored strip at the bottom of the page. */
.site-footer {
  background: var(--sand);
  text-align: center;
  padding: 1.5rem 0;
}

/* 8. The hero button is rust red so it stands out against the navy hull in the photo. */
.hero [role="button"] {
  background-color: var(--rust);
  border-color: var(--rust);
}

/* 9. Photo gallery: a grid with two photos per row.
      On narrow screens (phones) it drops to one photo per row. */
#boat h3 {
  margin-top: 2rem;   /* breathing room above "Below deck" */
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
.gallery figure {
  margin: 0;
}
.gallery figcaption {
  text-align: center;
  color: var(--navy);
}
