.tw-tiles-widget {
  --tw-tiles-per-row: 3;
  --tw-tile-max-width: 360px;
  --tw-tile-min-height: 260px;
  --tw-tile-radius: 18px;
  --tw-tile-padding: 1.25rem;
  --tw-default-bg: #ffffff;
  --tw-tile-border: rgba(15, 23, 42, 0.12);
  --tw-tile-text: #111827;
  --tw-tile-muted: #4b5563;
  --tw-tile-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  --tw-tile-shadow-hover: 0 22px 55px rgba(15, 23, 42, 0.16);
  width: 100%;
  max-width: 100%;
  margin: 1.5rem auto;
}

.tw-tiles-widget *,
.tw-tiles-widget *::before,
.tw-tiles-widget *::after {
  box-sizing: border-box;
}

.tw-tiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
}

.tw-tiles-widget.tw-justify-left .tw-tiles-grid {
  justify-content: flex-start;
}

.tw-tiles-widget.tw-justify-center .tw-tiles-grid {
  justify-content: center;
}

.tw-tiles-widget.tw-justify-right .tw-tiles-grid {
  justify-content: flex-end;
}

.tw-tile {
  flex: 0 1 var(--tw-tile-max-width, 360px);
  max-width: var(--tw-tile-max-width, 360px);
  min-height: var(--tw-tile-min-height, 260px);
  border-radius: var(--tw-tile-radius, 18px);
  padding: var(--tw-tile-padding, 1.25rem);
  background: var(--tw-tile-bg, var(--tw-default-bg, #ffffff));
}

.tw-tile {
  height: var(--tw-equal-tile-height, auto);
}

.tw-tile-inner {
  min-height: 100%;
}

.tw-tile,
.tw-tile-link,
.tw-tile-modal-button {
  min-width: 0;
  width: 100%;
  min-height: var(--tw-tile-min-height);
  height: 100%;
  border: 1px solid var(--tw-tile-border);
  border-radius: var(--tw-tile-radius);
  background: var(--tw-tile-bg, var(--tw-default-bg));
  color: var(--tw-tile-text);
  box-shadow: var(--tw-tile-shadow);
  overflow: hidden;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.tw-tile-link,
.tw-tile-modal-button {
  display: block;
  text-decoration: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.tw-tile-modal-button {
  font: inherit;
}

.tw-tile-inner {
  min-height: var(--tw-tile-min-height);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--tw-tile-padding);
  position: relative;
  z-index: 2;
}

.tw-tile-top {
  display: flex;
  min-height: 3rem;
  margin-bottom: 1rem;
}

.tw-icon-left .tw-tile-top {
  justify-content: flex-start;
}

.tw-icon-right .tw-tile-top {
  justify-content: flex-end;
}

.tw-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  font-size: 1.35rem;
  line-height: 1;
}

.tw-tile-image-wrap {
  width: min(100%, 7rem);
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--tw-tile-radius) * 0.65);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.tw-tile-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-tile-body {
  margin-top: auto;
}

.tw-tile-title {
  margin: 0 0 0.5rem;
  color: var(--tw-tile-text);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.18;
  font-weight: 750;
}

.tw-tile-description {
  margin: 0;
  color: var(--tw-tile-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.tw-effect-lift:hover,
.tw-effect-lift:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--tw-tile-shadow-hover);
}

.tw-effect-zoom:hover,
.tw-effect-zoom:focus-within {
  transform: scale(1.025);
  box-shadow: var(--tw-tile-shadow-hover);
}

.tw-effect-glow:hover,
.tw-effect-glow:focus-within {
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12), var(--tw-tile-shadow-hover);
}

.tw-effect-shadow:hover,
.tw-effect-shadow:focus-within {
  box-shadow: var(--tw-tile-shadow-hover);
}

.tw-effect-tilt:hover,
.tw-effect-tilt:focus-within {
  transform: perspective(900px) rotateX(2deg) rotateY(-2deg) translateY(-3px);
  box-shadow: var(--tw-tile-shadow-hover);
}

.tw-effect-fade_overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 1;
}

.tw-effect-fade_overlay:hover::after,
.tw-effect-fade_overlay:focus-within::after {
  opacity: 1;
}

.tw-empty {
  padding: 1rem;
  border: 1px dashed #cccccc;
  border-radius: 12px;
  color: #555555;
  background: #fafafa;
}

.tw-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
}

.tw-modal.is-open {
  display: block;
}

.tw-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
}

.tw-modal-dialog {
  position: relative;
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  margin: 1rem auto;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.tw-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.tw-modal-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.tw-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.tw-modal-body {
  padding: 1.25rem;
}

.tw-modal-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.tw-modal-description {
  margin: 0;
  color: #374151;
  font-size: 1rem;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .tw-tiles-grid {
    grid-template-columns: repeat(min(var(--tw-tiles-per-row), 3), minmax(0, var(--tw-tile-max-width)));
  }
}

@media (max-width: 780px) {
  .tw-tiles-grid {
    grid-template-columns: repeat(min(var(--tw-tiles-per-row), 2), minmax(0, var(--tw-tile-max-width)));
  }
}

@media (max-width: 540px) {
  .tw-tiles-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Modal layout update: centered modal, optional left photo, right content */
html.tw-modal-open,
html.tw-modal-open body {
  overflow: hidden;
}

.tw-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tw-modal-backdrop {
  z-index: 1;
}

.tw-modal-dialog {
  z-index: 2;
  margin: 0;
  width: min(1140px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.tw-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid rgba(15, 23, 42, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: rgba(15, 23, 42, 0.58);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
}

.tw-modal-layout {
  display: block;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.tw-modal-has-photo .tw-modal-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr);
}

.tw-modal-media {
  display: none;
  min-height: 420px;
  background: #f3f4f6;
}

.tw-modal-has-photo .tw-modal-media {
  display: block;
}

.tw-modal-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}

.tw-modal-content {
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
}

.tw-modal-eyebrow {
  margin-bottom: 0.75rem;
  color: #6f7cff;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tw-modal-title {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
  font-weight: 850;
}

.tw-modal-subtitle {
  margin-top: 1.15rem;
  color: #111827;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.4;
}

.tw-modal-description {
  margin-top: 1.25rem;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-line;
}

.tw-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.tw-modal-button {
  align-items: center;
  justify-content: center;
}

@media (max-width: 820px) {
  .tw-modal-has-photo .tw-modal-layout {
    grid-template-columns: 1fr;
  }

  .tw-modal-media,
  .tw-modal-image,
  .tw-modal-content {
    min-height: 0;
  }

  .tw-modal-image {
    max-height: 42vh;
  }
}


/*
 * Position the narrowed grid according to the widget's
 * existing justification setting.
 */
.tw-tiles-widget.tw-justify-left > .tw-tiles-grid {
  margin-left: 0;
  margin-right: auto;
}

.tw-tiles-widget.tw-justify-center > .tw-tiles-grid {
  margin-left: auto;
  margin-right: auto;
}

.tw-tiles-widget.tw-justify-right > .tw-tiles-grid {
  margin-left: auto;
  margin-right: 0;
}