/*
 * TFM Town Square — single pages of Daily Tasks
 * /wp-content/themes/blocksy/css/tfm-townsquare-task.css
 *
 * Loads after tfm-townsquare-core.css (card, corners, eyebrow, title, body
 * text, end ornament, navigation). This file adds the task parts:
 *   1. Day label pill                 .tfm-sq-pill
 *   2. Boxes, box titles, safety      .tfm-sq-task-box / .tfm-sq-box-title / .tfm-sq-safety
 *   3. "What you need" list           .tfm-sq-need
 *   4. Numbered steps                 .tfm-sq-steps
 *   5. Version switch (Nested Tabs)   .tfm-sq-switch
 *   6. Completion block (JS)          .tfm-sq-complete
 *   7. Teaser line (JS)               .tfm-sq-hard-teaser
 *   8. Hard version: locked / content .tfm-sq-hard-locked / .tfm-sq-hard-content
 *   9. Responsive + reduced motion
 *
 * Colors: Town Square variables; the safety box uses a warm amber so it
 * stands apart from the rest.
 */

/* ============================================================
   1. DAY LABEL PILL (Text widget, Dynamic Tag "TFM: Aufgabe – Tageslabel")
   ============================================================ */

.tfm-sq-pill {
  display: inline-flex;
  width: auto !important;
  max-width: 100%;
}
.tfm-sq-pill .elementor-widget-container {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--area-accent) 30%, transparent);
  background: color-mix(in srgb, var(--area-accent) 18%, transparent);
}
.tfm-sq-pill,
.tfm-sq-pill * {
  margin: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  color: var(--ink, #f6f1ea) !important;
}

/* ============================================================
   2. BOXES, BOX TITLES, SAFETY
   ============================================================ */

.tfm-sq-task-box {
  border-radius: 12px !important;
  background: rgba(0, 0, 0, .18) !important;
  border: 1px solid color-mix(in srgb, var(--area-accent) 18%, transparent) !important;
}

/* Heading widget for section titles (Introduction, What you need, …). */
.tfm-sq-box-title,
.tfm-sq-box-title * {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 1.6rem !important;
  font-weight: 600 !important;
  font-style: normal !important;
  line-height: 1.2 !important;
  color: var(--ink, #f6f1ea) !important;
}
.tfm-sq-box-title .elementor-heading-title::before {
  content: '\2726';
  display: inline-block;
  margin-right: .55em;
  font-size: .5em;
  vertical-align: .35em;
  color: var(--area-accent-soft);
}

/* Safety box: extra class next to tfm-sq-task-box. Its title gets a "!" sign. */
.tfm-sq-safety {
  border-color: rgba(240, 178, 122, .45) !important;
  background: color-mix(in srgb, #f0b27a 7%, rgba(0, 0, 0, .18)) !important;
}
.tfm-sq-safety .tfm-sq-box-title .elementor-heading-title::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-right: .5em;
  border-radius: 50%;
  border: 2px solid #f0b27a;
  color: #f0b27a;
  font-family: 'Jost', sans-serif;
  font-size: .6em;
  font-weight: 700;
  vertical-align: .2em;
}

/* ============================================================
   3. "WHAT YOU NEED" LIST (Text Editor with a bullet list)
   Also used for the safety list and "Additionally you need".
   ============================================================ */

.tfm-sq-need ul,
.tfm-sq-need ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tfm-sq-need li,
.tfm-sq-need p {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 1.15rem !important;
  line-height: 1.5 !important;
  color: var(--body-text, #e4ddf0) !important;
}
.tfm-sq-need li:last-child,
.tfm-sq-need p:last-child {
  border-bottom: 0;
}
.tfm-sq-need li::before {
  content: '\2726';
  flex-shrink: 0;
  font-size: .7rem;
  color: var(--area-accent-soft);
}
.tfm-sq-safety .tfm-sq-need li::before {
  content: '\2022';
  font-size: 1rem;
  color: #f0b27a;
}

/* ============================================================
   4. STEPS (Text Editor with the "How to do it" field)
   Numbered list  -> numbered circles with a connecting line.
   Bullet list    -> star bullets, like "What you need".
   Plain paragraphs (and line breaks inside them) -> same typography and
   spacing, so the field also looks tidy without any list.
   ============================================================ */

.tfm-sq-steps p,
.tfm-sq-steps li {
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 1.18rem !important;
  font-style: normal;
  line-height: 1.6 !important;
  color: var(--body-text, #e4ddf0) !important;
}
.tfm-sq-steps p {
  margin: 0 0 1em;
}
.tfm-sq-steps p:last-child {
  margin-bottom: 0;
}
.tfm-sq-steps strong,
.tfm-sq-steps b {
  font-weight: 600 !important;
  color: var(--ink, #f6f1ea) !important;
}

/* Numbered list */
.tfm-sq-steps ol {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  counter-reset: tfm-step;
}
.tfm-sq-steps ol:last-child {
  margin-bottom: 0;
}
.tfm-sq-steps ol > li {
  position: relative;
  margin: 0;
  padding: 4px 0 18px 54px;
}
.tfm-sq-steps ol > li::before {
  counter-increment: tfm-step;
  content: counter(tfm-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Jost', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink, #f6f1ea);
  background: color-mix(in srgb, var(--area-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--area-accent) 50%, transparent);
}
.tfm-sq-steps ol > li::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 4px;
  width: 2px;
  background: color-mix(in srgb, var(--area-accent) 20%, transparent);
}
.tfm-sq-steps ol > li:last-child::after {
  display: none;
}

/* Bullet list */
.tfm-sq-steps ul {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}
.tfm-sq-steps ul:last-child {
  margin-bottom: 0;
}
.tfm-sq-steps ul > li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 0;
  padding: 4px 0;
}
.tfm-sq-steps ul > li::before {
  content: '\2726';
  flex-shrink: 0;
  font-size: .7rem;
  color: var(--area-accent-soft);
}

/* ============================================================
   5. VERSION SWITCH (Elementor "Nested Tabs" widget)
   Class on the widget. The tab titles become a pill switch, each tab's
   content container becomes the panel. Set the widget's breakpoint to
   "None" so the switch stays a switch on phones. If the switch does not
   look right, check the class names with the browser's inspector.
   ============================================================ */

.tfm-sq-switch .e-n-tabs-heading {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  width: fit-content !important;
  max-width: 100%;
  margin: 0 auto 18px !important;
  padding: 4px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .04) !important;
  border: 1px solid color-mix(in srgb, var(--area-accent) 26%, transparent) !important;
}
.tfm-sq-switch .e-n-tab-title {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 44px;
  padding: 10px 24px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tfm-sq-switch .e-n-tab-title,
.tfm-sq-switch .e-n-tab-title * {
  font-family: 'Jost', sans-serif !important;
  font-size: .74rem !important;
  font-weight: 600 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  color: var(--muted, #b6afc7) !important;
}
.tfm-sq-switch .e-n-tab-title:hover,
.tfm-sq-switch .e-n-tab-title:hover * {
  color: var(--ink, #f6f1ea) !important;
}
.tfm-sq-switch .e-n-tab-title[aria-selected="true"] {
  background: color-mix(in srgb, var(--area-accent) 24%, transparent) !important;
}
.tfm-sq-switch .e-n-tab-title[aria-selected="true"],
.tfm-sq-switch .e-n-tab-title[aria-selected="true"] * {
  color: var(--ink, #f6f1ea) !important;
}
.tfm-sq-switch .e-n-tab-title:focus-visible {
  outline: 2px solid var(--area-accent-soft);
  outline-offset: 2px;
}
/* Lock and remaining time added to the hard tab by the JS. */
.tfm-sq-switch .tfm-sq-tab-lock {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.tfm-sq-switch .tfm-sq-tab-when,
.tfm-sq-switch .e-n-tab-title .tfm-sq-tab-when {
  margin-left: .45em;
  font-weight: 500 !important;
  letter-spacing: .06em !important;
  text-transform: none !important;
  color: var(--muted, #b6afc7) !important;
}
.tfm-sq-switch .tfm-sq-tab-when:empty {
  display: none;
}
.tfm-sq-switch .e-n-tab-title[aria-selected="true"] .tfm-sq-tab-when {
  color: var(--area-accent-soft) !important;
}

/* The panels (each tab's content container). Padding: set in Elementor. */
.tfm-sq-switch .e-n-tabs-content > .e-con {
  border-radius: 14px !important;
  background: rgba(0, 0, 0, .2) !important;
  border: 1px solid color-mix(in srgb, var(--area-accent) 30%, transparent) !important;
}

/* ============================================================
   6. COMPLETION BLOCK (empty container, filled by the JS)
   ============================================================ */

.tfm-sq-complete-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
  padding: 20px 22px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--area-accent) 45%, transparent);
  background: color-mix(in srgb, var(--area-accent) 6%, transparent);
}
.tfm-sq-complete-ui.is-done {
  border-style: solid;
  border-color: var(--area-accent);
  background: color-mix(in srgb, var(--area-accent) 12%, transparent);
}
.tfm-sq-complete-title {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink, #f6f1ea);
}
.tfm-sq-complete-sub {
  display: block;
  margin-top: 4px;
  font-family: 'Jost', sans-serif;
  font-size: .78rem;
  color: var(--muted, #b6afc7);
}
.tfm-sq-complete-sub.is-error {
  color: #f0a0a0;
}
.tfm-sq-complete-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tfm-sq-complete .tfm-sq-done-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--area-accent) !important;
  background: color-mix(in srgb, var(--area-accent) 22%, transparent) !important;
  box-shadow: 0 0 22px -8px var(--area-accent-glow) !important;
  font-family: 'Jost', sans-serif !important;
  font-size: .76rem !important;
  font-weight: 600 !important;
  letter-spacing: .12em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  color: var(--ink, #f6f1ea) !important;
  transition: background .2s ease;
}
.tfm-sq-complete .tfm-sq-done-btn:hover {
  background: color-mix(in srgb, var(--area-accent) 34%, transparent) !important;
}
.tfm-sq-complete .tfm-sq-done-btn:focus-visible,
.tfm-sq-complete .tfm-sq-undo:focus-visible,
.tfm-sq-hard-teaser .tfm-sq-teaser-link:focus-visible,
.tfm-sq-hard-locked .tfm-sq-ready-btn:focus-visible {
  outline: 2px solid var(--area-accent-soft);
  outline-offset: 2px;
}
.tfm-sq-done-box {
  /* anchor of the spark burst (js/tfm-fx.js) */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--area-accent-soft);
  font-size: .75rem;
  line-height: 1;
}
.tfm-sq-complete-ui.is-done .tfm-sq-done-btn {
  cursor: default;
  background: var(--area-accent) !important;
  color: #0d0a1a !important;
}
.tfm-sq-complete-ui.is-done .tfm-sq-done-box {
  border-color: #0d0a1a;
}
/* The tick is a stroke (drawn by js/tfm-fx.js on a tick, lab no. 09); its stroke
   styles are in css/tfm-townsquare.css (.tfm-sq-tick). */
.tfm-sq-done-box .tfm-sq-tick {
  width: 13px;
  height: 13px;
  opacity: 0;
}
.tfm-sq-complete-ui.is-done .tfm-sq-done-box .tfm-sq-tick {
  opacity: 1;
}
.tfm-sq-complete-ui.is-busy .tfm-sq-done-btn {
  opacity: .6;
  cursor: progress;
}
.tfm-sq-complete .tfm-sq-undo {
  padding: 6px 4px;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: 'Jost', sans-serif !important;
  font-size: .72rem !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  color: var(--muted, #b6afc7) !important;
}
.tfm-sq-complete .tfm-sq-undo:hover {
  color: var(--ink, #f6f1ea) !important;
}
.tfm-sq-complete .tfm-sq-undo[hidden] {
  display: none;
}

/* ============================================================
   7. TEASER LINE (empty container at the end of the easy panel)
   ============================================================ */

.tfm-sq-teaser-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 16px;
  border-top: 1px dashed color-mix(in srgb, var(--area-accent) 25%, transparent);
  font-family: 'Jost', sans-serif;
  font-size: .8rem;
  color: var(--muted, #b6afc7);
}
.tfm-sq-teaser-ui > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tfm-sq-teaser-ui svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.tfm-sq-hard-teaser .tfm-sq-teaser-link {
  padding: 6px 2px;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: 'Jost', sans-serif !important;
  font-size: .74rem !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  color: var(--area-accent-soft) !important;
}
.tfm-sq-hard-teaser .tfm-sq-teaser-link:hover {
  color: var(--ink, #f6f1ea) !important;
}

/* ============================================================
   8. HARD VERSION: LOCKED STATE + CONTENT
   ============================================================ */

.tfm-sq-hard-locked.is-hidden,
.tfm-sq-hard-content.is-hidden,
.tfm-sq-hard-extra.is-empty {
  display: none !important;
}

.tfm-sq-lock-head {
  width: 100%;
  text-align: center;
}
.tfm-sq-lock-head svg {
  display: block;
  width: 44px;
  height: 44px;
  margin: 4px auto 12px;
  color: var(--area-accent-soft);
}
.tfm-sq-lock-title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink, #f6f1ea);
}
.tfm-sq-lock-lead {
  margin: 8px auto 18px;
  max-width: 460px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--muted, #b6afc7);
}
.tfm-sq-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--area-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--area-accent) 40%, transparent);
  color: var(--ink, #f6f1ea);
}
.tfm-sq-countdown small {
  font-family: 'Jost', sans-serif;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--area-accent-soft);
}
.tfm-sq-countdown b {
  font-family: 'Jost', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .06em;
}
.tfm-sq-countdown[hidden],
.tfm-sq-hard-locked .tfm-sq-ready-btn[hidden] {
  display: none;
}
.tfm-sq-hard-locked .tfm-sq-ready-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--area-accent) !important;
  background: color-mix(in srgb, var(--area-accent) 22%, transparent) !important;
  box-shadow: none !important;
  font-family: 'Jost', sans-serif !important;
  font-size: .76rem !important;
  font-weight: 600 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  color: var(--ink, #f6f1ea) !important;
}

/* Sneak peek: label above the Text widget (ACF "Sneak peek"), soft lines below. */
.tfm-sq-peek-label {
  width: 100%;
  max-width: 560px;
  margin: 26px auto 8px;
  font-family: 'Jost', sans-serif;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--area-accent-soft);
}
.tfm-sq-hard-peek {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.tfm-sq-hard-peek,
.tfm-sq-hard-peek * {
  font-family: 'Cormorant Garamond', serif !important;
  font-style: italic !important;
  font-size: 1.2rem !important;
  line-height: 1.6 !important;
  color: var(--ink, #f6f1ea) !important;
}
.tfm-sq-hard-peek p {
  margin: 0;
}
.tfm-sq-ghost {
  width: 100%;
  max-width: 560px;
  margin: 14px auto 0;
  filter: blur(4px);
  opacity: .5;
  pointer-events: none;
  user-select: none;
}
.tfm-sq-ghost i {
  display: block;
  height: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--area-accent) 45%, transparent);
}
.tfm-sq-ghost i:nth-child(2) { width: 82%; }
.tfm-sq-ghost i:nth-child(3) { width: 64%; }

/* Admin preview note (only for admins who are not unlocked by time). */
.tfm-sq-admin-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(240, 178, 122, .6);
  font-family: 'Jost', sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #f0b27a;
}

/* "Additionally you need" title. */
.tfm-sq-extra-title,
.tfm-sq-extra-title * {
  font-family: 'Jost', sans-serif !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  color: var(--area-accent-soft) !important;
}

/* ============================================================
   9. RESPONSIVE + REDUCED MOTION
   ============================================================ */

@media (max-width: 700px) {
  .tfm-sq-switch .e-n-tab-title {
    padding: 10px 14px !important;
  }
  .tfm-sq-switch .e-n-tab-title,
  .tfm-sq-switch .e-n-tab-title * {
    font-size: .74rem !important;
    letter-spacing: .06em !important;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tfm-sq-switch .e-n-tab-title,
  .tfm-sq-complete .tfm-sq-done-btn {
    transition: none !important;
  }
}