/*
Theme Name: Kenhdulich Gutenberg
Theme URI: http://localhost:8003/
Author: Codex
Description: Gutenberg block theme cloned from the legacy Kenhdulich layout while preserving old URLs and /container asset paths.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: kenhdulich-gutenberg
*/

:root {
  --kdl-blue: #26519e;
  --kdl-blue-dark: #065093;
  --kdl-blue-light: #6ccdff;
  --kdl-ink: #182532;
  --kdl-leaf: #2f7d56;
  --kdl-sun: #f2a541;
  --kdl-text: #333333;
  --kdl-muted: #777777;
  --kdl-border: #e0e0e0;
  --kdl-soft: #f2f2f2;
  --kdl-page: #f7f8f4;
  --kdl-width: 1120px;
}

/* Archive/single layout: use full width instead of the old 650px content
   column, which left a blank gutter on the right. */
body:not(.home) .kdl-main {
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: 28px !important;
  width: min(var(--kdl-width), calc(100vw - 24px));
  justify-content: stretch;
}

body:not(.home) .kdl-content,
body:not(.home) .kdl-single,
body:not(.home) .kdl-page {
  max-width: none !important;
  min-width: 0;
  width: 100%;
}

body:not(.home) .kdl-single .wp-block-post-content,
body:not(.home) .kdl-page .wp-block-post-content,
body:not(.home) .kdl-single .entry-content,
body:not(.home) .kdl-page .entry-content {
  max-width: none !important;
}

body:not(.home) .kdl-feature-grid .wp-block-post-template {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

body:not(.home) .kdl-sidebar {
  width: 320px;
}

.kdl-breadcrumb-wrap {
  margin: 14px auto 0;
  color: #667382;
  font-size: 13px;
  line-height: 1.4;
}

.kdl-breadcrumb-wrap p {
  margin: 0;
}

.kdl-breadcrumb-wrap a {
  color: var(--kdl-leaf);
  font-weight: 700;
}

@media (max-width: 820px) {
  body:not(.home) .kdl-main {
    display: block;
    width: min(100%, calc(100vw - 24px));
  }

  body:not(.home) .kdl-sidebar {
    width: 100%;
  }
}

/* Mobile navigation: replace horizontal scrolling with a familiar hamburger panel. */
.kdl-menu-toggle,
.kdl-menu-overlay,
.kdl-mobile-menu-head,
.kdl-mobile-menu-search {
  display: none;
}

.kdl-menu-toggle {
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid #d8e5dc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgb(30 92 61 / 10%);
  cursor: pointer;
}

.kdl-menu-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: #17232f;
}

.kdl-menu-close {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #13261d;
  cursor: pointer;
}

.kdl-menu-close::before,
.kdl-menu-close::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 12px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.kdl-menu-close::before {
  transform: rotate(45deg);
}

.kdl-menu-close::after {
  transform: rotate(-45deg);
}

@media (max-width: 820px) {
  html.kdl-menu-is-open,
  html.kdl-menu-is-open body {
    overflow: hidden;
  }

  .kdl-header {
    position: relative;
    z-index: 50;
  }

  .kdl-brand {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
  }

  .kdl-logo {
    width: min(210px, 68vw);
    max-width: none;
  }

  .kdl-menu-toggle {
    display: block;
    justify-self: end;
  }

  .kdl-brand-search {
    grid-column: 1 / -1;
    margin: 4px 0 0;
  }

  .kdl-brand-search input {
    width: calc(100% - 42px);
  }

  .kdl-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    display: block;
    visibility: hidden;
    border: 0;
    background: rgb(11 20 16 / 48%);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .kdl-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    width: min(86vw, 370px);
    min-height: 100dvh;
    margin: 0;
    overflow-y: auto;
    border: 0;
    background: #ffffff;
    box-shadow: -24px 0 48px rgb(15 47 31 / 22%);
    transform: translateX(104%);
    transition: transform 220ms ease;
  }

  .kdl-nav-inner {
    display: block !important;
    width: 100%;
    max-width: none;
    padding: 22px 24px 30px !important;
  }

  .kdl-mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e6eee9;
  }

  .kdl-mobile-menu-head span {
    color: #13261d;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
  }

  .kdl-mobile-menu-search {
    display: flex;
    margin: 0 0 18px;
  }

  .kdl-mobile-menu-search input {
    width: calc(100% - 42px) !important;
  }

  .kdl-nav ul {
    display: block;
    overflow: visible;
  }

  .kdl-nav li {
    display: block;
    border-bottom: 1px solid #edf3ef;
  }

  .kdl-nav a,
  .kdl-nav .is-home a {
    height: auto;
    min-width: 0;
    padding: 17px 2px;
    background: transparent;
    color: #17232f;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    text-indent: 0;
    white-space: normal;
  }

  .kdl-nav a:hover,
  .kdl-nav .is-home a:hover {
    background: transparent;
    color: var(--kdl-leaf-dark);
  }

  .kdl-header.is-menu-open .kdl-menu-overlay {
    visibility: visible;
    opacity: 1;
  }

  .kdl-header.is-menu-open .kdl-nav {
    transform: translateX(0);
  }
}

/* Category/search blog cards inspired by the supplied blog-list reference. */
body:not(.home) .kdl-feature-grid {
  margin-top: 28px;
}

body:not(.home) .kdl-feature-grid .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 34px 34px !important;
  align-items: stretch;
}

body:not(.home) .kdl-feature-grid .wp-block-post {
  display: flex;
  min-width: 0;
}

body:not(.home) .kdl-post-card {
  display: flex;
  width: 100%;
  min-height: 0;
  flex-direction: column;
  padding: 0 0 8px;
  border-bottom: 1px dotted #cfd9d3;
  overflow: visible;
}

body:not(.home) .kdl-post-card > * {
  margin-block-start: 0 !important;
}

body:not(.home) .kdl-post-card .kdl-legacy-image.is-card {
  float: none;
  width: 100%;
  height: 220px;
  margin: 0 0 18px;
  border-radius: 10px;
  background: #dfe7e2;
  box-shadow: 0 12px 26px rgb(43 64 56 / 8%);
}

body:not(.home) .kdl-post-card .wp-block-post-date {
  margin: 0 0 9px;
  color: var(--kdl-leaf-dark);
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
}

body:not(.home) .kdl-post-card .wp-block-post-title {
  min-height: 58px;
  margin: 0 0 12px;
  font-size: 23px;
  line-height: 1.25;
}

body:not(.home) .kdl-post-card .wp-block-post-title a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--kdl-ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body:not(.home) .kdl-post-card .wp-block-post-excerpt {
  margin: 0 0 18px;
  color: #6a7580;
  font-size: 16px;
  line-height: 1.55;
}

body:not(.home) .kdl-post-card .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body:not(.home) .kdl-read-more {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin-top: auto;
  border-bottom: 2px solid var(--kdl-sun);
  color: #9a7136;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body:not(.home) .kdl-read-more::after {
  content: "→";
  margin-left: 8px;
  font-size: 16px;
}

body:not(.home) .kdl-read-more:hover {
  color: var(--kdl-leaf-dark);
  text-decoration: none;
}

@media (max-width: 820px) {
  body:not(.home) .kdl-feature-grid .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  body:not(.home) .kdl-post-card .kdl-legacy-image.is-card {
    height: 210px;
  }

  body:not(.home) .kdl-post-card .wp-block-post-title {
    min-height: 0;
    font-size: 21px;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  background: var(--kdl-page);
  color: var(--kdl-text);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.45;
}

a {
  color: var(--kdl-blue-dark);
  text-decoration: none;
}

a:hover {
  color: #3a82c6;
  text-decoration: underline;
}

.wp-site-blocks {
  padding: 0;
}

.kdl-container {
  width: min(var(--kdl-width), calc(100vw - 24px));
  margin: 0 auto;
}

.kdl-topbar {
  min-height: 28px;
  background: #102f4b;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  color: #c9d7e4;
  font-size: 12px;
}

.kdl-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
}

.kdl-hotline {
  color: #ffffff;
  padding-left: 20px;
  background: url("./assets/phone.png") left center / 13px auto no-repeat;
  border-right: 1px solid rgb(255 255 255 / 18%);
  padding-right: 12px;
}

.kdl-hotline strong {
  color: #9fddff;
  text-shadow: none;
}

.kdl-search {
  display: flex;
  align-items: center;
}

.kdl-search input {
  width: 230px;
  height: 30px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  padding: 2px 12px;
  background: rgb(255 255 255 / 96%);
  font-size: 12px;
}

.kdl-search button {
  width: 38px;
  height: 30px;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: var(--kdl-leaf) url("./assets/search.png") center / 15px auto no-repeat;
  cursor: pointer;
}

.kdl-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 0 16px;
}

.kdl-logo {
  display: block;
  flex: 0 0 auto;
  width: 240px;
  max-width: 48vw;
}

.kdl-logo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.kdl-brand-copy {
  max-width: 590px;
  color: var(--kdl-ink);
  text-align: right;
}

.kdl-brand-copy strong,
.kdl-brand-copy span {
  display: block;
}

.kdl-brand-copy strong {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.25;
}

.kdl-brand-copy span {
  color: #667382;
  font-size: 14px;
}

.kdl-brand-search {
  margin-left: auto;
}

.kdl-brand-search input {
  width: min(360px, 42vw);
}

.kdl-nav {
  background: #113a5f;
  min-height: 42px;
  margin-bottom: 0;
  box-shadow: 0 8px 20px rgb(16 47 75 / 12%);
}

.kdl-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.kdl-nav ul {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.kdl-nav li {
  flex: 0 0 auto;
}

.kdl-nav a {
  display: block;
  height: 42px;
  padding: 11px 12px 9px;
  color: #ffffff;
  font-size: 13px;
  line-height: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

.kdl-nav a:hover,
.kdl-nav .is-home a {
  background: #2f7d56;
  text-decoration: none;
}

.kdl-nav .is-home a {
  min-width: 44px;
  background: var(--kdl-leaf) url("./assets/home.png") center / 15px auto no-repeat;
  text-indent: -999px;
  overflow: hidden;
}

.kdl-nav .kdl-search {
  flex: 0 0 auto;
  margin-left: auto;
}

.kdl-nav .kdl-search input {
  width: 180px;
  height: 30px;
}

.kdl-nav .kdl-search button {
  height: 30px;
}

.kdl-main {
  display: grid;
  grid-template-columns: minmax(0, 650px) 310px;
  gap: 24px;
  align-items: start;
}

.kdl-section-title,
.kdl-sidebar-title {
  min-height: 32px;
  margin: 0 0 16px;
  border-bottom: 2px solid var(--kdl-border);
  color: var(--kdl-blue);
  font-size: 18px;
  line-height: 28px;
  text-transform: uppercase;
  font-weight: 700;
}

.kdl-section-title a,
.kdl-sidebar-title a {
  color: var(--kdl-blue);
}

.kdl-feature-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  margin: 0;
  padding: 0;
}

.kdl-post-card {
  min-height: 132px;
  padding-bottom: 12px;
  border-bottom: 1px dotted var(--kdl-border);
  overflow: hidden;
}

.kdl-post-card .wp-block-post-title {
  margin: 6px 0 6px;
  font-size: 15px;
  line-height: 1.35;
}

.kdl-post-card .wp-block-post-title a {
  color: #333333;
  font-weight: 700;
}

.kdl-post-card .wp-block-post-excerpt {
  margin: 0;
  color: var(--kdl-muted);
  font-size: 13px;
}

.kdl-post-card .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.kdl-post-card .wp-block-post-date,
.kdl-post-date {
  color: var(--kdl-muted);
  font-size: 12px;
  font-style: italic;
}

.kdl-legacy-image {
  display: block;
  overflow: hidden;
  background: #f5f5f5;
}

.kdl-legacy-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kdl-legacy-image.is-card {
  width: 149px;
  height: 90px;
  float: left;
  margin: 0 10px 7px 0;
}

.kdl-legacy-image.is-wide {
  width: 100%;
  height: 210px;
  margin-bottom: 10px;
}

.kdl-legacy-image.is-hero {
  width: 100%;
  height: 360px;
}

.kdl-legacy-image.is-single {
  width: 100%;
  max-height: 380px;
  margin: 8px 0 16px;
}

.kdl-legacy-image.is-single img {
  height: auto;
  max-height: 380px;
  object-fit: contain;
}

.kdl-sidebar {
  min-width: 0;
}

.kdl-sidebar-box {
  margin-bottom: 20px;
}

.kdl-sidebar .wp-block-post-template {
  list-style: none;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--kdl-border);
  box-shadow: 0 0 16px rgb(0 0 0 / 10%);
}

.kdl-sidebar-post {
  min-height: 74px;
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px dotted var(--kdl-border);
  overflow: hidden;
}

.kdl-sidebar-post .kdl-legacy-image {
  width: 100px;
  height: 60px;
  float: left;
  margin: 0 10px 5px 0;
}

.kdl-sidebar-post .wp-block-post-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.kdl-sidebar-post .wp-block-post-title a {
  color: #333333;
  font-weight: 700;
}

.kdl-category-list {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--kdl-border);
  box-shadow: 0 0 16px rgb(0 0 0 / 10%);
  list-style-position: inside;
}

.kdl-category-list li {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--kdl-border);
}

.kdl-single,
.kdl-page {
  max-width: 650px;
}

.kdl-single .wp-block-post-title,
.kdl-page .wp-block-post-title {
  margin: 0 0 8px;
  color: #222222;
  font-size: 22px;
  line-height: 1.28;
}

.kdl-single .wp-block-post-excerpt {
  margin: 0 0 12px;
  font-weight: 700;
  color: #333333;
}

.kdl-single .entry-content,
.kdl-page .entry-content,
.kdl-single .wp-block-post-content,
.kdl-page .wp-block-post-content {
  color: #333333;
  font-size: 15px;
  line-height: 1.7;
  text-align: justify;
}

.kdl-single .wp-block-post-content img,
.kdl-page .wp-block-post-content img {
  max-width: 100%;
  height: auto;
}

.kdl-pagination {
  margin: 24px 0;
  padding-top: 12px;
  border-top: 1px solid var(--kdl-border);
}

.kdl-footer-nav {
  margin-top: 26px;
  background: var(--kdl-blue-dark);
}

.kdl-footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.kdl-footer-nav a {
  display: block;
  padding: 7px 12px;
  color: #ffffff;
  font-size: 14px;
}

.kdl-footer-body {
  min-height: 84px;
  padding: 14px 0;
  background: url("./assets/footer-nav.jpg") center / cover repeat;
  font-size: 13px;
}

.kdl-footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.kdl-footer-body p {
  margin: 0 0 4px;
}

.kdl-copy {
  text-align: right;
  font-style: italic;
}

.kdl-empty {
  padding: 28px;
  border: 1px dotted var(--kdl-border);
  color: var(--kdl-muted);
}

.kdl-home {
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 520px, var(--kdl-page) 520px, var(--kdl-page) 100%);
}

.kdl-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 36px;
  align-items: center;
  padding: 42px 0 30px;
}

.kdl-hero-copy {
  max-width: 520px;
}

.kdl-eyebrow {
  margin: 0 0 12px;
  color: var(--kdl-leaf);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.kdl-hero-copy h1 {
  margin: 0;
  color: var(--kdl-ink);
  font-size: 56px;
  line-height: 1.02;
  font-weight: 800;
}

.kdl-hero-lead {
  margin: 18px 0 24px;
  color: #526171;
  font-size: 17px;
  line-height: 1.65;
}

.kdl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kdl-hero-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #d7e2dc;
  border-radius: 999px;
  background: #ffffff;
  color: var(--kdl-ink);
  font-weight: 700;
}

.kdl-hero-actions a:hover {
  border-color: var(--kdl-leaf);
  color: var(--kdl-leaf);
  text-decoration: none;
}

.kdl-hero-query .wp-block-post-template {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kdl-hero-card {
  overflow: hidden;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgb(24 37 50 / 12%);
}

.kdl-hero-card .kdl-legacy-image {
  border-bottom: 1px solid #edf1f4;
}

.kdl-hero-card-body {
  padding: 20px 22px 22px;
}

.kdl-hero-card .wp-block-post-date {
  color: var(--kdl-leaf);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
}

.kdl-hero-card .wp-block-post-title {
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1.22;
}

.kdl-hero-card .wp-block-post-title a {
  color: var(--kdl-ink);
}

.kdl-hero-card .wp-block-post-excerpt,
.kdl-hero-card .wp-block-post-excerpt__excerpt {
  margin: 0;
  color: #607080;
  font-size: 15px;
  line-height: 1.58;
}

.kdl-destination-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px auto 28px;
}

.kdl-destination-strip a {
  min-height: 92px;
  padding: 17px 16px;
  border: 1px solid #dfe7df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--kdl-ink);
}

.kdl-destination-strip a:hover {
  border-color: var(--kdl-leaf);
  text-decoration: none;
  transform: translateY(-1px);
}

.kdl-destination-strip span,
.kdl-destination-strip strong {
  display: block;
}

.kdl-destination-strip span {
  margin-bottom: 7px;
  color: var(--kdl-leaf);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kdl-destination-strip strong {
  font-size: 15px;
  line-height: 1.35;
}

.kdl-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}

.kdl-home-primary {
  min-width: 0;
}

.kdl-home .kdl-section-title {
  margin-bottom: 18px;
  border-bottom: 0;
  color: var(--kdl-ink);
  font-size: 24px;
  line-height: 1.25;
  text-transform: none;
}

.kdl-home .kdl-section-title::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin-top: 10px;
  background: var(--kdl-sun);
}

.kdl-card-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kdl-modern-card {
  overflow: hidden;
  min-height: 0;
  padding: 0 0 16px;
  border: 1px solid #e1e8ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgb(24 37 50 / 7%);
}

.kdl-modern-card .kdl-legacy-image {
  float: none;
  margin: 0 0 14px;
  border-bottom: 1px solid #edf1f4;
}

.kdl-modern-card .wp-block-post-date,
.kdl-modern-card .wp-block-post-title,
.kdl-modern-card .wp-block-post-excerpt {
  padding-right: 16px;
  padding-left: 16px;
}

.kdl-modern-card .wp-block-post-date {
  color: var(--kdl-leaf);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.kdl-modern-card .wp-block-post-title {
  margin: 7px 0 8px;
  font-size: 19px;
  line-height: 1.32;
}

.kdl-modern-card .wp-block-post-title a {
  color: var(--kdl-ink);
}

.kdl-modern-card .wp-block-post-excerpt,
.kdl-modern-card .wp-block-post-excerpt__excerpt {
  margin: 0;
  color: #607080;
  font-size: 14px;
  line-height: 1.58;
}

@media (max-width: 820px) {
  .kdl-topbar-inner,
  .kdl-brand,
  .kdl-main,
  .kdl-home-hero,
  .kdl-home-layout,
  .kdl-footer-grid {
    display: block;
  }

  .kdl-search {
    margin-top: 6px;
  }

  .kdl-nav-inner {
    display: block;
    padding-bottom: 8px;
  }

  .kdl-nav .kdl-search {
    margin: 8px 0 0;
  }

  .kdl-nav .kdl-search input {
    width: calc(100% - 38px);
  }

  .kdl-brand-copy {
    margin-top: 12px;
    text-align: left;
  }

  .kdl-brand-search {
    margin: 12px 0 0;
  }

  .kdl-brand-search input {
    width: calc(100% - 38px);
  }

  .kdl-main {
    width: min(100%, calc(100vw - 24px));
  }

  .kdl-feature-grid .wp-block-post-template,
  .kdl-card-grid .wp-block-post-template,
  .kdl-destination-strip {
    grid-template-columns: 1fr;
  }

  .kdl-home-hero {
    padding: 28px 0 22px;
  }

  .kdl-hero-copy h1 {
    font-size: 42px;
  }

  .kdl-hero-query {
    margin-top: 24px;
  }

  .kdl-legacy-image.is-hero {
    height: 250px;
  }

  .kdl-hero-card .wp-block-post-title {
    font-size: 23px;
  }

  .kdl-sidebar {
    margin-top: 24px;
  }

  .kdl-copy {
    text-align: left;
    margin-top: 10px;
  }
}

/* Homepage refresh inspired by the supplied travel magazine reference. */
:root {
  --kdl-leaf: #2c9860;
  --kdl-leaf-dark: #16764a;
  --kdl-mint: #eaf8f0;
  --kdl-sun: #f0b64b;
  --kdl-border: #dbe3df;
  --kdl-page: #e9edf1;
}

.kdl-topbar {
  background: var(--kdl-leaf-dark);
}

.kdl-search button {
  background-color: var(--kdl-leaf-dark);
}

.kdl-header {
  background: #fbfdfc;
  border-bottom: 1px solid #e7eee9;
}

.kdl-brand {
  background: #fbfdfc;
}

.kdl-nav {
  background: #ffffff;
  border-top: 1px solid #edf1ee;
  border-bottom: 1px solid #dfe7e2;
  box-shadow: 0 8px 20px rgb(44 152 96 / 9%);
}

.kdl-nav a {
  color: #2f5945;
}

.kdl-nav a:hover {
  background: var(--kdl-mint);
  color: var(--kdl-leaf-dark);
}

.kdl-nav .is-home a {
  background: var(--kdl-leaf) url("./assets/home.png") center / 15px auto no-repeat;
  color: #ffffff;
}

.kdl-legacy-image.is-story {
  width: 100%;
  height: 190px;
}

.kdl-legacy-image.is-thumb {
  width: 72px;
  height: 62px;
  float: left;
  margin: 0 12px 0 0;
  border-radius: 8px;
}

.kdl-legacy-image.is-food {
  width: 100%;
  height: 122px;
  margin-bottom: 9px;
  border-radius: 8px;
}

.kdl-home {
  padding-bottom: 34px;
  background:
    radial-gradient(circle at 34% 18%, rgb(44 152 96 / 14%), transparent 28%),
    linear-gradient(180deg, #f9fbfa 0, #eef2f4 460px, var(--kdl-page) 460px, var(--kdl-page) 100%);
}

.kdl-story-shell {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 8px;
  padding: 24px 0 14px;
}

.kdl-write-card {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  border: 2px dashed rgb(255 255 255 / 76%);
  border-radius: 10px;
  background: linear-gradient(160deg, #39ac6c, #22955c);
  color: #ffffff;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgb(34 149 92 / 22%);
}

.kdl-write-card:hover {
  color: #ffffff;
  text-decoration: none;
}

.kdl-write-card span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--kdl-leaf);
  font-size: 24px;
}

.kdl-story-rail {
  min-width: 0;
  overflow: hidden;
}

.kdl-story-rail .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kdl-story-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: 8px;
  background: #1d3229;
  box-shadow: 0 10px 24px rgb(38 54 48 / 14%);
}

.kdl-story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 10%), rgb(0 0 0 / 72%));
  pointer-events: none;
}

.kdl-story-card .kdl-legacy-image {
  position: absolute;
  inset: 0;
  margin: 0;
}

.kdl-story-card .wp-block-post-title {
  position: absolute;
  right: 10px;
  bottom: 12px;
  left: 10px;
  z-index: 2;
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.kdl-story-card .wp-block-post-title a {
  color: #ffffff;
  font-weight: 800;
}

.kdl-home-hero {
  padding: 22px 0 26px;
}

.kdl-hero-copy h1 {
  font-size: 50px;
}

.kdl-hero-card,
.kdl-destination-strip a,
.kdl-modern-card {
  border-radius: 10px;
}

.kdl-hero-card {
  box-shadow: 0 18px 45px rgb(44 152 96 / 13%);
}

.kdl-destination-strip {
  margin: 0 auto 26px;
}

.kdl-home-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.kdl-editor-grid {
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(43 64 56 / 9%);
}

.kdl-editor-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kdl-editor-grid .wp-block-post {
  min-width: 0;
}

.kdl-editor-grid .wp-block-post:nth-child(1),
.kdl-editor-grid .wp-block-post:nth-child(2) {
  grid-column: span 3;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) {
  grid-column: span 2;
}

.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-modern-card,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-modern-card {
  border: 0;
  box-shadow: none;
}

.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image {
  height: 220px;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image {
  height: 150px;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) .wp-block-post-excerpt {
  display: none;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) .wp-block-post-title {
  font-size: 16px;
}

.kdl-panel-title,
.kdl-review-title {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  color: var(--kdl-leaf-dark);
  text-transform: uppercase;
}

.kdl-popular-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(43 64 56 / 8%);
}

.kdl-popular-panel .kdl-panel-title {
  padding-bottom: 12px;
  border-bottom: 1px dashed #cfd9d3;
}

.kdl-popular-list .wp-block-post-template {
  counter-reset: popular;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kdl-popular-item {
  position: relative;
  min-height: 62px;
  overflow: hidden;
}

.kdl-popular-item::before {
  counter-increment: popular;
  content: counter(popular);
  position: absolute;
  left: 40px;
  top: 18px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--kdl-leaf);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.kdl-popular-item .wp-block-post-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.kdl-popular-item .wp-block-post-title a {
  color: var(--kdl-ink);
}

.kdl-review-strip {
  margin-top: 22px;
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f8d7f, #36b46b);
  box-shadow: 0 16px 40px rgb(24 126 95 / 18%);
}

.kdl-review-title {
  color: #ffffff;
}

.kdl-food-rail {
  overflow-x: auto;
}

.kdl-food-rail .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(5, minmax(138px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0 2px 2px;
  list-style: none;
}

.kdl-food-card {
  min-height: 198px;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
}

.kdl-food-card .wp-block-post-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.32;
}

.kdl-food-card .wp-block-post-title a {
  color: var(--kdl-ink);
  font-weight: 800;
}

.kdl-centered-title {
  margin-top: 36px;
  text-align: center;
}

.kdl-centered-title::after {
  margin-right: auto;
  margin-left: auto;
}

.kdl-weather-card,
.kdl-calendar-card {
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(43 64 56 / 9%);
}

.kdl-weather-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 0%)),
    linear-gradient(135deg, #21a9e6, #60d385);
  color: #ffffff;
}

.kdl-weather-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 0;
  margin-bottom: 18px;
}

.kdl-weather-card input,
.kdl-weather-card button {
  height: 38px;
  border: 0;
}

.kdl-weather-card input {
  min-width: 0;
  border-radius: 8px 0 0 8px;
  padding: 0 12px;
  background: rgb(255 255 255 / 78%);
  color: var(--kdl-ink);
}

.kdl-weather-card button {
  border-radius: 0 8px 8px 0;
  background: rgb(255 255 255 / 65%);
  color: var(--kdl-leaf-dark);
  font-size: 18px;
}

.kdl-weather-card span,
.kdl-weather-card strong,
.kdl-weather-card p {
  display: block;
}

.kdl-weather-card span {
  font-size: 20px;
}

.kdl-weather-card strong {
  margin: 4px 0 0;
  font-size: 48px;
  line-height: 1;
}

.kdl-weather-card p {
  margin: 8px 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.kdl-weather-card div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kdl-weather-card em {
  padding: 9px 6px;
  border-radius: 8px;
  background: rgb(255 255 255 / 28%);
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.kdl-calendar-card {
  padding: 0 18px 20px;
  text-align: center;
}

.kdl-calendar-card strong {
  display: block;
  margin: 0 -18px 18px;
  padding: 12px;
  background: var(--kdl-leaf);
  color: #ffffff;
  text-transform: uppercase;
}

.kdl-calendar-card span {
  display: block;
  color: var(--kdl-leaf);
  font-size: 58px;
  line-height: 1;
  font-weight: 800;
}

.kdl-calendar-card em {
  display: block;
  margin: 6px 0 12px;
  color: var(--kdl-leaf-dark);
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.kdl-calendar-card p {
  margin: 0;
  color: #5d6b62;
  font-size: 13px;
  line-height: 1.55;
}

.kdl-tag-widget {
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(43 64 56 / 9%);
}

.kdl-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.kdl-tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #d7efe3;
  color: #2a6a4c;
  font-size: 12px !important;
  line-height: 1.2;
}

.kdl-tag-cloud a:nth-child(3n + 2) {
  background: #dfd8f0;
  color: #665292;
}

.kdl-tag-cloud a:nth-child(3n) {
  background: #f2dfd6;
  color: #8b5849;
}

/* Keep horizontal card rows visually level. Gutenberg adds flow margins inside
   groups, so the homepage cards need stricter internal layout rules. */
.kdl-story-rail .wp-block-post-template,
.kdl-editor-grid .wp-block-post-template,
.kdl-card-grid .wp-block-post-template,
.kdl-popular-list .wp-block-post-template,
.kdl-food-rail .wp-block-post-template {
  align-items: stretch;
}

.kdl-story-rail .wp-block-post,
.kdl-editor-grid .wp-block-post,
.kdl-card-grid .wp-block-post,
.kdl-popular-list .wp-block-post,
.kdl-food-rail .wp-block-post {
  display: flex;
  min-width: 0;
}

.kdl-story-card,
.kdl-modern-card,
.kdl-food-card,
.kdl-popular-item,
.kdl-destination-strip a {
  width: 100%;
  height: 100%;
}

.kdl-modern-card,
.kdl-food-card {
  display: flex;
  flex-direction: column;
}

.kdl-modern-card > *,
.kdl-food-card > *,
.kdl-hero-card-body > *,
.kdl-popular-item > *,
.kdl-story-card > * {
  margin-block-start: 0 !important;
}

.kdl-modern-card .wp-block-post-title {
  min-height: 50px;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) .wp-block-post-title,
.kdl-card-grid .wp-block-post-title,
.kdl-food-card .wp-block-post-title {
  min-height: 44px;
}

.kdl-modern-card .wp-block-post-excerpt {
  margin-top: auto;
}

.kdl-destination-strip a {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Uniform homepage rows: no oversized left lead cards. */
.kdl-story-shell {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kdl-write-card {
  min-width: 0;
}

.kdl-story-rail {
  grid-column: span 6;
}

.kdl-story-rail .wp-block-post-template {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kdl-editor-grid .wp-block-post-template {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kdl-editor-grid .wp-block-post:nth-child(1),
.kdl-editor-grid .wp-block-post:nth-child(2),
.kdl-editor-grid .wp-block-post:nth-child(n + 3) {
  grid-column: auto;
}

.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-modern-card,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-modern-card {
  border: 1px solid #e1e8ee;
  box-shadow: 0 10px 28px rgb(24 37 50 / 7%);
}

.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image,
.kdl-card-grid .kdl-legacy-image.is-wide {
  height: 168px;
}

.kdl-editor-grid .wp-block-post:nth-child(n + 3) .wp-block-post-excerpt {
  display: block;
}

.kdl-editor-grid .wp-block-post:nth-child(1) .wp-block-post-title,
.kdl-editor-grid .wp-block-post:nth-child(2) .wp-block-post-title,
.kdl-editor-grid .wp-block-post:nth-child(n + 3) .wp-block-post-title,
.kdl-card-grid .wp-block-post-title {
  min-height: 52px;
  font-size: 17px;
}

/* Stronger equalized home layout: remove the large left/right hero imbalance. */
.kdl-home-hero {
  display: block;
  padding: 18px 0 22px;
}

.kdl-hero-copy {
  max-width: none;
  margin-bottom: 16px;
  padding: 24px 28px;
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 14px 34px rgb(43 64 56 / 8%);
}

.kdl-hero-copy h1 {
  font-size: 42px;
}

.kdl-hero-lead {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.kdl-hero-actions {
  justify-content: center;
}

.kdl-hero-query .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kdl-hero-query .wp-block-post {
  display: flex;
}

.kdl-hero-card {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.kdl-hero-card .kdl-legacy-image.is-hero {
  height: 168px;
}

.kdl-hero-card .wp-block-post-title {
  min-height: 58px;
  font-size: 18px;
}

.kdl-hero-card .wp-block-post-excerpt {
  margin-top: auto;
}

/* Fix Gutenberg query-loop vertical offsets. WordPress adds flow margins to
   post-template children, which made item 2+ start lower than item 1. */
.kdl-home .wp-block-query .wp-block-post-template > li,
.kdl-home .wp-block-query .wp-block-post-template > .wp-block-post {
  align-self: stretch !important;
  margin-block-start: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.kdl-home .wp-block-query .wp-block-post-template > li > *,
.kdl-home .wp-block-query .wp-block-post-template > .wp-block-post > * {
  margin-block-start: 0 !important;
}

.kdl-story-shell {
  align-items: start;
}

.kdl-write-card,
.kdl-story-card {
  min-height: 172px;
  height: 172px;
}

.kdl-legacy-image.is-story {
  height: 172px;
}

.kdl-hero-card,
.kdl-modern-card {
  min-height: 462px;
}

.kdl-hero-card .kdl-legacy-image.is-hero,
.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image,
.kdl-card-grid .kdl-legacy-image.is-wide {
  height: 188px;
}

.kdl-hero-card-body,
.kdl-modern-card {
  justify-content: flex-start;
}

.kdl-popular-list .wp-block-post-template {
  row-gap: 18px;
}

.kdl-popular-item {
  display: block;
  min-height: 84px;
  padding: 0;
}

.kdl-food-rail .wp-block-post-template > li,
.kdl-food-rail .wp-block-post {
  align-self: stretch !important;
}

.kdl-food-card {
  min-height: 282px;
}

.kdl-food-card .kdl-legacy-image.is-food {
  height: 148px;
}

/* "Tim hieu ngay nao" cards: include excerpts without the large blank area. */
.kdl-card-grid .wp-block-post-template {
  align-items: stretch !important;
}

.kdl-card-grid .wp-block-post-template > li,
.kdl-card-grid .wp-block-post {
  align-self: stretch !important;
  margin-block-start: 0 !important;
}

.kdl-card-grid .kdl-modern-card {
  min-height: 0;
  height: auto;
  padding-bottom: 18px;
}

.kdl-card-grid .kdl-modern-card .kdl-legacy-image.is-wide {
  height: 220px;
}

.kdl-card-grid .kdl-modern-card .wp-block-post-title {
  min-height: 58px;
  margin-bottom: 8px;
  font-size: 20px;
}

.kdl-card-grid .kdl-modern-card .wp-block-post-excerpt {
  display: block;
  margin: 0;
  padding-right: 16px;
  padding-left: 16px;
  color: #607080;
  font-size: 15px;
  line-height: 1.55;
}

.kdl-card-grid .kdl-modern-card .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Extra-strong top-row alignment for the supplied screenshots. */
.kdl-story-shell,
.kdl-hero-query .wp-block-post-template,
.kdl-editor-grid .wp-block-post-template,
.kdl-food-rail .wp-block-post-template {
  align-items: start !important;
}

.kdl-story-rail .wp-block-post-template > li,
.kdl-hero-query .wp-block-post-template > li,
.kdl-editor-grid .wp-block-post-template > li,
.kdl-food-rail .wp-block-post-template > li {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
  transform: none !important;
}

.kdl-story-rail .wp-block-post-template > li > *,
.kdl-hero-query .wp-block-post-template > li > *,
.kdl-editor-grid .wp-block-post-template > li > *,
.kdl-food-rail .wp-block-post-template > li > * {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
}

/* Story rail without the write-card: seven equal posts in one row. */
.kdl-story-shell {
  display: block;
  padding-top: 24px;
}

.kdl-story-rail {
  grid-column: auto;
  width: 100%;
}

.kdl-story-rail .wp-block-post-template {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kdl-story-card,
.kdl-legacy-image.is-story {
  height: 172px;
  min-height: 172px;
}

@media (max-width: 820px) {
  .kdl-story-shell {
    display: block;
  }

  .kdl-story-rail {
    margin-top: 10px;
    overflow-x: auto;
  }

  .kdl-story-rail .wp-block-post-template {
    grid-template-columns: repeat(6, 138px);
  }

  .kdl-write-card {
    min-height: 104px;
  }

  .kdl-editor-grid .wp-block-post-template,
  .kdl-popular-list .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .kdl-editor-grid .wp-block-post:nth-child(1),
  .kdl-editor-grid .wp-block-post:nth-child(2),
  .kdl-editor-grid .wp-block-post:nth-child(n + 3) {
    grid-column: auto;
  }

  .kdl-food-rail .wp-block-post-template {
    grid-template-columns: repeat(5, 150px);
  }
}

/* Final story rail sizing: 8 equal posts desktop, 4 + 4 on mobile. */
.kdl-story-shell {
  display: block !important;
}

.kdl-story-rail {
  width: 100%;
  overflow: visible;
}

.kdl-story-rail .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 8px;
}

@media (max-width: 820px) {
  .kdl-story-rail {
    overflow-x: visible !important;
  }

  .kdl-story-rail .wp-block-post-template {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .kdl-story-card,
  .kdl-legacy-image.is-story {
    height: 128px !important;
    min-height: 128px !important;
  }

  .kdl-story-card .wp-block-post-title {
    right: 7px;
    bottom: 8px;
    left: 7px;
    font-size: 11px;
    line-height: 1.18;
  }
}

/* Mobile: the three lead cards become compact list items, not narrow columns. */
@media (max-width: 820px) {
  .kdl-hero-query .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .kdl-hero-card {
    display: grid !important;
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 0 !important;
    overflow: hidden;
  }

  .kdl-hero-card .kdl-legacy-image.is-hero {
    width: 132px;
    height: 132px !important;
    min-height: 132px !important;
    border-right: 1px solid #edf1f4;
    border-bottom: 0;
  }

  .kdl-hero-card-body {
    min-width: 0;
    padding: 12px 13px;
  }

  .kdl-hero-card .wp-block-post-date {
    font-size: 11px;
  }

  .kdl-hero-card .wp-block-post-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 0 !important;
    margin: 5px 0 6px;
    font-size: 16px !important;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .kdl-hero-card .wp-block-post-excerpt,
  .kdl-hero-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* Compact editorial and list sections on desktop/mobile. */
.kdl-editor-grid .kdl-modern-card {
  min-height: 0 !important;
  height: auto !important;
}

.kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image,
.kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image {
  height: 170px !important;
}

.kdl-editor-grid .kdl-modern-card .wp-block-post-title {
  min-height: 52px !important;
}

.kdl-editor-grid .kdl-modern-card .wp-block-post-excerpt {
  margin-top: 0 !important;
}

.kdl-editor-grid .kdl-modern-card .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kdl-popular-list .wp-block-post-template {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px 24px !important;
}

.kdl-popular-item {
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  min-height: 76px !important;
  align-items: center;
}

.kdl-popular-item .kdl-legacy-image.is-thumb {
  width: 86px;
  height: 68px;
  float: none;
  margin: 0;
}

.kdl-popular-item::before {
  left: 56px !important;
  top: 8px !important;
}

.kdl-popular-item .wp-block-post-title {
  min-width: 0;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
}

.kdl-popular-item .wp-block-post-title a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kdl-sidebar .wp-block-post-template {
  padding: 12px !important;
  border-radius: 10px;
  background: #ffffff;
}

.kdl-sidebar-post {
  display: grid !important;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  min-height: 72px !important;
  align-items: center;
  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
}

.kdl-sidebar-post .kdl-legacy-image {
  width: 96px !important;
  height: 66px !important;
  float: none !important;
  margin: 0 !important;
  border-radius: 8px;
}

.kdl-sidebar-post .wp-block-post-title {
  min-width: 0;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.kdl-sidebar-post .wp-block-post-title a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 820px) {
  .kdl-editor-grid {
    padding: 12px;
  }

  .kdl-editor-grid .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .kdl-editor-grid .kdl-modern-card {
    display: flex !important;
    min-height: 0 !important;
    height: auto !important;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    position: relative;
  }

  .kdl-editor-grid .kdl-modern-card > a {
    flex: 0 0 132px;
    display: block;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-title,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt {
    width: calc(100% - 132px);
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date {
    position: absolute;
    top: 12px;
    left: 132px;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-title {
    margin-top: 34px !important;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt {
    margin-top: 6px !important;
  }
}

@media (max-width: 520px) {
  .kdl-editor-grid .kdl-modern-card {
    display: grid !important;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 0 !important;
    padding: 0 !important;
  }

  .kdl-editor-grid .kdl-modern-card > a {
    grid-row: 1 / span 3;
    grid-column: 1;
    width: 118px;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-title,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt {
    grid-column: 2;
    width: auto;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date {
    position: static;
  }

  .kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
  .kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image,
  .kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image {
    width: 118px;
    height: 118px !important;
    margin: 0 !important;
    border-right: 1px solid #edf1f4;
    border-bottom: 0;
  }

  .kdl-editor-grid .kdl-modern-card .wp-block-post-date,
  .kdl-editor-grid .kdl-modern-card .wp-block-post-title,
  .kdl-editor-grid .kdl-modern-card .wp-block-post-excerpt {
    padding-right: 13px;
    padding-left: 13px;
  }

  .kdl-editor-grid .kdl-modern-card .wp-block-post-date {
    padding-top: 12px;
    font-size: 11px;
  }

  .kdl-editor-grid .kdl-modern-card .wp-block-post-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 0 !important;
    margin: 3px 0 4px;
    font-size: 15px !important;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .kdl-editor-grid .kdl-modern-card .wp-block-post-excerpt,
  .kdl-editor-grid .kdl-modern-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .kdl-popular-list .wp-block-post-template {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .kdl-popular-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .kdl-popular-item .kdl-legacy-image.is-thumb {
    width: 82px;
    height: 64px;
  }

  .kdl-popular-item::before {
    left: 52px !important;
  }

  .kdl-sidebar-post {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .kdl-sidebar-post .kdl-legacy-image {
    width: 82px !important;
    height: 62px !important;
  }
}

/* Final mobile fix for "Dang duoc quan tam": image left, all text right. */
@media (max-width: 820px) {
  .kdl-editor-grid .kdl-modern-card {
    display: grid !important;
    grid-template-columns: 118px minmax(0, 1fr) !important;
    grid-template-rows: auto auto 1fr !important;
    min-height: 118px !important;
    height: auto !important;
    padding: 0 !important;
    align-items: start !important;
    gap: 0 !important;
  }

  .kdl-editor-grid .kdl-modern-card > a {
    grid-column: 1 !important;
    grid-row: 1 / 4 !important;
    width: 118px !important;
    height: 118px !important;
    flex: none !important;
  }

  .kdl-editor-grid .wp-block-post:nth-child(1) .kdl-legacy-image,
  .kdl-editor-grid .wp-block-post:nth-child(2) .kdl-legacy-image,
  .kdl-editor-grid .wp-block-post:nth-child(n + 3) .kdl-legacy-image {
    width: 118px !important;
    height: 118px !important;
    min-height: 118px !important;
    margin: 0 !important;
    border-right: 1px solid #edf1f4;
    border-bottom: 0 !important;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-title,
  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    padding-right: 12px !important;
    padding-left: 12px !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-date {
    grid-row: 1 !important;
    padding-top: 10px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-title {
    grid-row: 2 !important;
    display: -webkit-box !important;
    overflow: hidden !important;
    min-height: 0 !important;
    margin: 4px 0 4px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt {
    grid-row: 3 !important;
    margin: 0 !important;
    padding-bottom: 8px !important;
  }

  .kdl-editor-grid .kdl-modern-card > .wp-block-post-excerpt .wp-block-post-excerpt__excerpt {
    display: -webkit-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* Last-mile mobile menu override: keep nav as an off-canvas panel, never a swipe rail. */
@media (max-width: 820px) {
  .kdl-menu-toggle {
    display: block !important;
  }

  .kdl-menu-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 998 !important;
    display: block !important;
    visibility: hidden;
    opacity: 0;
  }

  .kdl-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    z-index: 999 !important;
    width: min(86vw, 370px) !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    overflow: auto !important;
    transform: translateX(104%);
  }

  .kdl-nav-inner {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 22px 24px 30px !important;
  }

  .kdl-mobile-menu-head,
  .kdl-mobile-menu-search {
    display: flex !important;
  }

  .kdl-nav ul {
    display: block !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .kdl-nav li {
    display: block !important;
    width: 100% !important;
  }

  .kdl-nav a,
  .kdl-nav .is-home a {
    height: auto !important;
    min-width: 0 !important;
    padding: 17px 2px !important;
    background-image: none !important;
    text-indent: 0 !important;
    white-space: normal !important;
  }

  .kdl-header.is-menu-open .kdl-menu-overlay {
    visibility: visible !important;
    opacity: 1 !important;
  }

  .kdl-header.is-menu-open .kdl-nav {
    transform: translateX(0) !important;
  }
}

/* Header polish after mobile menu change. */
.kdl-mobile-menu-search {
  display: none !important;
}

.kdl-search input {
  height: 42px;
  border: 1px solid #dbe8e2;
  border-right: 0;
  background: #ffffff;
  box-shadow: 0 8px 20px rgb(28 88 58 / 7%);
  color: #17232f;
  font-size: 14px;
}

.kdl-search input::placeholder {
  color: #7b8790;
  opacity: 1;
}

.kdl-search button {
  width: 48px;
  height: 42px;
  background-size: 18px auto;
  box-shadow: 0 8px 20px rgb(28 88 58 / 12%);
}

.kdl-brand-search input {
  width: min(420px, 44vw);
}

body:not(.home) .kdl-breadcrumb-wrap {
  margin-top: 26px;
  margin-bottom: 8px;
}

body:not(.home) .kdl-single,
body:not(.home) .kdl-page,
body:not(.home) .kdl-archive {
  padding-top: 8px;
}

@media (max-width: 820px) {
  .kdl-brand {
    row-gap: 8px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .kdl-logo {
    width: min(245px, 70vw) !important;
  }

  .kdl-brand-search {
    margin-top: 0 !important;
  }

  .kdl-brand-search input {
    width: calc(100% - 48px) !important;
  }

  .kdl-mobile-menu-search {
    display: flex !important;
  }

  .kdl-mobile-menu-search input {
    width: calc(100% - 48px) !important;
  }

  body:not(.home) .kdl-breadcrumb-wrap {
    margin-top: 24px !important;
    margin-bottom: 10px !important;
    font-size: 15px;
    line-height: 1.5;
  }

  body:not(.home) .kdl-single,
  body:not(.home) .kdl-page,
  body:not(.home) .kdl-archive {
    padding-top: 10px;
  }
}
