/**
 * AgNav Help Centre
 *
 * Styles for the `help_centre` flexible content layout
 * (flexible/content-help_centre.php).
 *
 * Ported from the CSS AgNav supplied (Kamran Trea's CodePen) so that the
 * public site matches the Help Centre inside the AgNav web app. Four
 * deliberate differences from that source, each marked inline below:
 *
 *   1. The `.help-centre__container` rules are omitted. They reproduced
 *      Bootstrap's container breakpoints, which this theme already loads, so
 *      the template uses the theme's own `.container` instead — same width,
 *      and it keeps the section aligned with the header and footer.
 *   2. `.help-centre__title` added, for the page H1 the template prints.
 *   3. `.guide-item__category` darkened from #359BE8 to #1977cc. At 0.72rem /
 *      600 weight the original is small text and needs 4.5:1 against white
 *      (WCAG 2.1 AA, SC 1.4.3); #359BE8 gives 3.00:1, #1977cc gives 4.61:1.
 *      #1977cc is already in use elsewhere in this theme (landing.css).
 *   4. The two `:focus-visible` outlines made opaque. The supplied
 *      rgba(0,72,56,.18) and rgba(53,155,232,.2) resolve to roughly 1.38:1 and
 *      1.22:1 against the white card; SC 1.4.11 requires 3:1 for a focus
 *      indicator. Solid #004838 (10.58:1) and #1977cc (4.61:1) keep the same
 *      3px geometry while actually being visible. Both also clear 3:1 against
 *      the hover backgrounds they can appear over.
 *
 * AgNav's brand blue #359BE8 is retained everywhere it is decorative — icon
 * tiles, hover borders, icon colours — since none of those carry meaning on
 * their own and none fall below the 3:1 required of UI components.
 *
 * Plain CSS, no build step: registered in inc/custom-functions.php as
 * `agnav-style-help_centre`, which the existing per-layout enqueue loop picks
 * up automatically whenever this layout is on the page.
 */

/* ---------------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------------- */

/* Difference 1: the supplied `.help-centre__container` block is intentionally
 * not reproduced here — the template uses the theme's `.container`. */

.help-centre__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.help-centre__col {
  flex: 1 1 100%;
  min-width: 0;
}

/* Two columns from 992px up, in a 5/7 split; stacked below that. */
@media (min-width: 992px) {
  .help-centre__col--5 { flex: 5 1 0; }
  .help-centre__col--7 { flex: 7 1 0; }
}

.help-centre {
  display: block;
  width: 100%;
  min-height: 100%;
  color: #17211d;
}

/* ---------------------------------------------------------------------------
 * Page title
 * ------------------------------------------------------------------------- */

/* Difference 2: the page H1, which the template prints because page.php does
 * not output a title on flexible-content pages. Font size is deliberately left
 * to the theme's existing h1 treatment so this page's heading matches every
 * other page on the site; only the colour is set here. */
.help-centre__title {
  color: #17211d;
}

/* ---------------------------------------------------------------------------
 * Intro
 * ------------------------------------------------------------------------- */

.help-centre__intro {
  max-width: 760px;
  margin-bottom: 2rem;
}

.help-centre__intro h2 {
  margin: 0 0 0.75rem;
  color: #17211d;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.help-centre__intro p {
  margin: 0 0 0.75rem;
  color: #66736d;
  font-size: 1rem;
  line-height: 1.6;
}

.help-centre__intro p:last-child {
  margin-bottom: 0;
}

.help-centre__intro a {
  color: #004838;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 150ms ease;
}

.help-centre__intro a:hover {
  color: #00352a;
}

/* Difference 4: opaque focus ring (was rgba(0, 72, 56, 0.18) at 1.38:1). */
.help-centre__intro a:focus-visible {
  outline: 3px solid #004838;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
 * Card shell
 * ------------------------------------------------------------------------- */

.help-card {
  height: 100%;
  overflow: hidden;
  border: 1px solid #e1e8e4;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 10px 28px rgba(16, 47, 35, 0.06);
}

/* Difference 5 (added Oct 2026, AgNav feedback): the card headings are not
 * clickable, but sat on the same white as the rows beneath them, which are. The
 * tint makes that obvious at a glance. #f6f8fa is the page background already
 * used elsewhere on the site, and it is deliberately a cool grey rather than a
 * green one — the hover state on the rows below resolves to #ebf0ef, so a
 * green-tinted header would read as a row sitting under the cursor. Subtext
 * #66736d still measures 4.65:1 here, clear of the 4.5:1 AA minimum. */
.help-card__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e1e8e4;
  background-color: #f6f8fa;
}

.help-card__header h2 {
  margin: 0;
  color: #17211d;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.help-card__header p {
  margin: 0.25rem 0 0;
  color: #66736d;
  font-size: 0.875rem;
  line-height: 1.5;
}

.help-card__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background-color: rgba(0, 72, 56, 0.08);
  color: #004838;
}

.help-card__icon--blue {
  background-color: rgba(53, 155, 232, 0.1);
  color: #359BE8;
}

.help-card__body {
  padding: 0.75rem;
}

.help-card__body--guides {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

/* ---------------------------------------------------------------------------
 * Contact Support card
 * ------------------------------------------------------------------------- */

.contact-item,
.support-hours {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.875rem 1rem;
}

.contact-item {
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

.contact-item:hover {
  background-color: rgba(0, 72, 56, 0.08);
  color: inherit;
  transform: translateY(-1px);
}

.contact-item:hover .contact-item__icon {
  background-color: #004838;
  color: #ffffff;
}

.contact-item:hover .contact-item__arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* Difference 4: opaque focus ring (was rgba(0, 72, 56, 0.18) at 1.38:1).
 * #004838 measures 10.58:1 on the white card and 9.19:1 on the hover tint. */
.contact-item:focus-visible {
  outline: 3px solid #004838;
  outline-offset: 2px;
}

.contact-item + .contact-item {
  border-top: 1px solid #e1e8e4;
  border-radius: 0;
}

.contact-item__icon,
.support-hours__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background-color: rgba(0, 72, 56, 0.08);
  color: #004838;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.contact-item__content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.contact-item__label,
.support-hours__label {
  display: block;
  margin-bottom: 0.15rem;
  color: #66736d;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  line-height: 1.3;
  text-transform: uppercase;
}

.contact-item__value,
.support-hours__value {
  display: block;
  overflow-wrap: anywhere;
  color: #17211d;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.contact-item__arrow {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
  opacity: 0.45;
  color: #66736d;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.support-hours {
  margin-top: 0.15rem;
  border-top: 1px solid #e1e8e4;
}

/* ---------------------------------------------------------------------------
 * User Guides card
 * ------------------------------------------------------------------------- */

.guide-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 6.75rem;
  padding: 1rem;
  border: 1px solid #e1e8e4;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.guide-item:hover {
  border-color: #359BE8;
  box-shadow: 0 8px 20px rgba(53, 155, 232, 0.1);
  color: inherit;
  transform: translateY(-2px);
}

.guide-item:hover .guide-item__icon {
  background-color: #359BE8;
  color: #ffffff;
}

.guide-item:hover .guide-item__action {
  background-color: rgba(53, 155, 232, 0.1);
  color: #359BE8;
}

/* Difference 4: opaque focus ring (was rgba(53, 155, 232, 0.2) at 1.22:1).
 * #1977cc measures 4.61:1 on the white card. */
.guide-item:focus-visible {
  outline: 3px solid #1977cc;
  outline-offset: 2px;
}

.guide-item__icon {
  display: grid;
  width: 3rem;
  height: 3.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background-color: rgba(53, 155, 232, 0.1);
  color: #359BE8;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.guide-item__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

/* Difference 3: darkened from #359BE8 (3.00:1) to #1977cc (4.61:1). This is
 * 0.72rem text at weight 600, so it is "small text" and needs 4.5:1. */
.guide-item__category {
  margin-bottom: 0.2rem;
  color: #1977cc;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1.3;
  text-transform: uppercase;
}

.guide-item__title {
  color: #17211d;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.guide-item__meta {
  margin-top: 0.3rem;
  color: #66736d;
  font-size: 0.8rem;
  line-height: 1.4;
}

.guide-item__action {
  display: grid;
  width: 2.375rem;
  height: 2.375rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #66736d;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

/* ---------------------------------------------------------------------------
 * Icons
 * ------------------------------------------------------------------------- */

/* Icons are stroked, not filled, and inherit the colour of whatever card or
 * tile they sit in via currentColor. */
.help-card__icon svg,
.contact-item__icon svg,
.support-hours__icon svg,
.contact-item__arrow svg,
.guide-item__icon svg,
.guide-item__action svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Difference 6 (added Oct 2026): the cow and wheat AgNav supplied are filled
 * artwork rather than line drawings, so they need the opposite treatment to the
 * rule above — paint the shape, draw no stroke. Scoped under .guide-item__icon
 * so it outweighs the shared rule's specificity; currentColor is kept, which is
 * what lets them invert to white on hover like the rest of the set. */
.guide-item__icon svg.help-icon--filled {
  fill: currentColor;
  stroke: none;
}

/* ---------------------------------------------------------------------------
 * Motion preferences
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .contact-item,
  .contact-item__icon,
  .contact-item__arrow,
  .guide-item,
  .guide-item__icon,
  .guide-item__action {
    transition: none;
  }

  .contact-item:hover,
  .guide-item:hover {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------------- */

@media (max-width: 575.98px) {
  .help-centre__intro {
    margin-bottom: 1.5rem;
  }

  .help-centre__intro h2 {
    font-size: 1.125rem;
  }

  .help-centre__intro p {
    font-size: 0.95rem;
  }

  .help-card__header {
    padding: 1.125rem;
  }

  .help-card__body {
    padding: 0.625rem;
  }

  .help-card__body--guides {
    padding: 0.75rem;
  }

  .contact-item,
  .support-hours {
    padding: 0.875rem;
  }

  /* The external-link affordance is dropped on narrow screens to give the
   * title room; the "Opens in a new tab" meta line still says what happens,
   * and the aria-label on the link is unchanged. */
  .guide-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.875rem;
    min-height: 6rem;
    padding: 0.875rem;
  }

  .guide-item__action {
    display: none;
  }
}