/* ==========================================================================
   GLOBAL VARIABLES / DESIGN TOKENS
   --------------------------------------------------------------------------
   These reusable CSS variables define the site's main colors, shadows,
   borders, and corner radius. Changing a value here updates it everywhere
   that uses var(--variable-name).
   ========================================================================== */

:root {
  --rotary-blue: #17458f;
  --deep-blue: #103465;
  --rotary-gold: #f7a81b;
  --pale-blue: #eef5fb;
  --ink: #172033;
  --muted: #5f6878;
  --line: #dbe3ec;
  --white: #ffffff;
  --shadow: 0 14px 35px rgba(24, 48, 78, 0.12);
  --radius: 16px;
}


/* ==========================================================================
   GLOBAL RESET / BASIC PAGE STYLING
   ========================================================================== */

/* Makes width calculations more predictable by including padding and borders
   inside an element's declared width/height. */
* {
  box-sizing: border-box;
}

/* Enables smooth scrolling when clicking links to anchors on the same page. */
html {
  scroll-behavior: smooth;
}

/* Base styling for the entire website. */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f6f8fb;
  line-height: 1.55;
}

/* Default link color. */
a {
  color: var(--rotary-blue);
}

/* Darkens links when hovered. */
a:hover {
  color: var(--deep-blue);
}

/* Prevents images from overflowing their containers. */
img {
  max-width: 100%;
  display: block;
}

/* Main content-width wrapper used throughout the site.
   Keeps content centered and prevents it from becoming too wide. */
.container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}


/* ==========================================================================
   ACCESSIBILITY: SKIP LINK
   --------------------------------------------------------------------------
   Hidden until a keyboard user tabs to it. Lets visitors skip directly
   to the main page content.
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 1000;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}

/* Moves the skip link onto the screen when focused. */
.skip-link:focus {
  left: 10px;
}


/* ==========================================================================
   SITE HEADER
   ========================================================================== */

/* The shared header is inserted by site-shell.js inside #site-header.
   The wrapper itself must be sticky so the generated header can remain
   visible while the page scrolls.  */

#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Visual styling for the actual header. */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

/* Arranges the logo/club name and navigation horizontally. */
.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}


/* ==========================================================================
   BRAND / ROTARY LOGO
   ========================================================================== */

/* Groups the Rotary logo and club name together as a home-page link. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

/* Controls the Rotary Mark of Excellence size in the header. */
.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
  display: block;
}

/* Forces the club name and tagline onto separate lines. */
.brand-copy strong,
.brand-copy span {
  display: block;
}

/* Main club name in the header. */
.brand-copy strong {
  color: var(--rotary-blue);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.15;
}

/* Small tagline under the club name. */
.brand-copy span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}


/* ==========================================================================
   MAIN NAVIGATION
   ========================================================================== */

/* Places navigation links in a horizontal row on larger screens. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Basic styling for all navigation links. */
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
}

/* Highlights hovered links. */
.site-nav a:hover {
  color: var(--rotary-blue);
  background: var(--pale-blue);
}

/* Makes Become a Member stand out from the other navigation links. */
.site-nav .join-nav {
  color: var(--white);
  background: var(--rotary-blue);
}

/* Donate hover/current-page styling. */
.site-nav .join-nav:hover {
  color: var(--deep-blue);
  background: #62b6ff;
}

/* Makes Donate stand out from the other navigation links. */
.site-nav .donate-nav {
  color: var(--deep-blue);
  background: var(--rotary-gold);
}

/* Donate hover/current-page styling. */
.site-nav .donate-nav:hover {
  color: var(--deep-blue);
  background: #ffc34d;
}

/* ==========================================================================
   "OUR CLUB" NAVIGATION DROPDOWN
   --------------------------------------------------------------------------
   Creates a dropdown menu in the main navigation.

   Desktop:
   - "Our Club" looks like the other navigation links.
   - No dropdown arrow is shown.

   Mobile:
   - A small arrow appears next to "Our Club".
   - The submenu opens as part of the vertical mobile navigation.
   ========================================================================== */


/* Dropdown container. */
.nav-dropdown {
  position: relative;
}


/* Makes "Our Club" look like the other navigation links. */
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
}


/* Removes the browser's built-in dropdown marker. */
.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::marker {
  content: "";
}


/* No arrow on desktop. */
.nav-dropdown summary::after {
  content: "";
}


/* Same hover/open appearance as the other navigation links. */
.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
  color: var(--rotary-blue);
  background: var(--pale-blue);
}


/* White dropdown box that appears below "Our Club". */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 100;

  min-width: 190px;
  padding: 6px;

  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}


/* Stack dropdown links vertically. */
.nav-dropdown-menu a {
  display: block;
  white-space: nowrap;
}

/* ==========================================================================
   MOBILE MENU BUTTON
   --------------------------------------------------------------------------
   Hidden on desktop. Shown later in the mobile media query.
   ========================================================================== */

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  padding: 9px 11px;
  cursor: pointer;
}

/* ==========================================================================
   HOMEPAGE SERVICE PROJECTS
   ========================================================================== */

.home-projects {
  padding: 0 0 64px;
}

/* Heading above the project cards. */
.home-projects-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.home-projects-heading h2 {
  margin: 5px 0 8px;
  color: var(--rotary-blue);
}

.home-projects-heading p {
  margin: 0;
  color: var(--muted);
}

/* Carousel: arrow / cards / arrow. */
.project-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

/* Scrolling row of cards. */
.project-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 54px) / 4);

  gap: 18px;

  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;

  scrollbar-width: none;

  /* Room for the card shadows. */
  padding: 10px 10px;

  /*
   * Tell scroll snapping that the visible content
   * begins 8px inside the scrolling area.
   * This prevents the little 8px jump after sliding.
   */
  scroll-padding-left: 10px;
  scroll-padding-right: 10px;
}

/* Slightly tighter shadow for carousel cards so it fits
   within the equal top and bottom spacing. */
.project-carousel-track .member-card {
  box-shadow: 0 4px 10px rgba(24, 48, 78, .10);
  scroll-snap-align: start;
}

.project-carousel-track::-webkit-scrollbar {
  display: none;
}

/* Each card snaps neatly into position. */
.project-carousel-track .member-card {
  scroll-snap-align: start;
}

/* Slightly smaller version of the project-directory cards. */
.project-card-compact .member-card-body {
  padding: 18px;
}

.project-card-compact .member-name {
  font-size: 18px;
}

.project-card-compact .member-title {
  font-size: 13px;
}

.project-card-compact .member-bio {
  font-size: 13px;
}

/* Left/right carousel arrows. */
.project-carousel-arrow {
  width: 42px;
  height: 42px;

  padding: 0;

  border: 1px solid var(--line);
  border-radius: 50%;

  background: var(--white);
  color: var(--rotary-blue);

  font-size: 28px;
  line-height: 1;

  cursor: pointer;
}

.project-carousel-arrow:hover {
  background: var(--pale-blue);
}

/* Two cards at a time on tablets. */
@media (max-width: 930px) {

  .project-carousel-track {
    grid-auto-columns: calc((100% - 18px) / 2);
  }

}

/* One card at a time on phones. */
@media (max-width: 760px) {

  .home-projects-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-carousel-track {
    grid-auto-columns: 100%;
  }

  .project-carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

}

/* ==========================================================================
   MOBILE NAVIGATION DROPDOWN
   ========================================================================== */

@media (max-width: 1160px) {

  /* Make the dropdown fill the width of the mobile navigation. */
  .nav-dropdown {
    width: 100%;
  }


  /* Center "Our Club" like the other mobile navigation items. */
  .nav-dropdown summary {
    text-align: center;
  }


  /* Show a small arrow only on mobile. */
  .nav-dropdown summary::after {
    content: " ▾";
    font-size: 11px;
  }


  /* Change the arrow when the submenu is open. */
  .nav-dropdown[open] summary::after {
    content: " ▴";
  }


  /*
   * On mobile, the submenu becomes part of the normal vertical menu
   * instead of floating over the page.
   */
  .nav-dropdown-menu {
    position: static;

    min-width: 0;
    width: 100%;

    margin-top: 4px;
    padding: 6px 0 6px 12px;

    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }


  /* Center the submenu links on mobile. */
  .nav-dropdown-menu a {
    text-align: center;
  }

}

/* ==========================================================================
   HOMEPAGE HERO SECTION
   ========================================================================== */

/* Large photo area at the top of the homepage. */
.hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background: var(--deep-blue);
}

/* Controls the size and crop of the homepage photograph. */
.hero-image {
  width: 100%;
  height: 390px;
  object-fit: cover;
  object-position: center 58%;
  opacity: .86;
}

/* Dark gradient placed over the image so white text remains readable. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 36, 71, .74) 0%,
    rgba(8, 36, 71, .34) 55%,
    rgba(8, 36, 71, .16) 100%
  );
}

/* Positions hero text over the image. */
.hero-content {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
}

/* Limits the width of the hero headline/text. */
.hero-copy {
  width: min(650px, 92%);
  color: #fff;
}

/* Small uppercase gold label such as "Serving SeaTac & Tukwila". */
.eyebrow {
  display: inline-block;
  color: var(--rotary-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 12px;
  margin-bottom: 10px;
}

/* Main homepage headline. clamp() lets it scale with screen size. */
.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
  margin: 0 0 14px;
  max-width: 720px;
}

/* Hero introductory paragraph. */
.hero p {
  font-size: 18px;
  margin: 0;
  max-width: 580px;
  color: #edf5ff;
}


/* ==========================================================================
   HOMEPAGE THREE-COLUMN GRID
   --------------------------------------------------------------------------
   Facebook | Welcome | Calendar
   ========================================================================== */

.home-grid {
  display: grid;
  grid-template-columns:
    minmax(300px, 1fr)
    minmax(320px, 1.2fr)
    minmax(280px, 1fr);
  gap: 22px;
  align-items: stretch;

  /* Pulls the cards upward so they overlap the bottom of the hero image. */
  margin-top: -36px;

  position: relative;
  z-index: 5;
  padding-bottom: 30px;
}


/* ==========================================================================
   GENERIC CARD STYLING
   ========================================================================== */

/* Shared appearance used for homepage cards. */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Card heading row. Usually contains a title and optional link. */
.card-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

/* Card headings. */
.card-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--rotary-blue);
}

/* Small header links such as "View page →". */
.card-header a {
  font-size: 12px;
  font-weight: 700;
}

/* Generic inner padding for cards containing body content. */
.card-body {
  padding: 20px;
}

/* Optional subtitle shown beneath a card title. */
.card-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}


/* ==========================================================================
   FACEBOOK CARD / EMBED
   ========================================================================== */

/* Container around Facebook's Page Plugin iframe. */
.facebook-frame-wrap {
  min-height: 500px;
  background: #fff;
  position: relative;
  overflow: hidden
}

/* Sets the visible Facebook embed size. */
.facebook-frame-wrap iframe {
  width: 100%;
  height: 560px;
  border: 0;
  display: block;
}

/* Fallback text if the Facebook embed cannot load. */
.embed-fallback {
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}


/* ==========================================================================
   HOMEPAGE WELCOME CARD
   ========================================================================== */

/* Makes the welcome card use a vertical Flexbox layout. */
.welcome-card {
  display: flex;
  flex-direction: column;
  min-height: 558px;
}

/* Positions welcome-card content near the top rather than vertically centered. */
.welcome-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 42px;
  text-align: center;
}

/* Welcome card headline. */
.welcome-card h2 {
  font-size: clamp(29px, 3vw, 42px);
  line-height: 1.12;
  color: var(--rotary-blue);
  margin: 0 0 18px;
}

/* Welcome card paragraph. */
.welcome-card p {
  color: var(--muted);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 24px;
}


/* ==========================================================================
   STRIPE DONATION WIDGET
   ========================================================================== */

/* Centers the entire Stripe donation widget. */
.stripe-donation {
  width: 100%;
  margin-top: 24px;
  text-align: center;
}

/* Prevents Stripe's web component from automatically stretching full-width. */
.stripe-donation stripe-buy-button {
  display: inline-block;
  width: auto;
  max-width: 100%;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

/* Container for groups of buttons. */
.button-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Shared styling for all site buttons. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 9px;
  padding: 11px 16px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
}

/* Blue primary button. */
.button-primary {
  background: var(--rotary-blue);
  color: #fff;
}

.button-primary:hover {
  background: var(--deep-blue);
  color: #fff;
}

/* Gold button. */
.button-gold {
  background: var(--rotary-gold);
  color: var(--deep-blue);
}

.button-gold:hover {
  background: #ffc34d;
  color: var(--deep-blue);
}

/* White button with blue outline. */
.button-outline {
  border-color: var(--rotary-blue);
  color: var(--rotary-blue);
  background: #fff;
}

.button-outline:hover {
  background: var(--pale-blue);
}


/* ==========================================================================
   CALENDAR CARD - GENERAL LAYOUT
   ========================================================================== */

/* Keeps homepage calendar similar in height to neighboring cards. */
.calendar-card {
  min-height: 558px;
}

/* Padding around the custom calendar. */
.calendar-wrap {
  padding: 14px 15px 18px;
}

/* Old/optional iframe calendar styling. */
.calendar-iframe {
  width: 100%;
  min-height: 490px;
  border: 0;
  border-radius: 10px;
}


/* ==========================================================================
   MINI CALENDAR TOOLBAR
   --------------------------------------------------------------------------
   Contains previous arrow, month/year title, and next arrow.
   ========================================================================== */

.mini-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* Previous/next month buttons. */
.mini-calendar-toolbar button {
  border: 1px solid var(--line);
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

/* Month and year heading. */
.mini-calendar-toolbar strong {
  color: var(--deep-blue);
  font-size: 15px;
}


/* ==========================================================================
   CALENDAR GRID
   ========================================================================== */

/* Seven equal columns, one for each day of the week. */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Sun / Mon / Tue / etc. labels. */
.calendar-grid .weekday {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
}

/* Individual calendar date square. */
.calendar-day {
  aspect-ratio: 1 / 1;
  min-height: 35px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  position: relative;
}

/* Days from the previous/next month are visually muted. */
.calendar-day.outside {
  color: #b2bac6;
}

/* Today's date gets a blue border. */
.calendar-day.today {
  border-color: var(--rotary-blue);
  font-weight: 700;
}

/* Legacy/special meeting-date styling. */
.calendar-day.meeting {
  background: #fff4d8;
  color: var(--deep-blue);
  font-weight: 700;
}

/* Small gold dot under legacy meeting dates. */
.calendar-day.meeting::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rotary-gold);
  position: absolute;
  bottom: 4px;
}

/* ==========================================================================
   TODAY - ALWAYS KEEP BLUE BORDER
   --------------------------------------------------------------------------
   Today's date keeps the Rotary-blue border even when it is also:
   - a club event / meeting day
   - a federal holiday
   - selected
   - being hovered
   ========================================================================== */

.calendar-day.today,
.calendar-day.today.has-event,
.calendar-day.today.meeting,
.calendar-day.today.federal-holiday,
.calendar-day.today.selected,
.calendar-day.today.has-event:hover,
.calendar-day.today.federal-holiday:hover {
  border-color: var(--rotary-blue);
  box-shadow: inset 0 0 0 2px var(--white);
}

/* ==========================================================================
   CALENDAR NOTE
   ========================================================================== */

/* Informational block beneath certain calendar versions. */
.calendar-note {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 9px;
  background: var(--pale-blue);
  font-size: 12px;
  color: var(--muted);
}

.calendar-note strong {
  color: var(--rotary-blue);
}


/* ==========================================================================
   INTERIOR PAGE HERO
   --------------------------------------------------------------------------
   Used at top of About, Meetings, Donate, Membership, etc.
   ========================================================================== */

.page-hero {
  background: linear-gradient(
    135deg,
    var(--deep-blue),
    var(--rotary-blue)
  );
  color: #fff;
  padding: 72px 0 62px;
}

/* Large title on interior pages. */
.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 54px);
}

/* Optional introductory paragraph under interior-page title. */
.page-hero p {
  margin: 0;
  color: #e7f0fb;
  font-size: 18px;
  max-width: 700px;
}


/* ==========================================================================
   INTERIOR PAGE CONTENT
   ========================================================================== */

/* Vertical spacing around interior-page main content. */
.page-content {
  padding: 48px 0 60px;
}

/* Two-column content layout used on pages such as Meetings and Donate. */
.content-grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 26px;
  align-items: start;
}

/* White content card used on interior pages. */
.content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 10px 28px rgba(24, 48, 78, .08);
}

/* Interior card headings use Rotary blue. */
.content-card h2,
.content-card h3 {
  color: var(--rotary-blue);
}

.content-card h2 {
  margin-top: 0;
  font-size: 28px;
}

.content-card h3 {
  margin-top: 26px;
}


/* ==========================================================================
   CHECKMARK LIST
   ========================================================================== */

/* Removes normal list bullets. */
.check-list {
  padding: 0;
  list-style: none;
  margin: 20px 0 0;
}

/* Adds room for custom checkmark. */
.check-list li {
  position: relative;
  padding: 9px 0 9px 28px;
}

/* Custom blue checkmark placed before each item. */
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--rotary-blue);
  font-weight: 700;
}


/* ==========================================================================
   INFORMATION BOX
   ========================================================================== */

/* Pale-blue highlighted information box with Rotary gold accent. */
.info-box {
  background: var(--pale-blue);
  border-left: 5px solid var(--rotary-gold);
  border-radius: 10px;
  padding: 18px;
  margin: 18px 0;
}

/* Tightens paragraph spacing inside info boxes. */
.info-box p {
  margin: 5px 0;
}


/* ==========================================================================
   DEFINITION / DETAIL LIST
   ========================================================================== */

.detail-list {
  margin: 0;
}

/* Term/name portion of detail list. */
.detail-list dt {
  font-weight: 700;
  color: var(--rotary-blue);
  margin-top: 14px;
}

/* Description/value portion of detail list. */
.detail-list dd {
  margin: 3px 0 0;
  color: var(--muted);
}


/* ==========================================================================
   CALLOUT BOX
   ========================================================================== */

/* Gold-tinted content block for special notes or calls to action. */
.callout {
  padding: 24px;
  background: #fff9e9;
  border: 1px solid #f5deb0;
  border-radius: 14px;
}

.callout h3 {
  margin-top: 0;
  color: var(--deep-blue);
}


/* ==========================================================================
   SITE FOOTER
   ========================================================================== */

/* Main dark-blue footer area. */
.site-footer {
  background: #0e2b52;
  color: #dce7f5;
  padding: 34px 0;
  margin-top: auto;
}

/* Places footer sections side-by-side when enough room is available. */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}

/* Brighter club name in footer. */
.footer-inner strong {
  color: #fff;
}

/* Compact footer paragraph sizing. */
.footer-inner p {
  margin: 5px 0;
  font-size: 13px;
}

/* Footer links shown in white. */
.footer-inner a {
  color: #fff;
}

/* Small homepage-only photo attribution. */
.photo-credit {
  font-size: 11px !important;
  color: #b9c8dc;
}


/* ==========================================================================
   SMALL DESKTOP / COLLAPSED NAVIGATION
   --------------------------------------------------------------------------
   At widths below 1160px, replace the horizontal navigation with
   the Menu button and dropdown navigation panel.
   ========================================================================== */

@media (max-width: 1160px) {

  /* Show the Menu button. */
  .menu-button {
    display: inline-block;
  }


  /*
   * Hide the navigation until the Menu button is clicked.
   * The desktop header is approximately 82px tall.
   */
  .site-nav {
    display: none;

    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    z-index: 100;

    background: #fff;

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    padding: 12px 18px 16px;

    flex-direction: column;
    align-items: stretch;
  }


  /* JavaScript adds .open when the Menu button is clicked. */
  .site-nav.open {
    display: flex;
  }


  /* Center navigation links in the dropdown. */
  .site-nav a {
    text-align: center;
  }

}



/* ==========================================================================
   TABLET / SMALL DESKTOP
   --------------------------------------------------------------------------
   At widths below 930px the homepage switches from three columns to two.
   ========================================================================== */

@media (max-width: 930px) {

  /* Facebook and calendar sit side-by-side. */
  .home-grid {
    grid-template-columns: 1fr 1fr;
  }


  /* Welcome card becomes full-width above the other two cards. */
  .welcome-card {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: auto;
  }


  /* Slightly tighter welcome padding. */
  .welcome-card .card-body {
    padding: 36px 28px;
  }


  /* Allows cards to shrink properly inside CSS Grid. */
  .facebook-card,
  .calendar-card {
    min-width: 0;
  }


  /* Interior pages become one column. */
  .content-grid {
    grid-template-columns: 1fr;
  }

}



/* ==========================================================================
   MOBILE LAYOUT
   --------------------------------------------------------------------------
   At widths below 760px page layouts stack and the header becomes shorter.
   ========================================================================== */

@media (max-width: 760px) {

  /* Shorter header on phones. */
  .header-inner {
    min-height: 70px;
  }


  /* Hide the small tagline to save horizontal space. */
  .brand-copy span {
    display: none;
  }


  /* Smaller Rotary logo on mobile. */
  .brand-logo {
    width: 46px;
    height: 46px;
  }


  /*
   * The navigation is already collapsed by the 1160px rule.
   * We only need to move it upward to match the shorter mobile header.
   */
  .site-nav {
    top: 70px;
  }


  /* Shorter homepage hero on mobile. */
  .hero,
  .hero-image {
    min-height: 330px;
    height: 330px;
  }


  /* Slightly moves hero copy downward. */
  .hero-copy {
    padding-top: 22px;
  }


  /* Smaller hero paragraph. */
  .hero p {
    font-size: 16px;
  }


  /* Homepage cards become one vertical column. */
  .home-grid {
    grid-template-columns: 1fr;
    margin-top: -22px;
  }


  /* Remove special grid-column assignments. */
  .welcome-card,
  .facebook-card,
  .calendar-card {
    grid-column: auto;
  }


  /* Facebook appears second in mobile ordering. */
  .facebook-card {
    order: 2;
  }


  /* Calendar appears third. */
  .calendar-card {
    order: 3;
  }


  /* Shorter interior page hero. */
  .page-hero {
    padding: 52px 0 45px;
  }


  /* Less padding inside interior cards on phones. */
  .content-card {
    padding: 24px;
  }

}



/* ==========================================================================
   VERY SMALL PHONE SCREENS
   ========================================================================== */

@media (max-width: 430px) {

  /* Reduces side margins further on very small phones. */
  .container {
    width: min(100% - 24px, 1180px);
  }


  /* Slightly smaller club name. */
  .brand-copy strong {
    font-size: 15px;
  }


  /* Keeps the homepage headline readable on small screens. */
  .hero h1 {
    font-size: 35px;
  }


  /* Reduces welcome-card padding. */
  .welcome-card .card-body {
    padding: 30px 20px;
  }

}

/* ==========================================================================
   CUSTOM GOOGLE-POWERED CALENDAR
   --------------------------------------------------------------------------
   Google supplies event information, but these rules control how the
   website's own custom calendar looks.
   ========================================================================== */


/* ==========================================================================
   CALENDAR STATUS MESSAGE
   ========================================================================== */

/* Small status message above the date grid. */
.calendar-status {
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  color: var(--muted);
  background: #f6f8fb;
}

/* Green status shown when live Google Calendar information is available. */
.calendar-status.live {
  color: #245839;
  background: #eef8f1;
}

/* Gold/brown status shown when the site is using fallback meetings. */
.calendar-status.fallback {
  color: #73561b;
  background: #fff8e7;
}

/* Slightly fades the status while loading. */
.calendar-status.loading {
  opacity: .8;
}


/* ==========================================================================
   INTERACTIVE CALENDAR DAYS
   ========================================================================== */

/* Resets browser button styling because every calendar date is a button. */
.calendar-day {
  appearance: none;
  -webkit-appearance: none;
  font-family: Arial, Helvetica, sans-serif;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

/* Pale blue when hovering over a calendar date. */
.calendar-day:hover {
  background: var(--pale-blue);
}

/* Visible keyboard focus outline for accessibility. */
.calendar-day:focus-visible {
  outline: 2px solid var(--rotary-blue);
  outline-offset: 1px;
}

/* Keeps the number inside each calendar day compact. */
.calendar-day-number {
  line-height: 1;
}

/* Dates containing one or more events. */
.calendar-day.has-event {
  background: #fff9e9;
  color: var(--deep-blue);
  font-weight: 700;
}

/* Highlight when an event date is hovered or selected. */
.calendar-day.has-event:hover,
.calendar-day.selected {
  background: #ffefc6;
  border-color: var(--rotary-gold);
}

/* If today's date is selected, retain a stronger Rotary-blue border. */
.calendar-day.today.selected {
  border-color: var(--rotary-blue);
  box-shadow: inset 0 0 0 1px var(--rotary-blue);
}


/* ==========================================================================
   EVENT DOTS
   --------------------------------------------------------------------------
   Small gold dots beneath a date indicate one or more calendar events.
   ========================================================================== */

.event-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
}

/* Individual event indicator dot. */
.event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rotary-gold);
}


/* ==========================================================================
   CALENDAR EVENT DETAILS PANEL
   --------------------------------------------------------------------------
   Appears below the month grid after a visitor selects an event date.
   ========================================================================== */

.calendar-details {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* Date heading above event information. */
.calendar-details-heading {
  color: var(--deep-blue);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Message shown when the selected date/month has no events. */
.calendar-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}


/* ==========================================================================
   INDIVIDUAL CALENDAR EVENT CARDS
   ========================================================================== */

/* Event block shown beneath the calendar. */
.calendar-event {
  padding: 10px;
  border-radius: 9px;
  background: var(--pale-blue);
  border-left: 4px solid var(--rotary-gold);
}

/* Adds spacing when multiple events occur on the same date. */
.calendar-event + .calendar-event {
  margin-top: 8px;
}

/* Event title. */
.calendar-event h3 {
  margin: 0 0 4px;
  color: var(--rotary-blue);
  font-size: 13px;
  line-height: 1.25;
}

/* Shared styling for time/location metadata and descriptions. */
.calendar-event-meta,
.calendar-event-description {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

/* Event description.
   Currently limited to three visible lines to keep the card compact. */
.calendar-event-description {
  margin-top: 5px;
  display: -webkit-box;

  /* Limit the description to three visible lines. */
  -webkit-line-clamp: 3;
  line-clamp: 3;

  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link to the original Google Calendar event. */
.calendar-event-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
}


/* ==========================================================================
   MOBILE CALENDAR ADJUSTMENTS
   ========================================================================== */

@media (max-width: 760px) {

  /* Makes calendar dates easier to tap with a finger. */
  .calendar-day {
    min-height: 42px;
  }

  /* Slightly increases event-title size on mobile. */
  .calendar-event h3 {
    font-size: 14px;
  }

  /* Slightly increases supporting calendar text for mobile readability. */
  .calendar-event-meta,
  .calendar-event-description,
  .calendar-event-link,
  .calendar-empty,
  .calendar-details-heading {
    font-size: 12px;
  }
}

/* ==========================================================================
   CONTACT CARD
   ========================================================================== */

/* Friendly contact block used instead of a full contact form. */
.contact-card {
  margin-top: 24px;
  padding: 26px;
  text-align: center;
  background: var(--pale-blue);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* Contact-card heading. */
.contact-card h3 {
  margin: 0 0 10px;
  color: var(--rotary-blue);
  font-size: 22px;
}

/* Introductory text. */
.contact-card p {
  max-width: 560px;
  margin: 0 auto 18px;
  color: var(--muted);
}

/* Makes the email address feel like part of the design instead of plain text. */
.contact-email-address {
  display: inline-block;
  margin-bottom: 18px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--deep-blue);
  font-weight: 700;
  font-size: 16px;
}

/* Small confirmation message after copying the email address. */
.copy-email-status {
  min-height: 20px;
  margin: 12px 0 0 !important;
  font-size: 13px;
  color: var(--rotary-blue) !important;
}

/* ==========================================================================
   MEMBER DIRECTORY
   ========================================================================== */


/* Shows the number of members above the directory. */
.member-directory-summary {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}


/* Responsive grid containing all member cards. */
.member-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}


/* Individual member profile card. */
.member-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(24, 48, 78, .08);
  overflow: hidden;
}


/* Area containing the member photograph. */
.member-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pale-blue);
}


/* Member photograph. */
.member-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}


/* Final fallback shown if neither the personal nor default image loads. */
.member-photo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--pale-blue);
  color: var(--rotary-blue);
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 700;
}


/* Properly hides the initials when a photograph is being displayed. */
.member-photo-fallback[hidden] {
  display: none;
}


/* Text portion of each member card. */
.member-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

/* Keep a card's final action button aligned at the bottom. */
.member-card-body > :last-child:has(.button) {
  margin-top: auto !important;
  padding-top: 9px;
}

/* Member name. */
.member-name {
  margin: 0 0 7px;
  min-height: 2.3em;

  display: flex;
  align-items: flex-end;
  
  color: var(--rotary-blue);
  font-size: 23px;
  line-height: 1.15;
}


/* Member title or position. */
.member-title {
  margin: 0;
  min-height: 18px;
  color: var(--deep-blue);
  font-size: 15px;
  font-weight: 700;
}


/* Employer, business, agency, nonprofit, etc. */
.member-affiliation {
  margin: 3px 0 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 14px;
}


/* Rotary membership date. */
.member-joined {
  margin: 15px 0 0;
  padding-top: 13px;
  min-height: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}


/* Short member biography. */
.member-bio {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}


/* Message displayed if no active member data is available. */
.member-directory-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}


/* Two directory columns on tablets and smaller desktops. */
@media (max-width: 930px) {

  .member-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}


/* One directory column on phones. */
@media (max-width: 650px) {

  .member-directory-grid {
    grid-template-columns: 1fr;
  }

}

/* ==========================================================================
   MEMBER BIO EXPAND / COLLAPSE
   ========================================================================== */

/* Collapsed biography state. */
.member-bio.is-collapsed {
  display: -webkit-box;

  /* Limit collapsed bios to five visible lines. */
  -webkit-line-clamp: 5;
  line-clamp: 5;

  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read more / Show less button. */
.member-bio-toggle {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rotary-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.member-bio-toggle:hover {
  color: var(--deep-blue);
  text-decoration: underline;
}

.member-bio-toggle:focus-visible {
  outline: 2px solid var(--rotary-blue);
  outline-offset: 3px;
  border-radius: 3px;
}


/* ==========================================================================
   U.S. FEDERAL HOLIDAYS
   --------------------------------------------------------------------------
   Federal holidays are generated locally in main.js.

   Purple = federal holiday
   Gold dot = actual club/Google Calendar event

   A holiday by itself therefore appears purple with NO dot.
   ========================================================================== */

/* Federal holiday date. */
.calendar-day.federal-holiday {
  background: #f2edf8;
  color: #5b4772;
  border-color: #d8cde5;
  font-weight: 700;
}

/* Slightly darker purple when hovered or selected. */
.calendar-day.federal-holiday:hover,
.calendar-day.federal-holiday.selected {
  background: #e6daef;
  color: #4d3864;
  border-color: #a990bf;
}

/*
 * If a real club event occurs on a federal holiday,
 * the date remains purple but the normal gold event dot
 * still appears beneath the number.
 */
.calendar-day.federal-holiday.has-event {
  background: #f2edf8;
}

/* Holiday information shown below the calendar after it is clicked. */
.calendar-event.federal-holiday-event {
  background: #f2edf8;
  border-left-color: #9d83b8;
}

/* Holiday name in the details panel. */
.calendar-event.federal-holiday-event h3 {
  color: #5b4772;
}

/* ==========================================================================
   CLUB ARCHIVES
   ========================================================================== */


/* Four archive documents per row on larger screens. */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}


/* Individual document card. */

.archive-card {
  min-width: 0;

  display: flex;
  flex-direction: column;

  background: var(--white);

  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: 0 10px 28px rgba(24, 48, 78, .08);

  overflow: hidden;
}


/* Area displaying the first page of the PDF. */

.archive-preview {
  padding: 18px 18px 0;

  background: var(--pale-blue);
  border-bottom: 1px solid var(--line);
}


/* PDF thumbnail. */

.archive-preview img {
  display: block;

  width: 100%;
  height: 260px;
  object-fit: contain;

  background: var(--pale-blue);

  box-shadow: 0 4px 16px rgba(24, 48, 78, .12);
}


/* Text/button area. */

.archive-card-body {
  flex: 1;

  display: flex;
  flex-direction: column;

  padding: 20px;
}


/* Document name. */

.archive-card h2 {
  margin: 0 0 7px;

  color: var(--rotary-blue);

  font-size: 19px;
  line-height: 1.25;
}


/* Document date. */

.archive-date {
  margin: 0;

  color: var(--muted);

  font-size: 13px;
  font-weight: 700;
}


/* Push Open PDF button to bottom. */

.archive-card-action {
  margin-top: auto;
  padding-top: 18px;
}


/* Two columns on tablets. */

@media (max-width: 930px) {

  .archive-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* One column on phones. */

@media (max-width: 650px) {

  .archive-grid {
    grid-template-columns: 1fr;
  }

}