﻿/* Live standalone AICS blog and article layout.
   Scoped to the preserved blog body classes so other AICS pages are unchanged. */

body:is(.blog, .category-news),
body.single-post {
  overflow-x: hidden;
}

body:is(.blog, .category-news),
body:is(.blog, .category-news) .wp-site-blocks,
body:is(.blog, .category-news) main,
body:is(.blog, .category-news) main > .wp-block-query,
body:is(.blog, .category-news) main > .wp-block-query > .wp-block-group {
  background: #fff !important;
}

body:is(.blog, .category-news) *,
body.single-post * {
  box-sizing: border-box;
}

body:is(.blog, .category-news) .wp-site-blocks,
body.single-post .wp-site-blocks {
  min-width: 0;
  max-width: 100%;
}

/* Blog listing */
body:is(.blog, .category-news) main,
body:is(.blog, .category-news) main > .wp-block-query,
body:is(.blog, .category-news) main > .wp-block-query > .wp-block-group {
  width: 100%;
  max-width: none;
  min-width: 0;
}

body:is(.blog, .category-news) main > .wp-block-query > .wp-block-group {
  padding: clamp(28px, 5vw, 72px) max(24px, calc((100vw - 1200px) / 2)) !important;
}

body:is(.blog, .category-news) ul.wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(24px, 3vw, 44px) !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  list-style: none !important;
}

body:is(.blog, .category-news) ul.wp-block-post-template > li.wp-block-post {
  position: relative;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0 22px !important;
  list-style: none !important;
}

body:is(.blog, .category-news) ul.wp-block-post-template > li.wp-block-post::marker {
  content: "";
}

body:is(.blog, .category-news) ul.wp-block-post-template > li.wp-block-post::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: #b8bec7;
  box-shadow: 0 3px 3px rgba(15, 34, 63, 0.22);
  content: "";
}

body:is(.blog, .category-news) ul.wp-block-post-template > li.wp-block-post > .wp-block-group {
  width: 100%;
  min-height: 100%;
  padding: clamp(20px, 2.4vw, 32px) !important;
}

body:is(.blog, .category-news) .wp-block-post-featured-image {
  width: 100% !important;
  height: auto !important;
  margin: 0 0 24px !important;
}

body:is(.blog, .category-news) .wp-block-post-featured-image > a {
  display: block;
  width: 100%;
  height: auto !important;
}

body:is(.blog, .category-news) .wp-block-post-featured-image img:not([src^="data:image/svg+xml"]) {
  display: block;
  width: 100%;
  height: clamp(220px, 27vw, 330px) !important;
  max-width: 100%;
  border-radius: 7px;
  object-fit: cover;
}

/* The migrated lazy placeholder is not an article image. Do not reserve space for it. */
body:is(.blog, .category-news) .wp-block-post-featured-image:has(img.lazyload),
body:is(.blog, .category-news) .wp-block-post-featured-image:has(img[src^="data:image/svg+xml"]),
body:is(.blog, .category-news) .wp-block-post-featured-image img.lazyload,
body:is(.blog, .category-news) .wp-block-post-featured-image img[src^="data:image/svg+xml"] {
  display: none !important;
}

body:is(.blog, .category-news) .wp-block-post-title {
  max-width: 100%;
  margin: 12px 0 !important;
  font-size: clamp(1.45rem, 2.25vw, 2.15rem) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere;
}

body:is(.blog, .category-news) .wp-block-post-title a {
  display: inline;
}

body:is(.blog, .category-news) .wp-block-post-author p,
body:is(.blog, .category-news) .wp-block-post-date,
body:is(.blog, .category-news) .wp-block-post-excerpt p,
body:is(.blog, .category-news) .wp-block-post-terms {
  margin: 0;
}

body:is(.blog, .category-news) .wp-block-post-excerpt {
  margin-top: 12px;
  line-height: 1.55;
}

/* Individual articles */
body.single-post main#wp--skip-link--target {
  width: min(100%, 1200px) !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: clamp(34px, 5vw, 72px) clamp(24px, 5vw, 72px) !important;
}

body.single-post main#wp--skip-link--target > .wp-block-group:first-child {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-post main h1.wp-block-post-title {
  max-width: 920px;
  margin: 12px 0 20px !important;
  font-size: clamp(2.1rem, 5vw, 4.25rem) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
}

body.single-post main .wp-block-post-author p,
body.single-post main .wp-block-post-date,
body.single-post main .taxonomy-category {
  margin: 0;
}

body.single-post main .wp-block-post-featured-image {
  width: 100% !important;
  max-width: 100% !important;
  margin: clamp(24px, 4vw, 42px) 0 !important;
}

body.single-post main .wp-block-post-featured-image img:not([src^="data:image/svg+xml"]) {
  display: block;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  border-radius: 7px;
  object-fit: cover;
}

body.single-post main .wp-block-post-featured-image:has(img.lazyload),
body.single-post main .wp-block-post-featured-image:has(img[src^="data:image/svg+xml"]),
body.single-post main .wp-block-post-featured-image img.lazyload,
body.single-post main .wp-block-post-featured-image img[src^="data:image/svg+xml"] {
  display: none !important;
}

body.single-post main .entry-content {
  width: 100%;
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow-wrap: anywhere;
}

body.single-post main .entry-content > * {
  max-width: 100%;
}

body.single-post main .entry-content p {
  margin: 0 0 1.25rem !important;
  line-height: 1.7;
}

body.single-post main .entry-content img,
body.single-post main .entry-content video,
body.single-post main .entry-content iframe,
body.single-post main .entry-content table {
  max-width: 100%;
}

body.single-post ul.wp-block-post-template {
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.single-post ul.wp-block-post-template > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.single-post ul.wp-block-post-template > li::marker {
  content: "";
}

@media (max-width: 760px) {
  body:is(.blog, .category-news) main > .wp-block-query > .wp-block-group {
    padding: 28px 20px 40px !important;
  }

  body:is(.blog, .category-news) ul.wp-block-post-template {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 22px !important;
  }

  body:is(.blog, .category-news) ul.wp-block-post-template > li.wp-block-post > .wp-block-group {
    padding: 20px !important;
  }

  body:is(.blog, .category-news) .wp-block-post-featured-image img:not([src^="data:image/svg+xml"]) {
    width: calc(100% - 32px);
    height: 220px !important;
  }

  body:is(.blog, .category-news) .wp-block-post-title {
    font-size: 1.7rem !important;
  }

  body.single-post main#wp--skip-link--target {
    padding: 30px 20px 48px !important;
  }

  body.single-post main h1.wp-block-post-title {
    font-size: clamp(2rem, 10vw, 3rem) !important;
  }

  body.single-post main .entry-content {
    font-size: 1rem;
  }
}
