/* ============================================================
   The HUGS Project of Elkhart — Modernized Stylesheet
   Based faithfully on the original RapidWeaver "Cafe" theme layout:
   - American flag fixed background
   - Centered white content box (max 900px)
   - Banner image at top with white border
   - Site title large text on dark overlay
   - Horizontal dark-gray nav bar
   - Two-column home: HUG info left / stats counter right
   - Rotating troop letter in bottom-right column
   Colors preserved exactly: navy rgb(31,73,125), dark navy rgb(42,50,125), red rgb(149,55,52)
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #1F497D;   /* rgb(31,73,125) -- original counter heading color */
  --navy-dk:   #2a327d;   /* rgb(42,50,125) -- original counter numbers */
  --red:       #953734;   /* rgb(149,55,52) -- original red subheads */
  --link:      #0B189B;   /* original link color */
  --link-hov:  #07106C;
  --body-text: #424242;   /* original body text color */
  --content-w: 900px;
  --font-body: "Lucida Grande", Lucida, Verdana, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--body-text);
  /* Original site: american flag jpeg, fixed, full background */
  background: url('/assets/images/americanflag.jpeg') center top / cover fixed;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hov); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   OUTER WRAPPER — dark overlay on top portion, like the original
   ============================================================ */

#outerWrapper {
  width: 100%;
  background: linear-gradient(to bottom,
    rgba(18,18,18,0.85) 0px,
    rgba(18,18,18,0.80) 220px,
    rgba(18,18,18,0.60) 400px,
    rgba(0,0,0,0)       580px
  );
}

/* ============================================================
   HEADER — patriotic banner using americanflag.jpeg + HUGS logo
   Replaces the original "Café" theme stock coffee-bean photo.
   The flag fills the banner frame; the logo is centered over it.
   ============================================================ */

.site-banner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 20px 24px 0;
}

/* Patriotic banner frame: flag background, white border, logo centered */
.site-banner-inner {
  width: 100%;
  min-height: 160px;
  background: url('/assets/images/americanflag.jpeg') center center / cover no-repeat;
  border: 14px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.65);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle dark overlay so logo reads cleanly against the flag */
.site-banner-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 40, 0.32);
}

/* Logo sits above the overlay */
.site-banner-inner img {
  position: relative;
  z-index: 1;
  max-width: 220px;
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Slight drop shadow so logo pops off the flag */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55));
  display: block;
  margin: 0 auto;
}

/* Large site title, centered, on dark background — like original h1.siteTitle */
.site-title {
  text-align: center;
  padding: 16px 24px 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 4.5vw, 52px);
  font-weight: bold;
  color: #E3E3E3;
  letter-spacing: -1px;
  text-shadow: #3a3a3a 0 1px 3px;
  line-height: 1.1;
}

.site-slogan {
  text-align: center;
  font-size: 15px;
  color: rgba(210,210,210,0.85);
  padding: 0 24px 10px;
  font-style: italic;
}

/* ============================================================
   NAV BAR — horizontal, dark gray, like original
   Original: dark gradient, 12px font, items float left 114px wide
   Modernized: flexbox, same dark look, red hover, sticky
   ============================================================ */

.nav-outer {
  max-width: var(--content-w);
  margin: 10px auto 0;
  padding: 0 24px;
}

nav.main-nav {
  border-radius: 5px;
  background: linear-gradient(to bottom, #5a5a5a 0%, #383838 100%);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.75), 0 2px 6px rgba(0,0,0,0.4);
  height: 40px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-family: var(--font-body);
  font-size: 12px;
  color: #a9a9a9;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid rgba(0,0,0,0.3);
  padding: 0 4px;
  min-width: 0;
}

nav.main-nav a:last-child { border-right: none; }

nav.main-nav a:hover,
nav.main-nav a.active {
  background: linear-gradient(to bottom, #a83030 0%, #7a1818 100%);
  color: #fff;
  text-decoration: none;
}

/* Mobile nav */
.mobile-nav-bar {
  display: none;
  max-width: var(--content-w);
  margin: 10px auto 0;
  padding: 0 24px;
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(to bottom, #5a5a5a 0%, #383838 100%);
  border-radius: 5px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.75);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-site-label { color: #ccc; font-size: 12px; font-weight: bold; }
.mobile-toggle { background: none; border: none; color: #bbb; font-size: 22px; cursor: pointer; line-height: 1; }

/* ============================================================
   CONTENT WRAPPER — the white box, like original #contentWrapper
   Original: 860px, centered, white background, box-shadow
   ============================================================ */

.content-wrapper {
  max-width: var(--content-w);
  margin: 14px auto 0;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,0.35);
  border-radius: 3px 3px 0 0;
  padding: 32px 36px 40px;
  min-height: 400px;
}

/* ============================================================
   HOMEPAGE LAYOUT — two columns, matching original Stacks layout
   LEFT half: logo image + "What is a HUG?" text
   RIGHT half: stats counter block
   ============================================================ */

.home-top-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Left: logo centered + "What is a HUG?" */
.col-hug-info .logo-wrap {
  text-align: center;
  margin-bottom: 14px;
}
.col-hug-info .logo-wrap img { max-width: 220px; margin: 0 auto; }

.col-hug-info .hug-heading {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  font-style: italic;
  text-decoration: underline;
  margin-bottom: 10px;
  color: var(--body-text);
}

.col-hug-info .hug-text {
  font-size: 15px;
  line-height: 1.68;
  text-align: center;
  color: var(--body-text);
}

/* Right: stats counter — original inline styles preserved */
.col-stats .stats-period-head {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  color: var(--navy);        /* rgb(31,73,125) */
  margin-bottom: 10px;
  line-height: 1.25;
}

.col-stats .stats-commitment {
  text-align: center;
  font-size: 21px;
  font-weight: bold;
  color: var(--red);         /* rgb(149,55,52) */
  line-height: 1.3;
  margin-bottom: 4px;
}

.col-stats .stats-thanks {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: var(--red);
  line-height: 1.3;
  margin-bottom: 20px;
}

/* 2x2 grid for the four stats — mirrors original two-column Stacks layout */
.stats-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.stat-box {
  text-align: center;
  padding: 12px 8px;
  border: 1px solid #dde4f0;
  border-radius: 4px;
  background: #f7f9fe;
}

.stat-box .num {
  font-size: 28px;
  font-weight: bold;
  color: var(--navy-dk);      /* rgb(42,50,125) */
  line-height: 1.1;
  display: block;
}

.stat-box .lbl {
  font-size: 13px;
  font-weight: bold;
  color: var(--navy-dk);
  display: block;
  margin-top: 5px;
}

/* Divider — original used <hr class="dashed_fade"> */
.dashed-divider {
  border: none;
  border-top: 1px dashed rgba(0,0,0,0.22);
  margin: 28px 0;
}

/* ============================================================
   HOMEPAGE BOTTOM SECTION — two columns:
   LEFT: Facebook link (narrow)
   RIGHT: "Our Troops Say" + thankyo image + rotating letter
   Mirrors original second columns_stack block
   ============================================================ */

.home-bottom-cols {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: start;
}

.col-fb {
  text-align: center;
  border-right: 1px dashed rgba(0,0,0,0.2);
  padding-right: 20px;
}

.col-fb img { width: 56px; margin: 0 auto 8px; }
.col-fb p { font-size: 13px; margin-top: 4px; }

.col-letters { }

.troops-heading {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  text-decoration: underline;
  margin-bottom: 12px;
}

.thankyo-wrap {
  text-align: center;
  margin-bottom: 14px;
}
.thankyo-wrap img { max-width: 380px; margin: 0 auto; }

/* The letter snippet — original used small Lucida Grande, black */
.letter-snippet {
  font-size: 14px;
  line-height: 1.72;
  color: #111;
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid #ddd;
}

.read-more-link { font-size: 13px; color: var(--link); }
.read-more-link:hover { color: var(--link-hov); }

/* CFC — centered, red, bold, large */
.cfc-line {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: #FB0007;
  margin-top: 28px;
}

/* ============================================================
   FOOTER — original: small, centered, blue link color
   ============================================================ */

.site-footer {
  max-width: var(--content-w);
  margin: 0 auto;
  text-align: center;
  padding: 10px 24px 36px;
  font-size: 12px;
  color: var(--link);
}
.site-footer a { color: var(--link); }
.site-footer a:hover { color: var(--link-hov); }

/* ============================================================
   INNER PAGE TITLE — for About, Donate, Letters, etc.
   ============================================================ */

.page-title-bar {
  background: rgba(15,15,15,0.78);
  text-align: center;
  padding: 20px 24px 16px;
}
.page-title-bar h1 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 4vw, 40px);
  color: #E3E3E3;
  text-shadow: #333 0 1px 3px;
  font-weight: bold;
}
.page-title-bar p {
  color: rgba(200,200,200,0.8);
  font-size: 14px;
  margin-top: 6px;
  font-style: italic;
}

/* ============================================================
   TROOP LETTERS PAGE
   ============================================================ */

.letter-entry {
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px dashed rgba(0,0,0,0.2);
}
.letter-entry:last-child { border-bottom: none; }

.letter-entry h2 {
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 3px;
  font-weight: bold;
}

.letter-date {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
  font-style: italic;
}

.letter-body { font-size: 14px; line-height: 1.75; color: var(--body-text); }
.letter-body p { margin-bottom: 8px; }

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.section-head {
  font-size: 20px;
  color: var(--navy);
  font-weight: bold;
  margin-bottom: 14px;
  border-bottom: 2px solid #eee;
  padding-bottom: 6px;
}

.about-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.about-text p { margin-bottom: 10px; font-size: 14px; }

.about-img img {
  width: 100%;
  border: 6px solid #f0f0f0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.18);
  border-radius: 2px;
}

/* ============================================================
   DONATE PAGE
   ============================================================ */

.donate-h3 {
  font-size: 17px;
  color: var(--navy);
  margin: 22px 0 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.donate-p { margin-bottom: 10px; font-size: 14px; }

.mail-address {
  font-family: "Courier New", monospace;
  font-size: 14px;
  background: #f6f6f6;
  border-left: 4px solid var(--navy);
  padding: 12px 16px;
  margin: 10px 0 14px;
  line-height: 1.85;
}

/* ============================================================
   PHOTOS PAGE
   ============================================================ */

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.photo-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 5px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
  .home-top-cols { grid-template-columns: 1fr; }
  .home-bottom-cols { grid-template-columns: 1fr; }
  .col-fb { border-right: none; border-bottom: 1px dashed rgba(0,0,0,0.2); padding-right: 0; padding-bottom: 16px; }
  .about-block { grid-template-columns: 1fr; }
  .photos-grid { grid-template-columns: repeat(2, 1fr); }
  .content-wrapper { padding: 20px 18px 30px; margin: 10px 10px 0; }
  .site-banner { padding: 14px 14px 0; }
  .nav-outer { display: none; }
  .mobile-nav-bar { display: block; }
  nav.main-nav { display: none; flex-direction: column; height: auto; position: static; border-radius: 4px; }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { flex: none; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.2); padding: 12px 16px; justify-content: flex-start; font-size: 13px; }
}

@media (max-width: 480px) {
  .photos-grid { grid-template-columns: 1fr; }
  .stats-2x2 { grid-template-columns: 1fr; }
  .site-title { font-size: 22px; letter-spacing: 0; }
  .content-wrapper { margin: 8px 6px 0; }
}

/* ============================================================
   UTILITY
   ============================================================ */

.skip-link { position: absolute; top: -40px; left: 0; background: var(--red); color: #fff; padding: 8px 16px; z-index: 999; }
.skip-link:focus { top: 0; }
