/* Card Container */
.listing-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  transition: box-shadow 0.2s ease;
}

.listing-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.listing-card.is-draft {
  border-left: 4px solid #f59e0b;
  background-color: #fffbf2;
}

/* 1. Unpolished Yellow Draft Badge */
.draft-badge {
  display: inline-block;
  background-color: #ffff00; /* Bright yellow */
  color: #000000;            /* Black text */
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid #000000; /* High contrast, unpolished border */
  border-radius: 0;          /* Sharp, unrounded corners */
  margin-bottom: 0.5rem;
}


/* 2. Solid SNIPEF Blue Document Cover */
.card-media.media-portrait-doc {
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.414;   /* Standard A4 paper proportions */
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  background-color: #003865; /* Primary SNIPEF Blue */
}

/* 3. Image Cropping Fix (Prevents cropping portrait & non-standard photos) */
.card-media.media-landscape {
  width: 100%;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc; /* Neutral background behind non-filling ratios */
  border-radius: 4px;
  overflow: hidden;
}

.card-media.media-landscape img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;       /* Fits full portrait or landscape image without clipping */
}
.doc-cover-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  padding: 1rem;
}

.doc-cover-inner {
  text-align: center;
  color: #ffffff;
}

.doc-cover-inner .file-icon {
  width: 42px;
  height: auto;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
  margin-bottom: 0.5rem;
}

.doc-type-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.9;
}

/* SNIPEF Primary Button Style */
.button.btn-snipef,
a.read-more {
  display: inline-block;
  background-color: #003865; /* SNIPEF Primary Navy */
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Hover & Focus States */
.button.btn-snipef:hover,
.button.btn-snipef:focus,
a.read-more:hover,
a.read-more:focus {
  background-color: #00a859; /* SNIPEF Green Hover */
  color: #ffffff !important;
  text-decoration: none;
}

/* Date & Meta Line Wrapper */
.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.meta-line .date {
  margin-bottom: 0;
  color: #64748b;
  font-size: 0.875rem;
}

/* Little Blue Subcategory Badge */
.subcat-badge {
  display: inline-block;
  background-color: #0077c8; /* SNIPEF Accent Blue */
  color: #ffffff !important;
  font-size: 0.725rem;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.subcat-badge:hover {
  background-color: #003865; /* Darkens to SNIPEF Navy on hover */
  color: #ffffff !important;
  text-decoration: none;
}

/* Card Actions Flex Wrapper */
.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0.75rem;
}

/* Admin Edit Link (Mirrors Draft Badge Style) */
.admin-edit-link {
  display: inline-block;
  background-color: #ffff00; /* Bright yellow */
  color: #000000 !important;  /* Black text */
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 8px 10px;          /* Sized to align visually with the Read More button */
  border: 1px solid #000000;  /* High contrast, unpolished border */
  border-radius: 0;           /* Sharp, unrounded corners */
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-edit-link:hover,
.admin-edit-link:focus {
  background-color: #000000;
  color: #ffff00 !important;   /* Inverts on hover for clear feedback */
  text-decoration: none;
}