/* Telework — wheel + labels (works with Betwins / theme index or Terafab layout) */

:root {
  /* Fixed / sticky header — fallback for scroll-margin (anchor) when JS doesn’t run */
  --telework-header-offset: 180px;
  /* Extra air below header so “Your result” isn’t clipped */
  --telework-result-scroll-extra: 3rem;
}

/* Header logo (desktop + mobile off-canvas) */
.header .navbar-logo img,
.mobile-menu__header .logo img {
  max-width: 180px;
  height: 55px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 1199.98px) {
  .header .navbar-logo img {
    max-width: 160px;
    height: auto;
  }
}

/* Mobile header row: logo | centered total spins | hamburger */
@media (max-width: 1199.98px) {
  .header .navbar {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .header .navbar__intro {
    flex: 0 0 auto;
    max-width: 160px;
    min-width: 0;
  }
  .header .navbar__options {
    flex: 0 0 auto;
  }
  .telework-total-spins--mobile-center {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    align-self: center;
  }
}

/* Total spins counter (top right) — label above number, white for dark hero under transparent header */
/* Beat theme `.header div { line-height: 0 }` so label/number stack visibly */
.header div.telework-total-spins {
  line-height: 1.2;
}
.telework-total-spins {
  line-height: 1.2;
  max-width: 13rem;
}
.telework-total-spins__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 16px;
  color: #fff;
  margin-bottom: 0.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.telework-total-spins__num {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.telework-total-spins--compact {
  max-width: 10rem;
}
.telework-total-spins--compact .telework-total-spins__num {
  font-size: 1.25rem;
}
.telework-total-spins--compact .telework-total-spins__label {
  font-size: 0.55rem;
}

.footer {
  margin-top: 0;
}

.footer .footer__widget-intro a.logo img {
  max-width: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* Excuse + contact: main content clears sticky header (no banner) */
.telework-inner-page {
  padding-top: calc(var(--telework-header-offset) + 2.5rem) !important;
  scroll-margin-top: var(--telework-header-offset);
}

/* Betwins theme: .hero__thumb defaults to position:absolute; min-width:700px — pulls wheel off-canvas */
.telework-hero {
  overflow: visible;
}

.telework-hero .hero__thumb-wrapper {
  height: auto !important;
  min-height: 0;
  max-width: 100%;
  padding-inline-start: 0 !important;
  padding-inline-end: 0;
  position: relative;
  z-index: 2;
}

.telework-hero .hero__thumb-wrapper .hero__thumb.telework-hero-wheel {
  position: relative !important;
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  inset: auto !important;
  inset-inline: auto !important;
}

.telework-hero .container > .row {
  align-items: flex-start;
}

.telework-hero .container > .row > [class*="col-"] {
  min-height: 0;
}

/* Mobile / stacked layout: theme uses huge fixed padding; let hero grow with wheel + copy */
@media only screen and (max-width: 991.98px) {
  .telework-hero {
    padding-block: clamp(100px, 22vw, 180px) clamp(72px, 14vw, 140px) !important;
    overflow: visible;
  }

  .telework-hero .hero__thumb-wrapper {
    margin-top: 1.5rem;
  }
}

/* Desktop: slightly tighter than theme’s 260px block padding so wheel column stays in view */
@media only screen and (min-width: 992px) {
  .telework-hero {
    padding-block: clamp(140px, 14vw, 200px) clamp(100px, 10vw, 160px) !important;
  }
}

.telework-skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
}
.telework-skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary, #2563eb);
  color: var(--color-primary-foreground, #fff);
  text-decoration: none;
  border-radius: 0.375rem;
}

/* Wheel pointer (fixed at top of stage) */
.wheel-stage {
  position: relative;
  container-type: inline-size;
  container-name: wheel;
}
.wheel-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -15%);
  width: clamp(28px, 7cqw, 48px);
  height: auto;
  z-index: 3;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.wheel-rotor {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.wheel-bg {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.telework-hero-wheel {
  position: relative;
  width: 100%;
}

.telework-wheel-stage {
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
}

/* Slice labels: % positions are relative to this layer (same box as the wheel image) */
.wheel-labels-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: visible;
  pointer-events: none;
}

.wheel-html-label {
  position: absolute;
  white-space: nowrap;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.wheel-html-label-pill {
  display: inline-block;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.2;
  color: #0f172a;
  /* White outline (no pill background) so text reads on any slice */
  text-shadow:
    0 0 1px #fff,
    0 0 2px #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    -1px 0 0 #fff,
    1px 0 0 #fff,
    0 -1px 0 #fff,
    0 1px 0 #fff;
}

@media (max-width: 767px) {
  .wheel-html-label-pill {
    font-size: 12px !important;
  }
}

.telework-page {
  box-sizing: border-box;
}

.telework-wheel-row {
  width: 100%;
}

#resultScrollTarget {
  /* Fallback for scrollIntoView / in-page links; wheel.js also offsets by live header height */
  scroll-margin-top: calc(var(--telework-header-offset) + var(--telework-result-scroll-extra));
}

/* No layout gap until the first spin result — entire block (incl. telework-inner-page padding) hidden */
.telework-spin-result:has(#resultSection[hidden]) {
  display: none !important;
}

/* Spin result: match Contact page title treatment (no forced uppercase) */
#resultHeadline {
  text-transform: none !important;
}

#resultLabel {
  text-transform: none !important;
}

/* Daily Excuse Generator — frame border on wrapper (theme resets strip borders on `p`) */
.telework-excuse-frame {
  max-width: 48rem;
  margin: 1.5rem auto 0;
  padding: 1.35rem 1.5rem;
  box-sizing: border-box;
  border: 2px dashed #ffba23 !important;
  border-radius: 0.75rem;
  background: rgba(7, 20, 49, 0.35);
}
#dailyExcuseText.telework-excuse-display {
  font-size: clamp(1.85rem, 5.5vw, 3.25rem) !important;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
  padding: 0;
  text-transform: none !important;
  border: none !important;
}
.telework-excuse-display {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.telework-excuse-display.telework-excuse-display--fade {
  opacity: 0;
  transform: translateY(8px);
}

/* Admin (legacy markup) */
.admin-wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.admin-form label {
  display: block;
  margin-bottom: 0.5rem;
}
.admin-form input[type='text'],
.admin-form input[type='number'],
.admin-form input[type='password'],
.admin-form select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.35rem;
  font: inherit;
  background: var(--color-background, #fff);
  color: var(--color-foreground, #0f172a);
}
.admin-form .wide {
  width: min(100%, 480px);
}
.admin-segments {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}
.admin-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1.2fr) 4.5rem 4rem 3.5rem 2.5rem auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
}
.admin-row.admin-head {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted-foreground, #64748b);
  background: var(--color-muted, #f8fafc);
}
.admin-row input[type='text'],
.admin-row input[type='number'],
.admin-row select {
  width: 100%;
  min-width: 0;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.btn-text {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary, #0369a1);
  cursor: pointer;
  text-decoration: underline;
}
.btn-text.danger {
  color: #b91c1c;
}
.error {
  color: #b91c1c;
  font-weight: 600;
}
@media (max-width: 900px) {
  .admin-row {
    grid-template-columns: 1fr;
  }
  .admin-row.admin-head {
    display: none;
  }
}

/* Shared header nav — active link */
.telework-nav-active > a {
  color: var(--color-primary, #0369a1) !important;
  font-weight: 600;
}

/* Contact form — honeypot (hidden from users, bots often fill) */
.telework-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.telework-contact-flash--success {
  color: var(--color-primary, #0369a1);
  text-align: center;
}

.telework-contact-flash--error {
  color: #b91c1c;
  text-align: center;
}
