/* J Studio widgets. Values match what Elementor Pro drew on jstudio.com.sg (measured Nov 2026). */

.jsw-car, .jsw-gal, .jsw-banner, .jsw-posts {
  /* colours */
  --jsw-ink: #000;
  --jsw-paper: #fff;
  --jsw-muted: #7a7a7a;
  --jsw-excerpt: #777;
  --jsw-link-quiet: #666;
  --jsw-post-title: #6e757c;
  --jsw-meta: #adadad;
  --jsw-rule: #eaeaea;
  --jsw-well: rgba(0, 0, 0, .04);
  --jsw-shadow: rgba(0, 0, 0, .15);
  /* type */
  --jsw-font: "Open Sans", sans-serif;
  --jsw-font-display: "Open Sans Condensed", "Open Sans", sans-serif;
  --jsw-text-xs: 12px;
  --jsw-text-sm: 14px;
  --jsw-text-md: 15px;
  --jsw-text-lg: 18px;
  --jsw-text-xl: 20px;
  --jsw-text-2xl: 21px;
  --jsw-text-3xl: 23px;
  /* motion */
  --jsw-fast: .2s;
  --jsw-medium: .3s;
  --jsw-slow: 1s;
  --jsw-slower: 1.5s;
}

/* In a flex container a widget is only as wide as its content, and a grid or scroller has none of its own.
   Elementor gives its own carousels and post lists the full width the same way. */
.e-con .elementor-widget-jstudio-cards, .e-con .elementor-widget-jstudio-testimonials, .e-con .elementor-widget-jstudio-gallery,
.e-con .elementor-widget-jstudio-banner, .e-con .elementor-widget-jstudio-posts { width: 100%; }

/* ---------- Carousel (cards and testimonials) ---------- */
.jsw-car { position: relative; --per: 1; --gap: 20px; --arrow-size: 25px; --arrow: var(--e-global-color-primary, var(--jsw-ink)); --arrow-hover: var(--e-global-color-accent, var(--jsw-link-quiet)); --dot: var(--jsw-ink); }
.jsw-track {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: auto;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; position: relative; outline: none;
}
.jsw-track::-webkit-scrollbar { display: none; }
.jsw-slide { flex: 0 0 calc(100% / var(--per)); min-width: 0; box-sizing: border-box; padding: 0 calc(var(--gap) / 2); scroll-snap-align: start; }
.jsw-arrow {
  position: absolute; top: var(--arrow-top, 50%); z-index: 2; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; color: var(--arrow); font-size: var(--arrow-size); line-height: 1;
  transition: color var(--jsw-fast); -webkit-tap-highlight-color: transparent;
}
.jsw-arrow[hidden] { display: none; }
.jsw-arrow svg { width: 1em; height: 1em; fill: currentColor; display: block; }
.jsw-arrow:focus, .jsw-arrow:active { background: none; color: var(--arrow); }
.jsw-arrow:focus:not(:focus-visible) { outline: none; }
.jsw-arrow:focus-visible, .jsw-dot:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.jsw-prev { left: calc(var(--gap) / 2); }
.jsw-next { right: calc(var(--gap) / 2); }
.jsw-dots { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.jsw-dots[hidden] { display: none; }
.jsw-dot {
  width: 22px; height: 32px; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.jsw-dot:focus, .jsw-dot:active { background: none; }
.jsw-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); opacity: .2; transition: opacity var(--jsw-fast); }
.jsw-dot[aria-current="true"]::before { opacity: 1; }

/* Cards */
.jsw-cards { --img-h: 300px; }
.jsw-cards .jsw-slide { padding-top: 10px; padding-bottom: 10px; }
.jsw-cards .jsw-arrow { --arrow-top: calc(10px + var(--img-h) / 2); }
.jsw-card-media { height: var(--img-h); margin: 0 0 15px; overflow: hidden; position: relative; }
.jsw-card-media a { display: block; height: 100%; }
.jsw-card-img { display: block; width: 100%; height: 100% !important; max-width: none; object-fit: cover; }
.jsw-card-title {
  margin: 0; font-family: var(--jsw-font-display); font-size: var(--jsw-text-lg); font-weight: 600; line-height: 1.5;
  letter-spacing: .1em; text-transform: uppercase; color: var(--jsw-ink);
}
.jsw-cards .jsw-card-title a { color: inherit; text-decoration: none; }
.jsw-card-text { margin-top: 8px; font-family: var(--jsw-font); font-size: var(--jsw-text-sm); font-weight: 400; line-height: 1.5; color: var(--jsw-muted); }
.jsw-card-text p { margin: 0 0 .8em; }
.jsw-card-text p:last-child { margin-bottom: 0; }

/* Testimonials */
.jsw-quotes .jsw-slide { display: flex; align-items: center; justify-content: center; padding-left: max(calc(var(--gap) / 2), 48px); padding-right: max(calc(var(--gap) / 2), 48px); }
.jsw-quotes .jsw-prev { left: 0; }
.jsw-quotes .jsw-next { right: 0; }
.jsw-quote { margin: 0; padding: 10px 0; text-align: center; width: 100%; }
.jsw-quote-text { margin: 0 0 20px; padding: 0; border: 0; quotes: none; font-style: normal; background: none; }
.jsw-quote-text::before, .jsw-quote-text::after { content: none; }
.jsw-quote-text p { margin: 0; text-align: center; font-family: var(--jsw-font); font-size: var(--jsw-text-lg); font-weight: 400; line-height: 1.6; color: var(--jsw-ink); }
.jsw-quote-name { margin: 0 0 12px; font-family: var(--jsw-font); font-size: var(--jsw-text-xl); font-weight: 600; line-height: 1.2; letter-spacing: 2px; color: var(--jsw-ink); }
.jsw-quote-rating { display: block; height: var(--rating-h, 30px) !important; width: auto !important; max-width: 100%; margin: 0 auto; }

/* ---------- Gallery ---------- */
.jsw-gal { --gap: 10px; --cols: 4; --tile: 3 / 2; --row-h: 200px; }
.jsw-gal--grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.jsw-gal--grid .jsw-gal-item { aspect-ratio: var(--tile); }
.jsw-gal--justified { display: flex; flex-wrap: wrap; gap: var(--gap); }
/* each photo grows in proportion to its shape, so every row ends up one height and nothing is cropped */
.jsw-gal--justified .jsw-gal-item { flex: var(--ar) 1 calc(var(--ar) * var(--row-h)); aspect-ratio: var(--ar); }
/* the last row keeps the normal row height instead of stretching across */
.jsw-gal--justified::after { content: ""; flex: 1000000 1 0px; }
.jsw-gal-item { display: block; position: relative; overflow: hidden; min-width: 0; background: var(--jsw-well); -webkit-tap-highlight-color: transparent; }
a.jsw-gal-item { cursor: zoom-in; }
.jsw-gal-img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transition: opacity var(--jsw-medium); }
a.jsw-gal-item:focus-visible { outline: 2px solid var(--jsw-ink); outline-offset: 2px; }

/* ---------- Banner ---------- */
.jsw-banner {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 500px; overflow: hidden;
  color: var(--jsw-paper); text-decoration: none; isolation: isolate; -webkit-tap-highlight-color: transparent;
}
.jsw-banner:hover, .jsw-banner:focus { color: var(--jsw-paper); text-decoration: none; }
.jsw-banner-media, .jsw-banner-shade { position: absolute; inset: 0; display: block; }
.jsw-banner-media { z-index: -2; }
.jsw-banner-shade { z-index: -1; transition: background-color var(--jsw-slower); }
.jsw-banner-img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transition: transform var(--jsw-slower); }
.jsw-banner-content { position: relative; display: block; padding: 35px; text-align: center; }
.jsw-banner-title {
  margin: 0 0 15px; font-family: var(--jsw-font-display); font-size: var(--jsw-text-3xl); font-weight: 600; line-height: 1.25;
  letter-spacing: .1em; text-transform: uppercase; color: var(--jsw-paper); transition: transform var(--jsw-slow);
}
.jsw-banner-text { display: block; margin: 0 0 15px; font-size: var(--jsw-text-md); line-height: 1.5; transition: transform var(--jsw-slow); }
.jsw-banner-button {
  display: inline-block; padding: 12px 24px; border: 2px solid var(--jsw-paper); border-radius: 3px; font-family: var(--jsw-font);
  font-size: var(--jsw-text-md); font-weight: 500; line-height: 1; color: var(--jsw-paper);
  transition: transform var(--jsw-slow) .33s, background-color var(--jsw-medium), color var(--jsw-medium);
}
a.jsw-banner:focus-visible { outline: 2px solid var(--jsw-ink); outline-offset: 2px; }

/* ---------- Blog posts ---------- */
.jsw-posts { --cols: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 30px; }
.jsw-post { display: flex; flex-direction: column; background: var(--jsw-paper); border-radius: 3px; overflow: hidden; box-shadow: 0 0 10px var(--jsw-shadow); transition: box-shadow var(--jsw-medium); }
.jsw-post-thumb { display: block; position: relative; aspect-ratio: 1 / .66; overflow: hidden; }
.jsw-post-thumb img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.jsw-post-text { flex-grow: 1; padding: 20px 30px 0; }
.jsw-post-title { margin: 0 0 25px; font-family: var(--jsw-font-display); font-size: var(--jsw-text-2xl); font-weight: 600; line-height: 1.5; letter-spacing: .1em; }
.jsw-posts .jsw-post-title a { color: var(--jsw-post-title); text-decoration: none; }
.jsw-posts .jsw-post-excerpt p { margin: 0 0 25px; font-family: var(--jsw-font); font-size: var(--jsw-text-sm); font-weight: 400; line-height: 1.5; color: var(--jsw-excerpt); }
.jsw-posts .jsw-post-more { display: inline-block; margin: 0 0 20px; font-family: var(--jsw-font); font-size: var(--jsw-text-xs); font-weight: 500; line-height: 1.5; text-transform: uppercase; color: var(--jsw-link-quiet); text-decoration: none; }
.jsw-post-meta { padding: 15px 30px; border-top: 1px solid var(--jsw-rule); font-family: var(--jsw-font); font-size: var(--jsw-text-xs); line-height: 1.3; color: var(--jsw-meta); }

/* Hover effects only where there's a real pointer: iOS keeps :hover after a tap. */
@media (hover: hover) {
  .jsw-arrow:hover { color: var(--arrow-hover); }
  .jsw-dot:hover::before { opacity: .6; }
  .jsw-dot[aria-current="true"]:hover::before { opacity: 1; }
  a.jsw-gal-item:hover .jsw-gal-img { opacity: .9; }
  a.jsw-banner:hover .jsw-banner-button { background: var(--jsw-paper); color: var(--jsw-ink); }
  .jsw-banner--zoom:hover .jsw-banner-img { transform: scale(1.2); }
  .jsw-banner:hover .jsw-banner-title, .jsw-banner:hover .jsw-banner-text, .jsw-banner:hover .jsw-banner-button { transform: scale(1.1); }
  .jsw-post:hover { box-shadow: 0 0 30px var(--jsw-shadow); }
}
a.jsw-banner:focus-visible .jsw-banner-button { background: var(--jsw-paper); color: var(--jsw-ink); }

/* A quick pressed state for touch instead. */
@media (hover: none) {
  .jsw-arrow:active, .jsw-banner:active .jsw-banner-button { opacity: .7; transition: none; }
  a.jsw-gal-item:active .jsw-gal-img, .jsw-post-thumb:active img { filter: brightness(.92); transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .jsw-banner-img, .jsw-banner-title, .jsw-banner-text, .jsw-banner-button, .jsw-gal-img { transition: none !important; }
  .jsw-banner--zoom:hover .jsw-banner-img, .jsw-banner:hover .jsw-banner-title, .jsw-banner:hover .jsw-banner-text, .jsw-banner:hover .jsw-banner-button { transform: none; }
}
