/*
 * Shared editorial CTA — `.kt-svc-cta`.
 *
 * A gold-framed, uppercase serif button used by the Services cards, the
 * Bathhouse "Beneath the finish" button and the Explore KiwiTile gateway
 * cards. Anatomy:
 *   - 1px gold frame (contexts usually thicken it to 2px)
 *   - two short gold "rules" painted inside the left/right edges
 *     (background layers 1 and 2) over a soft dark fill (layer 3)
 *   - two corner accents (::before top-left, ::after bottom-right)
 *
 * Contexts that scale the button with the viewport set:
 *   --cta-line    thickness of the edge rules and corner strokes (1px)
 *   --cta-corner  corner accent size
 *   --cta-rule    length of the edge rules
 *
 * Modifier `.kt-svc-cta--luxe`: the darker bronze finish shared by the
 * Services cards and the Bathhouse preparation trigger (single dark fill,
 * no edge rules).
 */

.kt-svc-cta {
  --svc-cta-gold: 215 168 96;
  --cta-line: 1px;
  --cta-corner: clamp(9px, 0.85vw, 11px);
  --cta-rule: clamp(24px, 8%, 36px);

  position: relative;
  isolation: isolate;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: min(100%, 260px);
  max-width: 100%;
  margin: clamp(14px, 1.4vw, 18px) auto 0;
  padding: clamp(15px, 1.35vw, 17px) clamp(42px, 4.2vw, 56px);
  border: 1px solid rgb(var(--svc-cta-gold) / 0.52);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgb(var(--svc-cta-gold) / 0.62), rgb(var(--svc-cta-gold) / 0.08))
      left center / var(--cta-rule) var(--cta-line) no-repeat,
    linear-gradient(270deg, rgb(var(--svc-cta-gold) / 0.62), rgb(var(--svc-cta-gold) / 0.08))
      right center / var(--cta-rule) var(--cta-line) no-repeat,
    linear-gradient(180deg, rgb(255 236 196 / 0.035), rgb(0 0 0 / 0.18) 58%, rgb(0 0 0 / 0.28));
  box-shadow:
    inset 0 1px 0 rgb(255 244 224 / 0.07),
    inset 0 -1px 0 rgb(0 0 0 / 0.22),
    0 10px 28px rgb(0 0 0 / 0.22);
  color: rgb(var(--svc-cta-gold) / 0.94);
  font-family: var(--font-serif);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.3em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgb(255 244 224 / 0.14),
    0 2px 10px rgb(0 0 0 / 0.42);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    color 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease,
    background 320ms ease,
    transform 320ms ease;
}

/* Modal triggers (Services, Bathhouse) are links to each document's own URL
   acting as buttons: no iOS link-preview callout on long press, as before. */
a.kt-svc-cta[role="button"] {
  -webkit-touch-callout: none;
}

/* Corner accents. */
.kt-svc-cta::before,
.kt-svc-cta::after {
  content: "";
  position: absolute;
  width: var(--cta-corner);
  height: var(--cta-corner);
  border-color: rgb(var(--svc-cta-gold) / 0.72);
  border-style: solid;
  pointer-events: none;
  transition: border-color 320ms ease, opacity 320ms ease;
}

.kt-svc-cta::before {
  top: calc(-1 * var(--cta-line));
  left: calc(-1 * var(--cta-line));
  border-width: var(--cta-line) 0 0 var(--cta-line);
}

.kt-svc-cta::after {
  right: calc(-1 * var(--cta-line));
  bottom: calc(-1 * var(--cta-line));
  border-width: 0 var(--cta-line) var(--cta-line) 0;
}

.kt-svc-cta:focus-visible {
  outline: 1px solid rgb(var(--svc-cta-gold) / 0.78);
  outline-offset: 4px;
}

/* Darker bronze finish (Services cards, Bathhouse preparation trigger). */
.kt-svc-cta--luxe {
  border-color: rgb(210 165 78 / 0.85);
  background: linear-gradient(180deg, rgb(115 84 36 / 0.18) 0%, rgb(10 10 8 / 0.88) 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 220 145 / 0.06),
    inset 0 1px 0 rgb(255 231 174 / 0.05),
    0 2px 8px rgb(0 0 0 / 0.28);
  color: #d8b66a;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.3);
}

@media (hover: hover) {
  .kt-svc-cta:hover,
  .kt-svc-cta:focus-visible {
    transform: translateY(-1px);
    border-color: rgb(var(--svc-cta-gold) / 0.78);
    background:
      linear-gradient(90deg, rgb(var(--svc-cta-gold) / 0.82), rgb(var(--svc-cta-gold) / 0.12))
        left center / var(--cta-rule) var(--cta-line) no-repeat,
      linear-gradient(270deg, rgb(var(--svc-cta-gold) / 0.82), rgb(var(--svc-cta-gold) / 0.12))
        right center / var(--cta-rule) var(--cta-line) no-repeat,
      linear-gradient(180deg, rgb(255 236 196 / 0.06), rgb(0 0 0 / 0.24) 58%, rgb(0 0 0 / 0.34));
    box-shadow:
      inset 0 1px 0 rgb(255 244 224 / 0.12),
      inset 0 -1px 0 rgb(0 0 0 / 0.28),
      0 14px 34px rgb(0 0 0 / 0.28),
      0 0 24px rgb(var(--svc-cta-gold) / 0.1);
    color: rgb(255 236 196 / 0.98);
  }

  .kt-svc-cta:hover::before,
  .kt-svc-cta:hover::after,
  .kt-svc-cta:focus-visible::before,
  .kt-svc-cta:focus-visible::after {
    border-color: rgb(255 220 140 / 0.92);
  }

  .kt-svc-cta--luxe:hover,
  .kt-svc-cta--luxe:focus-visible {
    border-color: rgb(232 190 103 / 0.92);
    background: linear-gradient(180deg, rgb(130 96 43 / 0.24) 0%, rgb(14 13 10 / 0.9) 100%);
    box-shadow:
      inset 0 0 0 1px rgb(255 220 145 / 0.08),
      inset 0 1px 0 rgb(255 235 188 / 0.07),
      0 3px 9px rgb(0 0 0 / 0.3);
    color: #e0c27c;
  }
}

/* 1440p and up: the label grows with the smaller viewport ratio (cap 22.5px). */
@media (min-width: 1921px) and (min-height: 1081px) {
  .kt-svc-cta {
    font-size: clamp(15px, min(0.78125vw, 1.388889vh), 22.5px);
  }
}
