/*
 * GetTogether blog article controls
 * Uses the article template's existing theme tokens; this file is intentionally
 * additive so the established article layout remains unchanged.
 */

.blog-asset {
  --asset-line: var(--border, hsl(47 21% 87%));
  --asset-surface: var(--bg-elev, hsl(0 0% 100%));
  --asset-muted: var(--bg-secondary, hsl(51 21% 94%));
  --asset-ink: var(--text, hsl(220 17% 7%));
  --asset-subtle: var(--text-secondary, hsl(217 7% 38%));
  --asset-accent: var(--primary, hsl(11 81% 53%));
  --asset-accent-soft: var(--accent-soft, hsl(13 100% 96%));
  --asset-radius: var(--radius, 12px);

  margin: 1.75rem 0;
  padding: clamp(1rem, 4vw, 1.5rem);
  color: var(--asset-ink);
  background: var(--asset-surface);
  border: 1px solid var(--asset-line);
  border-radius: var(--asset-radius);
  box-shadow: 0 5px 18px -12px hsl(220 17% 7% / 0.3);
}

.blog-asset :where(h2, h3, h4, legend) {
  color: var(--ink, var(--asset-ink));
}

.blog-asset :where(p, .description, .help-text, small) {
  color: var(--asset-subtle);
}

.blog-asset fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--asset-line);
  border-radius: calc(var(--asset-radius) - 2px);
  background: var(--bg, hsl(60 23% 97%));
}

.blog-asset fieldset + fieldset {
  margin-top: 1rem;
}

.blog-asset legend {
  max-width: 100%;
  padding: 0 0.5rem;
  font-weight: 650;
  line-height: 1.35;
}

.blog-asset :where(label) {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--asset-ink);
  font-size: 0.94rem;
  font-weight: 550;
  line-height: 1.45;
  cursor: pointer;
}

.blog-asset :where(input, select, textarea) {
  accent-color: var(--asset-accent);
}

.blog-asset :where(input[type="checkbox"], input[type="radio"]) {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.16rem 0 0;
}

.blog-asset :where(button, [role="button"], .button) {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--asset-accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.blog-asset :where(button:hover, [role="button"]:hover, .button:hover) {
  background: var(--primary-dark, hsl(11 80% 44%));
  transform: translateY(-1px);
}

.blog-asset :where(button:active, [role="button"]:active, .button:active) {
  transform: translateY(0);
}

.blog-asset :where(button:disabled, [aria-disabled="true"]) {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.blog-asset :where(.secondary, [data-variant="secondary"], button.secondary) {
  border-color: var(--asset-line);
  background: var(--asset-surface);
  color: var(--asset-ink);
}

.blog-asset :where(.secondary:hover, [data-variant="secondary"]:hover, button.secondary:hover) {
  border-color: var(--asset-accent);
  background: var(--asset-accent-soft);
  color: var(--accent-deep, var(--asset-accent));
}

.blog-asset :where(.reminder-message, .reminder-text, [data-selectable], .selectable-text) {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--asset-line);
  border-radius: 9px;
  background: var(--asset-muted);
  color: var(--asset-ink);
  line-height: 1.6;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.blog-asset :where(.reminder-message, .reminder-text, [data-selectable], .selectable-text):focus,
.blog-asset :where(.reminder-message, .reminder-text, [data-selectable], .selectable-text):focus-visible {
  outline: 2px solid var(--asset-accent);
  outline-offset: 2px;
}

.blog-asset :where([role="status"], output, .live-status, .status) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--accent-soft-border, var(--asset-line));
  border-radius: 999px;
  background: var(--asset-accent-soft);
  color: var(--accent-deep, var(--asset-accent));
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.blog-asset :where([role="status"], output, .live-status, .status)::before {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.blog-asset :where(.is-complete, [data-state="complete"], [aria-checked="true"]) {
  border-color: hsl(142 45% 67%);
  background: hsl(142 45% 96%);
}

.blog-asset :where(.is-complete, [data-state="complete"]) :where(label, .task-label) {
  color: var(--asset-subtle);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.blog-asset :where(:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible) {
  outline: 2px solid var(--asset-accent);
  outline-offset: 3px;
}

.blog-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border, hsl(47 21% 87%));
  border-radius: 10px;
  background: var(--bg-elev, hsl(0 0% 100%));
  -webkit-overflow-scrolling: touch;
}
.article-container, .article-body, .main-content {
  min-width: 0;
}
.blog-asset fieldset { min-inline-size: 0; min-width: 0; }
.blog-asset textarea { max-width: 100%; }
.blog-asset .print-url { overflow-wrap: anywhere; }

.blog-table-wrap table {
  min-width: 640px;
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.blog-table-wrap th,
.blog-table-wrap td {
  border: 0;
  border-bottom: 1px solid var(--border, hsl(47 21% 87%));
  border-right: 1px solid var(--border, hsl(47 21% 87%));
  vertical-align: top;
}

.blog-table-wrap tr:last-child > * {
  border-bottom: 0;
}

.blog-table-wrap tr > *:last-child {
  border-right: 0;
}

.blog-table-wrap th {
  color: var(--text, hsl(220 17% 7%));
  white-space: nowrap;
}

#gtg-analytics-choice {
  position: static;
  inset: auto;
  z-index: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border, hsl(47 21% 87%));
  border-left: 3px solid var(--primary, hsl(11 81% 53%));
  border-radius: 10px;
  background: var(--bg-secondary, hsl(51 21% 94%));
  color: var(--text, hsl(220 17% 7%));
  box-shadow: none;
}

#gtg-analytics-settings {
  position: static;
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  text-decoration: underline;
  cursor: pointer;
  color: var(--text, inherit);
  background: transparent;
  border: 0;
}

#gtg-analytics-choice :where(h2, h3, p, .choice-copy) {
  margin: 0;
}

#gtg-analytics-choice :where(h2, h3) {
  flex: 1 1 100%;
  color: var(--ink, var(--text, hsl(220 17% 7%)));
  font-size: 1rem;
  line-height: 1.35;
}

#gtg-analytics-choice :where(p, .choice-copy) {
  flex: 1 1 15rem;
  color: var(--text-secondary, hsl(217 7% 38%));
  font-size: 0.9rem;
  line-height: 1.55;
}

#gtg-analytics-choice :where(button, [role="button"], .review-control) {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border, hsl(47 21% 87%));
  border-radius: 999px;
  background: var(--bg-elev, hsl(0 0% 100%));
  color: var(--text, hsl(220 17% 7%));
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#gtg-analytics-choice :where(button:hover, [role="button"]:hover, .review-control:hover) {
  border-color: var(--primary, hsl(11 81% 53%));
  background: var(--accent-soft, hsl(13 100% 96%));
  color: var(--accent-deep, hsl(11 80% 44%));
}

#gtg-analytics-choice :where(button[data-choice="accept"], button.primary, .primary) {
  border-color: var(--primary, hsl(11 81% 53%));
  background: var(--primary, hsl(11 81% 53%));
  color: var(--primary-foreground, #fff);
}

#gtg-analytics-choice :where(button[data-choice="accept"]:hover, button.primary:hover, .primary:hover) {
  background: var(--primary-dark, hsl(11 80% 44%));
  color: #fff;
}

#gtg-analytics-choice :where(a, .review-control) {
  color: var(--article-link, var(--primary, hsl(11 81% 53%)));
  text-underline-offset: 3px;
}

#gtg-analytics-choice :where(:focus-visible) {
  outline: 2px solid var(--primary, hsl(11 81% 53%));
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .blog-asset {
    margin: 1.25rem 0;
    padding: 1rem;
  }

  .blog-asset fieldset {
    padding: 0.8rem;
  }

  .blog-asset :where(button, [role="button"], .button) {
    max-width: 100%;
    white-space: normal;
  }

  #gtg-analytics-choice {
    align-items: stretch;
    padding: 0.9rem;
  }

  #gtg-analytics-choice :where(button, [role="button"], .review-control) {
    flex: 1 1 100%;
  }
}

@media print {
  body.blog-printing > :not(main),
  body.blog-printing .article-container > :not(.article-body),
  body.blog-printing .article-body > :not(#birthday-print-checklist) {
    display: none !important;
  }
  body.blog-printing .article-body {
    margin: 0 !important;
    padding: 0 !important;
  }
  body.blog-printing .task input + span::before { content: "[ ] "; }
  body.blog-printing .task input:checked + span::before { content: "[x] "; }
  body.blog-printing {
    color: #111;
    background: #fff;
  }

  body.blog-printing :where(body > *, body > * *) {
    visibility: hidden !important;
  }

  body.blog-printing #birthday-print-checklist,
  body.blog-printing #birthday-print-checklist * {
    visibility: visible !important;
  }

  body.blog-printing #birthday-print-checklist {
    position: static !important;
    inset: 0 auto auto 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    font-size: 11pt;
  }

  body.blog-printing #birthday-print-checklist :where(h1, h2, h3, h4) {
    color: #111 !important;
    break-after: avoid;
  }

  body.blog-printing #birthday-print-checklist :where(button, input, select, textarea, [data-no-print], .no-print) {
    display: none !important;
  }

  body.blog-printing #birthday-print-checklist :where(a[href^="http"]) {
    color: #111 !important;
    text-decoration: none !important;
  }

  body.blog-printing #birthday-print-checklist :where(a[href^="http"])::after {
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
    font-size: 9pt;
  }

  body.blog-printing #birthday-print-checklist :where(fieldset, .task, li, [data-task]) {
    break-inside: avoid;
  }

  body.blog-printing #birthday-print-checklist :where(fieldset) {
    border-color: #aaa !important;
    background: transparent !important;
  }

  body.blog-printing #birthday-print-checklist :where(.blog-asset, .blog-table-wrap) {
    border-color: #aaa !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}
