/*
 * Components - Shared retro-gadget UI elements
 * Sticker buttons, logo mark, CSS pager device, chips, popovers
 */

/* --- Logo mark: amber square with ink border + "Bleep" wordmark --- */

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: var(--amber);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand--lg .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink);
}

.brand--lg .brand-name {
  font-size: 21px;
}

.brand--footer .brand-mark {
  width: 19px;
  height: 19px;
  border-width: 1.5px;
  border-radius: 5px;
  box-shadow: none;
}

.brand--footer .brand-name {
  font-size: 13.5px;
}

/* --- Sticker buttons: hard ink border + offset shadow --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--amber);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 10px 18px;
  border-radius: 11px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:is(:hover, :focus-visible) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--amber);
  color: var(--ink);
}

.btn:active {
  transform: translate(1px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn--white {
  background: #ffffff;
}

.btn--white:is(:hover, :focus-visible) {
  background: #ffffff;
}

.btn--lg {
  padding: 16px 30px;
  border-radius: 14px;
  font-size: 18px;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn--lg:is(:hover, :focus-visible) {
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--lg:active {
  box-shadow: 0 0 0 var(--ink);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Reset Pico's submit-button look when it carries .btn */
input[type="submit"].btn,
button.btn {
  width: auto;
  margin: 0;
}

/* Ink pill link (header CTA) */
.pill-link {
  display: inline-block;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.pill-link:is(:hover, :focus-visible) {
  color: var(--cream);
  opacity: 0.85;
}

/* --- Chips / pills --- */

.chip {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--faint);
}

.chip-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* LCD chip (use-case cards) */
.lcd-chip {
  display: inline-block;
  background: var(--lcd);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font: 700 13px var(--font-mono);
  color: var(--lcd-text);
}

/* --- The pager device (pure CSS) --- */

.pager-device {
  background: var(--ink);
  border-radius: 26px;
  padding: 20px 20px 24px;
  text-align: left;
}

.pager-screen {
  background: var(--lcd);
  border-radius: 9px;
  padding: 14px 13px 12px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.25);
}

.pager-screen-meta {
  display: flex;
  justify-content: space-between;
  font: 500 9px var(--font-mono);
  color: var(--lcd-meta);
  margin-bottom: 9px;
}

.pager-screen-title {
  font: 700 21px var(--font-mono);
  color: var(--lcd-text);
  letter-spacing: 0.02em;
}

.pager-screen-sub {
  font: 400 11px var(--font-mono);
  color: var(--lcd-meta);
  margin-top: 5px;
}

.lcd-cursor {
  animation: lcdBlink 1s step-end infinite;
}

.pager-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.pager-buttons {
  display: flex;
  gap: 7px;
}

.pager-button {
  width: 32px;
  height: 32px;
  background: var(--device-btn);
  border-radius: 50%;
  border: 1px solid var(--device-btn-border);
}

.pager-slider {
  width: 48px;
  height: 19px;
  background: var(--amber);
  border-radius: 999px;
}

@keyframes lcdBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* --- Site header / footer (dashboard, FAQ, privacy) --- */

body > header.container {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1.5px solid var(--hairline);
}

body > footer.container {
  max-width: 100%;
  text-align: center;
  padding: 16px;
  margin-top: auto;
  border-top: 1.5px solid var(--hairline);
  font-size: 12.5px;
  color: var(--faint);
}

body > footer.container small {
  font-size: 12.5px;
}

body > footer.container a {
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body > footer.container a:hover {
  color: var(--ink);
}

/* Pin the shared footer to the bottom on short pages */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body > main.container {
  flex: 1;
  width: 100%;
  padding-block: 32px;
}

.header-chip {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--faint);
  background: #ffffff;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 5px 12px;
}

/* --- Delete button & confirm popover (white card, ink border) --- */

.btn-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #b0a68f;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn-delete svg {
  width: 16px;
  height: 16px;
}

.btn-delete:is(:hover, :focus-visible) {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-delete:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.3);
}

.btn-delete:active {
  transform: scale(0.95);
}

.delete-popover-wrapper[data-confirm-delete-open-value="true"] .btn-delete {
  background: var(--danger-bg);
  color: var(--danger);
}

.delete-popover-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.delete-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 180px;
  padding: 12px 14px;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(42, 36, 25, 0.15);

  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.delete-popover.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.delete-popover-text {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}

.delete-popover .btn-confirm,
.delete-popover .btn-confirm:is(button, input[type="submit"], [role="button"]) {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #fff !important;
  background: var(--danger) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s ease;
  --pico-background-color: var(--danger);
  --pico-border-color: var(--ink);
  --pico-color: #fff;
}

.delete-popover .btn-confirm:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .delete-popover {
    right: -8px;
    min-width: 160px;
  }
}
