/* ======================================================
   Troop & Crew 537
   Colors: #005A9C (blue), #CE1126 (red), #252525 (text)
   ====================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 85%;
  line-height: 160%;
  color: #252525;
  background: #fff;
  width: 100%;
}

a {
  color: #005A9C;
  text-decoration: underline;
}

a:hover {
  color: #CE1126;
}

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

/* ── TOP LOCATION BAR ── */
#location-bar {
  background: #005A9C;
  color: #efefef;
  font-size: 85%;
  font-family: Helvetica, Arial, sans-serif;
  padding: 8px 20px;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── HEADER / NAV ── */
header#page-header {
  max-width: 990px;
  width: 97%;
  height: 130px;
  padding: 10px 0 10px 0;
  margin: 0 auto 0 auto;
  overflow: auto;
}


#fleurdelis {
  float: left;
  width: 20%;
}

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

#brand {
  float: left;
  width: 39%;
  padding-left: 18px;
  padding-right: 15px;
  padding-top: 18px;
  border-left: 3px solid #005A9C;
}

#site-tagline {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #005A9C;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 5px 0;
  line-height: 100%;
}

h1#site-name {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 34px;
  line-height: 100%;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  color: #CE1126;
  font-weight: bold;
}

#site-name a, #site-name a:visited {
  text-decoration: none;
  color: #CE1126;
}

#site-name a:hover {
  color: #CE1126;
}

#charter-box {
  float: right;
  width: 33%;
  text-align: right;
  color: #005A9C;
  padding-right: 5px;
  padding-top: 12px;
  font-size: 90%;
  line-height: 140%;
}

#charter-box a {
  color: #005A9C;
  text-decoration: none;
}

#charter-box a:hover {
  color: #CE1126;
  text-decoration: underline;
}

/* ── MAIN NAVIGATION ── */
#main-navigation {
  width: 100%;
  background-color: #005A9C;
  clear: both;
}

#main-navigation nav {
  font-size: 100%;
  max-width: 990px;
  width: 97%;
  margin: 0 auto;
  position: relative;
  z-index: 1000;
}

#main-navigation nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  height: 40px;
}

#main-navigation nav ul li {
  position: relative;
  list-style: none;
  display: flex;
  align-items: stretch;
  background-color: #005A9C;
  text-align: center;
  white-space: nowrap;
  flex: 1;
}

#main-navigation nav ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #ffffff;
  text-decoration: none;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 90%;
  font-weight: bold;
  padding: 0 0.75em;
  border-left: 1px solid #0065AD;
  border-bottom: none;
  transition: background 0.15s;
  line-height: 100%;
}

#main-navigation nav ul li:first-child a {
  border-left: none;
}

#main-navigation nav ul li a:hover,
#main-navigation nav ul li.current a {
  background: #CE1126;
  color: #ffffff;
}

#main-navigation nav ul li:last-child a,
#main-navigation nav ul li li a {
  border-right: 1px solid #0065AD;
}

/* ── PAGE LAYOUT ── */
#wrapper {
  max-width: 990px;
  width: 97%;
  margin: 0 auto;
  padding: 15px 0 10px 0;
  background: #fff;
}

/* Default 2-column layout for non-homepage pages */
#content {
  width: 66%;
  margin: 0 1.5% 0 1.5%;
  float: left;
  overflow-x: hidden;
}

#sidebar {
  width: 28%;
  margin: 0 1.5% 0 1.4%;
  float: right;
  overflow-x: hidden;
}

/* Homepage-specific overrides */
#front-pic + #content {
  width: 28%;
  float: right;
}

#front-pic ~ #sidebar {
  display: none;
}


/* ── HERO IMAGE (homepage only) ── */
#front-pic {
  width: 66.161%;
  float: left;
  clear: left;
}

#front-image {
  width: 100%;
  height: auto;
  display: block;
}

#front-bottom {
  width: 100%;
  clear: both;
  padding-top: 15px;
  overflow-y: auto;
}

.content-third {
  width: 32.323%;
  margin-left: 1.515%;
  float: left;
  overflow-x: hidden;
}

.content-third:first-child {
  margin-left: 0%;
}

#content h1,
#front-bottom h1 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 190%;
  font-weight: bold;
  color: #005A9C;
  margin: 0 0 10px 0;
  line-height: 130%;
}

#content h2,
#front-bottom h2 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 170%;
  font-weight: bold;
  color: #005A9C;
  margin: 20px 0 8px;
  line-height: 130%;
}

#content h2 a,
#front-bottom h2 a {
  color: #005A9C;
  text-decoration: none;
}

#content h2 a:hover,
#front-bottom h2 a:hover {
  text-decoration: underline;
}

#content h3,
#front-bottom h3 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 150%;
  font-weight: bold;
  color: #005A9C;
  margin: 0 0 10px 0;
  line-height: 130%;
}

#content p,
#front-bottom p { 
  margin-bottom: 12px; 
}

#content ul, #content ol {
  margin: 8px 0 12px 24px;
}

#content li { margin-bottom: 4px; }

/* ── POST META ── */
.post-meta {
  font-size: 12px;
  color: #777;
  font-family: Arial, sans-serif;
  margin-bottom: 10px;
}

/* ── PHOTOS PAGE ── */
.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.photo-gallery img {
  width: calc(33.333% - 6px);
  height: 160px;
  object-fit: cover;
  display: block;
}

/* ── CONTACT FORM ── */
.contact-form {
  max-width: 500px;
}

.contact-form .field-row {
  margin-bottom: 14px;
}

.contact-form label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #444;
}

.contact-form input[type=text],
.contact-form input[type=email],
.contact-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  background: #fafafa;
}

.contact-form input[type=text]:focus,
.contact-form input[type=email]:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #005A9C;
  background: #fff;
}

.contact-form textarea { min-height: 100px; resize: vertical; }

.contact-form .name-row {
  display: flex;
  gap: 10px;
}
.contact-form .name-row > div { flex: 1; }

.submit-btn {
  background: #005A9C;
  color: #fff;
  border: none;
  padding: 9px 22px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 90%;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.submit-btn:hover { background: #CE1126; }

/* ── SIDEBAR ── */
#sidebar .widget {
  margin-bottom: 20px;
}

#sidebar img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

#sidebar .search-form input[type=search] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  font-size: 90%;
  font-family: Helvetica, Arial, sans-serif;
  background: #005A9C;
  color: white;
  border: 1px solid #005A9C;
  border-radius: 3px;
  font-weight: bold;
}

#sidebar .prepared-img {
  width: 100%;
}

/* ── FOOTER ── */
#footer {
  background: #005A9C;
  color: #efefef;
  padding: 10px 20px;
  margin-top: 30px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 80%;
  width: 100%;
  clear: both;
  text-align: center;
}

#footer-inner {
  max-width: 990px;
  margin: 0 auto;
  text-align: center;
}

#footer a {
  color: #efefef;
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
  background-color: #005A9C;
}

#footer p {
  margin: 0;
  line-height: 130%;
}

/* ── VENTURE CREW LOGO ── */
.crew-logo {
  max-width: 220px;
  margin: 10px 0 16px;
}

/* ── CALENDAR IFRAME WRAPPER ── */
.calendar-embed {
  margin: 16px 0;
  width: 100%;
  overflow: hidden;
}

/* ── RESOURCE IMAGES ── */
.resource-img {
  float: right;
  margin: 0 0 10px 16px;
  max-width: 180px;
}

/* ── ABOUT PAGE PHOTOS ── */
.supporting-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.supporting-photos img {
  width: calc(33.333% - 6px);
  height: auto;
}

.scoutmaster-photo {
  float: right;
  margin: 0 0 12px 16px;
  max-width: 260px;
}

.former-sm-photo {
  float: left;
  margin: 0 16px 12px 0;
  max-width: 140px;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ── MOBILE ── */
@media (max-width: 640px) {

  /* Header: switch to flexbox row, shrink logo and site name */
  header#page-header {
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    width: 100%;
  }
  #fleurdelis { float: none; width: auto; flex-shrink: 0; }
  #fleurdelis img { height: 56px; }
  #brand {
    float: none;
    width: auto;
    flex: 1;
    padding: 0 0 0 10px;
    padding-top: 0;
    border-left: 2px solid #005A9C;
  }
  h1#site-name { font-size: 20px; white-space: normal; }
  #site-tagline { font-size: 10px; }
  #charter-box { display: none; }

  /* Navigation: remove fixed height, let items wrap */
  #main-navigation { height: auto; }
  #main-navigation nav ul { flex-wrap: wrap; height: auto; }
  #main-navigation nav ul li { flex: 0 0 auto; }
  #main-navigation nav ul li a { padding: 8px 9px; font-size: 11px; }

  /* Layout: single column, full width */
  #wrapper { padding: 10px; }
  #content { width: 100%; float: none; margin: 0; }
  #sidebar { display: none; }

  /* Homepage: stack hero image, intro, and thirds */
  #front-pic { width: 100%; float: none; }
  #front-pic + #content { width: 100%; float: none; }
  .content-third { width: 100%; float: none; margin: 0 0 16px 0; }

  /* Calendar: reduce iframe height on small screens */
  .calendar-embed iframe { height: 380px; }

  /* Photo galleries: 2 columns instead of 3 */
  .photo-gallery img { width: calc(50% - 4px); height: 130px; }

  /* About page */
  .supporting-photos img { width: calc(50% - 4px); }
  .scoutmaster-photo, .former-sm-photo { float: none; max-width: 100%; margin: 0 0 12px; }
  .resource-img { float: none; max-width: 100%; margin: 0 0 12px 0; }
}
