/* =========================================================
   Shared page utilities — used across all pages
   ========================================================= */

/* ---------- Ambient background shading / soft blobs ---------- */
body.bg-parchment {
  position: relative;
  background-color: #faf7f1;
  background-image:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(12, 51, 40, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(196, 163, 90, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 45% at 50% 100%, rgba(12, 51, 40, 0.05), transparent 55%);
  background-attachment: fixed;
}

/* Soft decorative orbs behind content (non-interactive) */
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}
body::before {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: 15%;
  left: -8%;
  background: rgba(12, 51, 40, 0.12);
}
body::after {
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  bottom: 10%;
  right: -6%;
  background: rgba(196, 163, 90, 0.14);
}

/* Sticky site header (.kx-head) is styled in modern.css; this only covers any other <header> */
main,
footer {
  position: relative;
  z-index: 1;
}
header:not(.kx-head) {
  position: absolute !important;
  inset-inline: 0;
  top: 0;
  z-index: 50 !important;
  background: transparent !important;
}

/* Section shading variants */
.section-shade {
  position: relative;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.92) 0%, rgba(244, 240, 232, 0.85) 100%);
}
.section-shade--soft {
  position: relative;
  background:
    radial-gradient(ellipse 70% 60% at 10% 50%, rgba(196, 163, 90, 0.07), transparent 60%),
    linear-gradient(180deg, #fff 0%, #faf7f1 100%);
}
.section-shade--dark {
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 90% 30%, rgba(196, 163, 90, 0.15), transparent 55%),
    #0c3328;
}

/* Glass / frosted cards */
.glass-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(12, 51, 40, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(12, 51, 40, 0.06);
  padding: 1.75rem 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.glass-card:hover {
  box-shadow: 0 12px 32px rgba(12, 51, 40, 0.1);
}

/* Standard content sections */
.page-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
@media (min-width: 768px) {
  .page-section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}
.page-section--tight {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Equal-height card grids */
.card-grid {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}
.card-grid--2 { grid-template-columns: 1fr; }
.card-grid--3 { grid-template-columns: 1fr; }
.card-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Company / content cards — FIXED media height for all */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 51, 40, 0.06);
  box-shadow: 0 4px 20px rgba(12, 51, 40, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card:hover {
  box-shadow: 0 12px 32px rgba(12, 51, 40, 0.12);
  border-color: rgba(196, 163, 90, 0.25);
}

/* Fixed media box — same size whether logo or photo or empty */
.card__media {
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 2.4rem 1rem 1.8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f8f5ef 0%, #fff 50%, #f0ebe3 100%);
  border-bottom: 1px solid rgba(12, 51, 40, 0.06);
}
.card__media img.card__logo,
.card__media .card__logo {
  width: 100%;
  max-width: 220px;
  height: 4.5rem;
  max-height: 4.5rem;
  object-fit: contain;
  object-position: center;
}
.card__media img.card__photo,
.card__media .card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Empty / placeholder media still keeps size */
.card__media--empty {
  background: linear-gradient(145deg, #f0ebe3 0%, #faf7f1 100%);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.35rem 1.5rem;
}
.card__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  color: #0c3328;
}
.card__kicker {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a35a;
}
.card__text {
  margin-top: 0.75rem;
  flex: 1;
  font-size: 0.875rem;
  color: rgba(20, 36, 29, 0.7);
  line-height: 1.55;
}
.card__link {
  margin-top: 1rem;
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0c3328;
}

/* Hierarchy / org boxes */
.org-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  text-align: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(20, 36, 29, 0.1);
  background: rgba(250, 247, 241, 0.7);
  backdrop-filter: blur(6px);
  padding: 1.25rem;
}
.org-box__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.125rem;
  color: #0c3328;
}
.org-box__meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgba(20, 36, 29, 0.65);
}

/* Image gallery tiles */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
.gallery-tile {
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(12, 51, 40, 0.08);
}
.gallery-tile img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  display: block;
}
.gallery-tile--wide { grid-column: span 1; }
@media (min-width: 640px) {
  .gallery-tile--wide { grid-column: span 2; }
}
@media (min-width: 1024px) {
  .gallery-tile--wide {
    grid-column: span 2;
    grid-row: span 2;
  }
  .gallery-tile--wide img {
    height: 100%;
    min-height: 280px;
  }
}

/* Office address cards — roomy padding */
.office-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 10rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(12, 51, 40, 0.08);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 4px 20px rgba(12, 51, 40, 0.05);
  transition: box-shadow 0.2s ease;
}
.office-card:hover {
  box-shadow: 0 8px 28px rgba(12, 51, 40, 0.1);
}
.office-card__city {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a35a;
  margin-bottom: 0.25rem;
}
.office-card ul {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(20, 36, 29, 0.75);
}
.office-card li {
  padding: 0;
}

/* =========================================================
   Layout & padding fixes (container, sections)
   ========================================================= */

.site-container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .site-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .site-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.page-section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}
@media (min-width: 768px) {
  .page-section {
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
  }
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Footer stays on original Tailwind classes — only ensure no white bg leak */
footer.bg-forest-deep {
  background-color: #071f19 !important;
  color: #f4f0e8;
  position: relative;
  z-index: 1;
}

/* Footer breathing room */
footer.bg-forest-deep {
  padding-top: 0.5rem;
}
footer.bg-forest-deep > .site-container {
  padding-top: 3.5rem !important;
  padding-bottom: 3.5rem !important;
  row-gap: 2.75rem !important;
  column-gap: 2rem !important;
}
@media (min-width: 768px) {
  footer.bg-forest-deep > .site-container {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
    gap: 2.5rem 2.25rem !important;
  }
}
footer.bg-forest-deep .md\:col-span-4 p,
footer.bg-forest-deep .md\:col-span-2 p {
  line-height: 1.65;
}
footer.bg-forest-deep ul {
  margin-top: 1.15rem;
}
footer.bg-forest-deep ul li {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}
footer.bg-forest-deep .border-t {
  margin-top: 0.5rem;
}
footer.bg-forest-deep .border-t .site-container {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

/* =========================================================
   LOGO MEDALLION — circular logo badge (company logos)
   ========================================================= */
.kx-medal {
  --s: 10.5rem;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  margin-inline: auto;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #c4a35a, 0 16px 32px -14px rgba(7, 31, 25, 0.5);
  transition: transform 0.5s var(--kx-ease, ease), box-shadow 0.5s;
}
.kx-medal img {
  width: 72%;
  height: 60%;
  max-width: none;
  object-fit: contain;
  display: block;
}
/* The logos marquee (.kx-track) has its own generic `img` sizing rule for
   plain logo strips; when a logo is wrapped in a .kx-medal circle (as on
   the Partners page) that rule must not override the medal's containment,
   or wide wordmark logos spill out of the circle into neighbouring badges. */
.kx-track .kx-medal img {
  width: 72%;
  height: 60%;
  object-fit: contain;
  filter: none;
  opacity: 1;
}
.kx-medal::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(196, 163, 90, 0.85);
  opacity: 0;
  transition: opacity 0.4s;
  animation: kxSpin 24s linear infinite;
}
a:hover > .kx-medal,
a:hover .kx-medal,
.kx-medal:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #e6c982, 0 22px 40px -14px rgba(196, 163, 90, 0.6);
}
a:hover .kx-medal::before,
.kx-medal:hover::before { opacity: 1; }
.kx-medal--sm { --s: 6.25rem; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #c4a35a, 0 10px 20px -10px rgba(7,31,25,.45); }
.kx-medal--sm::before { inset: -9px; }
.kx-medal--lg { --s: 12.5rem; margin: 0 0 2rem; display: grid; }
@keyframes kxSpin { to { transform: rotate(360deg); } }
.card__media { background: radial-gradient(circle at 50% 42%, rgba(196,163,90,.16), transparent 62%), linear-gradient(145deg, #f8f5ef, #fff 55%, #f0ebe3); }
.kx-card .kx-medal { margin-bottom: 1.1rem; }
.brand-link .kx-medal { margin-bottom: .2rem; }
.kx-logos .kx-track { align-items: center; gap: 2.5rem; }
@media (prefers-reduced-motion: reduce) { .kx-medal::before { animation: none; } }

/* =========================================================
   IMAGE SLIDESHOW (includes/slider.php + assets/js/slider.js)
   ========================================================= */
.kx-slider { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 7.5; min-height: 25rem; border-radius: 20px; background: #071f19; box-shadow: 0 30px 60px -24px rgba(7,31,25,.55); }
.kx-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1.1s ease, visibility 1.1s; }
.kx-slide.is-on { opacity: 1; visibility: visible; }
.kx-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
.kx-slide.is-on img { animation: kxKen 9s ease-out forwards; }
@keyframes kxKen { to { transform: scale(1.13); } }
.kx-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,31,25,.9) 0%, rgba(7,31,25,.55) 45%, transparent 78%), linear-gradient(0deg, rgba(7,31,25,.65), transparent 45%); }
.kx-cap { position: absolute; z-index: 2; left: clamp(1.25rem, 4vw, 3.5rem); bottom: clamp(4.25rem, 8vw, 5.5rem); max-width: 31rem; color: #f4f0e8; }
.kx-cap small { display: block; color: #e6c982; font-size: .7rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.kx-cap h3 { margin: .55rem 0 .6rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.1; font-weight: 600; color: #fff; }
.kx-cap p { font-size: .95rem; line-height: 1.65; color: rgba(244,240,232,.85); }
.kx-cap a { display: inline-block; margin-top: 1rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; color: #e6c982; }
.kx-slide.is-on .kx-cap > * { animation: kxCap .9s cubic-bezier(.2,.7,.2,1) both; }
.kx-slide.is-on .kx-cap > :nth-child(2) { animation-delay: .12s; }
.kx-slide.is-on .kx-cap > :nth-child(3) { animation-delay: .24s; }
.kx-slide.is-on .kx-cap > :nth-child(4) { animation-delay: .36s; }
@keyframes kxCap { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.kx-ctl { position: absolute; z-index: 3; left: clamp(1.25rem, 4vw, 3.5rem); right: clamp(1.25rem, 4vw, 3.5rem); bottom: 1.4rem; display: flex; align-items: center; gap: .6rem; }
.kx-dots { display: flex; gap: .5rem; margin-right: auto; }
.kx-dots button { width: 10px; height: 10px; padding: 0; border-radius: 99px; border: 0; background: rgba(244,240,232,.4); cursor: pointer; transition: width .4s, background .4s; }
.kx-dots button.is-on { width: 30px; background: #e6c982; }
.kx-arrow { width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 1px solid rgba(230,201,130,.6); background: rgba(7,31,25,.45); color: #f0dca0; font-size: 1.1rem; cursor: pointer; backdrop-filter: blur(6px); transition: .3s; }
.kx-arrow:hover { background: #c4a35a; color: #071f19; }
.kx-prog { position: absolute; z-index: 3; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, #c4a35a, #f0dca0); transform: scaleX(0); transform-origin: left; }
.kx-slider.is-playing .kx-prog { animation: kxProg var(--kx-dur, 6s) linear forwards; }
@keyframes kxProg { to { transform: scaleX(1); } }
@media (max-width: 700px) { .kx-slider { aspect-ratio: auto; min-height: 30rem; } .kx-cap p { display: none; } }
@media (prefers-reduced-motion: reduce) { .kx-slide.is-on img, .kx-slide.is-on .kx-cap > * { animation: none; } .kx-prog { display: none; } }

/* CTA band headings stay light regardless of theme */
.kx-band h2 { color: #f4f0e8; }
