/* Home section: Media grids (Images, Videos, Articles) */
.vetpro-home-media-articles {
  background: var(--vp-bg);
  padding: 56px 0;
  border-top: 1px solid #dddddd;
}

.vetpro-home-media-articles-inner {
  width: min(var(--vp-max), calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.media-grid-block {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fdfdfd;
  border: 1px solid #dddddd;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 24px;
  overflow: visible;
}

.media-grid-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
  padding-right: 36px;
}

.media-grid-icon {
  position: absolute;
  right: 16px;
  top: -24px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #b9b883;
  color: white;
}

.media-grid-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.media-grid-header h3 {
  margin: 0;
  color: #3c3c3b;
  font-family: var(--vp-font-heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.media-grid-header p {
  margin: 0;
  color: #878787;
  font-family: var(--vp-font-body);
  font-size: 13px;
  line-height: 1.5;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.media-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid #dddddd;
}

.media-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.media-grid-item:hover img {
  transform: scale(1.05);
}

.media-grid-item.article-item {
  position: relative;
}

.media-grid-item.article-item a {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(57, 57, 57, 0.9);
  color: white;
  text-decoration: none;
  font-family: var(--vp-font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 12px;
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-grid-item.article-item:hover a {
  opacity: 1;
}

.no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

.media-placeholder {
  width: 100%;
  height: 100%;
  background: #eeeeee;
}

.media-placeholder--video {
  background: #e5e5e5;
}

.media-placeholder--article {
  background: #ebebeb;
}

.media-grid-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #3c3c3b;
  text-decoration: none;
  font-family: var(--vp-font-body);
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.media-grid-link:hover {
  color: #b9b883;
}

.media-grid-link .link-arrow {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M15 8H4' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15 8L10.7574 12.2426' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15 8L10.7574 3.75736' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M15 8H4' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15 8L10.7574 12.2426' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15 8L10.7574 3.75736' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .vetpro-home-media-articles-inner {
    width: min(var(--vp-max), calc(100% - 40px));
    gap: 32px;
  }

  .media-grid {
    gap: 10px;
  }

  .media-grid-header h3 {
    font-size: 17px;
  }
}

@media (max-width: 900px) {
  .vetpro-home-media-articles-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .vetpro-home-media-articles {
    padding: 64px 0;
  }

  .vetpro-home-media-articles-inner {
    width: calc(100% - 40px);
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .media-grid-block {
    gap: 16px;
  }

  .media-grid-icon {
    position: absolute;
    right: 16px;
    top: -39px;
    width: 78px;
    height: 78px;
  }

  .media-grid-icon svg {
    width: 40px;
    height: 40px;
  }

  .media-grid-header {
    gap: 10px;
    margin-bottom: 4px;
    padding-right: 96px;
  }

  .media-grid {
    gap: 16px;
  }

  .media-grid-header h3 {
    font-size: 20px;
    line-height: 28px;
  }

  .media-grid-header p {
    font-size: 14px;
    line-height: 21px;
  }

  .media-grid-item {
    aspect-ratio: 1;
  }

  .media-grid-link {
    font-size: 16px;
    line-height: 28.8px;
    text-transform: none;
    letter-spacing: 0;
  }

  .media-grid-link .link-arrow {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 420px) {
  .vetpro-home-media-articles-inner {
    width: calc(100% - 40px);
    gap: 56px;
  }

  .media-grid-block {
    padding: 24px;
  }

  .media-grid-icon {
    right: 16px;
    top: -39px;
  }

  .media-grid {
    gap: 12px;
  }
}
