/* RMA Eastbourne theme. Deep green for buttons, headings and the footer. Bright green only for stripes and card tops. */
:root {
  --rma-green: var(--wp--preset--color--green);
  --rma-bright: var(--wp--preset--color--green-bright);
  --rma-soft: var(--wp--preset--color--green-soft);
  --rma-grey: var(--wp--preset--color--grey);
  --rma-surface: var(--wp--preset--color--surface);
  --rma-ink: var(--wp--preset--color--ink);
  --rma-muted: var(--wp--preset--color--muted);
  --rma-line: var(--wp--preset--color--line);
  --rma-radius: 6px;
  --rma-gutter: max(16px, 4vw);
  --rma-wide: 1180px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 4px solid var(--rma-ink); outline-offset: 3px; }
.rma-findus :focus-visible, .rma-footer :focus-visible { outline-color: #ffffff; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
html { scroll-behavior: smooth; }
a { text-underline-offset: 3px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rma-findus { scroll-margin-top: 1rem; }

/* Header and menu */
.rma-stripe { height: 8px; background: var(--rma-bright); }
.rma-header { border-bottom: 1px solid var(--rma-line); padding-block: .9rem; }
.rma-brand { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: var(--rma-green); font-weight: 700; line-height: 1.1; }
.rma-brand__org { font-size: 1.125rem; color: var(--rma-muted); }
.rma-brand__branch { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.01em; }
/* Core sets the links to "color: inherit" with a stronger selector, so the green goes on the menu itself. */
.rma-nav { color: var(--rma-green); }
.rma-nav .wp-block-navigation__container { gap: .3rem; flex-wrap: wrap; }
.rma-nav .wp-block-navigation-item__content { font-weight: 700; font-size: 1.125rem; padding: .7rem 1rem; border-radius: var(--rma-radius); color: var(--rma-green); text-decoration: none; border: 2px solid transparent; }
.rma-nav .wp-block-navigation-item__content:hover { border-color: var(--rma-green); }
.rma-nav .wp-block-navigation-item__content[aria-current="page"] { background: var(--rma-green); color: #ffffff; }

/* Banner: the branch's own picture, shown whole */
/* The banner is capped and centred, so it stays a comfortable size on a wide monitor. */
.rma-hero { margin: 1.2rem auto 0; max-width: 1100px; padding-inline: var(--rma-gutter); box-sizing: content-box; }
.rma-hero img { display: block; width: 100%; height: auto; border-radius: var(--rma-radius); }

/* Layout */
.rma-main { padding-block: 2rem 3rem; }
.rma-section { padding: 2.4rem var(--rma-gutter); }
.rma-section > * { max-width: var(--rma-wide); margin-inline: auto; }
.rma-section.is-alt { background: var(--rma-grey); }
.esvh-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; padding-bottom: .6rem; border-bottom: 4px solid var(--rma-bright); }
.esvh-section-head h2 { margin: 0; font-size: 1.7rem; }
.esvh-section-head a { font-weight: 700; font-size: 1.125rem; }
.rma-who { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.rma-who h2 { margin: 0 0 .4rem; font-size: 1.7rem; }
.rma-who p { margin: 0; max-width: 52ch; font-size: 1.15rem; }

/* Buttons */
.esvh-button, .rma-button { display: inline-block; padding: .85rem 1.2rem; min-height: 48px; box-sizing: border-box; background: var(--rma-green); color: #ffffff !important; font-weight: 700; font-size: 1.125rem; border-radius: var(--rma-radius); text-decoration: none; border: 2px solid var(--rma-green); text-align: center; }
.rma-button--light { background: #ffffff; color: var(--rma-green) !important; border-color: #ffffff; }
.rma-button--ghost { background: var(--rma-surface); color: var(--rma-green) !important; }

/* Cards: events and news */
.esvh-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; padding: 0; margin-block: 0; }
.esvh-cards > li { margin: 0; }
.esvh-cards > li > .esvh-card, .esvh-cards > .esvh-card { height: 100%; box-sizing: border-box; }
.esvh-card { background: var(--rma-surface); border: 1px solid var(--rma-line); border-top: 6px solid var(--rma-bright); border-radius: var(--rma-radius); padding: 1.1rem; }
.esvh-event { display: flex; gap: 1rem; align-items: flex-start; }
.esvh-event__title { font-size: 1.2rem; margin: 0 0 .25rem; }
.esvh-event__title a, .esvh-news-card .wp-block-post-title a { color: var(--rma-green); }
.esvh-event__when { margin: 0; color: var(--rma-muted); font-size: 1.125rem; }
.esvh-event__book { margin: .7rem 0 0; }
.esvh-date { flex: 0 0 4rem; text-align: center; border-radius: var(--rma-radius); background: var(--rma-green); color: #ffffff; padding: .45rem 0 .5rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.esvh-date b { display: block; font-size: 1.7rem; }
.esvh-date span { font-size: 1.125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.esvh-event.is-cancelled .esvh-event__title, .wp-block-post-title.is-cancelled { text-decoration: line-through; }
.esvh-news-card { display: flex; flex-direction: column; gap: .5rem; }
.esvh-news-card .wp-block-post-featured-image img { border-radius: 4px; }
.esvh-news-card .wp-block-post-title { font-size: 1.2rem; margin: 0; }
.esvh-card__date { font-size: 1.125rem; font-weight: 700; color: var(--rma-muted); text-transform: uppercase; letter-spacing: .04em; }
.esvh-label { display: inline-block; margin: .4rem 0 0; padding: .2rem .6rem; border-radius: 4px; font-size: 1.125rem; }
.esvh-label.is-updated { background: var(--rma-soft); box-shadow: inset 3px 0 0 var(--rma-green); }
.esvh-label.is-cancelled { background: #f3e4c0; box-shadow: inset 3px 0 0 #7a5a00; color: #3d2e00; }
.esvh-events.is-empty p { margin: 0; }

/* Find us */
.rma-findus { background: var(--rma-green); color: #ffffff; padding: 2.4rem var(--rma-gutter); }
.rma-findus__inner { max-width: var(--rma-wide); margin-inline: auto; }
.rma-findus h2 { color: #ffffff; margin: 0 0 1rem; font-size: 1.7rem; }
.rma-findus h3 { color: #cfe9d5; font-size: 1.125rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .3rem; }
.rma-findus__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
.rma-findus p { margin: 0 0 .7rem; }
.rma-findus a { color: #ffffff; font-weight: 700; }
.rma-findus .rma-button--light { color: var(--rma-green) !important; }
.rma-findus__todo { background: #fff4c2; color: #3d2e00; padding: .6rem .8rem; border-radius: 4px; }
.esvh-map { aspect-ratio: 16 / 9; border-radius: var(--rma-radius); background: #ffffff; color: var(--rma-ink); display: grid; place-content: center; gap: .8rem; text-align: center; padding: 1rem; overflow: hidden; margin-bottom: .8rem; }
.esvh-map iframe { width: 100%; height: 100%; border: 0; }
/* The map box is white, so the white ring used elsewhere in Find us would vanish on it; use the dark ring here. */
.rma-findus .esvh-map :focus-visible { outline-color: var(--rma-ink); }
.esvh-map__placeholder { margin: 0 !important; }
.esvh-map__button { font: inherit; font-weight: 700; background: var(--rma-green); color: #ffffff; border: 2px solid var(--rma-green); border-radius: var(--rma-radius); padding: .8rem 1.2rem; cursor: pointer; justify-self: center; min-height: 48px; }

/* Footer */
.rma-footer { background: #00330d; color: #ecf5ee; padding: 1.2rem var(--rma-gutter) 1.6rem; }
.rma-footer__inner { max-width: var(--rma-wide); margin-inline: auto; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; font-size: 1.125rem; }
.rma-footer p { margin: 0; }
.rma-footer a { color: #ffffff; font-weight: 700; }
.rma-footer__links { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; }

/* Event sign-up box (printed by the shared plugin) */
.esvh-signup { background: var(--rma-surface); border: 2px solid var(--rma-green); border-radius: var(--rma-radius); padding: 1.3rem; margin-block: 2rem; scroll-margin-top: 1rem; max-width: 40rem; }
.esvh-signup h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
.esvh-signup__places { font-weight: 700; color: var(--rma-green); margin: 0 0 .8rem; }
.esvh-signup form, .esvh-signup__form { display: flex; flex-direction: column; gap: 1rem; }
.esvh-signup__message { margin-bottom: 1rem; }
.esvh-signup__message[role="alert"] { background: #f3e4c0; border-left: 4px solid #7a5a00; padding: .6rem .9rem; color: #3d2e00; }
.esvh-signup__message[role="alert"] h2 { font-size: 1.15rem; margin: 0; color: inherit; }
.esvh-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; }
.esvh-field label { font-weight: 700; }
.esvh-field label span { font-weight: 400; color: var(--rma-muted); }
.esvh-field input, .esvh-signup select, .esvh-signup textarea { font: inherit; font-size: 1.2rem; padding: .8rem .9rem; border: 2px solid var(--rma-muted); border-radius: var(--rma-radius); background: #ffffff; color: var(--rma-ink); width: 100%; box-sizing: border-box; }
.esvh-field__help { color: var(--rma-muted); font-size: 1.125rem; }
.esvh-field__error { background: #f3e4c0; border-left: 4px solid #7a5a00; padding: .4rem .7rem; font-weight: 700; color: #3d2e00; }
.esvh-callback__button { font: inherit; font-size: 1.2rem; font-weight: 700; background: var(--rma-green); color: #ffffff; border: 2px solid var(--rma-green); border-radius: var(--rma-radius); padding: 1rem; cursor: pointer; width: 100%; min-height: 56px; }
.esvh-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* The Events Calendar views in the branch colours */
.tribe-common, .tribe-events {
  --tec-font-family-sans-serif: var(--wp--preset--font-family--body);
  --tec-color-text-primary: var(--rma-ink);
  --tec-color-text-secondary: var(--rma-muted);
  --tec-color-text-event-title: var(--rma-ink);
  --tec-color-text-events-title: var(--rma-ink);
  --tec-color-text-event-date: var(--rma-muted);
  --tec-color-text-secondary-event-date: var(--rma-green);
  --tec-color-link-primary: var(--rma-ink);
  --tec-color-link-accent: var(--rma-green);
  --tec-color-link-accent-hover: var(--rma-ink);
  --tec-color-accent-primary: var(--rma-green);
  --tec-color-accent-primary-hover: var(--rma-ink);
  --tec-color-accent-primary-active: var(--rma-ink);
  --tec-color-accent-primary-background: var(--rma-soft);
  --tec-color-button-primary: var(--rma-green);
  --tec-color-button-primary-hover: var(--rma-ink);
  --tec-color-button-primary-active: var(--rma-ink);
  --tec-color-background-events-bar-submit-button: var(--rma-green);
  --tec-color-background-events-bar-submit-button-hover: var(--rma-ink);
  --tec-color-background-events-bar-submit-button-active: var(--rma-ink);
  --tec-color-background-events: transparent;
  --tec-color-background-events-bar: var(--rma-surface);
  --tec-color-border-events-bar: var(--rma-line);
  --tec-color-border-default: var(--rma-line);
  --tec-color-border-secondary: var(--rma-line);
  --tec-color-icon-active: var(--rma-green);
  --tec-color-icon-focus: var(--rma-green);
  --tec-color-day-marker-current-month: var(--rma-green);
  --tec-border-radius-default: var(--rma-radius);
}

/* Phones */
@media (max-width: 782px) {
  .esvh-cards, .rma-findus__grid { grid-template-columns: 1fr; }
  /* Two classes, to beat core's "body .is-layout-flex { display: flex }". */
  .rma-header .rma-header__inner { display: block; }
  .rma-brand { margin-bottom: .8rem; }
  .rma-hero { margin-top: .8rem; }
  .rma-nav .wp-block-navigation__container { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; width: 100%; }
  /* Each menu item is a flex box in core, so the link grows to fill its grid cell. */
  .rma-nav .wp-block-navigation-item__content { display: block; flex: 1; text-align: center; border-color: var(--rma-line); padding: .8rem .3rem; }
  .rma-nav .wp-block-navigation-item__content[aria-current="page"] { border-color: var(--rma-green); }
  .rma-who .rma-button { width: 100%; box-sizing: border-box; }
  .esvh-news-card .wp-block-post-featured-image { display: none; }
}

/* In Remembrance: a quiet grid of names, and a page for each person */
.ct-remembered { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: start; }
.ct-remembered__card { margin: 0; }
.ct-remembered__link { display: flex; flex-direction: column; gap: .35rem; box-sizing: border-box; padding: 1rem; background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius); text-decoration: none; color: var(--rma-ink); }
.ct-remembered__link:hover { border-color: var(--rma-green); }
.ct-remembered__photo { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; margin-bottom: .4rem; }
.ct-remembered__name { font-size: 1.3rem; font-weight: 700; color: var(--rma-green); line-height: 1.2; }
.ct-remembered__number { color: var(--rma-muted); font-size: 1.125rem; margin: 0; }
.ct-remembered__empty { color: var(--rma-muted); }
.ct-remembered-entry { display: flex; flex-direction: column; gap: 1rem; }
.ct-remembered-entry > * { margin: 0; }
.ct-remembered-entry__photo { display: block; width: 100%; max-width: 420px; height: auto; border-radius: var(--rma-radius); }
.ct-remembered-entry__words { margin: 0; font-size: 1.2rem; max-width: 60ch; }
.ct-remembered-entry__back { margin: 1rem 0 0; }
@media (max-width: 782px) { .ct-remembered { grid-template-columns: 1fr; } }
