/* BLOCK VIEW (block.html.twig) - Modern Grid Layout */
.mx_news_block_item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  padding-block-end: clamp(1rem, 2vw, 1.5rem);
  margin-block-end: clamp(1rem, 2vw, 1.5rem);
  border-block-end: 1px solid hsl(0 0% 87%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mx_news_block_item:hover {
  transform: translateY(-2px);
}

.mx_news_block_item:last-child {
  border-block-end: none;
}

.mx_news_block_item h3,
.mx_news_block_item p {
  margin: 0;
  padding: 0;
}

.mx_news_block_item h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.3;
  margin-block-end: 0.5rem;
}

.mx_news_block_image {
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  border-radius: 0.5rem;
  aspect-ratio: 16 / 9;
  max-width: min(200px, 30vw);
}

.mx_news_block_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.mx_news_block_item:hover .mx_news_block_image img {
  transform: scale(1.05);
}

.mx_news_block_content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

/* CATEGORY VIEW (category.html.twig) - Modern Grid Layout */
#mx_news_category {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2rem);
}

.mx_news_category_item {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.mx_news_category_item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.mx_news_category_item h3,
.mx_news_category_item p {
  margin: 0;
  padding: 0;
}

.mx_news_category_item h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.3;
  margin-block-end: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mx_news_category_item em {
  display: block;
  font-size: 0.875rem;
  color: hsl(0 0% 50%);
  font-style: normal;
  margin-block-end: 0.5rem;
}

.mx_news_category_image {
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: hsl(0 0% 95%);
}

.mx_news_category_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.mx_news_category_item:hover .mx_news_category_image img {
  transform: scale(1.05);
}

.mx_news_category_content {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  flex: 1;
  min-height: 0;
}

.mx_news_category_content > * {
  width: 100%;
}

.mx_news_category_content p {
  line-height: 1.6;
  color: hsl(0 0% 30%);
  margin-block-end: 1rem;
}

/* Modern "Read More" Button */
.button-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, hsl(210 100% 50%), hsl(220 100% 55%));
  color: white !important;
  text-decoration: none !important;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
  position: relative;
  overflow: hidden;
  margin-inline: auto;
  margin-block-start: auto;
  width: fit-content;
}

.button-news::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(220 100% 55%), hsl(210 100% 50%));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button-news:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
  color: white !important;
  text-decoration: none !important;
}

.button-news:hover::before {
  opacity: 1;
}

.button-news span {
  position: relative;
  z-index: 1;
}

/* Alternative: Outline Button Style (uncomment to use) */
/*
.button-news {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  color: hsl(210 100% 50%) !important;
  text-decoration: none !important;
  border: 2px solid hsl(210 100% 50%);
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
  margin-block-start: 0.75rem;
}

.button-news:hover {
  background: hsl(210 100% 50%);
  color: white !important;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}
*/

/* ITEM VIEW (item.html.twig) - Modern Layout */
#mx_news_item .addthis_toolbox {
  margin: clamp(0.75rem, 2vw, 1rem) 0 clamp(0.75rem, 2vw, 1rem) -0.125rem;
}

.mx_news_item_main_image {
  float: inline-start;
  margin: 0 clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem) 0;
  border-radius: 0.75rem;
  overflow: hidden;
  max-width: min(500px, 100%);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.mx_news_item_main_image img {
  width: 100%;
  height: auto;
  display: block;
}

.mx_news_item_image {
  border: 1px solid hsl(0 0% 87%);
  padding: 0.625rem;
  float: inline-start;
  margin: 0 clamp(0.75rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1rem) 0;
  border-radius: 0.5rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  background: white;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.mx_news_item_image:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
}

.mx_news_item_image a {
  display: block;
  width: 100%;
  height: 100%;
}

.mx_news_item_image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

.mx_news_item_image span {
  display: block;
  width: 100%;
  line-height: 1.2;
  margin-block-start: 0.5rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: hsl(0 0% 40%);
}

/* Responsive Design - Mobile First */
@media (max-width: 1024px) {
  #mx_news_category {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #mx_news_category {
    grid-template-columns: 1fr;
  }

  .mx_news_block_item,
  .mx_news_category_item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mx_news_block_image,
  .mx_news_category_image {
    max-width: 100%;
    aspect-ratio: 21 / 9;
  }
  
  .mx_news_item_main_image {
    float: none;
    margin: 0 0 1.5rem 0;
    max-width: 100%;
  }
  
  .mx_news_item_image {
    float: none;
    margin: 0 0 1rem 0;
    max-width: 100%;
  }

  .button-news {
    width: 100%;
    justify-content: center;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .mx_news_block_item,
  .mx_news_category_item {
    border-block-end-color: hsl(0 0% 30%);
  }
  
  .mx_news_item_image {
    border-color: hsl(0 0% 30%);
    background: hsl(0 0% 15%);
  }
  
  .mx_news_item_image span {
    color: hsl(0 0% 70%);
  }

  .mx_news_category_item em {
    color: hsl(0 0% 60%);
  }

  .mx_news_category_content p {
    color: hsl(0 0% 80%);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .mx_news_block_item,
  .mx_news_category_item,
  .mx_news_block_image img,
  .mx_news_category_image img,
  .mx_news_item_image,
  .button-news {
    transition: none;
  }
  
  .mx_news_block_item:hover,
  .mx_news_category_item:hover,
  .mx_news_item_image:hover,
  .button-news:hover {
    transform: none;
  }
  
  .mx_news_block_item:hover .mx_news_block_image img,
  .mx_news_category_item:hover .mx_news_category_image img {
    transform: none;
  }
}