/**
 * Tiny Color Book - Single Coloring Page Styles
 * Modern studio layout, instant PDF controls, sheet packs, and print mode.
 */

.single-coloring-page {
  padding: 2rem 0 5rem;
}

/* Detail Hero Layout */
.single-sheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 4vw, 3.75rem);
  align-items: start;
  margin-bottom: 3.75rem;
}

/* Art Stage / Preview Card */
.single-art-stage {
  position: sticky;
  top: 88px;
  text-align: center;
}
.single-art-canvas {
  background:
    radial-gradient(rgba(96, 64, 168, 0.16) 1.1px, transparent 1.1px) 0 0 / 16px 16px,
    linear-gradient(155deg, #F7F2FD 0%, #ECE3FA 100%);
  border: 1px solid rgba(96, 64, 168, 0.14);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.15rem) clamp(1.25rem, 2.5vw, 1.85rem) clamp(1.25rem, 2.5vw, 1.85rem);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(41, 30, 58, 0.05), var(--shadow-sm);
}
.single-art-paper {
  position: relative;
  margin: 0;
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 210 / 297;
  background: var(--white);
  border: 1px solid rgba(41, 30, 58, 0.07);
  border-radius: 4px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -6px rgba(41, 30, 58, 0.16), 0 4px 10px -2px rgba(41, 30, 58, 0.08);
}
.single-art-paper::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 74px;
  height: 22px;
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, rgba(254, 241, 206, 0.92) 0%, rgba(248, 224, 162, 0.84) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(183, 112, 18, 0.15);
  box-shadow: 0 2px 5px rgba(41, 30, 58, 0.14);
  pointer-events: none;
  z-index: 2;
}
.single-art-paper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-touch-callout: none;
}
.single-art-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sheet-meta-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-600);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

/* Single Copy & Info */
.single-sheet-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.single-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.9rem;
}
.single-category-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(96, 64, 168, 0.16);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}
.single-category-pill:hover {
  background: var(--primary);
  color: var(--white);
}
.single-level-badge {
  position: static;
  padding: 0.35rem 0.85rem;
  box-shadow: none;
}
.single-sheet-title {
  overflow-wrap: anywhere;
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.15;
  margin-bottom: 0.85rem;
  letter-spacing: -0.025em;
}
.single-sheet-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.single-sheet-meta a {
  font-weight: 600;
  color: var(--primary);
}
.single-sheet-meta a:hover {
  text-decoration: underline;
}
.single-sheet-meta .meta-sep {
  color: var(--slate-300);
}

.single-sheet-lead {
  font-size: 1.03rem;
  color: var(--slate-600);
  line-height: 1.75;
  margin-bottom: 1.75rem;
}
.single-sheet-lead p:last-child { margin-bottom: 0; }

/* Action Download & Print Buttons */
.single-actions-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.single-buttons-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.btn-primary-download {
  flex: 1 1 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(96, 64, 168, 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary-download:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(96, 64, 168, 0.36);
  color: var(--white);
}
.btn-primary-download:disabled {
  opacity: 0.82;
  cursor: wait;
}
.btn-primary-download[aria-busy="true"] svg,
.sheet-pack-all[aria-busy="true"]::before {
  animation: tcbSpin 0.8s linear infinite;
}
@keyframes tcbSpin {
  to { transform: rotate(360deg); }
}

.btn-secondary-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  background: var(--slate-50);
  color: var(--slate-800);
  border: 1px solid var(--slate-300);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.btn-secondary-print:hover {
  background: var(--slate-100);
  border-color: var(--primary);
  color: var(--primary);
}
.single-actions-note {
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-top: 0.85rem;
}

/* PDF Status Reporter & Progress Bar */
[data-pdf-status] {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}
[data-pdf-status]:empty {
  display: none;
}
[data-pdf-status][data-pdf-state="done"] {
  color: var(--emerald);
}
[data-pdf-status][data-pdf-state="failed"] {
  color: var(--coral);
}
.pdf-bar {
  display: block;
  width: 100%;
  height: 6px;
  background: var(--slate-100);
  border-radius: var(--radius-full);
  margin-top: 0.45rem;
  overflow: hidden;
}
.pdf-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* Color Palette Inspiration Box */
.palette-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.35rem;
  margin-bottom: 1.5rem;
}
.palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}
.palette-title {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-900);
}
.palette-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slate-500);
}
.palette-swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}
.swatch-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s var(--ease);
}
.swatch-item:hover .swatch-circle {
  transform: scale(1.12);
}
.swatch-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--slate-600);
  line-height: 1.2;
}

/* Specs Grid */
.sheet-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.spec-item {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
}
.spec-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
  margin-bottom: 0.2rem;
  display: block;
}
.spec-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.4;
}

/* Multi-Sheet Pack & Inline Sheet Blocks */
.sheet-pack {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}
.sheet-pack-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--slate-100);
}
.sheet-pack-intro h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  margin-bottom: 0.35rem;
}
.sheet-pack-intro p {
  font-size: 0.9375rem;
  color: var(--slate-600);
}
.sheet-pack-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.sheet-pack-all:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.sheet-pack-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.sheet-pack-item {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.sheet-pack-art {
  aspect-ratio: 4 / 5;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}
.sheet-pack-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.sheet-pack-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.sheet-pack-note {
  font-size: 0.8125rem;
  color: var(--slate-600);
  margin-bottom: 0.65rem;
}
.sheet-download {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}
.sheet-download .text-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sheet-download .sheet-original {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-500);
}

.sheet-inline {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 1.75rem 0;
}
.sheet-inline.is-full {
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
  justify-items: center;
}
.sheet-inline-art {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.65rem;
}
.sheet-inline-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sheet-inline-name {
  font-weight: 700;
  color: var(--slate-900);
  font-size: 1.05rem;
}
.sheet-inline-note-text {
  font-size: 0.875rem;
  color: var(--slate-600);
}
.sheet-faq {
  margin-top: 2.5rem;
}
.sheet-faq h2 {
  margin-bottom: 1rem;
}
.sheet-faq .faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--slate-600);
  font-size: 0.9375rem;
}

/* Long Form Guide Content */
.single-article-content {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  margin-bottom: 3.5rem;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--slate-700);
  box-shadow: var(--shadow-xs);
}
.single-article-content h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  color: var(--slate-900);
  margin: 0 0 1rem;
}
.single-article-content h3 {
  font-size: clamp(1.12rem, 1.8vw, 1.32rem);
  font-weight: 700;
  color: var(--slate-900);
  margin: 1.65rem 0 0.65rem;
}
.single-article-content p { margin-bottom: 1.15rem; }
.single-article-content ul, .single-article-content ol {
  margin: 0.85rem 0 1.5rem 1.4rem;
}
.single-article-content li { margin-bottom: 0.5rem; }
.author-guide-notes {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--slate-100);
}

/* Related Sheets Section */
.related-sheets-section {
  padding-top: 2.75rem;
  border-top: 1px solid var(--slate-200);
}
.related-title {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .single-sheet-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .single-art-stage {
    position: static;
    max-width: 520px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .single-coloring-page {
    padding: 0.85rem 0 2.75rem;
  }
  .single-sheet-layout {
    margin-bottom: 2rem;
    gap: 1.15rem;
  }
  .single-art-stage {
    padding: 0;
  }
  .single-art-canvas {
    padding: 1.5rem 1.25rem 1.25rem;
    margin-bottom: 0;
    border-radius: 20px;
    aspect-ratio: auto;
    height: clamp(340px, 52vh, 420px);
  }
  .single-art-paper {
    padding: 0.55rem;
    border-radius: 4px;
  }
  .single-art-paper::before {
    top: -9px;
    width: 60px;
    height: 18px;
  }
  .sheet-meta-pill {
    font-size: 0.68rem;
    padding: 0.25rem 0.62rem;
  }
  .single-badge-row {
    margin-bottom: 0.55rem;
  }
  .single-sheet-title {
    font-size: 1.52rem;
    margin-bottom: 0.5rem;
  }
  .single-sheet-meta {
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.95rem;
    font-size: 0.8rem;
  }
  .single-sheet-meta .meta-sep {
    display: none;
  }
  .single-sheet-meta .meta-item {
    background: var(--slate-100);
    border-radius: var(--radius-full);
    padding: 0.2rem 0.62rem;
  }
  .single-sheet-lead {
    font-size: 0.94rem;
    line-height: 1.6;
    margin-bottom: 1.05rem;
  }
  .single-actions-box {
    padding: 0.9rem;
    margin-bottom: 1.15rem;
  }
  .single-buttons-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: stretch;
  }
  .btn-primary-download {
    width: 100%;
    min-width: 0;
    padding: 0.72rem 0.9rem;
    font-size: 0.88rem;
    min-height: 48px;
  }
  .btn-secondary-print {
    padding: 0.72rem 0.95rem;
    font-size: 0.88rem;
    min-height: 48px;
    white-space: nowrap;
  }
  .single-actions-note {
    font-size: 0.75rem;
    margin-top: 0.65rem;
  }
  .palette-swatches {
    gap: 0.35rem;
  }
  .swatch-circle {
    width: 34px;
    height: 34px;
  }
  .sheet-inline {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    justify-items: center;
  }
  .sheet-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .sheet-pack-item {
    padding: 0.75rem;
    border-radius: var(--radius-md);
  }
  .sheet-pack-name {
    font-size: 0.88rem;
  }
}

@media (max-width: 340px) {
  .single-buttons-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .sheet-specs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .swatch-name {
    font-size: 0.625rem;
  }
}

/* Clean Full-Page Print Output */
@media print {
  .site-header,
  .site-footer,
  .nav-backdrop,
  .reading-progress,
  .tcb-breadcrumb,
  .single-art-badges,
  .single-sheet-info,
  .tcb-ad-wrapper,
  .single-article-content,
  .sheet-pack,
  .related-sheets-section {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
  .single-coloring-page,
  .single-sheet-layout,
  .single-art-stage,
  .single-art-canvas,
  .single-art-paper {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    max-width: none !important;
  }
  .single-art-paper::before {
    content: none !important;
    display: none !important;
  }
  .single-art-paper img {
    width: 100% !important;
    max-height: 96vh !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}
