/* === Global Reset === */
*, *::before, *::after { box-sizing: border-box; }

/* ===================================================
   Public Page Common Styles
   Shared styles for all public-facing pages.
   Ported from design_preview/components/public-common.css
   =================================================== */

/* --- Semantic Color Variables --- */
:root {
  --youtube-red: #ff0000;
  --medal-gold: #ffd700;
  --medal-gold-dim: #f0c800;
  --medal-gold-shadow: rgba(255, 215, 0, 0.3);
  --medal-gold-text: #5a3e00;
  --medal-silver: #c0c0c0;
  --medal-silver-dim: #e8e8e8;
  --medal-silver-text: #444;
  --medal-bronze: #cd7f32;
  --medal-bronze-dim: #e8a060;
  --trophy-gold: #ffb700;
  --trophy-silver: #d0d0d0;
  --trophy-bronze: #b8722c;
  --success-green: #22c55e;
  --badge-popular-bg: rgba(255, 59, 48, 0.12);
  --badge-popular-fg: #e53e3e;
  --badge-beginner-bg: rgba(72, 187, 120, 0.12);
  --badge-beginner-fg: #38a169;
  --badge-expert-bg: rgba(159, 122, 234, 0.12);
  --badge-expert-fg: #805ad5;
}

/* --- Breadcrumb --- */
.pub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.pub-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px 2px;
}

.pub-breadcrumb a:hover {
  color: var(--accent);
}

.pub-breadcrumb .breadcrumb-sep {
  font-size: 0.6rem;
  opacity: 0.5;
}

.pub-breadcrumb .breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Section Header (border-left accent) --- */
.pub-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
}

.pub-section-header i {
  color: var(--accent);
  font-size: 1.1rem;
}

.pub-section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.pub-section-header .section-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Ad Slot --- */
.pub-ad {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  position: relative;
}

.pub-ad::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: var(--border-color);
  opacity: 0.4;
}

.pub-ad-label {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
}

.pub-ad-space {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1.5rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--card-radius);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  min-height: 90px;
  opacity: 0.6;
}

.pub-ad-space i {
  font-size: 1.25rem;
  opacity: 0.5;
}

.pub-ad-space-sm {
  min-height: 80px;
}

/* --- Share Section --- */
.pub-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  margin-bottom: 1.5rem;
}

.pub-share-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pub-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
}

.pub-share-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}

.pub-share-url {
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--body-bg);
  color: var(--text-muted);
  font-family: monospace;
}

/* --- Guest CTA --- */
.pub-guest-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg,
    rgba(var(--accent-rgb), 0.08) 0%,
    rgba(var(--accent-rgb), 0.02) 100%
  );
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--card-radius);
  margin-bottom: 1.5rem;
}

.pub-guest-cta-icon {
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.pub-guest-cta-body {
  flex: 1;
  min-width: 0;
}

.pub-guest-cta-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.pub-guest-cta-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pub-guest-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.pub-guest-cta-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

/* --- Visually Hidden (Accessibility) --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .pub-ad {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-top: 1rem;
  }

  .pub-ad-space {
    min-height: 50px;
    padding: 1rem;
    font-size: 0.7rem;
  }

  .pub-share {
    flex-wrap: wrap;
  }

  .pub-share-btn {
    width: 44px;
    height: 44px;
  }

  .pub-guest-cta {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .pub-guest-cta-btn {
    width: 100%;
    justify-content: center;
  }
}
