/* ==========================================================================
   Munting Lapis Neighborhood Center, Inc.
   Pixel-faithful rebuild of the original site-builder design.
   ========================================================================== */

:root {
  --blue: #61adff;          /* sky-blue header + alternating band */
  --green: #ddedd9;         /* pale sage green alternating band */
  --yellow: #ffe775;        /* heading highlight bands */
  --teal-light: #8ad6c6;
  --teal: #5aa897;
  --teal-dark: #3f8071;
  --ink: #1d1d1d;
  --content-width: 980px;
  --font-script: "Oleo Script", "Brush Script MT", cursive;
  --font-body: Georgia, "Times New Roman", serif;
  --font-nav: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--green);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ===== Top white PayPal bar ===== */
.topbar { background: #ffffff; border-bottom: 1px solid #ececec; }
.topbar__inner { max-width: var(--content-width); margin: 0 auto; padding: 6px 14px 7px; }
.paypal-donate { margin: 0; display: inline-block; line-height: 0; }
.paypal-donate input[type="image"] { border: 0; }

/* ===== Blue masthead ===== */
.masthead { background: var(--blue); }
.masthead__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}
.logo { display: inline-block; flex: 0 0 auto; }
.logo img { height: 130px; width: auto; }

/* 3D teal navigation buttons */
.mainnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mainnav a {
  display: inline-block;
  font-family: var(--font-nav);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
  text-decoration: none;
  padding: 7px 24px;
  border: 2px solid #111;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--teal-light) 0%, var(--teal) 55%, var(--teal-dark) 100%);
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.mainnav a:hover { filter: brightness(1.06); }
.mainnav a:active,
.mainnav a.is-active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4);
}

/* ===== Alternating full-width section bands ===== */
main > section { width: 100%; }
main > section:nth-child(odd)  { background: var(--green); }
main > section:nth-child(even) { background: var(--blue); }
/* Custom-colored section overrides (win over nth-child) */
main > section.section--rice { background: #65a953; }
main > section.section--grad { background: #a0cb95; }
main > section.section--tess { background: #a9ddf0; }
main > section.section--green { background: #ddedd9; }
main > section.section--xu { background: #c2e7ec; }
main > section.section--christmas { background: #8bd5f4; }

.wrap { max-width: var(--content-width); margin: 0 auto; padding: 28px 20px 46px; }

/* ===== Intro: text column + image column ===== */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 30px;
  align-items: stretch;
}
.intro-text { padding-right: 0; }
.intro-images {
  display: flex;
  flex-direction: column;
  border-left: 6px solid #8aa05a;
  border-right: 6px solid #8aa05a;
  margin-top: -28px;
  margin-bottom: -46px;
}
.intro-images img {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  object-fit: cover;
  display: block;
}

/* ===== Headings ===== */
.script-title {
  font-family: var(--font-script);
  font-weight: 700;
  color: #111;
  font-size: 2.5rem;
  line-height: 1.12;
  background: var(--yellow);
  padding: 6px 16px;
  margin: 0 0 18px;
  text-shadow: 2px 2px 0 #4f7a3a;
}
.yellow-band {
  font-family: var(--font-script);
  font-weight: 700;
  color: #111;
  font-size: 1.95rem;
  background: var(--yellow);
  padding: 6px 16px;
  margin: 26px 0 16px;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #4f7a3a;
}
.section-heading {
  font-family: var(--font-script);
  font-weight: 700;
  color: #111;
  font-size: 1.95rem;
  background: var(--yellow);
  padding: 6px 16px;
  margin: 0 auto 28px;
  text-align: center;
  max-width: 940px;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #4f7a3a;
}

/* ===== Body text ===== */
p { margin: 0 0 1em; }
.quote { font-style: italic; }
.bullets { margin: 0 0 1em; padding-left: 26px; }
.bullets li { margin-bottom: 3px; }
.services-intro { margin-bottom: 3px; }
.services-list { list-style: none; margin: 0 0 1.1em; padding-left: 30px; }
.services-list li { position: relative; padding-left: 16px; }
.services-list li::before { content: "-"; position: absolute; left: 0; }

/* ===== Photos thumbnail grid ===== */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px 24px;
  max-width: 940px;
  margin: 0 auto;
}
.photo {
  text-align: center;
  margin: 0;
  flex: 0 1 calc(33.333% - 16px);
  min-width: 240px;
}
.photo img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: 5px solid #6cbf3f;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.photo img:hover { transform: scale(1.03); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3); }
.photo figcaption {
  font-size: 1rem;
  margin-top: 8px;
  color: #111;
  background: #fff;
  padding: 5px 8px;
}

/* ===== Event galleries (lower page) ===== */
.gallery-block { max-width: 940px; margin: 0 auto; }
.gallery-block + .gallery-block { margin-top: 34px; }

/* Green heading band that holds the title + optional subtitle + divider */
.gallery-band {
  background: #c8e690;
  max-width: 940px;
  margin: 0 auto 22px;
  padding: 10px 20px 16px;
  text-align: center;
}
.gallery-band h2 {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.95rem;
  color: #111;
  margin: 0;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #4f7a3a;
}
.gallery-band .band-sub {
  margin: 6px 0 0;
  font-style: normal;
  font-weight: 700;
  color: #333;
}
.gallery-band::after {
  content: "";
  display: block;
  width: 80%;
  margin: 12px auto 0;
  border-top: 1px solid #8caa5c;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  justify-content: center;
}
/* Yellow band variant (e.g. Christmas Giveaways) */
.gallery-band--yellow { background: var(--yellow); }
/* Long single-line title that must not wrap */
.gallery-band--oneline h2 {
  white-space: nowrap;
  font-size: clamp(0.95rem, 2.4vw, 1.6rem);
}
/* One-line title that keeps the normal heading size */
.gallery-band--nowrap h2 { white-space: nowrap; }
/* 2-column variant with a full-width lead image */
.gallery--2col { grid-template-columns: repeat(2, 1fr); }
.gallery--2col .gallery-lead { grid-column: 1 / -1; }
.gallery--2col .gallery-lead img {
  height: 380px;
  border: 25px solid #6cbf3f;
}
/* Trailing full-width image inside a 3-column gallery */
.gallery .gallery-wide { grid-column: 1 / -1; }
.gallery .gallery-wide img { height: 420px; }
/* Centered variant: last partial row centers (e.g. Apron Making) */
.gallery--center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.gallery--center img {
  flex: 0 1 calc(33.333% - 12px);
  min-width: 240px;
}
/* Rounded-corner image variant (e.g. Rice Distribution) */
.gallery.gallery--rounded img {
  border: 0;
  border-radius: 16px;
}
/* Rounded image with orange border (e.g. MLNC Art Class) */
.gallery.gallery--rounded-orange img {
  border: 10px solid #e08a3c;
  border-radius: 16px;
}
/* 4-column portrait variant (e.g. Graduation portraits) */
.gallery--portrait { grid-template-columns: repeat(4, 1fr); }
.gallery--portrait img { height: 320px; object-fit: cover; }
.gallery img {
  width: 100%;
  height: 270px;
  object-fit: cover;
  border: 2px solid #8aa05a;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery--2col img { height: 300px; }
.gallery img:hover { transform: scale(1.02); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3); }

/* ===== Video embeds ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-grid .caption-note { text-align: center; font-style: italic; margin: 6px 0 0; }

/* ===== Link buttons (e.g. Sportsfest wrap-up videos) ===== */
.link-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px 40px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.link-btn {
  display: block;
  font-family: var(--font-nav);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 14px 22px;
  border: 2px solid #111;
  border-radius: 4px;
  background: linear-gradient(180deg, #8cc152 0%, #5a9e3a 55%, #3f7a28 100%);
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  line-height: 1.3;
}
.link-btn:hover {
  background: linear-gradient(180deg, #f0a44e 0%, #e07b1f 55%, #c4660f 100%);
  text-decoration: none;
}
.link-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4); }
.link-btn-grid .caption-note { text-align: center; font-style: normal; font-weight: bold; margin: 10px 0 0; }

/* Shake animation triggered when element scrolls into view */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
.shake-on-view.is-visible { animation: shake 0.7s ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .shake-on-view.is-visible { animation: none; }
}

/* ===== Contact form ===== */
.form-grid { max-width: 560px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #9a9a9a;
  border-radius: 3px;
  font: inherit;
  background: #fff;
}
.form-row input:focus,
.form-row textarea:focus { outline: none; border-color: var(--teal); }
.btn-submit {
  font-family: var(--font-nav);
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  border: 2px solid #111;
  cursor: pointer;
  padding: 12px 30px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--teal-light) 0%, var(--teal) 55%, var(--teal-dark) 100%);
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.btn-submit:active { transform: translate(2px, 2px); box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4); }
.form-status { margin-top: 12px; font-weight: bold; }
.form-note { font-size: 0.85rem; color: #444; }

/* ===== Lightbox ===== */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.9); z-index: 100;
  align-items: center; justify-content: center; padding: 30px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255, 255, 255, 0.15);
  border: 0; color: #fff; font-size: 2rem;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
}
.lightbox__close { top: 20px; right: 20px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

/* ===== Footer ===== */
.site-footer {
  background: #ffdb30;
  color: #222;
  text-align: left;
  padding: 26px 14px;
  font-family: var(--font-body);
}
.site-footer > * {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}
.site-footer h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 0 auto 8px;
  color: #222;
}
.site-footer p { margin: 1px auto; font-size: 0.82rem; }
.site-footer a { color: #222; }
.site-footer .footer-meta { margin-top: 10px; font-size: 0.78rem; }

/* ===== Mobile ===== */
@media (max-width: 780px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-text { padding-right: 0; margin-bottom: 18px; }
  .mainnav { justify-content: center; gap: 10px; }
  .mainnav a { padding: 10px 16px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
