/**
 * @file
 * Mobile Card View styling for Majors, Degrees and Programs
 * Responsive design to show cards on mobile and table on desktop
 */

/* ==========================================================================
   Mobile Card View for Majors, Degrees and Programs
   ========================================================================== */

/* Mobile Cards Wrapper */
.majors-degrees-cards-wrapper {
  padding: 0;
  margin: 0;
}

/* Individual Program Card */
.program-card {
  margin-bottom: 1rem;
}

.program-card .card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  background-color: #ffffff;
}

.program-card .card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.program-card .card-body {
  padding: 1.25rem;
}

/* Card Field Styling */
.program-card .card-field {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.program-card .card-field:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Field Labels */
.program-card .field-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: #113d34;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: block;
}

/* Field Content */
.program-card .field-content {
  font-size: 1rem;
  color: #212529;
  line-height: 1.6;
}

/* Link Styling in Card Fields */
.program-card .field-content a {
  color: #113d34;
  text-decoration: underline;
  word-break: break-word;
  transition: color 0.2s ease;
}

.program-card .field-content a:hover,
.program-card .field-content a:focus {
  color: #0d2f28;
  text-decoration: none;
}

/* Focus state for accessibility */
.program-card .field-content a:focus {
  outline: 3px solid #0d5c2e;
  outline-offset: 2px;
}

/* Button Field in Cards */
.program-card .views-field-field-majors-degree-button {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.program-card .views-field-field-majors-degree-button .field-label {
  margin-bottom: 0.75rem;
}

.program-card .views-field-field-majors-degree-button .field-content {
  margin-top: 0;
}

/* Empty field content */
.program-card .field-content:empty::after {
  content: "N/A";
  color: #6c757d;
  font-style: italic;
}

/* First field in card (usually title) */
.program-card .card-field:first-child .field-label {
  color: #113d34;
  font-size: 1rem;
}

.program-card .card-field:first-child .field-content {
  font-size: 1.125rem;
  font-weight: 600;
  color: #113d34;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 576px) {
  .program-card .card-body {
    padding: 1rem;
  }

  .program-card .field-label {
    font-size: 0.8125rem;
  }

  .program-card .field-content {
    font-size: 0.9375rem;
  }

  .program-card .card-field:first-child .field-content {
    font-size: 1.0625rem;
  }

  .program-card .card-field {
    margin-bottom: 0.875rem;
    padding-bottom: 0.875rem;
  }
}

/* Touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  .program-card .field-content a {
    padding: 0.25rem 0;
    display: inline-block;
  }
}

/* Loading state */
.majors-degrees-cards-wrapper.is-loading .program-card {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation for cards appearing */
@media (prefers-reduced-motion: no-preference) {
  .program-card {
    animation: fadeInUp 0.3s ease-out;
  }

  .program-card:nth-child(n+2) {
    animation-delay: 0.05s;
  }

  .program-card:nth-child(n+3) {
    animation-delay: 0.1s;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .program-card .card {
    border-width: 2px;
  }

  .program-card .field-label {
    font-weight: 800;
  }
}
