/* ========================================
   ORGANIZATION CARDS
   ======================================== */

/* ========================================
   HOME PAGE ORGANIZATION SECTION
   ======================================== */
.home-orgs {
  padding: 20px 0 40px;
  overflow: visible;
}

.home-orgs .container {
  overflow: visible;
}

/* ========================================
   ORGANIZATION GRID HEADER
   ======================================== */
.orgs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.orgs-more {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 700;
}

/* ========================================
   GRID LAYOUT FOR HOME PAGE (3 COLUMNS)
   ======================================== */

/* Carousel wrapper */
.org-carousel-wrapper {
  position: relative;
  padding: 10px 0 0 0;
  overflow: visible;
}

.org-carousel {
  overflow: hidden;
  width: 100%;
  padding-top: 5px;
}

.org-grid {
  display: flex;
  gap: 18px;
  transition: transform 0.3s ease;
}

/* Carousel buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--cf-blue-dark);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
}

.carousel-btn-prev {
  left: -50px;
}

.carousel-btn-next {
  right: -50px;
}

.carousel-btn:hover {
  background: var(--cf-primary-main);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-btn:disabled:hover {
  transform: translateY(-50%);
  background: var(--cf-blue-dark);
}

/* ========================================
   ORGANIZATION CARD (HOME PAGE)
   ======================================== */
.org-card {
  display: flex !important;
  width: 357px !important;
  height: 348px;
  padding: 20px;
  margin: 0 !important;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2.5px solid var(--cf-primary-main);
  background: var(--cf-white) !important;
  position: relative !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.org-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 15, 159, 0.15);
}

/* ========================================
   MEDIA VIEW LINK (INVISIBLE OVERLAY)
   ======================================== */
.org-card .media-view {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-decoration: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  z-index: 1;
  opacity: 0;
}

.org-card .media-view span {
  display: none;
}

/* ========================================
   MEDIA CONTENT
   ======================================== */
.org-card .media-content,
.media-item .media-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

/* ========================================
   ORGANIZATION LOGO/IMAGE
   ======================================== */
.org-card .media-image,
.media-item .media-image {
  width: 164px;
  height: 85px;
  object-fit: contain;
  margin: 0 0 0 -7px;
  display: block;
}

/* ========================================
   TEXT CONTENT
   ======================================== */
.org-card .media-text,
.media-item .media-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

/* ========================================
   ORGANIZATION HEADING
   ======================================== */
.org-card .media-heading,
.media-item .media-heading {
  margin: 0;
  color: var(--cf-primary-main);
  font-family: var(--font-roboto);
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 319px;
}

/* ========================================
   ORGANIZATION DESCRIPTION
   ======================================== */
.org-card .media-description,
.media-item .media-description {
  margin: 0;
  width: 319px;
  max-height: 100px;
  color: var(--cf-primary-main);
  font-family: var(--font-roboto);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* ========================================
   ORGANIZATION BADGES (DATASETS, REUSES)
   ======================================== */
.org-card .organization-badges,
.media-item .organization-badges {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.org-card .badge-item,
.media-item .badge-item {
  display: flex;
  padding: 2px 10px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 20px;
  background: var(--cf-primary-main);
  white-space: nowrap;
}

/* ========================================
   BADGE ICONS
   ======================================== */
.org-card .badge-icon,
.media-item .badge-icon {
  flex-shrink: 0;
}

.org-card .badge-datasets .badge-icon,
.media-item .badge-datasets .badge-icon {
  width: 16px;
  height: 16px;
}

.org-card .badge-reuses .badge-icon,
.media-item .badge-reuses .badge-icon {
  width: 12px;
  height: 16px;
}

/* ========================================
   BADGE LABELS AND COUNTS
   ======================================== */
.org-card .badge-label,
.org-card .badge-count,
.media-item .badge-label,
.media-item .badge-count,
.badge-item .badge-label,
.badge-item .badge-count {
  color: var(--cf-white) !important;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
}

/* ========================================
   ORGANIZATIONS LIST PAGE (MEDIA-GRID)
   ======================================== */
.media-grid {
  display: flex !important;
  width: 1113px;
  align-items: center;
  align-content: center;
  gap: 20px;
  flex-wrap: wrap;
  background: transparent !important;
  border: 0 !important;
  border-top: 0 !important;
  position: relative !important;
  margin-bottom: 90px !important;
  height: auto !important;
}

/* ========================================
   HIDE ITEMS AFTER 12TH
   ======================================== */
.media-grid .media-item:nth-child(n+13) {
  display: none !important;
}

/* ========================================
   MEDIA ITEM (ORGANIZATION LIST PAGE)
   ======================================== */
.media-grid .media-item {
  display: flex !important;
  width: 357px !important;
  height: 348px;
  padding: 20px;
  margin: 0 !important;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2.5px solid var(--cf-primary-main);
  background: var(--cf-white) !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.media-grid .media-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 15, 159, 0.15);
}

.media-grid .media-item[style] {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  transition: none !important;
}

/* ========================================
   MEDIA VIEW LINK FOR LIST PAGE
   ======================================== */
.media-item > a,
.media-item .media-view {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-decoration: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  z-index: 1;
}

.media-item .media-view {
  opacity: 0;
}

.media-item .media-view span {
  display: none;
}

/* ========================================
   HIDE COUNT ELEMENT (LEGACY)
   ======================================== */
.media-item .count {
  display: none;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (max-width: 1200px) {
  .org-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1000px) {
  .org-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .org-grid {
    grid-template-columns: 1fr;
  }
}
