/*
 * FormVault Frontend Styles
 * All custom properties reference tokens.css which is enqueued first.
 * ────────────────────────────────────────────────────────────────────────────
 */

/* ── Page wrap ───────────────────────────────────────────────────────────── */
.fv-single-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--fv-sp-6, 24px) var(--fv-sp-4, 16px) var(--fv-sp-16, 64px);
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.fv-breadcrumb {
  margin-bottom: var(--fv-sp-5, 20px);
}

.fv-breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #64748b !important;
}

.fv-breadcrumb__list a {
  color: var(--fv-primary, #2563eb);
  text-decoration: none;
}

.fv-breadcrumb__list a:hover {
  text-decoration: underline;
}

.fv-breadcrumb__sep {
  color: #cbd5e1 !important;
  user-select: none;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.fv-hero {
  display: flex;
  gap: var(--fv-sp-8, 32px);
  align-items: flex-start;
  margin-bottom: var(--fv-sp-10, 40px);
}

.fv-hero__thumb {
  flex-shrink: 0;
  width: 180px;
}

.fv-hero__img {
  width: 100%;
  height: auto;
  border-radius: var(--fv-radius-lg, 16px);
  border: 1px solid var(--fv-ink-100, #f1f5f9);
  box-shadow: var(--fv-shadow-md, 0 4px 12px rgba(15,23,42,0.08));
  display: block;
}

.fv-hero__body {
  flex: 1;
  min-width: 0;
}

.fv-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--fv-radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--fv-sp-2, 8px);
}

.fv-badge--featured {
  background: #fef9c3;
  color: #a16207;
}

.fv-hero__title {
  margin: 0 0 var(--fv-sp-3, 12px);
  font-family: var(--fv-font-heading, inherit);
  font-size: var(--fv-text-3xl, 30px);
  font-weight: 700;
  color: #0f172a !important;
  line-height: 1.25;
}

.fv-hero__desc {
  margin: 0 0 var(--fv-sp-4, 16px);
  font-size: var(--fv-text-base, 16px);
  color: #475569 !important;
  line-height: 1.6;
}

.fv-hero__formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--fv-sp-4, 16px);
}

/* ── Stats ───────────────────────────────────────────────────────────────── */
.fv-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fv-sp-4, 16px);
  margin-bottom: var(--fv-sp-5, 20px);
  font-size: 13px;
  color: #64748b !important;
}

.fv-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fv-stat__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.fv-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--fv-radius-md, 10px);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  user-select: none;
}

.fv-btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Like */
.fv-btn--like {
  background: #f8fafc !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

.fv-btn--like:hover:not(:disabled) {
  border-color: #fca5a5;
  color: #dc2626;
}

.fv-btn--like.is-liked {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.fv-btn--like:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Share */
.fv-btn--share {
  background: #f8fafc !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

.fv-btn--share:hover {
  border-color: var(--fv-primary, #2563eb);
  color: var(--fv-primary, #2563eb);
}

/* Download */
.fv-btn--download {
  background: var(--fv-primary, #2563eb);
  color: #fff;
  border-color: var(--fv-primary, #2563eb);
}

.fv-btn--download:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* Primary / large (bundle CTA) */
.fv-btn--primary {
  background: var(--fv-primary, #2563eb);
  color: #fff;
  border-color: var(--fv-primary, #2563eb);
}

.fv-btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.fv-btn--lg {
  padding: 13px 28px;
  font-size: 15px;
  border-radius: var(--fv-radius-lg, 16px);
}

/* ── Share toast ─────────────────────────────────────────────────────────── */
.fv-share-toast {
  display: inline-block;
  margin-left: 10px;
  padding: 5px 12px;
  background: var(--fv-ink-800, #1e293b);
  color: #fff;
  font-size: 13px;
  border-radius: var(--fv-radius-md, 10px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.fv-share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Download section ────────────────────────────────────────────────────── */
.fv-downloads {
  margin-bottom: var(--fv-sp-10, 40px);
}

.fv-section-title {
  font-size: var(--fv-text-xl, 20px);
  font-weight: 700;
  color: #0f172a !important;
  margin: 0 0 var(--fv-sp-4, 16px);
  padding-bottom: var(--fv-sp-3, 12px);
  border-bottom: 2px solid #e2e8f0 !important;
}

.fv-downloads__empty {
  color: #94a3b8 !important;
  font-size: 15px;
}

.fv-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fv-file-item {
  display: flex;
  align-items: center;
  gap: var(--fv-sp-4, 16px);
  padding: var(--fv-sp-4, 16px);
  background: #fff;
  border: 1px solid var(--fv-ink-100, #f1f5f9);
  border-radius: var(--fv-radius-lg, 16px);
  box-shadow: var(--fv-shadow-xs, 0 1px 2px rgba(15,23,42,0.04));
}

.fv-file-item__thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--fv-radius-sm, 6px);
  flex-shrink: 0;
  border: 1px solid var(--fv-ink-100, #f1f5f9);
}

.fv-file-item__thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  border-radius: var(--fv-radius-sm, 6px);
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
}

.fv-file-item__meta {
  flex: 1;
  min-width: 0;
}

.fv-file-item__label {
  display: block;
  font-weight: 600;
  color: #0f172a !important;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fv-file-item__details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #64748b !important;
}

.fv-file-item__size,
.fv-file-item__version {
  color: #94a3b8 !important;
}

.fv-file-item__action {
  flex-shrink: 0;
}

.fv-file-item__locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8 !important;
  font-size: 13px;
  font-weight: 600;
}

.fv-lock-icon {
  width: 16px;
  height: 16px;
}

/* ── Bundle card ─────────────────────────────────────────────────────────── */
.fv-bundle-card {
  margin-bottom: var(--fv-sp-10, 40px);
  padding: var(--fv-sp-8, 32px);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fcd34d;
  border-radius: var(--fv-radius-xl, 24px);
  text-align: center;
}

.fv-bundle-card__icon {
  margin: 0 auto var(--fv-sp-4, 16px);
  width: 56px;
  height: 56px;
  color: #d97706;
}

.fv-bundle-card__icon svg {
  width: 100%;
  height: 100%;
}

.fv-bundle-card__title {
  margin: 0 0 var(--fv-sp-3, 12px);
  font-size: var(--fv-text-2xl, 24px);
  font-weight: 700;
  color: #92400e;
}

.fv-bundle-card__desc {
  margin: 0 0 var(--fv-sp-5, 20px);
  font-size: 15px;
  color: #78350f;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.fv-bundle-card__note {
  margin: var(--fv-sp-3, 12px) 0 0;
  font-size: 12px;
  color: #b45309;
}

/* ── Post content ────────────────────────────────────────────────────────── */
.fv-content {
  font-size: 15px;
  line-height: 1.7;
  color: #334155 !important;
}

.fv-content p,
.fv-content li,
.fv-content h1,
.fv-content h2,
.fv-content h3,
.fv-content h4,
.fv-content td,
.fv-content th,
.fv-content blockquote {
  color: #334155 !important;
}

/* ── File-type chips (mirrored from admin.css for frontend) ──────────────── */
.fv-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--fv-radius-full, 9999px);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

.fv-chip--pdf  { background: #fee2e2; color: #b91c1c; }
.fv-chip--doc  { background: #dbeafe; color: #1d4ed8; }
.fv-chip--docx { background: #dbeafe; color: #1d4ed8; }
.fv-chip--xls  { background: #dcfce7; color: #15803d; }
.fv-chip--xlsx { background: #dcfce7; color: #15803d; }
.fv-chip--ppt  { background: #ffedd5; color: #c2410c; }
.fv-chip--pptx { background: #ffedd5; color: #c2410c; }
.fv-chip--zip  { background: #f1f5f9; color: #475569; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .fv-hero {
    flex-direction: column;
  }

  .fv-hero__thumb {
    width: 120px;
  }

  .fv-hero__title {
    font-size: var(--fv-text-2xl, 24px);
  }

  .fv-file-item {
    flex-wrap: wrap;
  }

  .fv-file-item__action {
    width: 100%;
  }

  .fv-btn--download {
    width: 100%;
    justify-content: center;
  }

  .fv-bundle-card {
    padding: var(--fv-sp-5, 20px) var(--fv-sp-4, 16px);
  }
}

