/* ============================================================
   Colonial Musketeers Senior Ancient Fife & Drum Corps
   styles.css
   ============================================================ */

:root {
  --color-green: rgba(37, 119, 107);
  --color-black: rgb(0, 0, 0);

  /* "Brush Script MT" ships with Windows and macOS — used for decorative headings.
     "Belwe Bd BT" is a Bitstream font; Georgia is the fallback if it's not installed. */
  --font-script: "Brush Script MT", cursive;
  --font-body:   "Belwe Bd BT", Georgia, "Times New Roman", serif;
}

/* ---- Page background & base ---- */

html {
  /* Tile the parchment across the full browser window */
  background-image: url("images/Background_Parchment.gif");
  background-color: #d4c09a; /* fallback if image is slow or missing */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: var(--color-green);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ---- Headings ---- */

h1 {
  font-family: var(--font-script);
  font-size: 3.75rem;
  text-align: center;
  line-height: 1.15;
  margin: 1rem 0 0;
  padding-bottom: 0.75rem;
  border-bottom: 6px double var(--color-green);
  text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.18);
}

h2 {
  font-family: var(--font-script);
  font-size: 2rem;
  margin: 1.75rem 0 0.25rem;
}

h3 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  margin: 1.5rem 0 0.25rem;
}

/* ---- Body text ---- */

p {
  margin: 0.25rem 0 1.25rem;
}

/* ---- Links ---- */

a {
  color: var(--color-black);
  font-weight: bold;
}

a:hover {
  color: var(--color-green);
}

/* ---- Navigation bar ---- */

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;        /* wraps gracefully on narrow screens */
  gap: 0.25rem 2rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 3px double var(--color-green);
  margin-bottom: 2rem;
}

nav a {
  font-family: var(--font-body);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--color-green);
  padding: 0.15rem 0.4rem;
}

nav a:hover {
  color: var(--color-black);
  background: rgba(0, 0, 0, 0.07);
  border-radius: 3px;
  text-decoration: none;
}

/* The current page's link gets an underline so it's clear where you are */
nav a.active {
  border-bottom: 2px solid var(--color-green);
}

/* ---- Main content area ---- */

main {
  background: rgba(255, 248, 225, 0.5);  /* soft cream over the parchment texture */
  box-shadow:
    0 2px 8px  rgba(0, 0, 0, 0.15),
    0 6px 24px rgba(0, 0, 0, 0.10);
  padding: 1.5rem 2rem 2rem;
  border-radius: 2px;
}

/* Remove top margin from the first heading on each page */
main > *:first-child {
  margin-top: 0;
}

/* Home page: first child is the group photo (floated), so also zero the h2 beside it */
main > img:first-child + h2 {
  margin-top: 0;
}

/* Gallery page: first heading is an h3 nested inside the first gallery-section */
main > .gallery-section:first-child > h3:first-child {
  margin-top: 0;
}

/* ---- Gallery ---- */

.gallery-section {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-green);
}

.gallery-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.gallery-section p {
  margin-bottom: 0.75rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;     /* fills the box without distorting the photo */
  border: 2px solid var(--color-green);
  display: block;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-grid img:hover {
  box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.38);
  transform: translateY(-2px);
}

/* ---- Home page group photo ---- */

.group-photo {
  float: right;
  max-width: 60%;
  margin: 0 0 1.25rem 2rem;
  border: 3px solid var(--color-green);
  box-shadow: 4px 5px 16px rgba(0, 0, 0, 0.3);
}

/* On small screens, drop the float and show it full-width */
@media (max-width: 600px) {
  .group-photo {
    float: none;
    max-width: 100%;
    margin: 0 0 1.5rem 0;
  }
}

/* ---- Gallery lightbox ---- */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

#lightbox.open {
  display: flex;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
  line-height: 1;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  font-family: sans-serif;
}

#lightbox-close:hover {
  color: #ccc;
}

/* ---- Facebook / social link ---- */

.facebook-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
  text-decoration: none;
  color: var(--color-black);
}

.facebook-link:hover {
  color: var(--color-green);
}

.facebook-link img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

/* ---- Responsive adjustments for phones & small tablets ---- */

@media (max-width: 600px) {
  h1 {
    font-size: 2.5rem;
  }

  nav {
    gap: 0.25rem 1rem;
  }

  nav a {
    font-size: 1.1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
