/* Additions for the static site (not from WordPress). Loaded last. */

/* WordPress made a square 350 x 350 copy of each featured image for the cards.
   Here editors upload one image and the browser crops it to the same square. */
.card .image-holder img.card-img-top {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Replaces the AddEvent button: a plain link to a calendar file */
.add-to-calendar {
  display: inline-block;
  margin-top: 1em;
}

/* Contact form: on the live site the theme's .form-width rule never applied (the form was nested
   inside Contact Form 7's form, which browsers ignore), so the form fills the content column.
   Contact Form 7's stylesheet also added this space below it. */
.contact-form {
  margin-bottom: 18px;
}

/* Images in page text. Editors can add images or re-save pages, and the editor drops any
   width/height set on an image, so sizing lives here, never in the content:
   - no image is ever wider than its column;
   - several images on one line are a row of logos, so they're kept small and level. */
.default-page img,
.about-profile-box img {
  max-width: 100%;
  height: auto;
}
.default-page p > img:not(:only-child),
.about-profile-box p > img:not(:only-child) {
  height: 65px;
  width: auto;
  max-width: 30%;
  object-fit: contain;
  margin: 0 12px 12px 0;
  vertical-align: middle;
}

/* ---------------------------------------------------------------------------
   Editor formatting safety net.
   Pages CMS lets editors use headings, quotes, code blocks, tables and inline
   code inside page text. The theme only styled some of these, and only on plain
   pages, so here every option gets the same on-brand look in every text area:
   plain pages, About-section pages and posts, and the home page columns (.editor-text,
   which keeps the Get Involved box out of reach).
   --------------------------------------------------------------------------- */

/* Headings inside text. Heading 1 looks like Heading 2, so a page never seems to have
   two main titles (the coloured title band is the page's real title). Sizes match the
   theme's plain pages. */
.default-page .container h1,
.default-page .container h2,
.about-profile-box h1,
.about-profile-box h2,
.editor-text h1,
.editor-text h2 {
  font-size: 24px;
  line-height: 36px;
  margin: 12px 0;
}
.default-page .container h3,
.default-page .container h4,
.about-profile-box h3,
.about-profile-box h4,
.editor-text h3,
.editor-text h4 {
  font-size: 18px;
  line-height: 27px;
  margin: 9px 0;
}

/* Quotes: a coloured bar in the section's link colour (yellow; green in About pages) */
.default-page blockquote,
.about-profile-box blockquote,
.editor-text blockquote {
  margin: 0 0 1rem;
  padding: 12px 18px;
  background: #f2f2f2;
  border-left: 4px solid #fdc741;
}
.about-profile-box blockquote {
  border-left-color: #25ce7b;
}
.default-page blockquote > :last-child,
.about-profile-box blockquote > :last-child,
.editor-text blockquote > :last-child {
  margin-bottom: 0;
}

/* Code: editors use it to set text apart, so it looks like the site's own text
   on a light panel, not like computer code */
.default-page pre,
.about-profile-box pre,
.editor-text pre {
  margin: 0 0 1rem;
  padding: 12px 18px;
  background: #f2f2f2;
  white-space: pre-wrap;
  font: inherit;
  color: inherit;
}
.default-page code,
.about-profile-box code,
.editor-text code {
  font: inherit;
  color: inherit;
  background: #f2f2f2;
  padding: 0 0.25em;
}
.default-page pre code,
.about-profile-box pre code,
.editor-text pre code {
  background: none;
  padding: 0;
}

/* Tables: full width, spaced, with a strong header line; scroll sideways on phones */
.default-page table,
.about-profile-box table,
.editor-text table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
}
.default-page th, .default-page td,
.about-profile-box th, .about-profile-box td,
.editor-text th, .editor-text td {
  padding: 8px 16px 8px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e2e2e2;
}
.default-page th,
.about-profile-box th,
.editor-text th {
  font-family: "Roboto Condensed", Roboto, sans-serif;
  font-weight: 700;
  border-bottom: 2px solid #4a4a4a;
}
@media (max-width: 575.98px) {
  .default-page table,
  .about-profile-box table,
  .editor-text table {
    display: block;
    overflow-x: auto;
  }
}

/* A single image on its own line: no bigger than the original Charter banner */
.default-page p > img:only-child,
.about-profile-box p > img:only-child {
  max-width: min(100%, 612px);
}

/* Visibility introduction: the live site shows its "Introduction" heading at the theme's
   full heading size, not the smaller in-text size used elsewhere. */
.page-template-template-visibility .about-profile-box h3 {
  font-size: 52px;
  line-height: 52px;
  margin: 0 0 31px;
}

/* News and events cards with no image: a tile in one of the FreeBar colours with the
   white statue from the home page standing on the bottom edge, in place of an empty
   white square. */
.image-placeholder {
  position: absolute;
  inset: 0;
  background-image: url(/assets/theme/images/statute.svg);
  background-repeat: no-repeat;
  background-position: 60% bottom;
  background-size: auto 86%;
  transition: transform .8s;
}
.image-placeholder:hover { transform: scale(1.05); }
.image-placeholder.ph-0 { background-color: #fb4236; }
.image-placeholder.ph-1 { background-color: #01b3e3; }
.image-placeholder.ph-2 { background-color: #25ce7b; }
.image-placeholder.ph-3 { background-color: #ff6b01; }

/* Links in page text: dark text with a thick coloured underline, so they pass WCAG
   contrast (15:1) while keeping the FreeBar colours. The old theme's pale yellow and
   green link text scored 1.6:1 and 2.1:1. Each section keeps its own underline colour. */
.about-profile-box a:not(.btn),
.default-page a:not(.btn),
.editor-text a:not(.btn) {
  color: #391f27;
  text-decoration: underline;
  text-decoration-color: #fdc741;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  transition: background-color .2s linear;
}
.about-profile-box a:not(.btn):hover,
.default-page a:not(.btn):hover,
.editor-text a:not(.btn):hover {
  color: #391f27;
  background-color: rgba(253, 199, 65, .35);
}
.page-template-template-about .about-profile-box a:not(.btn) { color: #391f27; text-decoration-color: #25ce7b; }
.page-template-template-about .about-profile-box a:not(.btn):hover { background-color: rgba(37, 206, 123, .25); }
.page-template-template-person .about-profile-box a:not(.btn) { color: #391f27; text-decoration-color: #fb4236; }
.page-template-template-person .about-profile-box a:not(.btn):hover { background-color: rgba(251, 66, 54, .2); }

/* Show where keyboard focus is (the old theme switched the outline off). */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #391f27;
  outline-offset: 2px;
}
