/* ============================================================
   TAMU Feature Cards
   Usage: wrap cards in .tamu-cards-grid, each card uses .tamu-card
   ============================================================ */

h2, h2 a {
  font-family: var(--oswald);
}

/* Add vertical spacing between rows of cards in all Bootstrap grid views */
.views-view-grid .row > * {
  margin-bottom: 1.5rem !important;
}

/* Grid container — CSS columns masonry */
.tamu-cards-grid {
  columns: 3;
  column-gap: 1.5rem;
  padding: 2rem 0;
}

/* Firefox fix: break-inside doesn't work on display:flex children.
   Wrap each card in a block-level div that takes the column break rules. */
.tamu-cards-grid > div,
.view-id-collection_membership .views-view-grid .row > [class*="col"] {
  break-inside: avoid;
  display: block;
  margin-bottom: 1.5rem;
}

/* Single card */
.tamu-card {
  margin-bottom: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.tamu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  color: inherit;
}

/* Image area */
.tamu-card__image {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--primary-brand-dark);
}

.tamu-card__image img {
  width: 100% !important;
  height: auto !important;
  display: block;
  transition: transform 0.3s ease !important;
}

.tamu-card:hover .tamu-card__image img {
  transform: scale(1.04);
}

/* Maroon accent bar at top of card */
.tamu-card::before {
  content: '';
  display: block !important;
  height: 4px !important;
  background: var(--primary-brand) !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}

/* Body */
.tamu-card__body {
  padding: 1.25rem 1.5rem 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

.tamu-card__title {
  font-family: var(--oswald) !important;
  margin: 0 0 0.5rem !important;
  color: var(--primary-brand-light) !important;
  line-height: 1.2 !important;
  font-weight: 400 !important;
}

.tamu-card__description {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
  font-family: var(--open-sans);
  font-weight: 400;
}

/* Optional "View collection" link at bottom */
.tamu-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-brand);
  text-decoration: none;
  margin-top: auto;
  transition: gap 0.2s ease;
}

.tamu-card__link::after {
  content: '→';
}

.tamu-card:hover .tamu-card__link {
  gap: 0.5rem;
  text-decoration: underline;
}

/* Image placeholder when no image is available */
.tamu-card__image--placeholder {
  background: linear-gradient(135deg, var(--primary-brand) 0%, var(--primary-brand-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tamu-card__image--placeholder::after {
  content: 'A&M';
  font-family: var(--oswald);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

/* Focus states — AUX gold dotted outline on interactive cards */
.tamu-card:focus-visible,
.tamu-card__link:focus-visible {
  outline: dotted var(--gold) 2px;
  outline-offset: 3px;
}

/* Responsive: fewer columns on smaller screens */
@media (max-width: 767px) {
  .tamu-cards-grid {
    columns: 2;
  }
}
@media (max-width: 575px) {
  .tamu-cards-grid {
    columns: 1;
  }
}

/* Invisible full-card link — sits above background, below image/text content */
.tamu-card__cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── Collection membership view — masonry override ─────────────────────── */
/* Override Bootstrap's flex row so CSS columns can take over */
.view-id-collection_membership .views-view-grid .row {
  display: block;
  columns: 4;
  column-gap: 1.5rem;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.view-id-collection_membership .views-view-grid .row > [class*="col"] {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
  .view-id-collection_membership .views-view-grid .row {
    columns: 3;
  }
}

@media (max-width: 767px) {
  .view-id-collection_membership .views-view-grid .row {
    columns: 2;
  }
}

@media (max-width: 575px) {
  .view-id-collection_membership .views-view-grid .row {
    columns: 1;
  }
}

/* ── Clover IIIF Slider / Swiper — Bootstrap conflict fix ──────────────── */
/* Bootstrap's .card and flex resets override Swiper's horizontal layout.  */
.swiper {
  overflow: hidden;
  width: 100%;
}

.swiper-wrapper {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
}

.swiper-slide {
  flex-shrink: 0;
  height: auto;
}

.clover-browse {
  color: var(--primary-brand) !important;
  padding-top: 1rem;
  font-family: var(--oswald);
  font-weight:400;
}

