/* ============================================================
 * theme-picker site chrome
 * Rendered from resources/views/components/site/theme-picker.blade.php
 * ============================================================ */

.tp-root {
      position: fixed;
      bottom: calc(4.5rem + env(safe-area-inset-bottom));
      right: 1rem;
      z-index: 9990;
    }
    @media (min-width: 48rem) {
      .tp-root { bottom: 1.5rem; right: 1.5rem; }
    }

    /* Toggle button */
    .tp-toggle {
      width: 2.75rem;
      height: 2.75rem;
      border-radius: 50%;
      background: var(--color-brass-400, #b89968);
      color: var(--color-ink-900, #161616);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 12px rgba(0,0,0,.5);
      transition: background 200ms ease, transform 200ms ease;
    }
    .tp-toggle:hover { background: var(--color-brass-300, #c9b086); transform: scale(1.08); }
    .tp-toggle:focus-visible { outline: 2px solid var(--color-brass-400, #b89968); outline-offset: 3px; }

    /* Panel */
    .tp-panel {
      position: absolute;
      bottom: calc(100% + 0.75rem);
      right: 0;
      width: clamp(17rem, 85vw, 21rem);
      background: var(--color-ink-900, #161616);
      border: 1px solid color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 14%, transparent);
      box-shadow: 0 8px 40px rgba(0,0,0,.7);
      overflow: hidden;
    }

    /* Transitions */
    .tp-enter    { transition: opacity 150ms ease, transform 150ms ease; }
    .tp-enter-start { opacity: 0; transform: translateY(6px); }
    .tp-enter-end   { opacity: 1; transform: translateY(0); }
    .tp-leave    { transition: opacity 120ms ease, transform 120ms ease; }
    .tp-leave-start { opacity: 1; transform: translateY(0); }
    .tp-leave-end   { opacity: 0; transform: translateY(6px); }

    .tp-panel__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.9rem 1rem 0.75rem;
      border-bottom: 1px solid color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 10%, transparent);
    }
    .tp-panel__title {
      font-family: var(--font-body-stack);
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 55%, transparent);
      margin: 0;
    }
    .tp-panel__close {
      background: none;
      border: none;
      cursor: pointer;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 50%, transparent);
      width: 1.75rem;
      height: 1.75rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: color 150ms ease;
    }
    .tp-panel__close:hover { color: var(--color-parchment-200, #ebe0c8); }
    .tp-panel__close:focus-visible { outline: 2px solid var(--color-brass-400, #b89968); outline-offset: 2px; }

    /* Section */
    .tp-section {
      padding: 0.9rem 1rem;
      border-bottom: 1px solid color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 8%, transparent);
    }
    .tp-section__label {
      font-family: var(--font-body-stack);
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 45%, transparent);
      margin: 0 0 0.7rem;
    }

    /* Colour swatches */
    .tp-swatches {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    .tp-swatch {
      background: none;
      border: none;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.3rem;
      padding: 0.25rem;
    }
    .tp-swatch:focus-visible { outline: 2px solid var(--color-brass-400, #b89968); outline-offset: 2px; border-radius: 50%; }
    .tp-swatch__dot {
      display: block;
      width: 1.75rem;
      height: 1.75rem;
      border-radius: 50%;
      transition: transform 150ms ease;
      border: 2px solid transparent;
    }
    .tp-swatch--active .tp-swatch__dot {
      transform: scale(1.15);
      border-color: var(--color-parchment-200, #ebe0c8);
    }
    .tp-swatch__label {
      font-family: var(--font-body-stack);
      font-size: 0.6rem;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 55%, transparent);
      text-align: center;
      white-space: nowrap;
    }

    /* Font buttons */
    .tp-fonts {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      max-height: 14rem;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 15%, transparent) transparent;
    }
    .tp-font-btn {
      width: 100%;
      background: none;
      border: 1px solid transparent;
      cursor: pointer;
      text-align: left;
      padding: 0.4rem 0.6rem;
      display: flex;
      flex-direction: column;
      gap: 0.1rem;
      transition: border-color 150ms ease, background 150ms ease;
    }
    .tp-font-btn:hover {
      background: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 5%, transparent);
    }
    .tp-font-btn--active {
      border-color: color-mix(in oklch, var(--color-brass-400, #b89968) 50%, transparent);
      background: color-mix(in oklch, var(--color-brass-400, #b89968) 8%, transparent);
    }
    .tp-font-btn:focus-visible { outline: 2px solid var(--color-brass-400, #b89968); outline-offset: 1px; }
    .tp-font-btn__display {
      font-size: 0.95rem;
      font-weight: 400;
      color: var(--color-parchment-200, #ebe0c8);
      line-height: 1.2;
    }
    .tp-font-btn__body {
      font-size: 0.7rem;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 48%, transparent);
      line-height: 1.3;
    }

    /* Footer */
    .tp-panel__footer {
      padding: 0.65rem 1rem;
      text-align: right;
    }
    .tp-reset {
      font-family: var(--font-body-stack);
      font-size: 0.75rem;
      color: color-mix(in oklch, var(--color-parchment-200, #ebe0c8) 45%, transparent);
      background: none;
      border: none;
      cursor: pointer;
      transition: color 150ms ease;
      text-decoration: underline;
      text-underline-offset: 0.3em;
    }
    .tp-reset:hover { color: var(--color-parchment-200, #ebe0c8); }
    .tp-reset:focus-visible { outline: 2px solid var(--color-brass-400, #b89968); outline-offset: 2px; }

    @media (prefers-reduced-motion: reduce) {
      .tp-toggle, .tp-swatch__dot { transition: none; }
      .tp-toggle:hover { transform: none; }
      .tp-swatch--active .tp-swatch__dot { transform: none; }
    }
