/* ============================================================
   Darimpo Events — Page-specific styles
   Mobile-first. All colors/spacing from var(--*) in base.css.
   ============================================================ */

/* ---------- Skip-link (a11y baseline even without full a11y package) ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-md);
  top: -100px;
  background: var(--primary);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-md); }

/* ---------- Responsive media (defensive — prevents future event images from overflowing) ---------- */
img, video {
  max-width: 100%;
  height: auto;
}

/* ---------- Layout ---------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

@media (min-width: 760px) {
  main { padding: var(--space-xl) var(--space-lg); }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: var(--space-lg) 0 var(--space-xl);
}

.hero h1 {
  color: var(--text);
  margin-bottom: var(--space-md);
  font-size: 1.8rem;
  line-height: 1.25;
}

.hero p {
  font-size: var(--font-size-md);
  max-width: 640px;
  margin: 0 auto var(--space-lg);
  color: var(--muted);
}

@media (min-width: 760px) {
  .hero { padding: var(--space-xl) 0; }
  .hero h1 { font-size: 2.4rem; }
}

/* ---------- Search input ---------- */
.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding-inline-end: 48px;
  font-size: var(--font-size-md);
  height: 48px;
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.search-icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.1rem;
  opacity: 0.6;
}

/* ---------- Stats row ---------- */
.stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--muted);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

@media (min-width: 760px) {
  .stats-row { gap: var(--space-xl); padding: var(--space-lg) var(--space-xl); }
  .stat-item { min-width: 100px; }
  .stat-num { font-size: 2rem; }
}

/* ---------- Filter tabs (extends .tabs from base.css) ---------- */
.filter-tabs {
  margin-bottom: var(--space-lg);
  /* horizontal scroll on tiny mobile if needed (already in .tabs from base) */
}

.filter-tabs .tab {
  cursor: pointer;
  min-height: 44px; /* tap target */
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--muted);
}

/* ---------- Cards grid ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 760px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Event card ---------- */
.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.event-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.event-card[hidden] { display: none; }

/* ---------- Event thumbnail ---------- */
.event-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.event-thumb-icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Gradient placeholder thumbnails (no image dependencies) */
.thumb-gradient-1 {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.thumb-gradient-2 {
  background: linear-gradient(135deg, var(--primary) 0%, #6c63ff 100%);
}
.thumb-gradient-3 {
  background: linear-gradient(135deg, var(--accent) 0%, #f97316 100%);
}
.thumb-gradient-4 {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
}

/* Type badge over thumbnail */
.event-type-badge {
  position: absolute;
  top: var(--space-sm);
  inset-inline-start: var(--space-sm);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.type-webinar { color: var(--primary-dark); }
.type-conference { color: #c2410c; /* darker orange for AA contrast on white */ }

/* ---------- Event body ---------- */
.event-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-xs);
  color: var(--muted);
  margin-bottom: 8px;
}

.event-meta-sep { opacity: 0.6; }

.event-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.35;
}

.event-desc {
  font-size: var(--font-size-sm);
  color: var(--muted);
  margin: 0 0 var(--space-md);
  line-height: 1.55;
  flex: 1;
}

.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  font-size: var(--font-size-xs);
}

.event-speaker {
  color: var(--muted);
  font-weight: 500;
}

.event-cta {
  color: var(--primary);
  font-weight: 700;
}

@media (min-width: 760px) {
  .event-body { padding: var(--space-lg); }
  .event-title { font-size: 1.2rem; }
}

/* ---------- CTA section ---------- */
.cta-section {
  margin-top: var(--space-xl);
}

.cta-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, #eaf5fb 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.cta-icon { font-size: 2.5rem; }
.cta-text h2 { margin: 0 0 8px; }
.cta-text p { color: var(--muted); margin: 0; }
.cta-btn { white-space: nowrap; min-height: 44px; }

@media (min-width: 760px) {
  .cta-card {
    flex-direction: row;
    text-align: start;
    padding: var(--space-xl);
    gap: var(--space-lg);
  }
  .cta-text { flex: 1; }
}

/* ---------- Mobile header polish (override base.css padding) ---------- */
@media (max-width: 759px) {
  header { padding: 0 var(--space-md); }
  .header-sub { font-size: var(--font-size-xs); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   Article page styles (per-event detail pages)
   ============================================================ */

.article-main {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-md);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: 0.5; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.article-header {
  margin-bottom: var(--space-lg);
}

.article-type-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.article-title {
  font-size: 1.8rem;
  margin: 0 0 var(--space-md);
  line-height: 1.25;
}

.article-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.article-meta-list strong {
  color: var(--text);
  font-weight: 600;
}

@media (min-width: 760px) {
  .article-main { padding: var(--space-xl) var(--space-lg); }
  .article-title { font-size: 2.4rem; }
}

/* Video embed wrapper — responsive 16:9 */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.video-wrap iframe,
.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* External-link video placeholder (Zoom Cloud, Drive, etc.) */
.video-external {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: var(--space-lg);
}

.video-external-icon { font-size: 3.5rem; }

.video-external h3 {
  color: #fff;
  margin: 0;
}

.video-external p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 480px;
}

/* Article body content */
.article-body h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article-body h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-size: 1.15rem;
}

.article-body p {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-md);
}

.article-body ul, .article-body ol {
  padding-inline-start: var(--space-lg);
  margin-bottom: var(--space-md);
}

.article-body li {
  margin-bottom: 8px;
  color: var(--text);
}

/* Resources card */
.resources-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
}

.resources-card h3 {
  margin: 0 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.resources-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resources-list li { margin-bottom: 8px; }

.resources-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 0;
  min-height: 44px;
}

.resources-list a:hover { text-decoration: underline; }

/* Back to all events */
.back-to-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-xl);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
}

.back-to-all:hover { text-decoration: underline; }
