/* SAL 468 — Sons of the American Legion, Julian CA (American Legion national style) */

:root {
  /* American Legion brand (from SAL-Branding / national site) */
  --al-navy: #003A70;
  --al-navy-light: #004a8f;
  --al-red: #CE0E2D;
  --al-red-dark: #a00b23;
  --white: #ffffff;
  --gray: #5a6c7d;
  --gray-light: #e8ecef;
  --gray-bg: #f5f6f8;
  --max-width: 960px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0, 58, 112, 0.1);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.65;
  color: var(--al-navy);
  background: var(--white);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utility bar (national style: dark blue strip) */
.utility-bar {
  background: var(--al-navy);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.utility-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.utility-bar a,
.utility-bar-link {
  color: var(--white);
  text-decoration: none;
}

.utility-bar a:hover,
.utility-bar-link:hover {
  text-decoration: underline;
}

.utility-bar .btn-join,
.utility-bar .btn-donate {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.utility-bar .btn-join {
  background: var(--white);
  color: var(--al-red);
  border: 2px solid var(--al-red);
}

.utility-bar .btn-join:hover {
  background: var(--al-red);
  color: var(--white);
}

.utility-bar .btn-donate {
  background: var(--al-red);
  color: var(--white);
  border: 2px solid var(--al-red);
}

.utility-bar .btn-donate:hover {
  background: var(--al-red-dark);
  border-color: var(--al-red-dark);
}

/* Main header (white bar, national style) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--al-navy);
}

.site-header .logo-wrap:hover {
  color: var(--al-navy);
}

.site-header .logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.site-header .logo-img.logo-wordmark {
  height: 40px;
  width: auto;
}

.site-header .logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav a {
  color: var(--al-navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nav a:hover {
  color: var(--al-red);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--al-navy);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius);
}

.menu-toggle:hover {
  background: var(--gray-light);
}

.menu-toggle::before {
  content: "☰";
}

.site-header.menu-open .menu-toggle::before {
  content: "✕";
}

@media (max-width: 700px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    flex-direction: column;
    align-items: flex-start;
    padding: 4rem 1.5rem 1.5rem;
    background: var(--white);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    border-left: 1px solid var(--gray-light);
  }

  .site-header.menu-open .nav {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }
}

/* Hero — dark blue, wordmark logo, star accent */
.hero {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--al-navy);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L33 20L30 22L27 20Z' fill='%23ffffff' fill-opacity='0.06'/%3E%3Cpath d='M50 15L52 18L50 20L48 18Z' fill='%23ffffff' fill-opacity='0.05'/%3E%3Cpath d='M10 25L12 28L10 30L8 28Z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  color: var(--white);
  padding: 3.5rem 1.5rem;
}

.hero-inner {
  max-width: 680px;
}

.hero .hero-logo {
  height: auto;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 1.5rem;
  display: block;
}

/* Wordmark on dark blue: lighten so it’s visible (navy+red logo on dark bg) */
/* Wordmark on dark blue: blend so black background disappears into blue; keep navy/red visible */
.hero-logo-wordmark {
  mix-blend-mode: lighten;
  isolation: isolate;
}

.tagline {
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
  font-weight: 700;
  opacity: 0.98;
  letter-spacing: 0.02em;
}

.hero-sub {
  margin: 0 0 2rem;
  opacity: 0.92;
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero-ctas .btn-primary {
  background: var(--al-red);
  color: var(--white);
  border: 2px solid var(--al-red);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  display: inline-block;
}

.hero-ctas .btn-primary:hover {
  background: var(--al-red-dark);
  border-color: var(--al-red-dark);
}

.hero-ctas .btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  display: inline-block;
}

.hero-ctas .btn-secondary:hover {
  background: var(--white);
  color: var(--al-navy);
}

/* Sections — more space and clearer hierarchy */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--gray-bg);
}

.section-dark {
  background: var(--al-navy);
  color: var(--white);
  padding: 4rem 0;
}

.section-dark .section-intro,
.section-dark h2 {
  color: var(--white);
}

.section-dark .section-intro {
  opacity: 0.9;
}

.section h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--al-navy);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.section-intro {
  margin: 0 0 2rem;
  color: var(--gray);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Center section content for balance (gallery + fundraising) */
#gallery h2,
#gallery .section-intro,
#fundraising h2,
#fundraising .section-intro {
  text-align: center;
}

.section-dark .section-intro {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;
}

/* About (in section-dark) */
.about-content p {
  margin: 0 0 1.25rem;
  max-width: 65ch;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  line-height: 1.7;
}

.section-dark .about-content p {
  color: rgba(255, 255, 255, 0.95);
}

/* Board — cards national style */
.board-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.board-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--al-red);
}

.board-card .role {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--al-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.board-card .name {
  font-weight: 600;
  color: var(--al-navy);
  font-size: 1rem;
}

/* Events — legend and 3-month calendars */
.events-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-bottom: 2.25rem;
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.5;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-item strong {
  color: var(--al-navy);
}

.legend-sal::before,
.legend-breakfast::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-sal::before {
  background: var(--al-navy);
}

.legend-breakfast::before {
  background: var(--al-red);
}

.calendars-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cal-nav-btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--al-navy);
  background: var(--white);
  border: 2px solid var(--al-navy);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.cal-nav-btn:hover:not(:disabled) {
  background: var(--al-navy);
  color: var(--white);
}

.cal-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cal-range {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray);
}

.calendars-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: start;
}

.calendar-wrap {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}

.calendar-wrap:hover,
.calendar-wrap:focus-within {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(0, 58, 112, 0.15);
  z-index: 1;
}

.calendar-month-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--al-navy);
  text-align: center;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mini-calendar {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mini-calendar th {
  text-align: center;
  font-weight: 700;
  color: var(--al-navy);
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.mini-calendar td {
  text-align: center;
  padding: 0.35rem;
  border: none;
  vertical-align: top;
}

.cal-empty {
  background: transparent;
}

.cal-day {
  position: relative;
  min-height: 2.2em;
}

.cal-num {
  display: block;
  color: var(--al-navy);
  font-weight: 600;
}

.cal-day.cal-today .cal-num {
  background: var(--al-navy);
  color: var(--white);
  border-radius: 50%;
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  margin: 0 auto;
}

.cal-day.cal-sal {
  background: rgba(0, 58, 112, 0.12);
}

.cal-day.cal-breakfast {
  background: rgba(206, 14, 45, 0.1);
}

.cal-day.cal-has-events {
  cursor: pointer;
}

.cal-day.cal-has-events:hover {
  outline: 2px solid var(--al-red);
  outline-offset: 1px;
}

.cal-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.cal-label-sal {
  color: var(--al-navy);
}

.cal-label-breakfast {
  color: var(--al-red);
}

.cal-label-onetime {
  color: var(--al-navy);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
  display: block;
}

.cal-day.cal-onetime {
  background: rgba(0, 58, 112, 0.08);
}

/* Event detail modal */
.cal-event-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s ease, opacity 0.2s ease;
}

.cal-event-modal.cal-event-modal-visible {
  visibility: visible;
  opacity: 1;
}

.cal-event-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 58, 112, 0.4);
}

.cal-event-modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.cal-event-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-light);
}

.cal-event-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--al-navy);
}

.cal-event-modal-close {
  padding: 0.25rem 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.cal-event-modal-close:hover {
  color: var(--al-navy);
  background: var(--gray-light);
}

.cal-event-modal-body {
  padding: 1.25rem;
}

.cal-event-detail {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-light);
}

.cal-event-detail:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cal-event-detail-name {
  display: block;
  color: var(--al-red);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.cal-event-detail-time,
.cal-event-detail-place,
.cal-event-detail-purpose {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--al-navy);
  line-height: 1.5;
}

.cal-event-detail-link {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.cal-event-detail-link a {
  color: var(--al-red);
  font-weight: 600;
}

.cal-event-detail-link a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .calendars-container {
    grid-template-columns: 1fr;
  }

  .calendar-wrap:hover,
  .calendar-wrap:focus-within {
    transform: scale(1.02);
  }
}

.events-note {
  margin: 1.25rem 0 0;
  font-size: 1.05rem;
  color: var(--gray);
}

.events-note a {
  color: var(--al-navy);
  font-weight: 600;
}

.events-note a:hover {
  color: var(--al-red);
}

/* Gallery */
#galleries-container {
  margin-bottom: 2.5rem;
}

.gallery-block {
  margin-bottom: 2.5rem;
}

.gallery-block:last-child {
  margin-bottom: 0;
}

.gallery-block-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--al-navy);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--al-red);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gallery-block .gallery-grid {
  margin-bottom: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  border: 1px solid var(--gray-light);
}

.gallery-placeholder {
  grid-column: 1 / -1;
  background: var(--gray-bg);
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  color: var(--gray);
}

.submit-photos {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-light);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.submit-photos h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.photo-form-cta-wrap {
  margin: 1rem 0 0;
}

.photo-submit-form {
  display: grid;
  gap: 0.75rem;
  max-width: 400px;
  margin-top: 1rem;
}

.photo-submit-form label {
  font-size: 0.9rem;
  font-weight: 600;
}

.photo-submit-form select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  min-width: 200px;
}

.photo-submit-form input[type="text"],
.photo-submit-form input[type="email"],
.photo-submit-form input[type="file"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  font-size: 1rem;
}

.field-help {
  display: block;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.form-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--gray);
}

/* Fundraising */
.fundraising-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--al-red);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--gray-light);
}

.fundraising-goal,
.fundraising-raised {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.goal-label,
.raised-label {
  font-size: 1rem;
  color: var(--gray);
}

.goal-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--al-navy);
}

.raised-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--al-red);
}

.progress-wrap {
  height: 16px;
  background: var(--gray-light);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  max-width: 100%;
  background: var(--al-red);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.fundraising-cta {
  margin: 1.25rem 0 0;
}

.fundraising-cta .btn {
  display: inline-block;
}

.fundraising-note {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  background: var(--al-red);
  border: 2px solid var(--al-red);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.btn:hover {
  background: var(--al-red-dark);
  border-color: var(--al-red-dark);
  color: var(--white);
}

/* Footer — dark blue national style */
.site-footer {
  padding: 1.75rem;
  background: var(--al-navy);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  text-align: center;
  line-height: 1.6;
}

.site-footer a {
  color: var(--white);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--white);
  opacity: 0.9;
}

.footer-version {
  opacity: 0.85;
  font-size: 0.9em;
}

/* Version notes (Konami code ↑↑↓↓←→←→BA) */
.version-notes {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 58, 112, 0.85);
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s ease, opacity 0.2s ease;
}

.version-notes[hidden] {
  display: none;
}

.version-notes.version-notes-visible {
  visibility: visible;
  opacity: 1;
  display: flex;
}

.version-notes-inner {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.5rem 2rem 3rem;
}

.version-notes-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--al-navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.version-notes-content {
  font-size: 0.95rem;
  color: var(--al-navy);
  line-height: 1.6;
}

.version-notes-list {
  margin: 0;
  padding-left: 1.25rem;
}

.version-notes-list li {
  margin-bottom: 0.5rem;
}

.version-notes-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.version-notes-close:hover {
  color: var(--al-navy);
  background: var(--gray-light);
}
