/* ─── Site frame ─────────────────────────────────────────────────────────── */

.site-layout {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 16px;
  box-sizing: border-box;
}

.site-sidebar {
  margin-top: 92px;
}

/* 980px — two-column, 960px frame: content 640 · gap 48 · sidebar 272 */
@media (min-width: 980px) {
  .site-layout {
    grid-template-columns: 640px 272px;
    column-gap: 48px;
    max-width: 960px;
    padding-inline: 0;
  }

  .site-sidebar {
    margin-top: 0;
  }
}

/* 1250px — wider content, 1196px frame: content 800 · gap 124 · sidebar 272 */
@media (min-width: 1250px) {
  .site-layout {
    grid-template-columns: 800px 272px;
    column-gap: 124px;
    max-width: 1196px;
  }
}

/* 1400px — content+sidebar stays at 1196px; 100px clearance each side is the
   alignwide bleed zone — see alignwide rule under Single post below. */

/* ─── Header ─────────────────────────────────────────────────────────────── */

/*
  The <header> element is the flex container. Logo and nav are its direct
  children — no intermediate group block, so no WP layout-class interference.
  padding-inline aligns content to the frame at each breakpoint.
*/
header.wp-block-template-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-inline: 16px;
  padding-top: 24px;
  padding-bottom: 96px;
}

/* 980px — switch to row, align to 960px frame */
@media (min-width: 980px) {
  header.wp-block-template-part {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-inline: max(0px, calc((100vw - 960px) / 2));
  }
}

/* 1250px — align to 1196px frame */
@media (min-width: 1250px) {
  header.wp-block-template-part {
    padding-inline: max(0px, calc((100vw - 1196px) / 2));
  }
}

/* 1400px — header expands to 1396px frame (1196px + 100px each side) */
@media (min-width: 1400px) {
  header.wp-block-template-part {
    padding-inline: max(0px, calc((100vw - 1396px) / 2));
  }
}

/* ─── Single post ────────────────────────────────────────────────────────── */

.site-single {
  box-sizing: border-box;
}

/* Featured image: spacing before the title; block renders nothing if unset */
.site-single .wp-block-post-featured-image {
  margin-bottom: 2rem;
}

/* Article title: 92px / 104px — only on single posts.
   .site-content.site-single (specificity 0,3,0) beats
   .site-content .wp-block-post-title (0,2,0) in the blog index section. */
.site-content.site-single .wp-block-post-title {
  font-size: 5.75rem;
  line-height: 1.13;
  margin-bottom: 2rem;
}

@media (max-width: 979px) {
  .site-content.site-single .wp-block-post-title {
    font-size: 4rem;
    line-height: 1.125;
  }
}

/* Subtitle: Roboto 28px / 32px */
.sod-post-subtitle {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.75rem;
  line-height: 1.143;
  color: var(--wp--preset--color--text-muted);
  margin: 0 0 2rem;
}

/* Date | reading time: Roboto 18px / 24px */
.sod-post-reading-meta {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  line-height: 1.333;
  color: var(--wp--preset--color--text-muted);
  margin: 0;
}

.sod-post-header-meta {
  margin-bottom: 2rem;
}

/* H2 and H3 in post content */
.wp-block-post-content h2 {
  margin-top: 4rem;
  font-size: 3rem;
  line-height: 1.167;
}

.wp-block-post-content h3 {
  margin-top: 4rem;
  font-size: 1.375rem;
  color: var(--wp--preset--color--text-dark);
}

/* Featured image: natural width only, no upscaling — overrides WP's width:100% via :where(img) */
.site-single .wp-block-post-featured-image img,
.site-content .wp-block-post-featured-image img {
  width: auto !important;
  max-width: 100%;
  height: auto;
}

/* Image captions */
.wp-block-post-content figcaption,
.wp-block-post-content .wp-element-caption {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--wp--preset--color--text-muted);
}

/* Pullquote */
.wp-block-post-content .wp-block-pullquote {
  padding-block: 64px;
  padding-inline: 0;
}

.wp-block-post-content .wp-block-pullquote p {
  font-family: var(--wp--preset--font-family--playfair-display);
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.wp-block-post-content .wp-block-pullquote cite {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  color: var(--wp--preset--color--text-muted);
  font-style: normal;
}

/* alignwide: symmetric 100px bleed beyond the 800px column.
   Only at 1400px+ where the frame has ≥ 102px margin left — below that the
   image would overflow the viewport.
   Must use !important to beat WP's constrained-layout margin: auto !important. */
@media (min-width: 1400px) {
  .site-single .wp-block-post-content .alignwide {
    width: var(--wp--style--global--wide-size) !important;
    margin-left: calc((var(--wp--style--global--content-size) - var(--wp--style--global--wide-size)) / 2) !important;
    margin-right: calc((var(--wp--style--global--content-size) - var(--wp--style--global--wide-size)) / 2) !important;
  }

  /* Caption re-aligns with body text column (100px inset to match the bleed). */
  .site-single .wp-block-post-content .alignwide figcaption,
  .site-single .wp-block-post-content .alignwide .wp-element-caption {
    padding-inline: 100px;
  }
}

/* ─── Blog index ─────────────────────────────────────────────────────────── */

/* Reset WP block-flow top margin so first article aligns with sidebar top */
.site-content .wp-block-query,
.site-content .wp-block-post-template {
  margin-top: 0;
}

/* 92px gap between post cards */
.wp-block-post-template.sod-post-card > li + li {
  margin-top: 92px;
}

/* 24px gap from title to subtitle/excerpt; reset WP block-flow top margin */
.sod-post-card .wp-block-post-title {
  margin-block-start: 0;
  margin-bottom: 1.5rem;
}

.sod-post-card .sod-post-subtitle,
.sod-post-card .wp-block-post-excerpt {
  margin-top: 0;
}

.sod-post-card .sod-post-subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Post titles: Playfair, 48px/56px, black; link color on hover, no background flash */
.site-content .wp-block-post-title {
  font-family: var(--wp--preset--font-family--playfair-display);
  font-size: 3rem;
  line-height: 1.167;
  color: var(--wp--preset--color--heading-primary);
}

.site-content .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.site-content .wp-block-post-title a:hover,
.site-content .wp-block-post-title a:focus {
  color: var(--wp--preset--color--link-hover);
}

/* "Read more →" inline at end of excerpt; WP defaults this to block, force inline */
.sod-post-card .wp-block-post-excerpt__more-link {
  display: inline;
  white-space: nowrap;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */

/* Mobile hamburger button */
@media (max-width: 979px) {
  header.wp-block-template-part .wp-block-navigation__responsive-container-open {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: var(--wp--preset--color--background);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 8px;
    color: var(--wp--preset--color--border);
  }

  header.wp-block-template-part .wp-block-navigation__responsive-container-open::after {
    content: "Menu";
    font-family: var(--wp--preset--font-family--roboto);
    font-size: 1.125rem;
    color: var(--wp--preset--color--text-muted);
  }

  header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open {
    padding-inline: 8px !important;
  }

  /* WP shows the nav container above its 600px internal breakpoint — hide it
     until the overlay is opened (is-menu-open is added by WP's JS on click) */
  header.wp-block-template-part .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }
}

.wp-block-navigation a {
  font-family: var(--wp--preset--font-family--playfair-display);
  font-size: 1.5rem;
  color: var(--wp--preset--color--text-muted);
  text-decoration: none;
}

header.wp-block-template-part .wp-block-navigation a:hover,
header.wp-block-template-part .wp-block-navigation a:focus {
  color: var(--wp--preset--color--link-hover) !important;
  text-decoration: none;
}

@media (min-width: 980px) {
  /* Reset WP default gap; spacing controlled via margins below */
  header.wp-block-template-part .wp-block-navigation__container {
    gap: 0;
  }

  /* Dot after each item except the last */
  header.wp-block-template-part .wp-block-navigation__container > li:not(:last-child)::after {
    content: ".";
    font-family: var(--wp--preset--font-family--playfair-display);
    font-size: 1.5rem;
    color: var(--wp--preset--color--text-muted);
    margin-left: 0.5em;
  }

  /* Space between the dot and the next nav item */
  header.wp-block-template-part .wp-block-navigation__container > li + li {
    margin-left: 0.5em;
  }
}

/* ─── Logo: always 320px, never shrinks in flex context ──────────────────── */
header.wp-block-template-part .wp-block-site-logo {
  width: 320px !important;
  max-width: 320px;
  flex-shrink: 0;
}

header.wp-block-template-part .wp-block-site-logo img {
  width: 320px;
  max-width: 320px;
  height: auto;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer.wp-block-template-part {
  color: var(--wp--preset--color--text-muted);
  font-size: 0.875rem;
  margin-top: 92px;
  padding-bottom: 32px;
}

footer.wp-block-template-part a {
  color: inherit;
  text-decoration: underline;
}

footer.wp-block-template-part a:hover,
footer.wp-block-template-part a:focus {
  color: var(--wp--preset--color--link-hover);
}

.site-footer-inner {
  text-align: center;
}

@media (min-width: 980px) {
  footer.wp-block-template-part {
    grid-column: 1 / -1;
  }

  .site-footer-inner {
    text-align: left;
  }
}

/* ─── Button ─────────────────────────────────────────────────────────────── */

.wp-block-query-pagination {
  margin-top: 64px;
}

.sod-btn,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: var(--wp--preset--color--background);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 8px;
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  color: var(--wp--preset--color--text-muted);
  text-decoration: none;
  cursor: pointer;
}

.sod-btn:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  border-color: var(--wp--preset--color--border);
  color: var(--wp--preset--color--text);
}

.wp-block-query-pagination-previous::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.wp-block-query-pagination-next::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  flex-shrink: 0;
}

/* ─── Sidebar link list ──────────────────────────────────────────────────── */

.sod-link-list--social {
  margin-top: 40px;
}

.sod-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 80px;
  border-top: 1px solid var(--wp--preset--color--separator);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: background-color 0.12s ease;
}

.sod-link-item:last-child {
  border-bottom: 1px solid var(--wp--preset--color--separator);
}

.sod-link-item:hover {
  background-color: var(--wp--preset--color--item-hover);
}

.sod-link-item__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: block;
}

.sod-link-item__text {
  display: flex;
  flex-direction: column;
}

.sod-link-item__title {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1rem;
  font-weight: 700;
  line-height: 20px;
  color: var(--wp--preset--color--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sod-link-item__subtitle {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 0.6875rem;
  line-height: 13px;
  color: var(--wp--preset--color--text-muted);
}

/* ─── Discussion bar + Post-meta bar ─────────────────────────────────────── */

.sod-discussion-bar,
.sod-post-meta-bar {
  background: var(--wp--preset--color--surface);
  margin-top: 64px;
}

.sod-discussion-bar + .sod-post-meta-bar {
  margin-top: 8px;
}

.sod-discussion-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px;
}

.sod-discussion-bar__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sod-discussion-bar__label {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--wp--preset--color--text-dark);
}

.sod-discussion-bar__buttons {
  display: flex;
  gap: 8px;
}

.sod-post-meta-bar {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px;
}

.sod-post-meta-bar p {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  color: var(--wp--preset--color--text-muted);
  margin: 0;
}

/* Tighten gap from post-meta bar to read-next */
.sod-post-meta-bar + .sod-read-next {
  margin-top: 48px;
}

/* ─── Read next ──────────────────────────────────────────────────────────── */

.sod-read-next {
  margin-top: 64px;
}

.sod-read-next__label {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wp--preset--color--text-dark);
  margin-bottom: 16px;
}

.sod-read-next__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sod-read-next__image-link {
  display: block;
}

.sod-read-next__image {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 980px) {
  .sod-read-next__card {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .sod-read-next__image-link {
    flex-shrink: 0;
    width: 300px;
  }

  .sod-read-next__image {
    width: 300px;
  }
}

.sod-read-next__title {
  font-family: var(--wp--preset--font-family--playfair-display);
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.sod-read-next__title a {
  color: var(--wp--preset--color--heading-primary);
  text-decoration: none;
}

.sod-read-next__title a:hover {
  color: var(--wp--preset--color--link-hover);
}

.sod-read-next__subtitle {
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--wp--preset--color--text-muted);
  margin-bottom: 0.5rem;
}

.sod-read-next__excerpt {
  font-family: var(--wp--preset--font-family--lora);
  font-size: 1.125rem;
  line-height: 2rem;
  margin-top: 0.5rem;
}

.sod-read-next__excerpt a {
  white-space: nowrap;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.wp-block-button .wp-block-button__link {
  font-family: var(--wp--preset--font-family--roboto);
  padding-top: calc(.333em + 1px);
  padding-bottom: calc(.333em + 1px);
  border-radius: 8px;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background-color: var(--wp--preset--color--link-hover);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--link-hover);
  color: var(--wp--preset--color--link-hover);
}

@media (max-width: 979px) {
  .wp-block-group.is-nowrap {
    flex-direction: column;
  }
}

/* ─── Fluent Forms ───────────────────────────────────────────────────────── */

.fluentform .ff-el-form-control {
  font-size: 16px;
}

.fluentform .ff-btn-submit {
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--wp--preset--font-family--roboto);
  font-size: 1.125rem;
  padding-block: calc(.333em + 1px);
  padding-inline: calc(1.333em + 2px);
}

/* #32373c matches WP core's default .wp-block-button__link background used on the Trainings page buttons */
.fluentform .ff-btn-submit:not(.ff_btn_no_style) {
  background-color: #32373c !important;
}

.fluentform .ff-btn-submit:not(.ff_btn_no_style):hover,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):focus {
  background-color: var(--wp--preset--color--link-hover) !important;
  opacity: 1;
}

.ff-message-success {
  background-color: #d9e4af;
  border: none;
  box-shadow: none;
}
