/* =========================
   NEW RIVER PUBLIC LIBRARY COOPERATIVE
   Combined Styles — Contained Layout + Apple Cards
   ========================= */

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

/* Body */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #e8e8ed;
  color: #1d1d1f;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Site Container — contained like index2 */
.site-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* Container */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #0e3061;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* =========================
   HEADER
   ========================= */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  max-width: none;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: auto;
  padding: 0 2.5rem;
  max-width: none;
}

.logo__img {
  height: auto;
  width: 150px;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #1d1d1f;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Nav */
.main-nav__list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-nav__link {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: #6e6e73;
  transition: color 0.2s;
  letter-spacing: -0.005em;
}

.main-nav__link:hover,
.main-nav__link--active {
  color: #1d1d1f;
}

/* Nav Arrow Icon */
.nav-arrow {
  font-size: 0.55rem;
  margin-left: 4px;
  transition: transform 0.2s;
}

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

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  list-style: none;
  min-width: 200px;
  padding: 8px 0;
  margin-top: 8px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}

.dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.has-dropdown:hover .dropdown,
.has-dropdown.dropdown-open .dropdown {
  display: block;
  opacity: 1;
}

.has-dropdown:hover .nav-arrow,
.has-dropdown.dropdown-open .nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown toggle button — styled like a link */
.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.dropdown li a {
  display: block;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: #6e6e73;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.dropdown li a:hover {
  background: #f5f5f7;
  color: #1d1d1f;
}

/* Keep right-side dropdowns from getting cut off */
.main-nav__list > li:last-child .dropdown {
  left: auto;
  right: 0;
  transform: none;
}

/* =========================
   HERO
   ========================= */
.hero {
  position: relative;
  text-align: center;
  padding: 5rem 2rem 4rem;
  background: var(--hero-image, url('images/hero-newriver.png')) center center / cover no-repeat;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 47, 108, 0.55) 0%,
    rgba(0, 47, 108, 0.7) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 0.5rem;
}

.hero__tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  max-width: 440px;
  margin: 0 auto 1.5rem;
  gap: 0.6rem;
  transition: background 0.3s;
}

.search-bar:focus-within {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.search-bar__icon {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-bar__input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

.search-bar__input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-bar__submit {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.search-bar__submit:hover {
  color: #fff;
}

/* Hero Actions */
.hero__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.hero__action-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__action-link:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero__divider {
  color: rgba(255, 255, 255, 0.3);
}

/* =========================
   CARDS SECTION (Apple Style)
   ========================= */
.cards-section {
  background: #f5f5f7;
  padding: 3.5rem 2.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

/* Card Base */
.card {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem 1.25rem 1.4rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  cursor: pointer;
  position: relative;
}

.card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-icon-wrap svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.6;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
  color: #1d1d1f;
}

.card-desc {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #636366;
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}

.card-link {
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  transition: gap 0.3s;
  letter-spacing: -0.005em;
}

.card-link:hover { gap: 6px; }

.card-link svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

/* Card Themes */

/* Hoopla — Blue */
.card--hoopla .card-icon-wrap { background: #e8f1fe; }
.card--hoopla .card-icon-wrap svg { color: #0066cc; }
.card--hoopla .card-link { color: #0066cc; }

/* Libby — Orange */
.card--libby .card-icon-wrap { background: #fef1e6; }
.card--libby .card-icon-wrap svg { color: #c45e1a; }
.card--libby .card-link { color: #c45e1a; }

/* Gale — Green */
.card--gale .card-icon-wrap { background: #e6f5ed; }
.card--gale .card-icon-wrap svg { color: #1a8a4a; }
.card--gale .card-link { color: #1a8a4a; }

/* Events — Purple */
.card--events .card-icon-wrap { background: #f1e8fd; }
.card--events .card-icon-wrap svg { color: #7c3aed; }
.card--events .card-link { color: #7c3aed; }

/* Community — Red */
.card--community .card-icon-wrap { background: #fce8ea; }
.card--community .card-icon-wrap svg { color: #c62828; }
.card--community .card-link { color: #c62828; }

/* =========================
   FOOTER
   ========================= */
.site-footer {
  background: #f5f5f7;
  color: #1d1d1f;
}

.footer__top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  padding: 50px 40px 30px;
}

.footer__heading {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1d1d1f;
  letter-spacing: 0.02em;
}

.footer__tagline {
  font-size: 13px;
  color: #6e6e73;
  margin-bottom: 12px;
}

.footer__address {
  font-style: normal;
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.5;
  margin-bottom: 10px;
}

.footer__link {
  color: #0066cc;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer__link:hover {
  text-decoration: underline;
}

.footer__location-list {
  list-style: none;
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.5;
}

.footer__location-list li {
  margin-bottom: 14px;
}

.footer__location-list strong {
  color: #1d1d1f;
  font-weight: 600;
}

.footer__location-list a {
  color: #0066cc;
  text-decoration: none;
}

.footer__location-list a:hover {
  text-decoration: underline;
}

.footer__mission {
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.6;
  font-style: italic;
}

.footer__quick-links {
  list-style: none;
}

.footer__quick-links li {
  margin-bottom: 8px;
}

.footer__quick-links a {
  color: #6e6e73;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer__quick-links a:hover {
  color: #1d1d1f;
}

/* Facebook List */
.footer__facebook-list {
  list-style: none;
}

.footer__facebook-list li {
  margin-bottom: 8px;
}

.footer__facebook-list a {
  color: #6e6e73;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer__facebook-list a:hover {
  color: #1877f2;
}

.footer__facebook-list .fab {
  color: #1877f2;
}

/* Footer Bottom */
.footer__bottom {
  border-top: 1px solid #d2d2d7;
  padding: 20px 0;
}

.footer__bottom-inner {
  text-align: center;
}

.footer__copyright {
  font-size: 12px;
  color: #6e6e73;
}

.footer__bottom-link {
  color: #6e6e73;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__bottom-link:hover {
  color: #1d1d1f;
  text-decoration: underline;
}


/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  /* Nav */
  .mobile-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .main-nav--open {
    display: block;
  }

  .main-nav__list {
    flex-direction: column;
    gap: 0;
  }

  .main-nav__link {
    display: block;
    padding: 0.65rem 0;
    font-size: 1rem;
    border-bottom: 1px solid #f5f5f7;
  }

  .has-dropdown .dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0 0 0 1rem;
    background: transparent;
  }

  .has-dropdown .dropdown::before {
    display: none;
  }

  .dropdown li a {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f7;
  }

  /* Hero */
  .hero {
    min-height: 340px;
    padding: 3.5rem 1.5rem 3rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-section {
    padding: 2rem 0 2.5rem;
  }

  /* Footer */
  .footer__top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer__hours {
  margin-top: 10px;
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.5;
}

.footer__hours-heading {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 6px;
}

.footer__hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 190px;
  margin-bottom: 2px;
  font-size: 13px;
  color: #6e6e73;
}

.footer__hours-row span:first-child {
  font-weight: 400;
}

.footer__hours-row span:last-child {
  white-space: nowrap;
}