/* Program Festival: Workshop Schedule Table Block Styles */
@import "../shared/venue-map-button.css";

.htc-schedule-block {
  width: 100%;
  margin: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.htc-schedule-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header Styles */
.htc-schedule__header {
  text-align: center;
  margin-bottom: 2rem;
}

.htc-schedule__title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.htc-schedule__subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

/* Responsive Table Container */
.htc-schedule-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.htc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Table Header */
.htc-table__header {
  background-color: #f8fafc;
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.htc-table__header--workshop {
  width: 25%;
  min-width: 180px;
}

.htc-table__header--description {
  width: 55%;
  min-width: 300px;
}

.htc-table__header--period {
  width: 20%;
  min-width: 150px;
}

/* Table Body */
.htc-table__row {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.htc-table__row:hover {
  background-color: #f8fafc;
}

.htc-table__row:last-child {
  border-bottom: none;
}

.htc-table__cell {
  padding: 1.25rem 0.75rem;
  vertical-align: top;
}

.htc-table__cell--workshop {
  font-weight: 500;
}

.htc-table__cell--description p {
  margin: 0 0 0.75rem 0;
  color: #4b5563;
  line-height: 1.6;
}

.htc-table__cell--description p:last-child {
  margin-bottom: 0;
}

/* Workshop Title */
.htc-workshop__title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
}

/* Period and Location */
.htc-period {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.htc-period__date {
  font-weight: 600;
  color: #059669;
  font-size: 0.875rem;
}

.htc-period__location {
  font-style: normal;
  color: #6b7280;
  font-size: 0.813rem;
  font-weight: 500;
}

/* Mobile: convert rows to labeled cards; keep 3-viewport policy */
@media (max-width: 575.98px) {
  .htc-schedule__title { font-size: 1.5rem; }
  .htc-schedule__subtitle { font-size: 1rem; }

  /* Remove table chrome and switch to list of cards */
  .htc-schedule-table { background: transparent; border: 0; box-shadow: none; padding: 0; }
  .htc-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; }
  .htc-table thead { display: none; }

  .htc-table__row { display: grid; gap: 0.75rem; padding: 1rem; margin: 0 0 1rem 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

  /* Each cell becomes a stacked label above content for consistent left alignment */
  .htc-table__cell { padding: 0; display: grid; grid-template-columns: 1fr; gap: 0.375rem; align-items: start; }
  .htc-table__cell::before { content: attr(data-label); font-weight: 600; color: #475569; font-size: 0.875rem; line-height: 1.2; }

  /* Provide labels via CSS for each column without HTML changes */
  .htc-table__cell--workshop { grid-template-columns: 1fr; }

  /* Localized labels */
  .htc-schedule-block[data-htc-lang="en"] .htc-table__cell--workshop::before { content: "Workshop Type"; }
  .htc-schedule-block[data-htc-lang="en"] .htc-table__cell--description::before { content: "Description"; }
  .htc-schedule-block[data-htc-lang="en"] .htc-table__cell--period::before { content: "Period & Location"; }

  .htc-schedule-block:not([data-htc-lang="en"]) .htc-table__cell--workshop::before { content: "Tip Atelier"; }
  .htc-schedule-block:not([data-htc-lang="en"]) .htc-table__cell--description::before { content: "Descriere"; }
  .htc-schedule-block:not([data-htc-lang="en"]) .htc-table__cell--period::before { content: "Perioadă & Locație"; }

  .htc-workshop__title { margin: 0; font-size: 1rem; }
  .htc-table__cell--description p { margin: 0; }
  .htc-period { align-items: start; }
}

/* Tablet: reflow each row into a 2-column card with period pinned right */
@media (min-width: 576px) and (max-width: 1023.98px) {
  .htc-schedule-table { background: transparent; border: 0; box-shadow: none; }
  .htc-table thead { /* keep accessible but hide visually */ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); white-space: nowrap; }

  .htc-table__row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "workshop period" "description description"; gap: 0.75rem 1rem; align-items: start; padding: 1rem; margin: 0 0 1rem 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

  .htc-table__cell { padding: 0; }
  .htc-table__cell--workshop { grid-area: workshop; }
  .htc-table__cell--description { grid-area: description; }
  .htc-table__cell--period { grid-area: period; text-align: right; }

  .htc-workshop__title { margin: 0; font-size: 1.063rem; }
  .htc-table__cell--description p { margin: 0; }
}

/* Note: mobile+tablet reflow uses 3 viewports only; desktop uses native table */

/* Data attributes for filtering */
.htc-table__row[data-htc-month="iulie"] .htc-period__date::before {
  content: "🌱 ";
}

.htc-table__row[data-htc-month="septembrie"] .htc-period__date::before {
  content: "🔬 ";
}

.htc-table__row[data-htc-month="octombrie"] .htc-period__date::before {
  content: "📊 ";
}
