/**
 * News overview + article extras (shared Markendesign / studio language).
 */

/* —— Topic filter (overview + article) —— */

.studio-news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
}

@media (max-width: 991.98px) {
  .studio-news-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    padding-bottom: 0.15rem;
    margin-right: -16px;
    padding-right: 16px;
  }

  .studio-news-filter::-webkit-scrollbar {
    display: none;
    height: 0;
  }

  .studio-news-filter__btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.studio-news-filter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--studio-border, #ccc) 90%, transparent);
  border-radius: 999px;
  color: var(--studio-text-strong, #1a1a1a);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.studio-news-filter__btn:hover,
.studio-news-filter__btn:focus-visible {
  border-color: var(--studio-text-strong, #1a1a1a);
  text-decoration: none;
}

.studio-news-filter__btn.is-active {
  background: var(--studio-accent, #0612f4);
  border-color: var(--studio-accent, #0612f4);
  color: #fff;
}

html[data-bs-theme='dark'] .studio-news-filter__btn.is-active {
  background: var(--studio-accent, #6ea8fe);
  border-color: var(--studio-accent, #6ea8fe);
  color: #111;
}

/* —— Pagination (pill controls, same language as filters) —— */

.studio-news-pager {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
}

.studio-news-pager__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.studio-news-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.65rem;
  border: 1px solid color-mix(in srgb, var(--studio-border, #ccc) 90%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--studio-text-strong, #1a1a1a);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.studio-news-pager__btn:hover,
a.studio-news-pager__btn:focus-visible {
  border-color: var(--studio-text-strong, #1a1a1a);
  text-decoration: none;
}

.studio-news-pager__btn.is-current {
  background: var(--studio-accent, #0612f4);
  border-color: var(--studio-accent, #0612f4);
  color: #fff;
}

.studio-news-pager__btn--gap {
  border-color: transparent;
  cursor: default;
  letter-spacing: 0.08em;
  color: var(--studio-text, #555);
}

html[data-bs-theme='dark'] .studio-news-pager__btn.is-current {
  background: var(--studio-accent, #6ea8fe);
  border-color: var(--studio-accent, #6ea8fe);
  color: #111;
}

.studio-news-empty {
  margin: 1rem 0 0;
  color: var(--studio-text, #333);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
}

/* —— Article layout —— */

.studio-news-article__header {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.studio-news-article__meta {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--studio-text, #555);
}

.studio-news-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 2.75rem);
  align-items: start;
}

@media (min-width: 992px) {
  .studio-news-article--with-sidebar .studio-news-article__layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(14rem, 0.85fr);
    column-gap: clamp(2.5rem, 5vw, 4rem);
  }
}

.studio-news-article__main,
.studio-news-article__aside {
  min-width: 0;
}

@media (min-width: 992px) {
  .studio-news-article__aside {
    position: sticky;
    top: 6.5rem;
  }
}

.studio-news-article__content {
  max-width: 42rem;
}

.studio-news-article--with-sidebar .studio-news-article__content {
  max-width: none;
}

.studio-news-article__content > *:first-child {
  margin-top: 0;
}

.studio-news-article__content > *:last-child {
  margin-bottom: 0;
}

.studio-news-article__content a {
  color: var(--studio-accent, #0612f4);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.studio-news-article__content a:hover,
.studio-news-article__content a:focus-visible {
  text-decoration-thickness: 2px;
}

.studio-news-article__content a.studio-cta-btn,
.studio-news-article__content a.studio-mdp__all-btn {
  color: #fefefe;
  text-decoration: none;
  text-underline-offset: unset;
}

.studio-news-article__content a.studio-cta-btn:hover,
.studio-news-article__content a.studio-cta-btn:focus-visible,
.studio-news-article__content a.studio-mdp__all-btn:hover,
.studio-news-article__content a.studio-mdp__all-btn:focus-visible {
  color: #fff;
  text-decoration: none;
}

html[data-bs-theme='dark'] .studio-news-article__content a {
  color: var(--studio-accent, #6ea8fe);
}

html[data-bs-theme='dark'] .studio-news-article__content a.studio-cta-btn,
html[data-bs-theme='dark'] .studio-news-article__content a.studio-mdp__all-btn {
  color: #fefefe;
}

.studio-news-article__content h2,
.studio-news-article__content h3,
.studio-news-article__content h4 {
  margin: 1.75rem 0 0.75rem;
  color: var(--studio-text-strong, #1a1a1a);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.studio-news-article__content h2 {
  margin-top: 4rem;
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
}

.studio-news-article__content h3 {
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
}

.studio-news-article__content h4 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
}

.studio-news-article__content ul,
.studio-news-article__content ol {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

.studio-news-article__content li + li {
  margin-top: 0.35rem;
}

.studio-news-article__content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--studio-accent, #0612f4);
  color: var(--studio-text, #333);
}

.studio-news-article__content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.studio-news-article__hero {
  margin: 0 0 clamp(1.25rem, 3vw, 1.75rem);
  overflow: hidden;
  background: color-mix(in srgb, var(--studio-border, #ddd) 35%, transparent);
}

.studio-news-article__hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: initial;
  object-position: center;
}

/* —— Related links (sidebar) —— */

.studio-news-related-links {
  margin: 0;
  padding: 1.15rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--studio-border, #ccc) 80%, transparent);
}

@media (min-width: 992px) {
  .studio-news-related-links {
    padding-top: 0;
    border-top: 0;
  }
}

.studio-news-related-links__title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--studio-text-strong, #1a1a1a);
}

.studio-news-related-links__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.studio-news-related-links__item {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-border, #ccc) 70%, transparent);
}

.studio-news-related-links__item:first-child {
  padding-top: 0;
}

.studio-news-related-links__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.studio-news-related-links__num {
  flex: 0 0 auto;
  min-width: 1.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--studio-accent, #0612f4);
}

html[data-bs-theme='dark'] .studio-news-related-links__num {
  color: var(--studio-accent, #6ea8fe);
}

.studio-news-related-links__anchor {
  flex: 1 1 auto;
  color: var(--studio-text-strong, #1a1a1a);
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.studio-news-related-links__anchor:hover,
.studio-news-related-links__anchor:focus-visible {
  color: var(--studio-text-strong, #1a1a1a);
  text-decoration: underline;
  text-decoration-color: var(--studio-text-strong, #1a1a1a);
  text-underline-offset: 0.15em;
}

/* —— Related topics / articles spacing —— */

.studio-news-related-topics {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
}

.studio-news-related-topics .studio-news-filter {
  margin-bottom: 0;
}

.studio-news-related-topics + .studio-mdp__similar {
  margin-top: 90px;
}

/*
 * News cards must not use the portfolio tall crop (fixed height + object-fit:
 * cover). Width scales with the viewport; height follows the image — no crop.
 */
.studio-news-overview .studio-md__media {
  height: auto;
  aspect-ratio: auto;
}

.studio-news-overview .studio-md__media-link {
  height: auto;
}

.studio-news-overview .studio-md__media-link img {
  width: 100%;
  height: auto;
  object-fit: initial;
}

.studio-home-news .studio-mdp__similar-media,
.studio-news-article .studio-mdp__similar-media {
  aspect-ratio: auto;
  height: auto;
}

.studio-home-news .studio-mdp__similar-media img,
.studio-news-article .studio-mdp__similar-media img {
  width: 100%;
  height: auto;
  object-fit: initial;
}

@media (max-width: 767px) {
  .studio-news-overview .studio-md__media {
    height: auto;
  }
}

/* —— Home News —— */

.studio-home-news {
  margin: clamp(3rem, 7vw, 5rem) 0;
}

.studio-home-news__title {
  margin-bottom: 40px;
}

@media (max-width: 767.98px) {
  .studio-home-news__title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 991.98px) {
  .studio-main--news,
  .studio-main--news-article {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
}
