/* Placement taxonomy and placement-group archive pages only. */

body.k3-layout-archive {
  --k3-content-font-size: 13px;
  --k3-content-font-size-mobile: 12px;
}

body.k3-layout-archive .sb-archive-header {
  margin: 0 0 14px;
}

body.k3-layout-archive .wp-block-query-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

body.k3-layout-archive .k3-archive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

body.k3-layout-archive .k3-archive-main,
body.k3-layout-archive .k3-archive-sidebar {
  min-width: 0;
}

body.k3-layout-archive .sb-cards {
  display: grid;
  gap: 16px;
}

body.k3-layout-archive .sb-card > .entry-title {
  padding: 8px 12px;
  font-size: 20px;
  line-height: 1.25;
}

body.k3-layout-archive .sb-card > .sb-content {
  padding: 10px 12px 12px;
}

body.k3-layout-archive .sb-meta {
  margin: 0 0 8px;
  font-size: 12px;
  opacity: 0.75;
}

body.k3-layout-archive .sb-excerpt {
  margin-top: 10px;
  opacity: 0.92;
}

/* --------------------------------------------------------------------------
 * Query controls
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .sb-pagination {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

body.k3-layout-archive .sb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--k3-text);
  line-height: 1;
  text-decoration: none;
}

body.k3-layout-archive .sb-pagination .page-numbers.current {
  font-weight: 800;
}

body.k3-layout-archive .sb-placement-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fffaf2;
}

body.k3-layout-archive .sb-placement-filter__label {
  color: #555;
  font-size: 13px;
}

body.k3-layout-archive .sb-placement-filter__keyword {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #355d88;
  font-size: 12px;
  line-height: 1.4;
}

body.k3-layout-archive .sb-placement-filter__clear {
  margin-left: auto;
  color: var(--k3-link);
  font-size: 13px;
  text-decoration: none;
}

body.k3-layout-archive .sb-placement-filter__clear:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
 * Active block-template archive renderer
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .sb-placement-posts {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.k3-layout-archive .sb-placement-posts > li {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

body.k3-layout-archive .sb-placement-posts .sb-card {
  overflow: hidden;
  background: #fff;
}

body.k3-layout-archive .sb-placement-posts .sb-card__titlebar {
  margin: 0;
  padding: 12px 18px 13px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  font-family: "Noto Serif JP", "Noto Serif JP Regular", "Times New Roman", serif;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
}

body.k3-layout-archive .sb-placement-posts .sb-card__titlebar a {
  color: inherit;
  text-decoration: none;
}

body.k3-layout-archive .sb-placement-posts .sb-card__body {
  padding: 18px 20px 16px;
}

body.k3-layout-archive .sb-placement-posts .sb-card__thumb {
  margin: 0 0 16px;
  overflow: hidden;
  background: #f6f6f6;
}

body.k3-layout-archive .sb-placement-posts .sb-card__thumb .wp-block-post-featured-image,
body.k3-layout-archive .sb-placement-posts .sb-card__thumb .wp-block-post-featured-image a,
body.k3-layout-archive .sb-placement-posts .sb-card__thumb .sb-thumb__link {
  display: block;
  margin: 0;
}

body.k3-layout-archive .sb-placement-posts .sb-card__thumb img {
  display: block;
  width: 100%;
  height: auto;
}

body.k3-layout-archive .sb-placement-posts .sb-card__content {
  max-width: 100%;
  font-size: 13px;
  line-height: 1.8;
  word-break: break-word;
}

body.k3-layout-archive .sb-placement-posts .sb-card__content > :first-child {
  margin-top: 0;
}

body.k3-layout-archive .sb-placement-posts .sb-card__content > :last-child {
  margin-bottom: 0;
}

/*
body.k3-layout-archive .sb-placement-posts .sb-card__content p,
body.k3-layout-archive .sb-placement-posts .sb-card__content li,
body.k3-layout-archive .sb-placement-posts .sb-card__content dd,
body.k3-layout-archive .sb-placement-posts .sb-card__content td,
body.k3-layout-archive .sb-placement-posts .sb-card__content th {
  font-size: 13px;
}
*/

body.k3-layout-archive .sb-placement-posts .sb-card__content h4,
body.k3-layout-archive .sb-placement-posts .sb-card__content h5,
body.k3-layout-archive .sb-placement-posts .sb-card__content h6 {
  font-size: 14px;
}

body.k3-layout-archive .sb-placement-posts .sb-card__meta {
  margin-top: 14px;
  color: #666;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: right;
}

body.k3-layout-archive .sb-card--placement .sb-entry-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 14px 14px 8px;
}

body.k3-layout-archive .sb-card--placement .sb-entry-meta__left,
body.k3-layout-archive .sb-card--placement .sb-entry-meta .sb-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

body.k3-layout-archive .sb-card--placement .sb-entry-meta__label,
body.k3-layout-archive .sb-card--placement .sb-entry-meta__date {
  font-size: 13px;
  white-space: nowrap;
}

body.k3-layout-archive .sb-card--placement .sb-entry-meta__label {
  color: #555;
}

body.k3-layout-archive .sb-chip--link {
  color: #444;
  text-decoration: none;
}

body.k3-layout-archive .sb-single-status {
  margin: 14px 14px 0;
  padding: 12px 14px;
  border: 1px solid #e2c28d;
  border-radius: 8px;
  background: #fff5e8;
  color: #8a4a00;
  font-weight: 700;
  text-align: center;
}

/* --------------------------------------------------------------------------
 * Thumbnail-grid subtypes: flyer, link, slideshow
 * ----------------------------------------------------------------------- */

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px !important;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts > li,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid > li {
  display: flex;
  margin: 0 !important;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card--placement,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card--placement {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__titlebar,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__titlebar {
  padding: 10px 14px 11px;
  font-size: 1.02rem;
  line-height: 1.45;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__titlebar a,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__titlebar a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__body,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 14px 14px 16px;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__thumb,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__thumb {
  margin: 0 0 12px;
  aspect-ratio: 3 / 2;
}

body.k3-layout-archive.is-placement-flyer .sb-placement-posts .sb-card__thumb,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid--flyer .sb-card__thumb {
  aspect-ratio: 4 / 3;
}

body.k3-layout-archive.is-placement-link .sb-placement-posts .sb-card__thumb,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid--link .sb-card__thumb {
  aspect-ratio: 3 / 2;
}

body.k3-layout-archive.is-placement-slideshow .sb-placement-posts .sb-card__thumb,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid--slideshow .sb-card__thumb {
  aspect-ratio: 16 / 9;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__thumb :is(.wp-block-post-featured-image, .wp-block-post-featured-image a, .sb-thumb__link),
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__thumb :is(.wp-block-post-featured-image, .wp-block-post-featured-image a, .sb-thumb__link) {
  height: 100%;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__thumb img,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__content,
body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__content .wp-block-post-content,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__content,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__content .wp-block-post-content {
  min-height: 0;
  max-height: 7.2em;
  overflow: hidden;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__content p,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__content p {
  margin: 0;
  color: #444;
  font-size: 0.92rem;
  line-height: 1.8;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__content p + p,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__content p + p {
  margin-top: 0.55em;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__content :is(h1, h2, h3, h4, h5, h6, figure, img, ul, ol, table, iframe, .wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-buttons, .wp-block-table),
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__content :is(h1, h2, h3, h4, h5, h6, figure, img, ul, ol, table, iframe, .wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-buttons, .wp-block-table) {
  display: none !important;
}

body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts .sb-card__meta,
body.k3-layout-archive .sb-placement-posts.is-thumb-grid .sb-card__meta {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.85rem;
}

/* Rails-style slideshow archive cards use a dedicated two-column gallery. */
body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template > li {
  margin: 0;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-card--placement {
  display: block;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-archive-slideshow-thumbnail {
  margin: 0;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-archive-slideshow-thumbnail__link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f5;
  text-decoration: none;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-archive-slideshow-thumbnail__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-card__titlebar {
  margin: 0;
  padding: 9px;
  border: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.42857143;
  font-weight: 700;
  text-align: center;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-card__titlebar a {
  display: inline;
  color: inherit;
  text-decoration: none;
}

body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .wp-block-post.type-slideshow .sb-card__body {
  display: none;
}

/* --------------------------------------------------------------------------
 * Standalone placement-group archive renderer
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .sb-archive-entries {
  display: grid;
  gap: 28px;
}

body.k3-layout-archive .sb-archive-entry {
  overflow: hidden;
}

body.k3-layout-archive .sb-archive-entry__title {
  margin: 0;
  padding: 12px 18px 13px;
  background: #ef8d00;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 700;
}

body.k3-layout-archive .sb-archive-entry__title a {
  color: #fff;
  text-decoration: none;
}

body.k3-layout-archive .sb-archive-entry__title a:hover {
  text-decoration: underline;
}

body.k3-layout-archive .sb-archive-entry__inner {
  padding: 18px 20px 20px;
}

body.k3-layout-archive .sb-archive-entry__media {
  margin: 0 0 18px;
}

body.k3-layout-archive .sb-archive-entry__media img,
body.k3-layout-archive .sb-archive-entry__content img {
  display: block;
  max-width: 100%;
  height: auto;
}

body.k3-layout-archive .sb-archive-entry__media img {
  width: 100%;
}

body.k3-layout-archive .sb-archive-entry__content p {
  margin: 0 0 1em;
}

body.k3-layout-archive .sb-archive-entry__content p:last-child {
  margin-bottom: 0;
}

body.k3-layout-archive .sb-archive-entry__action {
  margin-top: 16px;
}

body.k3-layout-archive .sb-archive-entry__action-link {
  color: var(--k3-link);
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
}

body.k3-layout-archive .sb-archive-entry__action-link:hover {
  text-decoration: underline;
}

body.k3-layout-archive .sb-archive-entry__note {
  margin: 16px 0 0;
  color: #666;
  font-size: 13px;
  line-height: 1.7;
}

body.k3-layout-archive .sb-archive-entry__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.k3-layout-archive .sb-archive-entry__footer-left {
  min-width: 0;
}

body.k3-layout-archive .sb-archive-entry__footer .sb-archive-chip-list {
  margin: 0;
}

body.k3-layout-archive .sb-archive-entry__date {
  flex: 0 0 auto;
  color: #555;
  font-size: 14px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
 * Legacy archive card renderer retained by some placement subtypes
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .sb-archive-cards {
  display: grid;
  gap: 24px;
}

body.k3-layout-archive .sb-archive-cards--stack {
  grid-template-columns: 1fr;
}

body.k3-layout-archive .sb-archive-cards--grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

body.k3-layout-archive .sb-archive-card,
body.k3-layout-archive .sb-archive-card__thumb-wrap {
  overflow: hidden;
}

body.k3-layout-archive .sb-archive-card__thumb-wrap {
  background: #f7f7f7;
}

body.k3-layout-archive .sb-archive-card__thumb-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

body.k3-layout-archive .sb-archive-card__img {
  display: block;
  width: 100%;
  height: auto;
}

body.k3-layout-archive .sb-archive-card--link .sb-archive-card__thumb-wrap,
body.k3-layout-archive .sb-archive-card--flyer .sb-archive-card__thumb-wrap {
  aspect-ratio: 3 / 2;
}

body.k3-layout-archive .sb-archive-card--flyer .sb-archive-card__thumb-wrap--flyer {
  aspect-ratio: 4 / 3;
}

body.k3-layout-archive .sb-archive-card--link .sb-archive-card__img,
body.k3-layout-archive .sb-archive-card--flyer .sb-archive-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.k3-layout-archive .sb-archive-card__body {
  padding: 16px 18px 18px;
}

body.k3-layout-archive .sb-archive-card__meta {
  margin-bottom: 8px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

body.k3-layout-archive .sb-archive-card__title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

body.k3-layout-archive .sb-archive-card__title a {
  color: #c65400;
  text-decoration: none;
}

body.k3-layout-archive .sb-archive-card__excerpt {
  margin: 10px 0 0;
  color: #444;
  font-size: 14px;
  line-height: 1.8;
}

body.k3-layout-archive .sb-archive-card__url {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
}

body.k3-layout-archive .sb-archive-card__url a,
body.k3-layout-archive .sb-archive-chip {
  color: var(--k3-link);
  text-decoration: none;
}

body.k3-layout-archive .sb-archive-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

body.k3-layout-archive .sb-archive-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4fb;
  font-size: 12px;
  line-height: 1.4;
}

body.k3-layout-archive .sb-archive-card--link .sb-archive-card__body,
body.k3-layout-archive .sb-archive-card--flyer .sb-archive-card__body {
  min-height: 150px;
}

/* --------------------------------------------------------------------------
 * Sidebar
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .k3-archive-sidebar {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

body.k3-layout-archive .k3-archive-sidebar > * {
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0;
  flex: 0 0 auto;
}

body.k3-layout-archive .sb-placement-sidebar,
body.k3-layout-archive .sb-spot-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 18px;
  min-height: 0;
  height: auto;
}

body.k3-layout-archive .sb-placement-sidebar > *,
body.k3-layout-archive .sb-spot-sidebar > * {
  min-height: 0;
  height: auto;
  margin: 0;
  flex: 0 0 auto;
}

body.k3-layout-archive .sb-side-card,
body.k3-layout-archive .sb-widget {
  min-height: 0;
  height: auto;
}

body.k3-layout-archive .sb-side-card > .entry-title,
body.k3-layout-archive .sb-side-card__title,
body.k3-layout-archive .sb-widget > .entry-title {
  padding: 8px 12px;
  font-size: 20px;
  line-height: 1.2;
}

body.k3-layout-archive .sb-side-card .sb-content,
body.k3-layout-archive .sb-widget .sb-content {
  padding: 10px 12px 12px;
}

body.k3-layout-archive .search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

body.k3-layout-archive .search-form label {
  display: block;
  min-width: 0;
}

body.k3-layout-archive .search-form .search-field {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
}

body.k3-layout-archive .search-form .search-submit {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

body.k3-layout-archive .sb-list {
  margin: 0;
  padding-left: 1.1rem;
}

body.k3-layout-archive .sb-list li + li {
  margin-top: 8px;
}

body.k3-layout-archive .sb-chip {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #444;
  font-size: 11px;
  line-height: 1.2;
}

body.k3-layout-archive .sb-map-link,
body.k3-layout-archive .sb-info-table dd a {
  color: #78a400;
  text-decoration: none;
}

body.k3-layout-archive .sb-map-link:hover,
body.k3-layout-archive .sb-info-table dd a:hover {
  text-decoration: underline;
}

body.k3-layout-archive .sb-map iframe {
  height: 260px;
}

body.k3-layout-archive .sb-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.k3-layout-archive .sb-keywords__item {
  margin: 0;
  padding: 0;
}

body.k3-layout-archive .sb-keywords__link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #355d88;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

body.k3-layout-archive .sb-keywords__item.is-current .sb-keywords__link {
  background: #6cb7d8;
  color: #fff;
  font-weight: 700;
}

body.k3-layout-archive .sb-keywords__link:hover {
  text-decoration: underline;
}

body.k3-layout-archive .sb-monthly {
  overflow-x: auto;
}

body.k3-layout-archive .sb-monthly-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

body.k3-layout-archive .sb-monthly-table th,
body.k3-layout-archive .sb-monthly-table td {
  padding: 6px 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

body.k3-layout-archive .sb-monthly-table th {
  width: 54px;
  background: #faf8ef;
  font-weight: 700;
}

body.k3-layout-archive .sb-monthly-table td.is-empty {
  color: #999;
}

body.k3-layout-archive .sb-monthly-table td a {
  color: #355d88;
  text-decoration: none;
  white-space: nowrap;
}

body.k3-layout-archive .sb-monthly-table td.is-current {
  background: #fff6cf;
  font-weight: 700;
}

body.k3-layout-archive .sb-monthly-table td a:hover {
  text-decoration: underline;
}

/* Sidebar HTML is full-width inside its narrow card, unlike main rich text. */
body.k3-layout-archive .sb-sidebar-html .container,
body.k3-layout-archive .sb-sidebar-html .row,
body.k3-layout-archive .sb-sidebar-html [class*="col-"] {
  max-width: 100%;
  box-sizing: border-box;
}

body.k3-layout-archive .sb-sidebar-html .container {
  width: 100%;
  margin: 0;
  padding: 0;
}

body.k3-layout-archive .sb-sidebar-html .row {
  margin: 0;
}

body.k3-layout-archive .sb-sidebar-html [class*="col-"] {
  width: 100%;
  padding: 0;
}

/* --------------------------------------------------------------------------
 * Media containment and paired lightbox images
 * ----------------------------------------------------------------------- */

body.k3-layout-archive .sb-card__content :is(figure, .wp-block-image, .wp-block-gallery, .wp-caption) {
  max-width: 100% !important;
}

body.k3-layout-archive .sb-card__content :is(img, .wp-block-image img, .wp-caption img) {
  max-width: 100% !important;
  width: auto;
}

body.k3-layout-archive .sb-card__content :is(iframe, video, embed, object) {
  max-width: 100% !important;
}

/*
 * Keep a genuine two-image lightbox row side by side.
 * Requiring both adjacent links to contain images prevents empty lightbox
 * anchors (for example, an anchor containing only <br>) from turning the
 * whole text paragraph into a flex container.
 */
body.k3-layout-archive .sb-card__content > p:has(
  > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
    + a[rel~="lightbox"]:last-child:has(> img)
) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 30px;
}

body.k3-layout-archive .sb-card__content > p:has(
  > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
    + a[rel~="lightbox"]:last-child:has(> img)
) > a[rel~="lightbox"]:has(> img) {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(50% - 15px);
}

body.k3-layout-archive .sb-card__content > p:has(
  > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
    + a[rel~="lightbox"]:last-child:has(> img)
) > a[rel~="lightbox"]:has(> img) > img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 !important;
}

body.k3-layout-archive .sb-card__content > p:has(
  > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
    + a[rel~="lightbox"]:last-child:has(> img)
) > a[rel~="lightbox"]:last-child > img {
  margin-left: auto !important;
}

@media (max-width: 1080px) {
  body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts,
  body.k3-layout-archive .sb-placement-posts.is-thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.k3-layout-archive .k3-archive-grid,
  body.k3-layout-archive .sb-archive-cards--grid {
    grid-template-columns: 1fr;
  }

  body.k3-layout-archive .k3-archive-sidebar {
    margin-top: 18px;
  }
}

@media (max-width: 900px) {
  body.k3-layout-archive .sb-archive-entry__title {
    font-size: 26px;
  }

  body.k3-layout-archive .sb-archive-entry__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  body.k3-layout-archive .sb-archive-entry__date {
    white-space: normal;
  }
}

@media (max-width: 781px) {
  body.k3-layout-archive.is-placement-slideshow.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /*
  body.k3-layout-archive .sb-placement-posts .sb-card__content,
  body.k3-layout-archive .sb-placement-posts .sb-card__content p,
  body.k3-layout-archive .sb-placement-posts .sb-card__content li,
  body.k3-layout-archive .sb-placement-posts .sb-card__content dd,
  body.k3-layout-archive .sb-placement-posts .sb-card__content td,
  body.k3-layout-archive .sb-placement-posts .sb-card__content th {
    font-size: 12px;
  }
  */

  body.k3-layout-archive .sb-archive-entry__title {
    padding: 10px 14px 11px;
    background: #fff;
    color: #111;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 24px;
    text-align: center;
  }

  body.k3-layout-archive .sb-archive-entry__title a {
    color: #111;
  }

  body.k3-layout-archive .sb-archive-entry__inner {
    padding: 14px 14px 16px;
  }
}

@media (max-width: 640px) {
  body.k3-layout-archive.sb-placement-layout--thumb-grid .sb-placement-posts,
  body.k3-layout-archive .sb-placement-posts.is-thumb-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body.k3-layout-archive .sb-card__content > p:has(
    > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
      + a[rel~="lightbox"]:last-child:has(> img)
  ) {
    gap: 15px;
  }

  body.k3-layout-archive .sb-card__content > p:has(
    > a[rel~="lightbox"]:first-child:nth-last-child(2):has(> img)
      + a[rel~="lightbox"]:last-child:has(> img)
  ) > a[rel~="lightbox"]:has(> img) {
    max-width: calc(50% - 7.5px);
  }
}

@media (max-width: 720px) {
  body.k3-layout-archive .sb-side-card > .entry-title,
  body.k3-layout-archive .sb-side-card__title,
  body.k3-layout-archive .sb-widget > .entry-title {
    font-size: 18px;
  }
}

body.k3-layout-archive .sb-placement-posts .sb-card__content {
  max-width: 100%;
  font-size: 13px;
  line-height: 1.8;
  word-break: break-word;
}

@media (max-width: 720px) {
  body.k3-layout-archive .sb-placement-posts .sb-card__content {
    font-size: 12px;
  }
}

/* Rails-style Link archive cards. */
body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template > li {
  display: block;
  min-width: 0;
  margin: 0 !important;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .wp-block-post.type-link .sb-card--placement {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .wp-block-post.type-link .sb-card--placement > :not(.sb-archive-link-card) {
  display: none !important;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card {
  height: 100%;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__thumbnail {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #f5f5f5;
  color: inherit;
  text-decoration: none;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__caption {
  padding: 9px;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__title {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.42857143;
  font-weight: 700;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__title a {
  color: inherit;
  text-decoration: none;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__title a:hover {
  text-decoration: underline;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__keywords {
  margin: 0 0 8px;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__keywords .sb-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__keywords .sb-chip {
  font-size: 11px;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__description {
  color: #333;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-archive-link-card__description p {
  margin: 0;
}

@media (max-width: 767px) {
  body.k3-layout-archive.is-placement-link.sb-placement-layout--thumb-grid .sb-placement-posts.wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
}
