/* KSHome Flatsome Shim — render legacy UX Builder shortcodes as luxury HTML
 * Design language: sharp corners · gold accents · Cormorant Garamond + Sarabun */

.kshome-sc-section {
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.kshome-sc-section--has-bg {
  color: #fff;
}

.kshome-sc-section__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.kshome-sc-section__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----- ROW / COL (12-column flexbox grid) ----- */

.kshome-sc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.kshome-sc-row--full    { max-width: 100%; padding: 0; }
.kshome-sc-row--collapse { gap: 0; }
.kshome-sc-row--vmid    { align-items: center; }
.kshome-sc-row--vbot    { align-items: flex-end; }
.kshome-sc-row--hcenter { justify-content: center; }

.kshome-sc-col {
  flex: 0 0 100%;
  min-width: 0;
}

/* Column spans (12-grid) */
@media (min-width: 768px) {
  .kshome-sc-col--md-1  { flex-basis: calc(8.333%  - 1rem); }
  .kshome-sc-col--md-2  { flex-basis: calc(16.667% - 1rem); }
  .kshome-sc-col--md-3  { flex-basis: calc(25%     - 1rem); }
  .kshome-sc-col--md-4  { flex-basis: calc(33.333% - 1rem); }
  .kshome-sc-col--md-5  { flex-basis: calc(41.667% - 1rem); }
  .kshome-sc-col--md-6  { flex-basis: calc(50%     - 1rem); }
  .kshome-sc-col--md-7  { flex-basis: calc(58.333% - 1rem); }
  .kshome-sc-col--md-8  { flex-basis: calc(66.667% - 1rem); }
  .kshome-sc-col--md-9  { flex-basis: calc(75%     - 1rem); }
  .kshome-sc-col--md-10 { flex-basis: calc(83.333% - 1rem); }
  .kshome-sc-col--md-11 { flex-basis: calc(91.667% - 1rem); }
  .kshome-sc-col--md-12 { flex-basis: 100%; }
}

@media (min-width: 1024px) {
  .kshome-sc-col--1  { flex-basis: calc(8.333%  - 1rem); }
  .kshome-sc-col--2  { flex-basis: calc(16.667% - 1rem); }
  .kshome-sc-col--3  { flex-basis: calc(25%     - 1rem); }
  .kshome-sc-col--4  { flex-basis: calc(33.333% - 1rem); }
  .kshome-sc-col--5  { flex-basis: calc(41.667% - 1rem); }
  .kshome-sc-col--6  { flex-basis: calc(50%     - 1rem); }
  .kshome-sc-col--7  { flex-basis: calc(58.333% - 1rem); }
  .kshome-sc-col--8  { flex-basis: calc(66.667% - 1rem); }
  .kshome-sc-col--9  { flex-basis: calc(75%     - 1rem); }
  .kshome-sc-col--10 { flex-basis: calc(83.333% - 1rem); }
  .kshome-sc-col--11 { flex-basis: calc(91.667% - 1rem); }
  .kshome-sc-col--12 { flex-basis: 100%; }
}

@media (max-width: 767px) {
  .kshome-sc-col--sm-12 { flex-basis: 100%; }
  .kshome-sc-col--sm-6  { flex-basis: calc(50% - 1rem); }
  .kshome-sc-row { gap: 1rem; }
}

.kshome-sc-col--center { text-align: center; }

/* ----- DIVIDER ----- */

.kshome-sc-divider {
  border: 0;
  height: 1px;
  background: rgba(184, 152, 90, 0.25);
  margin: 3rem 0;
}

/* ----- IMAGE ----- */

.kshome-sc-image {
  display: block;
  max-width: 100%;
  height: auto;
}

.kshome-sc-image-link { display: block; }

/* ----- IMAGE BOX — luxury portfolio card ----- */

.kshome-image-box {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  transition: box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-image-box:hover {
  box-shadow: 0 20px 60px rgba(5, 15, 44, 0.35), 0 8px 20px rgba(5, 15, 44, 0.2);
}

.kshome-image-box__link {
  display: block;
  text-decoration: none;
}

.kshome-image-box__media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.kshome-image-box__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-image-box:hover .kshome-image-box__media img {
  transform: scale(1.08);
}

.kshome-image-box__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Gradient overlay — richer luxury gradient */
.kshome-image-box__content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1.75rem 1.75rem;
  color: #fff;
  background: linear-gradient(to top,
    rgba(5, 15, 44, 0.95) 0%,
    rgba(5, 15, 44, 0.65) 50%,
    transparent 100%
  );
  z-index: 2;
  transform: translateY(6px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-image-box:hover .kshome-image-box__content {
  transform: translateY(0);
}

.kshome-image-box__content > * {
  color: #fff !important;
}

/* Typography inside image boxes */
.kshome-image-box__content h1,
.kshome-image-box__content h2,
.kshome-image-box__content h3,
.kshome-image-box__content h4 {
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.01em !important;
  margin: 0 0 0.5rem !important;
}

.kshome-image-box__content p {
  font-family: 'Sarabun', sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 300 !important;
  line-height: 1.65 !important;
  opacity: 0.85;
  margin: 0 !important;
}

/* Gold accent line on hover top-left */
.kshome-image-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--kshome-gold, #b8985a);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.kshome-image-box:hover::before {
  width: 60px;
}

/* Shade variant */
.kshome-image-box--shade .kshome-image-box__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 15, 44, 0.25);
  z-index: 1;
  transition: opacity 0.4s ease;
}

/* ----- TEXT ----- */

.kshome-sc-text {
  margin: 0;
  font-family: 'Sarabun', sans-serif;
  font-weight: 300;
  line-height: 1.8;
}

.kshome-sc-text > p { margin: 0; }

.kshome-sc-text-box {
  margin: 0 auto;
  padding: 1rem;
}

/* ----- BUTTON — match luxury theme ----- */

.kshome-sc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: 'Sarabun', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none !important;
  color: #fff !important;
  background: var(--kshome-navy, #0a1f44);
  border: 1px solid var(--kshome-navy, #0a1f44);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
}

.kshome-sc-button:hover {
  background: transparent !important;
  color: var(--kshome-navy, #0a1f44) !important;
}

/* Inside dark image-box → gold button */
.kshome-image-box__content .kshome-sc-button {
  background: var(--kshome-gold, #b8985a) !important;
  border-color: var(--kshome-gold, #b8985a) !important;
  color: #fff !important;
  margin-top: 1rem;
}

.kshome-image-box__content .kshome-sc-button:hover {
  background: transparent !important;
  color: var(--kshome-gold-light, #d4b87a) !important;
  border-color: var(--kshome-gold-light, #d4b87a) !important;
}

.kshome-sc-button--small { padding: 0.6rem 1.25rem; font-size: 0.8rem !important; }
.kshome-sc-button--large { padding: 1.1rem 2.5rem;  font-size: 0.95rem !important; }

/* ----- BANNER ----- */

.kshome-sc-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 5rem 1.5rem;
}

.kshome-sc-banner__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.kshome-sc-banner__inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.kshome-sc-banner__inner h1,
.kshome-sc-banner__inner h2,
.kshome-sc-banner__inner h3 {
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
}

/* ----- GALLERY — luxury masonry-feel grid ----- */

.kshome-sc-gallery {
  display: grid;
  grid-template-columns: repeat(var(--kshome-cols, 4), 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.kshome-sc-gallery__item {
  display: block;
  overflow: hidden;
  background: #f0ede8;
}

.kshome-sc-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-sc-gallery__item:hover img {
  transform: scale(1.06);
}

@media (max-width: 767px) {
  .kshome-sc-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ----- SLIDER (horizontal scroll fallback) ----- */

.kshome-sc-slider {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kshome-sc-slider::-webkit-scrollbar { display: none; }

.kshome-sc-slider > * {
  flex: 0 0 calc(33.333% - 1.5rem);
  scroll-snap-align: start;
}

@media (max-width: 767px) {
  .kshome-sc-slider > * { flex-basis: 80%; }
}

/* ----- VIDEO ----- */

.kshome-sc-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.kshome-sc-video iframe,
.kshome-sc-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ----- ACCORDION ----- */

.kshome-sc-accordion__item {
  border-bottom: 1px solid rgba(184, 152, 90, 0.2);
  margin-bottom: 0;
}

.kshome-sc-accordion__item summary {
  cursor: pointer;
  padding: 1.25rem 0;
  font-family: 'Cormorant Garamond', 'Mitr', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--kshome-navy, #0a1f44);
  list-style: none;
  position: relative;
  padding-right: 2rem;
  transition: color 0.3s ease;
}

.kshome-sc-accordion__item summary::-webkit-details-marker { display: none; }

.kshome-sc-accordion__item summary::after {
  content: '+';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--kshome-gold, #b8985a);
  line-height: 1;
  transition: transform 0.3s ease;
}

.kshome-sc-accordion__item[open] summary::after {
  content: '−';
}

.kshome-sc-accordion__item[open] summary {
  color: var(--kshome-gold, #b8985a);
}

.kshome-sc-accordion__item > div {
  padding: 0 0 1.5rem;
  font-family: 'Sarabun', sans-serif;
  font-weight: 300;
  line-height: 1.8;
  color: #555;
}

/* ----- TITLE ----- */

.kshome-sc-title {
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
  color: var(--kshome-navy, #0a1f44) !important;
  margin: 0 0 1.5rem !important;
}

/* ----- STACK ----- */

.kshome-sc-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ----- MESSAGE BOX ----- */

.kshome-sc-msg {
  padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--kshome-gold, #b8985a);
  margin: 1.5rem 0;
  background: var(--kshome-cream, #fafaf6);
  font-family: 'Sarabun', sans-serif;
  font-weight: 300;
  line-height: 1.7;
}

/* ----- PRODUCTS GRID (WC shortcode in pages) ----- */

.kshome-sc-products {
  display: grid;
  grid-template-columns: repeat(var(--kshome-cols, 4), 1fr);
  gap: 2rem;
}

.kshome-sc-products__item {
  text-decoration: none !important;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-sc-products__item:hover {
  box-shadow: 0 12px 40px rgba(5, 15, 44, 0.14);
}

.kshome-sc-products__item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-sc-products__item:hover img {
  transform: scale(1.05);
}

.kshome-sc-products__item h4 {
  margin: 0 !important;
  padding: 1rem !important;
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-size: 1.1rem !important;
  font-weight: 500 !important;
  color: var(--kshome-navy, #0a1f44) !important;
  letter-spacing: 0.005em;
}

@media (max-width: 767px) {
  .kshome-sc-products { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* ----- ICON BOX (small image_width) ----- */

.kshome-icon-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  background: #fff;
  border-top: 1px solid rgba(184, 152, 90, 0.2);
  transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-icon-box:hover {
  box-shadow: 0 8px 32px rgba(5, 15, 44, 0.08);
}

.kshome-icon-box-link {
  text-decoration: none !important;
  color: inherit !important;
}

.kshome-icon-box__icon {
  flex-shrink: 0;
}

.kshome-icon-box__icon img {
  display: block;
  filter: none;
}

.kshome-icon-box__content h1,
.kshome-icon-box__content h2,
.kshome-icon-box__content h3,
.kshome-icon-box__content h4 {
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-size: 1.3rem !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  color: var(--kshome-navy, #0a1f44) !important;
  margin: 0 0 0.75rem !important;
}

.kshome-icon-box__content p {
  font-family: 'Sarabun', sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 300 !important;
  line-height: 1.75 !important;
  color: #666 !important;
  margin: 0 !important;
}

/* ----- PAGES GRID (ux_pages shortcode → portfolio / sub-pages) ----- */

.kshome-pages-grid {
  display: grid;
  grid-template-columns: repeat(var(--kshome-pg-cols, 3), 1fr);
  gap: 1.25rem;
  margin: 2.5rem 0;
}

@media (max-width: 900px) {
  .kshome-pages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .kshome-pages-grid {
    grid-template-columns: 1fr;
  }
}

.kshome-pages-card {
  display: block;
  text-decoration: none !important;
  overflow: hidden;
  background: #1a1a1a;
  position: relative;
}

.kshome-pages-card__media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.kshome-pages-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-pages-card:hover .kshome-pages-card__media img {
  transform: scale(1.08);
}

.kshome-pages-card__inner {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(5, 15, 44, 0.9) 0%, rgba(5, 15, 44, 0.5) 60%, transparent 100%);
  transform: translateY(4px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.kshome-pages-card:hover .kshome-pages-card__inner {
  transform: translateY(0);
}

.kshome-pages-card__title {
  font-family: 'Cormorant Garamond', 'Mitr', serif !important;
  font-size: 1.35rem !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  color: #fff !important;
  margin: 0 !important;
  letter-spacing: 0.01em;
}

/* Gold accent line on hover */
.kshome-pages-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--kshome-gold, #b8985a);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.kshome-pages-card:hover::before {
  width: 50px;
}

/* ----- SCROLL TO ----- */

.kshome-sc-scroll-to {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--kshome-navy, #0a1f44);
  border-bottom: 1px solid var(--kshome-navy, #0a1f44);
  transition: all 0.3s ease;
}

.kshome-sc-scroll-to:hover {
  color: var(--kshome-gold, #b8985a);
  border-color: var(--kshome-gold, #b8985a);
}
