/* ================================================================
   CMS ADDITIONS
   Styles only for features the original static site did not have
   (dropdowns, top bar, FAQ, testimonials, team, gallery, video,
   newsletter, preview bar). Built on the original design tokens.
   ================================================================ */

/* ---- Section options ------------------------------------------- */
.section--large { padding-block: calc(var(--section-y) * 1.35); }
.section--flush { padding-block: 0; }
.section--has-bg { background-image: var(--cms-bg-image); background-size: cover; background-position: center; }
.container-x--narrow { max-width: 860px; }
.container-x--wide { max-width: 1440px; }
.page-hero.section--has-bg .page-hero__bg,
.page-hero__bg--image {
  background-image: linear-gradient(120deg, rgba(11,16,38,.92) 0%, rgba(11,16,38,.72) 60%, rgba(27,39,98,.62) 100%), var(--cms-bg-image);
  background-size: cover; background-position: center;
}
.page-hero.section--has-bg { background-image: none; }
.cta-band__row--center { flex-direction: column; text-align: center; justify-content: center; }
.cta-band__row--center .cta-band__actions { justify-content: center; }
.about-v2__row--reverse { direction: rtl; }
.about-v2__row--reverse > * { direction: ltr; }
.about-row--image-left > :first-child { order: 0; }
main.cms-main--offset { padding-top: var(--navbar-h); }
.cms-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note.is-error { border-color: var(--thanya-red); background: var(--thanya-red-100); }
.form-note.is-error i { color: var(--thanya-red); }

/* ---- Header: not sticky / top bar ------------------------------- */
.t-nav.t-nav--unstick { position: absolute; }
.t-topbar { background: var(--navy); color: rgba(255,255,255,.72); font-size: var(--fs-xs); position: relative; z-index: calc(var(--z-nav) + 1); }
.t-topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 36px; }
.t-topbar a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; margin-right: 1.1rem; }
.t-topbar a:hover { color: #fff; }
.t-topbar__social a { margin: 0 0 0 .8rem; font-size: .9rem; }
.t-nav--with-topbar:not(.is-solid) { top: 36px; }
@media (max-width: 575.98px) { .t-topbar__contact a:nth-child(2) { display: none; } }

/* ---- Dropdown + multi-level menus ------------------------------ */
.t-dd { position: relative; }
.t-dd__menu {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 230px; list-style: none; margin: 0; padding: .45rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
  z-index: var(--z-mega);
}
.t-dd__menu .t-dd__menu { top: -.45rem; left: 100%; margin-left: 2px; }
.t-dd:hover > .t-dd__menu, .t-dd.is-open > .t-dd__menu, .t-dd:focus-within > .t-dd__menu,
.t-dd--sub:hover > .t-dd__menu, .t-dd--sub:focus-within > .t-dd__menu { opacity: 1; visibility: visible; transform: none; }
.t-dd__item { position: relative; margin: 0; }
.t-dd__link { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: var(--r-sm); color: var(--text-soft); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.t-dd__link:hover, .t-dd__link:focus { background: var(--thanya-blue-050); color: var(--thanya-blue); }
.t-dd__link i { color: var(--thanya-blue); }
.t-dd__caret { margin-left: auto; font-size: .75rem; opacity: .6; }

/* ---- Rich text ------------------------------------------------- */
.cms-prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.cms-prose table { width: 100%; border-collapse: collapse; margin: var(--sp-5) 0; }
.cms-prose th, .cms-prose td { border: 1px solid var(--border); padding: .6rem .8rem; }
.cms-prose blockquote { border-left: 3px solid var(--thanya-red); padding-left: var(--sp-4); color: var(--text-soft); }
.tech .cms-prose, .tech .cms-prose li { color: rgba(255,255,255,.75); }

/* ---- Full image / gallery / video ------------------------------ */
.cms-figure { margin: 0; }
.cms-figure img { width: 100%; height: auto; display: block; border-radius: var(--r-lg); box-shadow: var(--sh-md); }
.cms-full-image--edge .cms-figure img { border-radius: 0; box-shadow: none; }
.cms-figure figcaption { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-3); text-align: center; }
.cms-gallery { display: grid; grid-template-columns: repeat(var(--cms-cols, 3), minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-7); }
.cms-gallery__item { margin: 0; }
.cms-gallery__item a { display: block; overflow: hidden; border-radius: var(--r-md); aspect-ratio: 4 / 3; background: var(--surface-2); }
.cms-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.cms-gallery__item a:hover img { transform: scale(1.05); }
.cms-gallery__item figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: .45rem; }
@media (max-width: 767.98px) { .cms-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cms-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(11,16,38,.92); display: none; align-items: center; justify-content: center; padding: 3rem 4rem; }
.cms-lightbox.is-open { display: flex; }
.cms-lightbox figure { margin: 0; text-align: center; }
.cms-lightbox img { max-width: 100%; max-height: 80vh; border-radius: var(--r-md); }
.cms-lightbox figcaption { color: rgba(255,255,255,.8); margin-top: .75rem; }
.cms-lightbox button { position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; }
.cms-lightbox__close { top: 1rem; right: 1rem; }
.cms-lightbox__prev { left: 1rem; top: 50%; }
.cms-lightbox__next { right: 1rem; top: 50%; }
.cms-video { margin-top: var(--sp-7); max-width: 960px; margin-inline: auto; }
.cms-video--wide { max-width: none; }
.cms-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-lg); background: var(--navy); }
.cms-video__frame iframe, .cms-video__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Testimonials --------------------------------------------- */
.cms-testimonials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-7); }
.cms-testimonials--slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--sp-3); scrollbar-width: thin; }
.cms-testimonials--slider > * { flex: 0 0 min(420px, 88%); scroll-snap-align: start; }
.cms-quote { margin: 0; position: relative; display: flex; flex-direction: column; }
.cms-quote__mark { font-size: 2.6rem; line-height: 1; color: var(--thanya-blue-100); position: absolute; right: var(--sp-5); top: var(--sp-4); }
.cms-quote__stars { color: #f5b301; font-size: .85rem; margin-bottom: var(--sp-3); display: flex; gap: 2px; }
.cms-quote blockquote { margin: 0 0 var(--sp-5); color: var(--text-soft); font-size: var(--fs-body); flex: 1; }
.cms-quote figcaption { display: flex; align-items: center; gap: .75rem; }
.cms-quote figcaption img, .cms-quote__initials { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.cms-quote__initials { display: grid; place-items: center; background: var(--grad-blue); color: #fff; font-weight: 700; }
.cms-quote figcaption strong { display: block; color: var(--text); font-size: var(--fs-sm); }
.cms-quote figcaption small { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 991.98px) { .cms-testimonials:not(.cms-testimonials--slider) { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .cms-testimonials:not(.cms-testimonials--slider) { grid-template-columns: 1fr; } }

/* ---- Team ------------------------------------------------------ */
.cms-team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-7); }
.cms-member { text-align: center; }
.cms-member__photo { width: 120px; height: 120px; margin: 0 auto var(--sp-4); border-radius: 50%; overflow: hidden; background: var(--grad-blue); display: grid; place-items: center; color: #fff; font-size: 2.4rem; font-weight: 700; }
.cms-member__photo img { width: 100%; height: 100%; object-fit: cover; }
.cms-member h3 { font-size: var(--fs-h4); margin-bottom: .2rem; }
.cms-member__role { color: var(--thanya-red); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-3); }
.cms-member__links { display: flex; justify-content: center; gap: .5rem; margin-top: var(--sp-3); }
.cms-member__links a { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--thanya-blue-050); color: var(--thanya-blue); }
.cms-member__links a:hover { background: var(--thanya-blue); color: #fff; }
@media (max-width: 991.98px) { .cms-team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .cms-team { grid-template-columns: 1fr; } }

/* ---- FAQ ------------------------------------------------------- */
.cms-faq { margin-top: var(--sp-7); max-width: 900px; margin-inline: auto; }
.cms-faq--two { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-5); }
@media (max-width: 767.98px) { .cms-faq--two { grid-template-columns: 1fr; } }
.cms-faq__item { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--sp-3); transition: box-shadow var(--t-fast) var(--ease); }
.cms-faq__item[open] { box-shadow: var(--sh-sm); border-color: var(--thanya-blue-100); }
.cms-faq__item summary { list-style: none; cursor: pointer; padding: var(--sp-4) var(--sp-5); font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.cms-faq__item summary::-webkit-details-marker { display: none; }
.cms-faq__item summary i { color: var(--thanya-blue); transition: transform var(--t-fast) var(--ease); flex: none; }
.cms-faq__item[open] summary i { transform: rotate(45deg); }
.cms-faq__answer { padding: 0 var(--sp-5) var(--sp-4); color: var(--text-soft); }
.cms-faq__answer p:last-child { margin-bottom: 0; }

/* ---- Cards with media (portfolio images, blog) ----------------- */
.cms-card-media { display: block; margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) var(--sp-4); aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface-2); }
.cms-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cms-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.cms-post h3 { font-size: var(--fs-h4); }
.cms-post h3 a { color: inherit; text-decoration: none; }
.cms-post .cat { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
@media (max-width: 991.98px) { .cms-posts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .cms-posts { grid-template-columns: 1fr; } }
.cms-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; }

/* ---- Newsletter (footer) --------------------------------------- */
.t-newsletter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-5); margin-top: var(--sp-8); padding: var(--sp-6); border: 1px solid var(--border-dark); border-radius: var(--r-lg); background: rgba(255,255,255,.03); }
.t-newsletter h3 { color: #fff; font-size: var(--fs-h4); margin-bottom: .25rem; }
.t-newsletter p { margin: 0; }
.t-newsletter__form { display: flex; flex-wrap: wrap; gap: .6rem; flex: 1 1 380px; max-width: 520px; }
.t-newsletter__form .form-control-t { flex: 1 1 220px; }
.t-newsletter__note { flex-basis: 100%; margin: 0; font-size: var(--fs-xs); min-height: 1em; }

/* ---- Admin preview bar ----------------------------------------- */
.cms-preview-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; background: #111936; color: #fff; padding: .55rem 1rem; border-radius: 999px; font-size: .8rem; box-shadow: var(--sh-lg); display: flex; gap: .75rem; align-items: center; }
.cms-preview-bar a { color: #ff8098; font-weight: 600; }

/* Grids sit directly under the heading; without one they need no top gap */
.cms-gallery, .cms-testimonials, .cms-team, .cms-faq, .cms-video { margin-top: 0; }
.section-head + .cms-gallery, .section-head + .cms-testimonials, .section-head + .cms-team,
.section-head + .cms-faq, .section-head + .cms-video { margin-top: var(--sp-7); }

/* ---- Client logos: heading + centred, full-colour logo cards ---- */
.clients__grid--cms {
  --cms-gap: clamp(1rem, 5vw, 5rem);
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--sp-5) var(--cms-gap);
  margin-top: var(--sp-7);
}
.clients__grid--cms .clients__item {
  flex: 0 1 calc((100% - (var(--cms-cols, 4) - 1) * var(--cms-gap)) / var(--cms-cols, 4));
  min-height: 116px;
  padding: var(--sp-4) var(--sp-6);
  filter: none; opacity: 1;
}
.clients__grid--cms .clients__item:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.clients__grid--cms .clients__item a { display: block; width: 100%; }
.clients__grid--cms .clients__item img { max-width: 170px; max-height: 70px; width: 100%; height: auto; object-fit: contain; margin-inline: auto; }
.clients__grid--mono .clients__item { filter: grayscale(1); opacity: .72; }
.clients__grid--mono .clients__item:hover { filter: none; opacity: 1; }
@media (max-width: 991.98px) {
  .clients__grid--cms { --cms-gap: var(--sp-5); }
  .clients__grid--cms .clients__item { flex-basis: calc((100% - 2 * var(--cms-gap)) / 3); }
}
@media (max-width: 575.98px) {
  .clients__grid--cms .clients__item { flex-basis: calc((100% - var(--cms-gap)) / 2); min-height: 96px; padding: var(--sp-3) var(--sp-4); }
}

/* ---- Product dashboard screenshots ----------------------------- */
.prod-shot { margin: 0; }
.prod-shot img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--sh-lg); }
.tech .prod-shot img, .prod-hero .prod-shot img { box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.showcase__mock .prod-shot img { box-shadow: var(--sh-md); }
