/**
 * @file
 * Workshop Catalog page — /workshops card layout.
 *
 * Matches the event-teaser card aesthetic used on /events:
 *   grey background, solid border, rounded corners, image floated left.
 */

/* ── Page-level overrides ────────────────────────────────────────────────── */

/* The global .block-views rule adds grey bg + border to every view block.
   The workshop cards carry that styling themselves, so remove it from the
   block wrapper to avoid double-boxing. */
.path-workshops .main-content .block-views {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* ── Stack cards vertically, full-width (like event listing) ─────────────── */

.view-id-public-course-catalog .view-content {
  /* No special grid — cards stack, each full width, just like events */
}

.view-id-public-course-catalog .views-row {
  margin-bottom: 22px;
}

/* ── Workshop card shell — mirrors event teaser style ────────────────────── */

.workshop-card {
  display: block;             /* article default */
  background: #eee;
  border: 1px solid grey;
  border-radius: 19px;
  padding: 20px;
  overflow: hidden;           /* keep floats contained */
  transition: box-shadow 0.18s ease;
  margin-bottom: 25px;        /* Increased spacing between cards */
}

.workshop-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

/* ── More Button ────────────────────────────────────────────────────────── */

.workshop-card-more-btn {
  display: inline-block;
  padding: 0.35rem 1.2rem;
  background: #8b1919;
  color: #fff !important;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color 0.15s;
  margin-left: auto; /* Push to the right in flex footer */
}

.workshop-card-more-btn:hover {
  background: #6c1a1a;
  text-decoration: none;
}

/* ── Image column (float left, like event teaser image) ─────────────────── */

.workshop-card-image {
  float: left;
  margin-right: 20px;
  margin-bottom: 12px;
  width: 220px;
  flex-shrink: 0;
}

.workshop-card-image a {
  display: block;
}

/* Constrain the rendered img / field wrapper */
.workshop-card-image img,
.workshop-card-image .field--type-image img {
  width: 220px;
  height: 165px;          /* 4:3 thumbnail */
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

/* Strip default Drupal field margins inside image area */
.workshop-card-image .field,
.workshop-card-image .field__item {
  margin: 0;
  padding: 0;
  line-height: 0;
}

/* Placeholder when no image is available */
.workshop-card-img-placeholder {
  width: 220px;
  height: 165px;
  background: linear-gradient(135deg, #6c1a1a 0%, #a32020 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workshop-card-img-placeholder svg {
  width: 54px;
  height: 54px;
  fill: rgba(255, 255, 255, 0.35);
}

/* ── Text column ────────────────────────────────────────────────────────── */

.workshop-card-body {
  overflow: hidden;   /* new block formatting context — sits beside the float */
}

/* Title */
.workshop-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}

.workshop-card-title a {
  color: #212529;
  text-decoration: none;
}

.workshop-card-title a:hover {
  color: #8b1919;
  text-decoration: underline;
}

/* Tags / instructor expertise */
.workshop-card-tags {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.workshop-card-tags .field__item {
  display: inline-block;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.1em 0.65em;
  font-size: 0.8rem;
  color: #555;
  margin-right: 0.2rem;
  margin-bottom: 0.2rem;
}

/* Description */
.workshop-card-description {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workshop-card-description p {
  margin: 0;
}

/* ── Scheduled instances ────────────────────────────────────────────────── */

.workshop-card-schedule {
  border-top: 1px solid #ccc;
  padding-top: 0.6rem;
  margin-top: 0.5rem;
  clear: none;
}

.workshop-card-schedule-label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.workshop-card-schedule--past .workshop-card-schedule-label {
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
}

.workshop-card-schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.workshop-card-schedule-item a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 20px;
  padding: 0.25em 0.75em;
  font-size: 0.82rem;
  color: #333;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.workshop-card-schedule-item a:hover {
  background: #8b1919;
  border-color: #8b1919;
  color: #fff;
}

.workshop-card-schedule-item.is-full a {
  color: #888;
  border-color: #ccc;
  cursor: default;
  pointer-events: none;
}

/* Date / time labels */
.schedule-date {
  font-weight: 600;
}

.schedule-time {
  color: #666;
  font-size: 0.78rem;
}

.workshop-card-schedule-item.is-full .schedule-time {
  color: #aaa;
}

/* Open / Full badges */
.schedule-badge {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.1em 0.45em;
}

.schedule-badge.open {
  background: #d4edda;
  color: #155724;
}

.schedule-badge.full {
  background: #f8d7da;
  color: #721c24;
}

/* ── Card footer: voting + frequency ────────────────────────────────────── */

.workshop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #ccc;
  padding-top: 0.55rem;
  margin-top: 0.6rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Flag link — override Flag module's default styles */
.workshop-card-vote {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* The rendered flag link uses a <a> with class use-ajax */
.workshop-card-vote a.flag-action,
.workshop-card-vote a[href*="flag"],
.workshop-card-vote .flag a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff;
  border: 1.5px solid #8b1919;
  color: #8b1919;
  border-radius: 20px;
  padding: 0.25em 0.8em;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.workshop-card-vote a.flag-action:hover,
.workshop-card-vote a[href*="flag"]:hover,
.workshop-card-vote .flag a:hover {
  background: #8b1919;
  color: #fff;
}

/* "Following" / active state */
.workshop-card-vote a.flag-action.action-unflag,
.workshop-card-vote .flag a.action-unflag {
  background: #8b1919;
  color: #fff;
  border-color: #8b1919;
}

.workshop-interest-count {
  font-size: 0.78rem;
  color: #666;
  white-space: nowrap;
}

/* Offer-frequency badge */
.workshop-runs-badge {
  display: inline-block;
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 20px;
  padding: 0.15em 0.65em;
  font-size: 0.78rem;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Sort toggle bar ────────────────────────────────────────────────────── */

.workshop-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.workshop-sort-label {
  font-size: 0.85rem;
  color: #666;
  margin-right: 0.25rem;
}

.workshop-sort-btn {
  display: inline-block;
  padding: 0.3em 0.9em;
  border: 1.5px solid #ccc;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #555;
  background: #fff;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.workshop-sort-btn:hover {
  border-color: #8b1919;
  color: #8b1919;
  background: #fff;
}

.workshop-sort-btn.active {
  background: #8b1919;
  border-color: #8b1919;
  color: #fff;
}

/* ── Clearfix so card stretches below floated image ────────────────────── */

.workshop-card::after {
  content: '';
  display: table;
  clear: both;
}

/* ── Pager ──────────────────────────────────────────────────────────────── */

.view-id-public-course-catalog .pager {
  margin-top: 1.5rem;
}

/* ── Responsive: stack image above text on narrow screens ────────────────── */

@media (max-width: 600px) {
  .workshop-card-image {
    float: none;
    margin-right: 0;
    margin-bottom: 12px;
    width: 100%;
  }

  .workshop-card-image img,
  .workshop-card-image .field--type-image img,
  .workshop-card-img-placeholder {
    width: 100%;
    height: 180px;
  }
}

/* ── Course Node (Full Page) Styles ───────────────────────────────────────── */

.node--type-course.node--view-mode-full {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.course-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 1rem;
}

.course-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #212529;
}

.course-tags .field__item {
  display: inline-block;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 0.2rem 0.8rem;
  font-size: 0.9rem;
  margin-right: 0.4rem;
}

.course-frequency-badge-link {
  text-decoration: none !important;
}

.course-frequency-badge-link:hover .course-frequency-badge {
  background: #8b1919;
  color: #fff;
}

.course-frequency-badge {
  display: inline-block;
  background: #e9ecef;
  color: #495057;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
}

.course-main .course-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.course-body {
  font-size: 1.1rem;
  line-height: 1.7;
}

.instructor-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.instructor-list li a {
  display: inline-block;
  background: #fff;
  border: 1px solid #8b1919;
  color: #8b1919;
  padding: 0.4rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.instructor-list li a:hover {
  background: #8b1919;
  color: #fff;
}

/* Sidebar Cards */
.course-sidebar .card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #dee2e6;
}

.course-sidebar .card-title {
  font-weight: 700;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.course-action-card {
  background-color: #fdf2f2;
  border-color: #f5c6cb;
}

.course-notify-area .workshop-auth-prompt {
  font-size: 0.9rem;
  line-height: 1.5;
}

.upcoming-sessions-list .list-group-item {
  border-left: none;
  border-right: none;
  padding: 0.75rem 0;
}

.upcoming-sessions-list .list-group-item:first-child {
  border-top: none;
}

.upcoming-sessions-list .badge {
  font-size: 0.75rem;
  padding: 0.5rem 0.8rem;
}

/* Auth Buttons */
.login-to-notify, .register-to-notify {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #8b1919;
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  margin: 0 0.2rem;
}

.login-to-notify:hover, .register-to-notify:hover {
  background: #6c1a1a;
  text-decoration: none;
}
