/* ==========================================================================
   josh-reaume.com — site overrides for the FlatGear template
   Palette taken from the Team Reaume brand (black / teal / white) and
   contrast-checked against WCAG 2.1 AA. Ratios noted inline.

   ⚠️ FlatGear ships no custom.css hook. This file is loaded by one guarded
      line added to templates/flatgear/index.php — RE-APPLY AFTER A TEMPLATE
      UPDATE or these styles silently stop loading.
   ========================================================================== */

:root {
  --jr-teal:       #0bbcca;  /* brand teal — 9.06:1 on black. DARK SURFACES ONLY. */
  --jr-teal-dark:  #07757e;  /* 5.45:1 on white, 4.98:1 on #f2f5f7 */
  --jr-teal-deep:  #065f66;  /* 7.40:1 on white — hover/active */
  --jr-ink:        #16191d;  /* 17.63:1 on white */
  --jr-muted:      #5a6169;  /* 6.27:1 on white, 5.73:1 on #f2f5f7 */
  --jr-surface:    #ffffff;
  --jr-surface-alt:#f2f5f7;
  --jr-black:      #000000;
  --jr-night:      #111417;
  --jr-white:      #ffffff;
  --jr-rule:       #d4dae0;
}

/* --------------------------------------------------------------------------
   1. ACCESSIBILITY BASELINE
   -------------------------------------------------------------------------- */

/* Brand teal is 2.32:1 on white — it must never be body text on a light
   background. Anything teal on light uses the darkened variant. */
body { color: var(--jr-ink); font-size: 16px; line-height: 1.6; }

a { color: var(--jr-teal-dark); }
a:hover, a:focus { color: var(--jr-teal-deep); text-decoration: underline; }

/* A visible focus ring everywhere — FlatGear ships `outline:0` on several
   elements, which removes the only keyboard affordance there is. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--jr-teal-dark) !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}
/* On dark surfaces the ring switches to the brighter brand teal */
#top-handler a:focus-visible,
#menu a:focus-visible,
#story-footer a:focus-visible,
#slideshow-header a:focus-visible {
  outline: 3px solid var(--jr-teal) !important;
  outline-offset: 3px !important;
}

/* Skip link — keyboard users land on a dark header full of nav otherwise */
.jr-skip {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--jr-black); color: var(--jr-white);
  padding: .75rem 1.25rem; font-weight: 700; text-decoration: none;
}
.jr-skip:focus { left: 0; color: var(--jr-white); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   2. HEADER / NAV — dark bar, brand teal accents
   -------------------------------------------------------------------------- */
#top-handler { background: var(--jr-black) !important; }
#site-name-handler #h1 img { max-height: 58px; width: auto; }
#sn-position #h2 { color: var(--jr-teal); letter-spacing: .06em; text-transform: uppercase; }

#menu .menu-nav > li > a {
  color: var(--jr-white);          /* 21:1 on black */
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
#menu .menu-nav > li > a:hover,
#menu .menu-nav > li.active > a,
#menu .menu-nav > li.current > a {
  background: var(--jr-teal);
  color: var(--jr-black);          /* 9.06:1 — black on teal, not white */
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
.jr-lead { font-size: 1.2rem; line-height: 1.55; color: var(--jr-muted); margin-bottom: 1.75rem; }

.com-content-article h2,
.item-page h2,
.jr-section-title {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
  color: var(--jr-ink);
  border-bottom: 3px solid var(--jr-teal-dark);
  display: table;
  clear: both;
  padding-bottom: .25rem;
  margin: 2.5rem 0 1rem;
}

.jr-closing {
  font-size: 1.08rem; font-weight: 600; color: var(--jr-ink);
  border-left: 4px solid var(--jr-teal-dark); padding-left: 1rem;
}

/* --------------------------------------------------------------------------
   4. PULL QUOTE
   -------------------------------------------------------------------------- */
.jr-quote {
  background: var(--jr-surface-alt);
  border-left: 5px solid var(--jr-teal-dark);
  border-radius: 4px; margin: 2rem 0; padding: 1.5rem 1.75rem;
}
.jr-quote p { font-size: 1.12rem; line-height: 1.6; font-style: italic; color: var(--jr-ink); margin-bottom: .75rem; }
.jr-quote footer { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; font-weight: 700; color: var(--jr-muted); }

/* --------------------------------------------------------------------------
   5. LOGO GRIDS — partners / charities
   -------------------------------------------------------------------------- */
.jr-logo-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem; align-items: center; margin: 1.5rem 0 2.5rem;
}
.jr-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; min-height: 110px;
  background: var(--jr-white);
  border: 1px solid var(--jr-rule); border-radius: 6px;
}
.jr-logo img { max-width: 100%; max-height: 70px; width: auto; height: auto; object-fit: contain; }
.jr-logo a { display: block; line-height: 0; }

/* --------------------------------------------------------------------------
   6. FIGURES + GALLERIES
   -------------------------------------------------------------------------- */
.jr-fig { margin: 0 0 1.25rem; max-width: 340px; }
.jr-fig img { width: 100%; height: auto; border-radius: 6px; display: block; }
.jr-fig figcaption,
.jr-gallery figcaption { font-size: .85rem; color: var(--jr-muted); margin-top: .4rem; line-height: 1.35; }
@media (min-width: 768px) {
  .jr-fig--right { float: right; margin-left: 1.75rem; }
  .jr-fig--left  { float: left;  margin-right: 1.75rem; }
}
@media (max-width: 767.98px) {
  .jr-fig { max-width: 100%; float: none !important; margin-left: 0; margin-right: 0; }
}

.jr-gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem; margin: 1.5rem 0 2rem; clear: both;
}
.jr-gallery figure { margin: 0; }
.jr-gallery img {
  width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 6px; display: block;
}
.jr-gallery--hero img { aspect-ratio: 3 / 4; }
@media (min-width: 992px) { .jr-gallery--hero { grid-template-columns: repeat(3, 1fr); } }

.item-page::after, .com-content-article__body::after { content: ""; display: table; clear: both; }

/* --------------------------------------------------------------------------
   7. CONTACT
   -------------------------------------------------------------------------- */
.jr-address {
  font-size: 1.15rem; font-style: normal; font-weight: 600; line-height: 1.6;
  background: var(--jr-surface-alt); border-left: 5px solid var(--jr-teal-dark);
  border-radius: 4px; padding: 1.1rem 1.4rem; margin: 1.25rem 0; color: var(--jr-ink);
}
.jr-note { color: var(--jr-muted); font-size: .95rem; }
.jr-empty {
  text-align: center; padding: 3rem 1rem; background: var(--jr-surface-alt);
  border: 1px dashed var(--jr-rule); border-radius: 6px;
  color: var(--jr-muted); font-size: 1.12rem;
}
.jr-empty p { margin: 0; }

/* Convert Forms — required marker and error text must not rely on colour alone */
.convertforms .cf-required-label { color: #b3261e; font-weight: 700; }  /* 5.9:1 on white */
.convertforms .cf-btn:focus-visible { outline: 3px solid var(--jr-teal-dark) !important; outline-offset: 3px !important; }

/* --------------------------------------------------------------------------
   8. FOOTER — dark, brand teal links
   -------------------------------------------------------------------------- */
#story-footer { background: var(--jr-black); color: var(--jr-white); }
#story-footer a { color: var(--jr-teal); }          /* 9.06:1 on black */
#story-footer a:hover, #story-footer a:focus { color: var(--jr-white); }

.jr-follow { text-align: center; padding: 1.25rem 0; }
.jr-follow-title { text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; font-weight: 700; margin-bottom: .9rem; color: var(--jr-white); }
.jr-social { list-style: none; display: flex; justify-content: center; gap: 1rem; padding: 0; margin: 0 0 1rem; }
.jr-social img { width: 39px; height: 39px; display: block; }
.jr-social a { display: block; border-radius: 50%; transition: transform .15s ease; }
.jr-social a:hover { transform: translateY(-2px); }
.jr-copyright { font-size: .85rem; margin: 0; color: var(--jr-white); opacity: .9; }

/* --------------------------------------------------------------------------
   9. HEADER LAYOUT FIX
   FlatGear positions the site name and slogan absolutely from template params
   (H1TitlePositionY / H2TitlePositionY), which overlaps them whenever the logo
   is taller than the gap. Replace it with a simple flex stack.
   -------------------------------------------------------------------------- */
#site-name-handler { height: auto !important; }
#sn-position {
  position: relative !important;
  display: flex; flex-direction: column; justify-content: center;
  height: 84px; gap: 2px;
}
#sn-position #h1,
#sn-position #h2 {
  position: static !important;
  top: auto !important; left: auto !important;
  margin: 0; line-height: 1;
}
#sn-position #h1 img { max-height: 42px; width: auto; display: block; }
#sn-position #h2 {
  font-size: 10px; letter-spacing: .08em; white-space: nowrap;
  color: var(--jr-teal);           /* 7.97:1 on the near-black header */
}
@media (max-width: 900px) {
  #sn-position { height: auto; padding: .75rem 0; }
  #sn-position #h1 img { max-height: 38px; }
  #sn-position #h2 { font-size: 9px; }
}

/* --------------------------------------------------------------------------
   10. MOBILE BRANDING
   FlatGear's responsive CSS hides #site-name-handler entirely below the
   breakpoint, leaving a bare black bar with a hamburger and no way to tell
   whose site it is (or to get home). Put the logo back.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  #site-name-handler { display: block !important; float: left; }
  #sn-position {
    height: auto; padding: .55rem 0 .55rem .25rem;
    align-items: flex-start; justify-content: center;
  }
  #sn-position #h1 { display: block; }
  #sn-position #h1 img { max-height: 32px; width: auto; }
  #sn-position #h2 { display: none; }   /* too cramped to be legible at this size */
  a#menupanel { float: right; }
}
@media (max-width: 420px) {
  #sn-position #h1 img { max-height: 26px; }
}

/* --------------------------------------------------------------------------
   11. HEADER ALIGNED TO THE CONTENT COLUMN + BIGGER LOGO
   The black bar stays full-bleed, but the logo and nav inside it now sit on
   the same gutters as the page content. The content uses Bootstrap 2's
   .container (1170 / 940 / 724 / auto), so #top mirrors those exact
   breakpoints rather than hardcoding one width.
   -------------------------------------------------------------------------- */
#top-handler #top {
  width: 940px;
  margin-left: auto;
  margin-right: auto;
  float: none;
}
@media (min-width: 1200px) {
  #top-handler #top { width: 1170px; }
}
@media (min-width: 768px) and (max-width: 979px) {
  #top-handler #top { width: 724px; }
}
@media (max-width: 767px) {
  /* below Bootstrap's smallest container the content column falls back to a
     40px gutter (20px on .story + 20px on #content-handler). Match it. */
  #top-handler #top { width: auto; padding-left: 40px; padding-right: 40px; }
}

/* bigger logo — header grows to match so nothing is cropped */
#sn-position { height: 100px; }
#site-name-handler #h1 img,
#sn-position #h1 img { max-height: 62px; width: auto; }
#sn-position #h2 { font-size: 11px; }

@media (max-width: 900px) {
  #sn-position { height: auto; }
  #sn-position #h1 img,
  #site-name-handler #h1 img { max-height: 44px; }
}
@media (max-width: 420px) {
  #sn-position #h1 img,
  #site-name-handler #h1 img { max-height: 34px; }
}

/* --- tablet/mobile header: logo flush to the content gutter, burger hard right --- */
@media (max-width: 900px) {
  #sn-position { padding-left: 0; padding-right: 0; }
  /* the site-name column is fixed at `topwidth` px, which pushes #menu (and the
     burger inside it) into the middle of the bar. Let it shrink and float the
     menu right so the toggle lands on the content column's right edge. */
  #site-name-handler { width: auto !important; }
  #top-handler #menu { float: right; }
  a#menupanel { float: none; margin-left: auto; }
}

/* --------------------------------------------------------------------------
   12. CONVERT FORMS SUBMIT BUTTON
   FlatGear's own .button/.cf-btn rules out-specify Convert Forms' CSS custom
   properties, which left the submit button rendering as a pale outline.
   Pin it to the brand teal. White on #07757e = 5.45:1 (AA).
   -------------------------------------------------------------------------- */
.convertforms .cf-btn,
#cf2 .cf-btn,
.convertforms button.cf-btn {
  background-color: var(--jr-teal-dark) !important;
  color: var(--jr-white) !important;
  border: 0 !important;
  border-radius: 6px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.convertforms .cf-btn:hover,
#cf2 .cf-btn:hover {
  background-color: var(--jr-teal-deep) !important;   /* 7.40:1 */
  color: var(--jr-white) !important;
  opacity: 1;
}
