/**
 * 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__meta-sep {
  margin: 0 0.4em;
  font-weight: 500;
  opacity: 0.55;
}

.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 1.25rem;
  padding: 0;
  list-style: none;
}

.studio-news-article__content li {
  position: relative;
  margin: 0.45rem 0;
  padding-left: 1.15rem;
}

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

.studio-news-article__content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.7rem;
  height: 2px;
  background: var(--studio-accent, #c10807);
}

.studio-news-article__content .wpcf7,
.studio-news-article__content .idm-form__embed {
  max-width: 100%;
  min-width: 0;
}

.studio-news-article__content .idm-form__embed {
  margin: 1.75rem 0 0.5rem;
}

.studio-news-article__content .idm-form__embed .idm-cf7-grid {
  grid-template-columns: 1fr;
  min-width: 0;
}

.studio-news-article__content .idm-form__embed .idm-cf7-grid > label.idm-field,
.studio-news-article__content .idm-form__embed .idm-field {
  grid-column: 1 / -1;
}

.studio-news-article__content input,
.studio-news-article__content select,
.studio-news-article__content textarea {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.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;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  object-fit: cover;
}

.studio-news-article__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 600px;
  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: 600px;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.idm-article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 2.75rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--studio-text-strong, #011627) 16%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--studio-text-strong, #011627) 16%, transparent);
}

.idm-article-nav__btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  min-height: 6.25rem;
  padding: 1.15rem 1.15rem 1.15rem 0;
  border: 0;
  background: transparent;
  color: var(--studio-text-strong, #011627);
  text-align: left;
  text-decoration: none;
}

.idm-article-nav__btn--prev {
  grid-column: 1;
  padding-right: 1.35rem;
}

.idm-article-nav__btn--next {
  grid-column: 2;
  padding-right: 0;
  padding-left: 1.35rem;
  border-left: 1px solid color-mix(in srgb, var(--studio-text-strong, #011627) 16%, transparent);
}

.idm-article-nav:not(:has(.idm-article-nav__btn--prev)) .idm-article-nav__btn--next,
.idm-article-nav:not(:has(.idm-article-nav__btn--next)) .idm-article-nav__btn--prev {
  grid-column: 1 / -1;
  border-left: 0;
  padding-left: 0;
}

.studio-news-article__content a.idm-article-nav__btn,
.studio-news-article__content a.idm-article-nav__btn:hover,
.studio-news-article__content a.idm-article-nav__btn:focus-visible {
  color: var(--studio-text-strong, #011627);
  text-decoration: none;
}

.idm-article-nav__btn:focus-visible {
  outline: 2px solid var(--studio-accent, #c10807);
  outline-offset: 4px;
}

.idm-article-nav__arrow {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  color: currentColor;
  transition: transform 0.22s ease, color 0.22s ease;
}

.idm-article-nav__arrow svg {
  display: block;
}

.idm-article-nav__btn--prev:hover .idm-article-nav__arrow,
.idm-article-nav__btn--prev:focus-visible .idm-article-nav__arrow {
  color: var(--studio-accent, #c10807);
  transform: translateX(-5px);
}

.idm-article-nav__btn--next:hover .idm-article-nav__arrow,
.idm-article-nav__btn--next:focus-visible .idm-article-nav__arrow {
  color: var(--studio-accent, #c10807);
  transform: translateX(5px);
}

.idm-article-nav__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.idm-article-nav__btn--next .idm-article-nav__copy {
  align-items: flex-end;
  text-align: right;
}

.idm-article-nav__dir {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--studio-accent, #c10807);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.idm-article-nav__dir::before {
  content: "";
  width: 1.05rem;
  height: 2px;
  background: currentColor;
}

.idm-article-nav__btn--next .idm-article-nav__dir {
  flex-direction: row-reverse;
}

.idm-article-nav__title {
  display: -webkit-box;
  overflow: hidden;
  max-width: 22rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}

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

  .idm-article-nav__btn--prev,
  .idm-article-nav__btn--next,
  .idm-article-nav:not(:has(.idm-article-nav__btn--prev)) .idm-article-nav__btn--next {
    grid-column: auto;
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }

  .idm-article-nav__btn--next {
    border-top: 1px solid color-mix(in srgb, var(--studio-text-strong, #011627) 16%, transparent);
  }

  .idm-article-nav__btn--next .idm-article-nav__copy {
    align-items: flex-start;
    text-align: left;
  }

  .idm-article-nav__btn--next .idm-article-nav__dir {
    flex-direction: row;
  }
}

/* —— 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;
}

/* Blog cards: the photo frame is a fixed 350px, the image fills it. */
.studio-news-overview .studio-md__media {
  height: 350px;
  aspect-ratio: auto;
  overflow: hidden;
}

.studio-news-overview .studio-md__media-link {
  display: block;
  height: 100%;
}

.studio-news-overview .studio-md__media-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.studio-home-news .studio-mdp__similar-media,
.studio-news-article .studio-mdp__similar-media {
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

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

/* —— 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;
  }
}

/* —— Phone & tablet polish for blog overview + all 16 articles —— */

.studio-news-article .studio-mdp__title,
.studio-news-overview .studio-md__title,
.studio-news-overview .studio-md__project-title,
.studio-news-article__content,
.studio-news-article__content a,
.idm-article-nav__title {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.studio-news-article__content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.studio-news-article__content pre,
.studio-news-article__content iframe,
.studio-news-article__content video,
.studio-news-article__content embed,
.studio-news-article__content object {
  max-width: 100%;
}

.studio-news-article__content pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.studio-news-article__content figure {
  margin: 1.5rem 0;
  max-width: 100%;
}

.studio-news-article__content figcaption {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--studio-text, #555);
}

@media (max-width: 991.98px) {
  .studio-news-article .studio-mdp__title {
    font-size: clamp(1.85rem, 4.6vw, 2.65rem);
    line-height: 1.12;
  }

  .studio-news-article__hero {
    max-height: min(52vh, 420px);
  }

  .studio-news-article__hero img {
    max-height: min(52vh, 420px);
  }

  .studio-news-article__content h2 {
    margin-top: 2.75rem;
  }

  .studio-news-related-topics + .studio-mdp__similar {
    margin-top: 3rem;
  }

  .studio-news-overview .studio-md__media {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .studio-news-article .studio-mdp__similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1.25rem;
  }
}

@media (max-width: 767.98px) {
  .studio-news-overview .studio-md__title {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
    line-height: 1.12;
  }

  .studio-news-overview .studio-md__project-title {
    font-size: clamp(1.2rem, 5.2vw, 1.45rem);
    line-height: 1.25;
  }

  .studio-news-overview .studio-md__media {
    aspect-ratio: 3 / 2;
  }

  .studio-news-article .studio-mdp__title {
    font-size: clamp(1.65rem, 7.2vw, 2.05rem);
  }

  .studio-news-article__hero {
    max-height: min(46vh, 300px);
    margin-bottom: 1.15rem;
  }

  .studio-news-article__hero img {
    max-height: min(46vh, 300px);
  }

  .studio-news-article__content h2 {
    margin-top: 2.25rem;
    font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  }

  .studio-news-article__content h3 {
    font-size: clamp(1.15rem, 4.6vw, 1.35rem);
  }

  .studio-news-article__content p,
  .studio-news-article__content li {
    font-size: 1.02rem;
    line-height: 1.6;
  }

  .idm-article-nav__title {
    max-width: none;
    font-size: 0.98rem;
  }

  .studio-news-article .studio-mdp__similar-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .studio-news-related-topics + .studio-mdp__similar {
    margin-top: 2.5rem;
  }
}

@media (min-width: 992px) {
  .studio-news-overview .studio-md__media {
    height: 350px;
    aspect-ratio: auto;
  }
}
