/*
Theme Name: KRCTI
Theme URI: https://www.krcti.ac.ke/
Author: KRCTI
Description: Native WordPress presentation layer for the approved KRCTI website. Phase 1 establishes the global visual system, header, navigation, footer, accessibility/cookie utilities and direct integration with KRCTI Website Manager settings.
Version: 0.6.4
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: krcti
*/

/*
 * The approved frontend CSS is enqueued separately from assets/css/approved-site.css.
 * Keep this file limited to WordPress integration corrections.
 */

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.krcti-phase1-content {
  min-height: 32vh;
}

.krcti-phase1-content > .section:first-child {
  margin-top: 0;
}


/* --------------------------------------------------------------------------
   KRCTI NATIVE WORDPRESS FRONTEND — PHASE 2 HOMEPAGE
   The approved Astro homepage classes are retained exactly.
   -------------------------------------------------------------------------- */

body.krcti-home-editorial .krcti-phase1-content {
  min-height: 0;
}

/* WordPress sometimes inserts automatic paragraph spacing around empty
   front-page content. Phase 2 renders the approved homepage explicitly. */
body.krcti-home-editorial .krcti-phase1-content > :first-child {
  margin-top: 0;
}

/* KRCTI-PHASE-2-STATS-BACKGROUND-ASSET-PATH-FIX-V1 */
body.krcti-home-editorial .stats-band {
  background:
    linear-gradient(rgba(17, 19, 24, 0.78), rgba(17, 19, 24, 0.78)),
    url("assets/images/home/home-counterbox_1920x322.jpg") center / cover;
}

/* KRCTI-NATIVE-WORDPRESS-PHASE-3-INSTITUTIONAL-V1 */
body.krcti-theme-phase-3 .krcti-phase1-content {
  min-height: 0;
}


/* KRCTI-NATIVE-WORDPRESS-PHASE-4-CATALOGUE-V1 */
body.krcti-courses-index-editorial .krcti-phase1-content,
body.krcti-academic-programmes-editorial .krcti-phase1-content,
body.krcti-course-category-editorial .krcti-phase1-content,
body.krcti-course-detail-editorial .krcti-phase1-content {
  min-height: 0;
}

/* Preserve the approved OHS Committee Course facts treatment from the
   final Astro catalogue fallback. */
.krcti-ohs-native-detail .course-sidebar.krcti-ohs-course-facts {
  padding: 0;
  background: transparent;
  border-top: 0;
}
.krcti-ohs-native-detail .krcti-ohs-course-facts > h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.65rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.krcti-ohs-native-detail .krcti-ohs-course-facts .course-facts.compact {
  display: block;
  margin: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
}
.krcti-ohs-native-detail .krcti-ohs-course-facts .course-facts.compact > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.65fr) minmax(0, 1.35fr);
  gap: 1.25rem;
  align-items: start;
  padding: 0.95rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.krcti-ohs-native-detail .krcti-ohs-course-facts .course-facts.compact dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.krcti-ohs-native-detail .krcti-ohs-course-facts .course-facts.compact dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.45;
}
.krcti-ohs-native-detail .krcti-ohs-course-facts .notice {
  margin: 1.25rem 0 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
@media (max-width: 620px) {
  .krcti-ohs-native-detail .krcti-ohs-course-facts .course-facts.compact > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
}


/* KRCTI-NATIVE-WORDPRESS-PHASE-5-FUNCTIONAL-V1 */
body.krcti-course-calendar-editorial .krcti-phase1-content,
body.krcti-alumni-editorial .krcti-phase1-content,
body.krcti-rpl-editorial .krcti-phase1-content,
body.krcti-thank-you-editorial .krcti-phase1-content {
  min-height: 0;
}

.krcti-field-error {
  display: block;
  margin-top: 0.35rem;
  color: #a30f16;
  font-size: 0.86rem;
  line-height: 1.35;
}

.krcti-form-status {
  margin-top: 0.75rem;
}

.krcti-form-status.error {
  color: #a30f16;
}

.krcti-form-status.success {
  color: #176b39;
}


/* KRCTI-CATALOGUE-EDITORIAL-PARITY-V1-20260902
   Presentation-only parity pass for catalogue listing surfaces.
   Preserves all WordPress data, links, data-* hooks and course-detail rendering.
*/

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main {
  --krcti-catalogue-rule: rgba(20, 20, 20, 0.16);
  --krcti-catalogue-rule-strong: rgba(20, 20, 20, 0.30);
}

/* Match the editorial section rhythm used by Home/About. */
body.krcti-courses-index-editorial main
  :is(.krcti-courses-index-categories, .krcti-courses-index-frequent),
body.krcti-academic-programmes-editorial main
  .krcti-academic-programmes-list,
body.krcti-course-category-editorial main
  .krcti-course-category-list {
  padding-block: clamp(3.5rem, 7vw, 6.25rem);
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories + .krcti-courses-index-frequent {
  border-top: 1px solid var(--krcti-catalogue-rule);
}

/* Courses index: category cards become institutional navigation rows. */
body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--krcti-catalogue-rule-strong);
  border-bottom: 1px solid var(--krcti-catalogue-rule-strong);
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  min-width: 0;
  margin: 0;
  padding: clamp(1.55rem, 3vw, 2.3rem) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card:last-child {
  border-bottom: 0;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card :where(h3, h4) {
  max-width: 48rem;
  margin-top: 0.25rem;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card p:not(.card-kicker) {
  max-width: 60rem;
  margin-bottom: 0;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card .card-link {
  white-space: nowrap;
  align-self: center;
}

/* Course tiles: convert floating cards into ruled prospectus rows. */
body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--krcti-catalogue-rule-strong);
  border-bottom: 1px solid var(--krcti-catalogue-rule-strong);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(14rem, 0.85fr) auto;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: clamp(1.65rem, 3.2vw, 2.45rem) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile:last-child {
  border-bottom: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile > div:first-child {
  min-width: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile h3 {
  max-width: 50rem;
  margin-top: 0;
  margin-bottom: 0.65rem;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile > div:first-child p {
  max-width: 58rem;
  margin-bottom: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--krcti-catalogue-rule);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dl > div {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  min-width: 10.5rem;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions .button {
  width: 100%;
  justify-content: center;
  text-align: center;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions .text-link {
  text-align: center;
}

/* The old soft catalogue band made /courses feel like a separate design system. */
body.krcti-courses-index-editorial main
  .krcti-courses-index-frequent {
  background: transparent;
}

/* Neutralise legacy hover elevation only on catalogue listings. */
@media (hover: hover) and (pointer: fine) {
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main :is(.card, .course-tile):hover {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
}

@media (max-width: 980px) {
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-tile {
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.75fr);
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions .button {
    width: auto;
  }
}

@media (max-width: 700px) {
  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .section-heading {
    display: block;
  }

  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .section-heading > a {
    display: inline-block;
    margin-top: 0.8rem;
  }

  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card .card-link {
    white-space: normal;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-tile {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions {
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions .button {
    width: 100%;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions .text-link {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main :is(.card, .course-tile) {
    transition: none;
    transform: none;
  }
}


/* KRCTI-CATALOGUE-EDITORIAL-GRID-V2-20260902
   Presentation-only refinement of the GREEN v0.5.1 catalogue parity pass.
   Converts catalogue listings from ruled single-column rows to a flat
   editorial grid. No WordPress data, templates, links, forms or hooks change.
*/

/* -------------------------------------------------------------------------
   Category navigation: two-column editorial grid, not floating cards.
   ------------------------------------------------------------------------- */
body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--krcti-catalogue-rule-strong);
  border-bottom: 1px solid var(--krcti-catalogue-rule-strong);
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: clamp(1.7rem, 3vw, 2.45rem) clamp(1.4rem, 2.6vw, 2.35rem);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card:nth-child(odd) {
  border-right: 1px solid var(--krcti-catalogue-rule);
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card:nth-last-child(1):nth-child(odd) {
  border-bottom: 0;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card > div {
  flex: 1 1 auto;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card :where(h3, h4) {
  max-width: 34rem;
  margin-top: 0.25rem;
  margin-bottom: 0.7rem;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card p:not(.card-kicker) {
  max-width: 38rem;
  margin-bottom: 1.25rem;
}

body.krcti-courses-index-editorial main
  .krcti-courses-index-categories .card .card-link {
  align-self: flex-start;
  white-space: normal;
  margin-top: auto;
}

/* -------------------------------------------------------------------------
   Course listings: two-column prospectus-style editorial grid.
   ------------------------------------------------------------------------- */
body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--krcti-catalogue-rule-strong);
  border-bottom: 1px solid var(--krcti-catalogue-rule-strong);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: clamp(1.8rem, 3.25vw, 2.55rem) clamp(1.45rem, 2.7vw, 2.4rem);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile:nth-child(odd) {
  border-right: 1px solid var(--krcti-catalogue-rule);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile:nth-last-child(-n + 2) {
  border-bottom: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile:nth-last-child(1):nth-child(odd) {
  border-bottom: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile h3 {
  max-width: 34rem;
  margin: 0 0 0.7rem;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile > div:first-child p {
  max-width: 38rem;
  margin-bottom: 1.35rem;
}

/* Facts sit as a compact two-row information block inside each grid cell. */
body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  margin: auto 0 0;
  border-top: 1px solid var(--krcti-catalogue-rule);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-tile dl > div {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.68rem 0;
  border-bottom: 1px solid var(--krcti-catalogue-rule);
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  width: 100%;
  min-width: 0;
  margin-top: 1.2rem;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions .button {
  width: auto;
  justify-content: center;
  text-align: center;
}

body:is(
  .krcti-courses-index-editorial,
  .krcti-academic-programmes-editorial,
  .krcti-course-category-editorial
) main .course-actions .text-link {
  text-align: left;
}

/* Keep the grid restrained and institutional on hover. */
@media (hover: hover) and (pointer: fine) {
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main :is(.card, .course-tile):hover {
    background: rgba(0, 0, 0, 0.018);
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
}

/* -------------------------------------------------------------------------
   Responsive collapse: one-column editorial grid.
   ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card-grid,
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card,
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-tile {
    border-right: 0;
    border-bottom: 1px solid var(--krcti-catalogue-rule);
  }

  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card:last-child,
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-tile:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  body.krcti-courses-index-editorial main
    .krcti-courses-index-categories .card,
  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-tile {
    padding-inline: 0;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body:is(
    .krcti-courses-index-editorial,
    .krcti-academic-programmes-editorial,
    .krcti-course-category-editorial
  ) main .course-actions .button {
    width: 100%;
  }
}

/* KRCTI-NATIVE-WORDPRESS-PHASE-6-CLOSURE-V1 */
body.krcti-resources-editorial .krcti-phase1-content,
body.krcti-resource-detail-editorial .krcti-phase1-content,
body.krcti-article-editorial .krcti-phase1-content,
body.krcti-legal-editorial .krcti-phase1-content {
  min-height: 0;
}

.krcti-resource-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.krcti-resource-file-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}


/* KRCTI-PHASE-6-ARTICLE-HEADER-PARITY-FIX-V1-20260902
   Scope:
   - center the article reading column without centering article text;
   - derive sticky-header admin-toolbar offset from the toolbar that is
     actually visible, instead of assuming a fixed 32/46px gap.
*/

/* The old WordPress integration rules assumed the admin toolbar was always
   visible whenever body.admin-bar existed. Phase 6.2 replaces that assumption
   with a runtime CSS variable. */
.site-header,
body.admin-bar .site-header {
  top: var(--krcti-admin-toolbar-offset, 0px);
}

/* Center the article reading surface within the same institutional page frame.
   The text itself remains left aligned for long-form readability. */
body.krcti-article-editorial .article-body.section--narrow {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 900px);
  max-width: 900px;
  margin-inline: auto;
}

body.krcti-article-editorial .article-body.section--narrow > * {
  margin-inline: 0;
}

body.krcti-article-editorial .article-body.section--narrow p {
  max-width: 100%;
}

@media (max-width: 640px) {
  body.krcti-article-editorial .article-body.section--narrow {
    width: min(calc(100% - 1.25rem), 900px);
  }
}


/* KRCTI-PHASE-6-ARTICLE-COMMENTS-EDITORIAL-FIX-V1-20260902
   Remove inherited card treatment from long-form reading content and add
   a native WordPress comment surface in the same editorial language.
*/

body.krcti-article-editorial .article-body.section--narrow {
  width: min(calc(100% - 2rem), 900px);
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(3.5rem, 6vw, 5.75rem) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.krcti-article-editorial .article-body.section--narrow::before,
body.krcti-article-editorial .article-body.section--narrow::after {
  display: none;
}

body.krcti-article-editorial .article-body.section--narrow > * {
  margin-inline: 0;
}

body.krcti-article-editorial .article-body.section--narrow p {
  max-width: 100%;
}

/* Comments are part of the article reading flow, not a floating card. */
body.krcti-article-editorial .krcti-article-comments {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 900px);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 clamp(4rem, 7vw, 6rem);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.krcti-article-editorial .krcti-article-comments-inner {
  padding-top: clamp(2.25rem, 4vw, 3.25rem);
  border-top: 1px solid var(--line);
}

body.krcti-article-editorial .krcti-article-comments h2,
body.krcti-article-editorial .krcti-article-comments h3 {
  margin-top: 0;
}

body.krcti-article-editorial .krcti-comment-intro {
  max-width: 42rem;
  margin-bottom: 2rem;
  color: var(--muted);
}

body.krcti-article-editorial .krcti-comment-list {
  list-style: none;
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
  padding: 0;
  border-top: 1px solid var(--line);
}

body.krcti-article-editorial .krcti-comment-list > li {
  margin: 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

body.krcti-article-editorial .krcti-comment-list .comment-author {
  margin-bottom: 0.35rem;
  font-weight: 700;
}

body.krcti-article-editorial .krcti-comment-list .comment-metadata {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
}

body.krcti-article-editorial .krcti-comment-list .comment-content p:last-child {
  margin-bottom: 0;
}

body.krcti-article-editorial .krcti-comment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1.35rem;
  max-width: 100%;
  margin-top: 1.5rem;
}

body.krcti-article-editorial .krcti-comment-form > p {
  margin: 0;
}

body.krcti-article-editorial .krcti-comment-form .comment-form-comment,
body.krcti-article-editorial .krcti-comment-form .comment-notes,
body.krcti-article-editorial .krcti-comment-form .form-submit,
body.krcti-article-editorial .krcti-comment-form .logged-in-as,
body.krcti-article-editorial .krcti-comment-form .comment-form-cookies-consent,
body.krcti-article-editorial .krcti-comment-form .krcti-comment-moderation-note,
body.krcti-article-editorial .krcti-comment-form .krcti-comment-hp {
  grid-column: 1 / -1;
}

body.krcti-article-editorial .krcti-comment-form label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--ink);
  font-weight: 700;
}

body.krcti-article-editorial .krcti-comment-form :is(input[type="text"], input[type="email"], textarea) {
  box-sizing: border-box;
  width: 100%;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}

body.krcti-article-editorial .krcti-comment-form textarea {
  min-height: 9.5rem;
  resize: vertical;
}

body.krcti-article-editorial .krcti-comment-form :is(input, textarea):focus-visible {
  outline: 3px solid rgba(211, 18, 29, 0.18);
  outline-offset: 2px;
  border-color: var(--red);
}

body.krcti-article-editorial .krcti-comment-form .form-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.72rem 1.15rem;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

body.krcti-article-editorial .krcti-comment-form .form-submit input[type="submit"]:hover {
  filter: brightness(0.94);
}

body.krcti-article-editorial .krcti-comment-form .krcti-comment-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

body.krcti-article-editorial .krcti-comment-moderation-note {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  body.krcti-article-editorial .article-body.section--narrow,
  body.krcti-article-editorial .krcti-article-comments {
    width: min(calc(100% - 1.25rem), 900px);
  }

  body.krcti-article-editorial .krcti-comment-form {
    grid-template-columns: minmax(0, 1fr);
  }

  body.krcti-article-editorial .krcti-comment-form > p {
    grid-column: 1;
  }
}
