/**
 * News Card Styles
 *
 * @package Helasverige
 */

/* ==========================================================================
   News Card
   ========================================================================== */

.hsn-news-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hsn-news-card.global {
  border-top: 10px solid #a21a17;
}

.hsn-news-card.regional {
  border-top: 10px solid #7c98a2;
}

.hsn-news-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #f0f0f0;
}

.hsn-news-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.hsn-news-card__image-link--no-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hsn-news-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hsn-news-card:hover .hsn-news-card__img {
  transform: scale(1.05);
}

/* Placeholder (no featured image) */
.hsn-news-card__image--no-thumb {
  background: linear-gradient(135deg, #a21a17 0%, #5c0000 100%);
}

.hsn-news-card__image--no-thumb img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}

.hsn-news-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  text-align: center;
}

.hsn-news-card__placeholder-month {
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.hsn-news-card__placeholder-day {
  font-family: 'Oswald', sans-serif;
  font-size: 4rem;
  font-weight: 400;
  line-height: 1;
  margin-top: 0.25rem;
}

.hsn-news-card__placeholder-icon {
  opacity: 0.5;
}

.hsn-news-card:hover .hsn-news-card__placeholder {
  transform: scale(1.05);
}

/* Date Badge (Month + Day) */
.hsn-news-card__date-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 50px;
  height: 66px;
  background-color: #fff;
  clip-path: polygon(20% 0%, 100% 0, 100% 20%, 100% 100%, 50% 92%, 0 100%, 0 0);
}

.hsn-news-card__date-month {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  min-width: 100%;
  text-align: center;
  background-color: #a21a17;
  padding: 4px 0px;
}

.hsn-news-card__date-day {
  font-family: 'Oswald', sans-serif;
  font-size: 1.55rem;
  font-weight: 400;
  color: #1a1a1a;
  line-height: 1;
  margin-top: 2px;
  padding-top: 5px;
}

/* Content */
.hsn-news-card__content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Meta (Categories + Date) */
.hsn-news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #666;
}

.hsn-news-card__meta a {
  all: unset;
  cursor: pointer;
}

.hsn-news-card__meta a:focus-visible {
  outline: 1px solid black;
}

.hsn-news-card__meta a:hover {
  color: #a21a17;
}

.hsn-news-card__categories {
  color: #a21a17;
  font-weight: 500;
}

.hsn-news-card__meta-separator {
  color: #999;
}

.hsn-news-card__date {
  color: #666;
}

/* Title */
h3.hsn-news-card__title {
  padding: 0;
  font-weight: 600 !important;
  line-height: 1.3;
  margin-block-end: 16px;
  margin-block-start: 0;
  text-transform: uppercase;
}

.hsn-news-card__title a {
  color: #1a1a1a;
  text-decoration: none;
}

.hsn-news-card__title a:hover {
  color: #a21a17;
}

/* Excerpt */
.hsn-news-card__excerpt {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  margin: 0 0 1rem;
  flex-grow: 1;
}

/* Footer */
.hsn-news-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  margin-top: auto;
}

.hsn-news-card__cta {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.2s ease;
}

.hsn-news-card__cta:hover {
  color: #a21a17;
}

/* Share Icons */
.hsn-news-card__share {
  display: flex;
  gap: 0.75rem;
}

.hsn-news-card__share-link {
  color: #1a1a1a;
  transition: color 0.2s ease;
}

.hsn-news-card__share-link:hover {
  color: #a21a17;
}

.hsn-news-card__share-link svg {
  display: block;
}

/* ==========================================================================
   News Grid (for use in modules/sections)
   ========================================================================== */

#riks-news-heading,
#lan-news-heading {
  font-weight: 600;
}

/* News Section Header */
.hsn-news-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hsn-news-section__header h3 {
  margin: 0;
}

.hsn-news-section {
  width: min(1380px, 100%);
  padding: 20px;
  margin-inline: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.hsn-news-section.extra-end-spacing-bottom {
  margin-bottom: 7rem;
}

.hsn-news-section:last-child {
  margin-block-end: 3rem;
}

.hsn-news-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 576px) {
  .hsn-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .hsn-news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   News Slider (Mobile only)
   ========================================================================== */

/* Mobile slider styles */
@media (max-width: 575px) {
  .hsn-news-slider.swiper {
    display: block;
    overflow: visible;
    padding-bottom: 2.5rem;
  }

  div.hsn-news-section__actions {
    margin-top: 2.5rem;
  }

  .hsn-news-section {
    padding: 20px;
  }

  .hsn-news-slider .swiper-wrapper {
    display: flex;
  }

  .hsn-news-slider .swiper-slide {
    height: auto;
  }

  .hsn-news-slider .swiper-slide .hsn-news-card {
    height: 100%;
  }

  .hsn-news-slider__pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .hsn-news-slider__pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    opacity: 1;
    transition: background 0.2s ease;
  }

  .hsn-news-slider__pagination .swiper-pagination-bullet-active {
    background: #a21a17;
  }
}

/* Desktop: hide slider-specific elements, show as grid */
@media (min-width: 576px) {
  .hsn-news-slider.swiper {
    overflow: visible;
  }

  .hsn-news-slider .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .hsn-news-slider .swiper-slide {
    width: auto !important;
    margin: 0 !important;
  }

  .hsn-news-slider__pagination {
    display: none;
  }
}

@media (min-width: 992px) {
  .hsn-news-slider .swiper-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   News Section Actions (Buttons & Dropdown)
   ========================================================================== */

.hsn-news-section__actions {
  display: flex;
  justify-content: center;
  margin-top: 4rem;
}

/* Archive Button */
.hsn-news-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background-color: #a21a17;
  border: 2px solid #a21a17;
  text-decoration: none;
  transition: all 0.25s ease;
}

.hsn-news-archive-btn:hover {
  background-color: #7c1512;
  border-color: #7c1512;
  color: #fff;
}

.hsn-news-archive-btn:focus-visible {
  outline: 2px solid #a21a17;
  outline-offset: 2px;
}

.hsn-news-archive-btn svg {
  transition: transform 0.25s ease;
}

.hsn-news-archive-btn:hover svg {
  transform: translateX(4px);
}

/* Län Dropdown */
.hsn-lan-dropdown {
  position: absolute;
  display: inline-block;
}

.hsn-lan-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a1a1a;
  background-color: #fff;
  border: 2px solid #7c98a2;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 220px;
  justify-content: space-between;
}

.hsn-lan-dropdown__toggle:hover {
  background-color: #7c98a2;
  color: #fff;
}

.hsn-lan-dropdown__toggle:focus-visible {
  outline: 2px solid #7c98a2;
  outline-offset: 2px;
}

.hsn-lan-dropdown__chevron {
  transition: transform 0.25s ease;
}

.hsn-lan-dropdown[data-open='true'] .hsn-lan-dropdown__chevron {
  transform: rotate(180deg);
}

.hsn-lan-dropdown__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background-color: #fff;
  border: 2px solid #7c98a2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
}

.hsn-lan-dropdown[data-open='true'] .hsn-lan-dropdown__list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hsn-lan-dropdown__list li {
  margin: 0;
  padding: 0;
}

.hsn-lan-dropdown__list a {
  display: block;
  padding: 0.625rem 1.25rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1a1a1a;
  text-decoration: none;
  transition: all 0.15s ease;
}

.hsn-lan-dropdown__list a:hover,
.hsn-lan-dropdown__list a:focus {
  background-color: #7c98a2;
  color: #fff;
}

/* Custom scrollbar for dropdown */
.hsn-lan-dropdown__list::-webkit-scrollbar {
  width: 6px;
}

.hsn-lan-dropdown__list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.hsn-lan-dropdown__list::-webkit-scrollbar-thumb {
  background: #7c98a2;
  border-radius: 3px;
}

.hsn-lan-dropdown__list::-webkit-scrollbar-thumb:hover {
  background: #5a7a85;
}
