/* ==========================================================================
 * Block styles (inc/blocks.php): the Bootstrap look on core blocks.
 * --------------------------------------------------------------------------
 * Loaded on the front end and inside the editor canvas, so the editor shows
 * the real thing. theme.css is not loaded in the editor, so colours come from
 * theme.json's presets (--wp--preset--color--*), which exist in both places;
 * on the front end theme.css points those at the site's brand tokens.
 * ========================================================================== */

/* - Group: Card / Card, raised / Panel - */
.wp-block-group.is-style-card,
.wp-block-group.is-style-card-raised {
  padding: var(--wp--preset--spacing--4);
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: .75rem;
}
.wp-block-group.is-style-card-raised {
  border-color: transparent;
  box-shadow: var(--wp--preset--shadow--lg);
}
.wp-block-group.is-style-surface {
  padding: var(--wp--preset--spacing--5);
  background: var(--wp--preset--color--surface);
  border-radius: .75rem;
}
/* A card's first image runs to its edges. */
:is(.is-style-card, .is-style-card-raised) > .wp-block-image:first-child {
  margin: calc(var(--wp--preset--spacing--4) * -1) calc(var(--wp--preset--spacing--4) * -1) var(--wp--preset--spacing--4);
}
:is(.is-style-card, .is-style-card-raised) > .wp-block-image:first-child img {
  width: 100%;
  border-radius: .75rem .75rem 0 0;
}
/* Cards in a row are the same height, with their buttons along the bottom. */
.wp-block-column > :is(.is-style-card, .is-style-card-raised):only-child {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.wp-block-column > :is(.is-style-card, .is-style-card-raised):only-child > .wp-block-buttons:last-child {
  margin-top: auto;
  padding-top: var(--wp--preset--spacing--3);
}

/* - Paragraph: Lead / Eyebrow label - */
p.is-style-lead {
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.55;
  color: var(--wp--preset--color--muted);
}
.has-text-color.is-style-lead {
  color: inherit;
}
p.is-style-eyebrow {
  margin-bottom: .5rem;
  font-family: var(--hcdsb-font-ui, inherit);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

/* - Heading: Accent bar - */
.wp-block-heading.is-style-accent-bar::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: .75rem;
  background: var(--wp--preset--color--gold);
  border-radius: 2px;
}
.wp-block-heading.is-style-accent-bar.has-text-align-center::after {
  margin-inline: auto;
}

/* - Button: Pill - */
.wp-block-button.is-style-pill > .wp-block-button__link {
  border-radius: 50rem;
}

/* - Image: Rounded corners / Shadow - */
.wp-block-image.is-style-soft-rounded img {
  border-radius: .75rem;
}
.wp-block-image.is-style-shadow img {
  border-radius: .75rem;
  box-shadow: var(--wp--preset--shadow--lg);
}

/* - List: Checklist / Divided - */
ul.is-style-checklist,
ul.is-style-divided {
  padding-left: 0;
  list-style: none;
}
ul.is-style-checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: .5rem;
}
ul.is-style-checklist li::before {
  content: "";
  position: absolute;
  top: .4em;
  left: 0;
  width: 1.1em;
  height: 1.1em;
  background: var(--wp--preset--color--primary);
  border-radius: 50%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0m3.7 5.3a1 1 0 0 1 0 1.4l-4 4a1 1 0 0 1-1.4 0l-2-2a1 1 0 1 1 1.4-1.4L7 8.6l3.3-3.3a1 1 0 0 1 1.4 0'/%3E%3C/svg%3E") center / contain no-repeat;
}
ul.is-style-divided li {
  padding-block: .625rem;
  border-bottom: 1px solid var(--wp--preset--color--line);
}
ul.is-style-divided li:last-child {
  border-bottom: 0;
}

/* - Details: Accordion - */
/* Consecutive accordion items join into one bordered stack. */
.wp-block-details.is-style-accordion {
  padding: 0;
  margin-block: 0;
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: .5rem;
}
.wp-block-details.is-style-accordion + .wp-block-details.is-style-accordion {
  margin-top: -1px;
}
.wp-block-details.is-style-accordion:has(+ .is-style-accordion) {
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}
.wp-block-details.is-style-accordion + .is-style-accordion {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}
.wp-block-details.is-style-accordion > summary {
  position: relative;
  padding: 1rem 3rem 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.wp-block-details.is-style-accordion > summary::-webkit-details-marker {
  display: none;
}
.wp-block-details.is-style-accordion > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.25rem;
  width: .6rem;
  height: .6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}
.wp-block-details.is-style-accordion[open] > summary {
  color: var(--wp--preset--color--primary);
  background: color-mix(in srgb, var(--wp--preset--color--primary) 8%, #fff);
}
.wp-block-details.is-style-accordion[open] > summary::after {
  transform: translateY(-30%) rotate(-135deg);
}
.wp-block-details.is-style-accordion > :not(summary) {
  margin-inline: 1.25rem;
}
.wp-block-details.is-style-accordion > summary + * {
  margin-top: 1rem;
}
.wp-block-details.is-style-accordion > :last-child:not(summary) {
  margin-bottom: 1.25rem;
}
@media (prefers-reduced-motion: reduce) {
  .wp-block-details.is-style-accordion > summary::after {
    transition: none;
  }
}

/* - Separator: Short bar - */
.wp-block-separator.is-style-short-bar {
  width: 3rem;
  max-width: 3rem;
  height: 4px;
  margin-inline: 0;
  background: var(--wp--preset--color--gold);
  border: 0;
  border-radius: 2px;
  opacity: 1;
}
.wp-block-separator.is-style-short-bar.aligncenter {
  margin-inline: auto;
}

/* - Query loop as cards (the news patterns) - */
.wp-block-post-template .is-style-card .wp-block-post-featured-image {
  margin: calc(var(--wp--preset--spacing--4) * -1) calc(var(--wp--preset--spacing--4) * -1) var(--wp--preset--spacing--3);
}
.wp-block-post-template .is-style-card .wp-block-post-featured-image img {
  border-radius: .75rem .75rem 0 0;
}
.wp-block-post-template .is-style-card {
  height: 100%;
}
.wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}
.wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}
.wp-block-post-date {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--muted);
}

/* - News list pattern: dated rows with dividers - */
.hcdsb-news-list .wp-block-post-template > li {
  padding-block: .75rem;
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.hcdsb-news-list .wp-block-post-template > li:last-child {
  border-bottom: 0;
}
.hcdsb-news-list .wp-block-post-date {
  margin-bottom: .125rem;
}
.hcdsb-news-list .wp-block-post-title {
  margin: 0;
}

/* - Latest comments - */
/* WordPress resets this list with a zero-specificity :where() rule, which
   Bootstrap's "ol, ul { padding-left: 2rem }" outranks. */
.wp-block-latest-comments {
  padding-left: 0;
}
