/* ==========================================================================
   Chandlersville Methodist Church - shared stylesheet
   --------------------------------------------------------------------------
   This one file styles every page on the site.

   HOW TO FIND THINGS: the file is split into labeled sections, in this order:
     1.  COLORS & FONTS  ....... change the site's colors here
     2.  BASIC RESET
     3.  TYPOGRAPHY
     4.  LAYOUT HELPERS
     5.  BUTTONS
     6.  HEADER & NAVIGATION
     7.  HERO (big photo on the home page)
     8.  CARDS & INFO BOXES
     9.  MISSIONS LIST
     10. PHOTO GALLERY & LIGHTBOX
     11. CALENDAR EMBED
     12. FOOTER
     13. MOBILE / SMALL SCREENS
   ========================================================================== */


/* ==========================================================================
   1. COLORS & FONTS
   --------------------------------------------------------------------------
   Every color on the site is listed here. Change a value here and it updates
   everywhere. The colors were picked from real photos of the church.
   ========================================================================== */
:root {
  /* --- Colors --- */
  --cream:       #F5F1E6;  /* page background - warm off-white */
  --cream-deep:  #EDE6D6;  /* slightly darker cream, for alternating bands */
  --brick:       #9C4433;  /* main accent - the church's exterior brick */
  --brick-dark:  #7C3527;  /* darker brick, used for hover states */
  --forest:      #3B5B41;  /* second accent - green altar cloth */
  --wood:        #5C4033;  /* borders and dividers - the wooden pews */
  --gold:        #B8912F;  /* small brass/gold highlights */
  --magenta:     #C0407A;  /* stained glass pink - use very sparingly */
  --ink:         #2E2A24;  /* body text */
  --ink-soft:    #6B6156;  /* quieter text, captions */
  --white:       #FFFFFF;

  /* --- Fonts ---
     These use fonts already installed on the visitor's computer, so the site
     loads fast and needs no internet connection to look right. */
  --font-heading: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --font-body:    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* --- Spacing --- */
  --page-width: 1080px;   /* how wide the content gets on a big screen */
  --radius: 4px;          /* corner rounding */
}


/* ==========================================================================
   2. BASIC RESET
   Clears the browser's built-in spacing so pages look the same everywhere.
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;   /* about 17px - comfortable to read */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--wood);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.85rem; color: var(--brick); }
h3 { font-size: 1.25rem; color: var(--forest); }

p { margin: 0 0 1.1em; }

a {
  color: var(--brick);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--brick-dark); }

/* A short decorative line used under section headings. */
.rule {
  border: 0;
  height: 2px;
  width: 70px;
  background: var(--gold);
  margin: 0 0 1.5rem;
}
.rule--center { margin-left: auto; margin-right: auto; }

/* Larger intro paragraph, used at the top of a page. */
.lead {
  font-size: 1.2rem;
  color: var(--ink);
}

/* Small italic note - used for the "still listed as UMC" clarification. */
.note {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.97rem;
}


/* ==========================================================================
   4. LAYOUT HELPERS
   ========================================================================== */

/* Centers content and keeps it from getting too wide to read. */
.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Vertical spacing around a block of content. */
.section { padding: 3.5rem 0; }

/* A section with the slightly darker cream background, to break up the page. */
.section--tinted {
  background-color: var(--cream-deep);
  border-top: 1px solid rgba(92, 64, 51, 0.15);
  border-bottom: 1px solid rgba(92, 64, 51, 0.15);
}

/* The colored strip at the top of every page except the home page. */
.page-header {
  background-color: var(--forest);
  color: var(--cream);
  padding: 2.75rem 0;
  text-align: center;
}
.page-header h1 { color: var(--cream); margin-bottom: 0.25rem; }
.page-header p  { color: rgba(245, 241, 230, 0.85); margin: 0; }

/* Two columns side by side that stack on a phone. */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}


/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.button {
  display: inline-block;
  background-color: var(--brick);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid var(--brick);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover {
  background-color: var(--brick-dark);
  border-color: var(--brick-dark);
  color: var(--white);
}

/* Outlined version, for a second, less important button. */
.button--outline {
  background-color: transparent;
  color: var(--brick);
  border-color: var(--brick);
}
.button--outline:hover {
  background-color: var(--brick);
  color: var(--white);
}


/* ==========================================================================
   6. HEADER & NAVIGATION
   The same header markup appears at the top of every .html page.
   ========================================================================== */
.site-header {
  background-color: var(--cream);
  border-bottom: 3px solid var(--wood);
  position: relative;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  max-width: var(--page-width);
  margin: 0 auto;
}

/* Church name in the top-left corner. */
.site-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brick);
  text-decoration: none;
  line-height: 1.2;
}
.site-title span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--forest);
}

/* The row of page links. */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.45rem 0.65rem;
  color: var(--wood);
  text-decoration: none;
  font-size: 0.97rem;
  font-weight: 600;
  border-radius: var(--radius);
  border-bottom: 3px solid transparent;
  white-space: nowrap;   /* keeps "About & Beliefs" on one line */
}
.site-nav a:hover {
  color: var(--brick);
  background-color: var(--cream-deep);
}

/* Marks which page you are currently on. The class "is-current" is already
   set on the correct link in each page's nav. */
.site-nav a.is-current {
  color: var(--brick);
  border-bottom-color: var(--brick);
}

/* The three-line menu button. Hidden on desktop, shown on phones. */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--wood);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  color: var(--wood);
  font-size: 1.1rem;
  line-height: 1;
}


/* ==========================================================================
   7. HERO (the large photo at the top of the home page)
   ========================================================================== */
.hero { position: relative; }

.hero__image {
  width: 100%;
  height: 480px;
  object-fit: cover;   /* crops the photo nicely instead of squashing it */
}

/* The text box that sits on top of the photo. */
.hero__panel {
  background-color: var(--cream);
  border-top: 5px solid var(--brick);
  padding: 2rem;
  max-width: 620px;
  margin: -5rem auto 0;   /* pulls the box up over the photo */
  position: relative;
  text-align: center;
  box-shadow: 0 4px 18px rgba(46, 42, 36, 0.15);
}
.hero__panel h1 { color: var(--brick); margin-bottom: 0.35rem; }
.hero__panel .lead { margin-bottom: 0; }

/* "Sundays at 9:15 AM" line. */
.service-time {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--forest);
  font-weight: 700;
  margin: 1rem 0 0.35rem;
}


/* ==========================================================================
   8. CARDS & INFO BOXES
   ========================================================================== */

/* A row of boxes that wraps onto more lines when the screen is narrow. */
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--white);
  border: 1px solid rgba(92, 64, 51, 0.2);
  border-top: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Highlighted box for key details like address and service time. */
.info-box {
  background-color: var(--white);
  border-left: 5px solid var(--gold);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
}
.info-box p:last-child { margin-bottom: 0; }

/* Marks a spot where the church still needs to add its own words.
   These show as a dashed box so they are easy to spot - delete the
   whole block once you have replaced it with real content. */
.placeholder {
  background-color: #FCF7E8;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.placeholder strong { color: var(--wood); }
.placeholder p:last-child { margin-bottom: 0; }


/* ==========================================================================
   9. MISSIONS LIST
   ========================================================================== */
.mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.mission {
  background-color: var(--white);
  border: 1px solid rgba(92, 64, 51, 0.2);
  border-left: 5px solid var(--brick);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.mission h3 {
  margin: 0 0 0.35rem;
  color: var(--wood);
  font-size: 1.15rem;
}
.mission p { margin: 0; color: var(--ink); }

/* The Blessing Box entry, which has a photo beside its text. */
.mission--featured {
  grid-column: 1 / -1;      /* spans the full width of the list */
  border-left-color: var(--forest);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.5rem;
}
.mission--featured img {
  border-radius: var(--radius);
  border: 3px solid var(--wood);
}


/* ==========================================================================
   10. PHOTO GALLERY & LIGHTBOX
   ========================================================================== */

/* The grid of photos. Add more <figure> blocks in gallery.html and they
   drop into place automatically - no changes needed here. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-grid figure { margin: 0; }

.gallery-grid img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border: 4px solid var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(46, 42, 36, 0.18);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery-grid img:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(46, 42, 36, 0.28);
}

.gallery-grid figcaption {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding-top: 0.5rem;
}

/* --- The enlarged-photo overlay ---
   Hidden until someone clicks a photo; script.js opens and closes it. */
.lightbox {
  position: fixed;
  inset: 0;                       /* covers the whole screen */
  background-color: rgba(30, 26, 22, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 100;
}
.lightbox.is-open { display: flex; }   /* JS adds this class */

.lightbox__figure {
  margin: 0;
  max-width: 1000px;
  text-align: center;
}
.lightbox__image {
  max-height: 78vh;
  max-width: 100%;
  margin: 0 auto;
  border: 5px solid var(--cream);
  border-radius: var(--radius);
}
.lightbox__caption {
  color: var(--cream);
  padding-top: 0.9rem;
  font-size: 1rem;
}

/* Close / previous / next buttons on the overlay. */
.lightbox__btn {
  position: absolute;
  background-color: rgba(245, 241, 230, 0.92);
  color: var(--wood);
  border: none;
  border-radius: var(--radius);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}
.lightbox__btn:hover { background-color: var(--white); color: var(--brick); }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__prev  { left: 1.25rem;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }


/* ==========================================================================
   11. CALENDAR EMBED
   Keeps the Google Calendar iframe from overflowing on a phone.
   ========================================================================== */
.calendar-frame {
  background-color: var(--white);
  border: 1px solid rgba(92, 64, 51, 0.25);
  border-radius: var(--radius);
  padding: 0.6rem;
  overflow-x: auto;   /* lets a wide calendar scroll sideways if it must */
}
.calendar-frame iframe {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
}


/* ==========================================================================
   12. FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--wood);
  color: rgba(245, 241, 230, 0.9);
  padding: 2.5rem 0 2rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.95rem;
  border-top: 5px solid var(--brick);
}
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--gold); }

.site-footer__name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--cream);
  margin-bottom: 0.35rem;
}
.site-footer__affiliation {
  color: var(--gold);
  font-weight: 600;
}
.site-footer__copyright {
  margin: 1.25rem 0 0;
  font-size: 0.87rem;
  color: rgba(245, 241, 230, 0.65);
}

/* The one small pop of stained-glass pink on the site: a thin line
   above the footer text, echoing the sanctuary windows. */
.site-footer::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--magenta);
  margin: 0 auto 1.5rem;
}


/* ==========================================================================
   13. MOBILE / SMALL SCREENS
   Rules below only apply on narrow screens (phones and tablets).

   The 940px figure is the switch-over point: any screen narrower than this
   gets the tap-to-open menu instead of the row of links across the top.
   ========================================================================== */
@media (max-width: 940px) {

  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }

  /* Show the menu button, and hide the links until it is tapped. */
  .nav-toggle { display: block; }

  .site-nav {
    display: none;              /* hidden by default on a phone */
    width: 100%;
    order: 3;                   /* drops below the church name */
    border-top: 1px solid rgba(92, 64, 51, 0.25);
    padding-top: 0.5rem;
  }
  .site-nav.is-open { display: block; }   /* JS adds this class on tap */

  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a {
    padding: 0.75rem 0.4rem;
    border-bottom: 1px solid rgba(92, 64, 51, 0.12);
    border-radius: 0;
  }
  .site-nav a.is-current {
    border-bottom-color: rgba(92, 64, 51, 0.12);
    background-color: var(--cream-deep);
  }

  .site-header__inner { flex-wrap: wrap; }

  /* Stack anything that was side by side. */
  .two-col,
  .mission--featured { grid-template-columns: 1fr; }

  /* Shorter hero photo, and the text box sits below it instead of on it. */
  .hero__image { height: 300px; }
  .hero__panel {
    margin-top: 0;
    max-width: none;
    padding: 1.5rem 1.25rem;
  }

  .section { padding: 2.5rem 0; }

  /* Move the lightbox arrows to the bottom so they miss the photo. */
  .lightbox__prev { left: 1rem;  top: auto; bottom: 1.25rem; transform: none; }
  .lightbox__next { right: 1rem; top: auto; bottom: 1.25rem; transform: none; }
}
