/* D.HOUSE UI repair 2026-09-18. Load AFTER the existing theme stylesheet.
   Shared by the static V7.1 site and the WordPress staging theme. */

/* WordPress supplies intrinsic width/height attributes; reset the inherited
   global img {height:100%} so a thumbnail cannot consume the entire card. */
.cms-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
  align-items: start;
}
.cms-card-grid .cms-card { min-width: 0; height: auto; }
.cms-card-grid .cms-card > a { display: block; }
.cms-card-grid .cms-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}
.cms-card-grid .cms-card h2 {
  display: block;
  position: static;
  color: #2e3c2d;
  font-size: clamp(20px, 1.6vw, 25px);
  line-height: 1.42;
  letter-spacing: -.025em;
  margin: 20px 22px 12px;
  overflow-wrap: break-word;
}
.cms-card-grid .cms-card > p {
  margin: 0 22px 24px;
  font-size: 14px;
  line-height: 1.8;
  color: #596151;
}
.cms-card-grid .cms-card > a:focus-visible { outline-offset: -4px; }

/* Menu colors are assigned on the actual painted surface, not inherited
   across the home/editorial/scrolled header variants. Scope excludes article
   contents, pagination and other nav elements in the older static stylesheet. */
#header #navigation { color: inherit; background: transparent; }
#header #navigation > a,
#header #navigation > .nav-services > summary { color: inherit; }
#header #navigation .nav-services-panel {
  background: #eadec3;
  color: #2e3c2d;
  border-color: #c5c5b5;
}
#header #navigation .nav-services-panel a,
.editorial-page #header #navigation .nav-services-panel a {
  color: #2e3c2d;
}
#header #navigation .nav-services-panel a:hover,
#header #navigation .nav-services-panel a:focus-visible {
  color: #18251d;
  text-decoration: underline;
  text-underline-offset: 5px;
}
#header .menu { color: inherit; flex-shrink: 0; }
.editorial-page #header,
.editorial-page #header.scrolled { background: #eadec3; color: #2e3c2d; }
body:not(.editorial-page) #header.scrolled { background: #263328; color: #f0ecdf; }

@media (max-width: 1000px) {
  #header { gap: 16px; }
  #header .menu {
    display: block;
    width: 44px;
    height: 44px;
    padding: 10px;
    z-index: 2;
  }
  #header .menu span {
    display: block;
    width: 24px;
    height: 1px;
    background: currentColor;
    margin: 7px 0;
    transition: transform .2s ease;
  }
  #header .menu[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  #header .menu[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  #header #navigation,
  .editorial-page #header #navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 22px max(24px, 4vw) 28px;
    margin: 0;
    max-height: calc(100svh - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #eadec3;
    color: #2e3c2d;
    border-top: 1px solid #2e3c2d26;
    box-shadow: 0 14px 22px #10231b15;
    font-size: 20px;
    line-height: 1.5;
    align-items: stretch;
    gap: 6px;
  }
  #header #navigation.open { display: flex; flex-direction: column; }
  #header #navigation > a,
  #header #navigation > .nav-services > summary,
  .editorial-page #header #navigation > a,
  .editorial-page #header #navigation > .nav-services > summary {
    color: #2e3c2d;
    padding: 10px 0;
    margin: 0;
    white-space: normal;
    font-size: 19px;
    line-height: 1.5;
  }
  #header #navigation > .nav-services > summary { justify-content: space-between; }
  #header #navigation .nav-contact { border-color: #2e3c2d66; align-self: flex-start; }
  #header #navigation .nav-services-panel {
    position: static;
    min-width: 0;
    margin: 4px 0 12px 4px;
    padding: 0 0 0 16px !important;
    border: 0;
    border-left: 1px solid #2e3c2d44;
    box-shadow: none;
    background: #eadec3;
    color: #2e3c2d;
  }
  #header #navigation .nav-services-panel a { padding: 12px 0; font-size: 14px; }
  .cms-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cms-card-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .cms-card-grid .cms-card img { aspect-ratio: 3 / 2; max-height: 300px; }
  .cms-card-grid .cms-card h2 { margin: 18px 18px 10px; font-size: 22px; line-height: 1.42; }
  .cms-card-grid .cms-card > p { margin: 0 18px 21px; }
}

/* Remove the previously inserted bright logo from text CTAs, keeping the
   useful link text intact. The contact launcher below is the single widget. */
.pill .dh-icon-zalo, .text-link .dh-icon-zalo { display: none; }

.dh-contact-widget {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 18;
  color: #2e3c2d;
  font-family: Be, Arial, sans-serif;
  line-height: 1.6;
}
.dh-contact-widget [hidden] { display: none !important; }
.dh-contact-widget button, .dh-contact-widget a { -webkit-tap-highlight-color: transparent; }
.dh-contact-trigger {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 0 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #eadec399;
  background: #2e3c2d;
  color: #eadec3;
  box-shadow: 0 4px 18px #14211726;
  transition: background .2s ease, transform .2s ease;
}
.dh-contact-trigger:hover { background: #18251d; transform: translateY(-2px); }
.dh-contact-trigger:focus-visible, .dh-contact-widget a:focus-visible, .dh-contact-close:focus-visible {
  outline: 3px solid #a27c37;
  outline-offset: 4px;
}
.dh-contact-mark { display: block; width: 40px; height: 36px; }
.dh-contact-mark text { font: 600 11px Arial, sans-serif; letter-spacing: -.3px; }
.dh-contact-card {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(334px, calc(100vw - 32px));
  padding: 27px 25px 23px;
  border: 1px solid #d3ccb7;
  border-radius: 12px;
  background: #f0ecdf;
  box-shadow: 0 16px 50px #18251d26;
  animation: dh-contact-enter .18s ease-out both;
}
.dh-contact-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #2e3c2d;
  border-radius: 50%;
}
.dh-contact-close:hover { background: #e5dfce; }
.dh-contact-close svg { width: 18px; height: 18px; }
.dh-contact-kicker { margin: 0 28px 16px 0; font-size: 10px; letter-spacing: .13em; font-weight: 500; }
.dh-contact-title { margin: 0 0 12px; font-size: 24px; line-height: 1.32; letter-spacing: -.035em; font-weight: 400; }
.dh-contact-description { margin: 0 0 20px; font-size: 13px; line-height: 1.8; color: #5a6253; }
.dh-contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  padding: 11px 16px;
  border-radius: 5px;
  background: #2e3c2d;
  color: #f0ecdf;
  font-size: 13px;
  text-decoration: none;
}
.dh-contact-link:hover { background: #18251d; }
.dh-contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.dh-contact-phone { margin: 12px 0 0; font-size: 11px; color: #5a6253; letter-spacing: .03em; }
body.locked .dh-contact-widget { visibility: hidden; }
@keyframes dh-contact-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .dh-contact-widget { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .dh-contact-trigger { width: 54px; height: 54px; }
  .dh-contact-card { bottom: 67px; }
}
@media (prefers-reduced-motion: reduce) {
  .dh-contact-card { animation: none; }
  .dh-contact-trigger, #header .menu span { transition: none; }
  .dh-contact-trigger:hover { transform: none; }
}
body.reduced .dh-contact-card { animation: none; }
body.reduced .dh-contact-trigger { transition: none; }
@media print { .dh-contact-widget { display: none !important; } }

/* Editorial header is sticky and already occupies document flow. */
.editorial-page .cms-main:not(.section){padding-top:38px}
@media(max-width:700px){.editorial-page .cms-main:not(.section){padding-top:24px}}
