/*
  Country Roads Connect shared theme
  Goal: align CRC with the public Country Roads Yuma community-site feel
  while preserving the existing module badge styles already used in CRC.

  Recommended path on server:
  /assets/css/crc-country-roads-theme.css

  Important:
  - Do NOT delete your existing badge CSS.
  - This file intentionally avoids generic .badge overrides.
*/

:root {
  --cr-blue: #1f5f8b;
  --cr-blue-dark: #123f62;
  --cr-blue-soft: #e8f3f9;
  --cr-sky: #d7edf7;
  --cr-green: #657b45;
  --cr-sand: #f6efe4;
  --cr-sand-2: #fbf7ef;
  --cr-copper: #b66a2c;
  --cr-ink: #23313b;
  --cr-muted: #64717b;
  --cr-line: rgba(31, 95, 139, 0.18);
  --cr-card: rgba(255, 255, 255, 0.94);
  --cr-shadow: 0 18px 45px rgba(18, 63, 98, 0.16);
  --cr-radius-lg: 24px;
  --cr-radius-md: 16px;
  --cr-radius-sm: 10px;
  --cr-max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cr-sand);
}

body.cr-body,
body {
  margin: 0;
  min-height: 100%;
  color: var(--cr-ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 255, 255, 0.95), transparent 31rem),
    linear-gradient(180deg, var(--cr-sand-2) 0%, var(--cr-sand) 52%, #efe2d0 100%);
}

body.cr-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(30deg, rgba(31, 95, 139, 0.06) 12%, transparent 12.5%, transparent 87%, rgba(31, 95, 139, 0.06) 87.5%, rgba(31, 95, 139, 0.06)),
    linear-gradient(150deg, rgba(31, 95, 139, 0.06) 12%, transparent 12.5%, transparent 87%, rgba(31, 95, 139, 0.06) 87.5%, rgba(31, 95, 139, 0.06));
  background-size: 48px 84px;
}

a {
  color: var(--cr-blue);
}

.cr-shell {
  position: relative;
  width: min(var(--cr-max), calc(100% - 32px));
  margin: 0 auto;
}

.cr-topbar {
  position: relative;
  z-index: 3;
  background: var(--cr-blue-dark);
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.cr-topbar-inner {
  width: min(var(--cr-max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cr-topbar strong {
  font-weight: 700;
}

.cr-topbar a {
  color: #fff;
  text-decoration: none;
}

.cr-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--cr-line);
  backdrop-filter: blur(12px);
}

.cr-header-inner {
  width: min(var(--cr-max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cr-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--cr-ink);
  text-decoration: none;
}

.cr-brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--cr-line);
  box-shadow: 0 8px 22px rgba(18, 63, 98, 0.12);
}

.cr-brand-text {
  min-width: 0;
}

.cr-brand-title {
  display: block;
  color: var(--cr-blue-dark);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.01em;
}

.cr-brand-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--cr-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.cr-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cr-nav a,
.cr-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--cr-blue-dark);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.cr-nav a:hover,
.cr-nav button:hover,
.cr-nav .is-active {
  background: var(--cr-blue-soft);
  border-color: var(--cr-line);
}

.cr-hero {
  position: relative;
  padding: clamp(32px, 5vw, 64px) 0 28px;
}

.cr-hero-card {
  overflow: hidden;
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: stretch;
  border-radius: var(--cr-radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, var(--cr-blue-soft), var(--cr-sand));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--cr-shadow);
}

.cr-hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 5vw, 54px);
}

.cr-eyebrow {
  margin: 0 0 12px;
  color: var(--cr-copper);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cr-hero h1,
.cr-page-title {
  margin: 0;
  color: var(--cr-blue-dark);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.cr-hero h1 span {
  color: var(--cr-blue);
}

.cr-lede {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--cr-muted);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.55;
}

.cr-hero-actions,
.cr-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.cr-btn,
a.cr-btn,
button.cr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--cr-blue);
  background: var(--cr-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(31, 95, 139, 0.2);
  cursor: pointer;
}

.cr-btn:hover {
  background: var(--cr-blue-dark);
  border-color: var(--cr-blue-dark);
}

.cr-btn.secondary,
a.cr-btn.secondary,
button.cr-btn.secondary {
  background: #fff;
  color: var(--cr-blue-dark);
  border-color: var(--cr-line);
  box-shadow: none;
}

.cr-btn.secondary:hover {
  background: var(--cr-blue-soft);
}

.cr-hero-photo {
  position: relative;
  min-height: 320px;
  background:
    linear-gradient(0deg, rgba(18, 63, 98, 0.22), rgba(18, 63, 98, 0.05)),
    var(--cr-sky);
}

.cr-hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
}

.cr-photo-placeholder {
  height: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--cr-blue-dark);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(31, 95, 139, 0.2), rgba(182, 106, 44, 0.18)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 18rem),
    var(--cr-sky);
}

.cr-photo-placeholder strong {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.cr-section {
  position: relative;
  z-index: 1;
  padding: 30px 0;
}

.cr-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.cr-section-title {
  margin: 0;
  color: var(--cr-blue-dark);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.05;
}

.cr-section-note {
  margin: 7px 0 0;
  color: var(--cr-muted);
  line-height: 1.5;
}

.cr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.cr-card,
.cr-panel,
.cr-form-card {
  position: relative;
  border-radius: var(--cr-radius-md);
  background: var(--cr-card);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(18, 63, 98, 0.09);
}

.cr-card {
  padding: 20px;
}

.cr-card h2,
.cr-card h3,
.cr-panel h2,
.cr-panel h3 {
  margin: 0 0 8px;
  color: var(--cr-blue-dark);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.15;
}

.cr-card p,
.cr-panel p {
  margin: 0;
  color: var(--cr-muted);
  line-height: 1.5;
}

.cr-card-link {
  display: block;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.cr-card-link:hover .cr-card {
  transform: translateY(-2px);
  border-color: var(--cr-line);
  box-shadow: 0 16px 36px rgba(18, 63, 98, 0.14);
}

.cr-card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  background: var(--cr-blue-soft);
  color: var(--cr-blue-dark);
  font-size: 1.35rem;
}

.cr-module-card {
  padding: 20px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-module-card .cr-module-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cr-badge-row,
.cr-module-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Preserve current badge styles: this wrapper only positions existing badges. */
.cr-badge-row > *,
.cr-module-badges > * {
  flex: 0 0 auto;
}

.cr-kicker-card {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31, 95, 139, 0.1), rgba(182, 106, 44, 0.1)),
    rgba(255, 255, 255, 0.86);
}

.cr-page-hero {
  padding: 28px 0 18px;
}

.cr-page-hero .cr-panel {
  padding: clamp(22px, 4vw, 36px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 249, 0.82));
}

.cr-page-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.cr-form-card {
  padding: clamp(18px, 4vw, 28px);
}

.cr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cr-field {
  display: grid;
  gap: 6px;
}

.cr-field.full {
  grid-column: 1 / -1;
}

.cr-field label {
  color: var(--cr-blue-dark);
  font-weight: 800;
  font-size: 0.92rem;
}

.cr-field input,
.cr-field select,
.cr-field textarea,
input.cr-input,
select.cr-input,
textarea.cr-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 95, 139, 0.22);
  background: #fff;
  color: var(--cr-ink);
  font: inherit;
}

.cr-field textarea,
textarea.cr-input {
  min-height: 110px;
  resize: vertical;
}

.cr-field input:focus,
.cr-field select:focus,
.cr-field textarea:focus,
.cr-input:focus {
  outline: 3px solid rgba(31, 95, 139, 0.18);
  border-color: var(--cr-blue);
}

.cr-dashboard {
  display: grid;
  gap: 14px;
}

.cr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: var(--cr-radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--cr-line);
}

.cr-status-list {
  display: grid;
  gap: 10px;
}

.cr-list-row {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 95, 139, 0.14);
}

.cr-muted {
  color: var(--cr-muted);
}

.cr-footer {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  padding: 28px 0;
  color: rgba(255, 255, 255, 0.86);
  background: var(--cr-blue-dark);
}

.cr-footer-inner {
  width: min(var(--cr-max), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.cr-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.cr-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .cr-header-inner {
    min-height: auto;
    padding: 14px 0;
    flex-direction: column;
    align-items: stretch;
  }

  .cr-brand {
    justify-content: center;
  }

  .cr-brand-subtitle {
    white-space: normal;
  }

  .cr-nav {
    justify-content: center;
  }

  .cr-hero-card {
    grid-template-columns: 1fr;
  }

  .cr-hero-photo {
    order: -1;
    min-height: 220px;
  }

  .cr-hero-photo img,
  .cr-photo-placeholder {
    min-height: 220px;
  }

  .cr-grid,
  .cr-grid.two {
    grid-template-columns: 1fr;
  }

  .cr-section-header {
    display: block;
  }
}

@media (max-width: 560px) {
  .cr-shell,
  .cr-header-inner,
  .cr-topbar-inner,
  .cr-footer-inner {
    width: min(100% - 20px, var(--cr-max));
  }

  .cr-topbar-inner {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 8px 0;
  }

  .cr-brand-logo {
    width: 46px;
    height: 46px;
  }

  .cr-nav a,
  .cr-nav button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .cr-hero-content {
    padding: 24px;
  }

  .cr-form-grid {
    grid-template-columns: 1fr;
  }

  .cr-footer-inner {
    display: grid;
    justify-items: center;
    text-align: center;
  }
}

/* =========================================================
   CRC Footer Navigation Buttons
   Gives footer links the same pill/button behavior as header nav
   ========================================================= */

.cr-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.cr-footer-links a,
.cr-footer-links a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.cr-footer-links a:hover,
.cr-footer-links a:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

.cr-footer-links a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .cr-footer-links {
    justify-content: center;
    gap: 7px;
  }

  .cr-footer-links a,
  .cr-footer-links a:visited {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.84rem;
  }
}


/* =========================================================
   CRC Hero Background Image Fix
   Required for: --cr-hero-photo: url('/images/country-roads-yuma-hero.jpg')
   ========================================================= */

.cr-photo-placeholder.has-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 63, 98, 0.18), rgba(18, 63, 98, 0.68)),
    var(--cr-hero-photo),
    var(--cr-sky);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cr-photo-placeholder.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.34), transparent 16rem),
    linear-gradient(135deg, rgba(182, 106, 44, 0.18), rgba(31, 95, 139, 0.22));
}

.cr-photo-title {
  display: inline-block;
  max-width: min(88%, 420px);
  padding: clamp(18px, 3vw, 26px) clamp(20px, 4vw, 34px);
  border-radius: 22px;
  color: #fff;
  text-align: center;
  background: rgba(18, 63, 98, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 40px rgba(18, 63, 98, 0.25);
  backdrop-filter: blur(4px);
}

.cr-photo-placeholder.has-photo .cr-photo-title strong,
.cr-photo-placeholder.has-photo strong {
  display: block;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.cr-photo-placeholder.has-photo .cr-photo-title span,
.cr-photo-placeholder.has-photo span {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}
