/*
 * uudised.html autoplay landing CSS
 */

body {
  overflow: hidden;
}

.news-landing {
  --c-ivory: var(--color-ivory-light);
  --c-cream: var(--color-bg-soft);
  --c-espresso: var(--color-ink-espresso);
  --c-ink: var(--color-ink);
  --c-ink-soft: var(--color-text-warm-soft);
  --c-ink-muted: var(--color-text-warm-muted);
  --c-on-dark: var(--c-ivory);
  --c-on-dark-soft: rgba(255, 255, 240, 0.72);
  --c-on-dark-muted: rgba(255, 244, 236, 0.62);
  --ease-brand: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-soft: cubic-bezier(0.25, 0.74, 0.22, 1);
  --autoplay: 3500ms;
  --dur-panel: 900ms;
  --dur-fade: 400ms;
  --pad-x: clamp(1.75rem, 4vw, 4rem);
  --pad-y: clamp(2rem, 6vh, 5rem);
  position: relative;
  width: 100vw;
  height: calc(100vh - 88px);
  min-height: 620px;
  overflow: hidden;
  background: var(--c-ivory);
}

.news-landing__image {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50vw;
  overflow: hidden;
}

.news-landing__image-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  filter: grayscale(0.38) sepia(0.34) hue-rotate(2deg) saturate(1.22) contrast(0.76) brightness(1.04);
  opacity: 0;
  transition: opacity 1200ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.news-landing__image-layer.is-active {
  opacity: 1;
}

.news-landing__image-layer.is-unfiltered {
  filter: none;
}

.news-landing__image-layer.is-unfiltered::after {
  display: none;
}

.news-landing__image-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-brand-rust);
  mix-blend-mode: color;
  opacity: 0.48;
  pointer-events: none;
  z-index: 1;
}

.news-landing__image-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: none;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.news-landing__article {
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100%;
  background-color: var(--color-surface-sand);
  background-image: none;
  padding: calc(var(--pad-y) + 0.4rem) var(--pad-x) var(--pad-y);
  overflow-y: auto;
  z-index: 1;
  opacity: 1;
}

.news-article__inner {
  max-width: 36rem;
}

.news-article__meta {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  margin-bottom: 1.75rem;
}

.news-article__meta::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--c-ink);
  display: inline-block;
}

.news-article__title {
  font-size: clamp(1.8rem, 4.6vw, 3.5rem);
  font-weight: 590;
  letter-spacing: 0.003em;
  line-height: 1.05;
  color: var(--c-ink);
  margin: 0 0 2rem;
}

.news-article__title em {
  font-style: normal;
  color: var(--menu-base);
}

.news-article__body {
  font-size: 1.0625rem;
  line-height: 1.58;
  font-weight: 400;
  color: var(--c-ink-soft);
}

.news-article__body p + p {
  margin-top: 1.1rem;
}

.news-article__body h2 {
  color: var(--c-ink);
  font-size: clamp(1.25rem, 3.8vw, 1.7rem);
  font-weight: 560;
  line-height: 1.16;
  margin: 2rem 0 0.75rem;
}

.news-article__body h2:first-child {
  margin-top: 0;
}

.news-article__body a {
  color: var(--menu-base);
  position: relative;
  display: inline-block;
  text-decoration: none;
  border-bottom: 0;
  padding-bottom: 0.08em;
  transition: color 220ms ease, transform 220ms ease;
}

.news-article__body a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 1px;
  background: rgba(138, 87, 66, 0.34);
  transform: scaleX(0.18);
  transform-origin: left center;
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), background-color 340ms ease;
}

.news-article__body a:hover,
.news-article__body a:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.news-article__body a:hover::after,
.news-article__body a:focus-visible::after {
  transform: scaleX(1);
  background: rgba(138, 87, 66, 0.78);
}

.news-article__more-news {
  display: none;
}

.news-landing[data-open="true"] .news-article__more-news {
  color: var(--menu-base);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  margin-top: 1.4rem;
  padding-bottom: 0.18rem;
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
}

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .news-landing[data-open="true"] .news-article__more-news {
    transition: color 220ms var(--ease-soft);
  }

  .news-landing[data-open="true"] .news-article__more-news::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--color-brand-copper);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 600ms var(--ease-brand);
  }

  .news-landing[data-open="true"] .news-article__more-news:hover,
  .news-landing[data-open="true"] .news-article__more-news:focus-visible {
    color: var(--color-brand-copper);
    outline: none;
  }

  .news-landing[data-open="true"] .news-article__more-news:hover::after,
  .news-landing[data-open="true"] .news-article__more-news:focus-visible::after {
    transform: scaleX(1);
  }

  .news-article__more-news span[aria-hidden="true"] {
    display: inline-block;
    transition: transform 400ms var(--ease-brand);
  }

  .news-landing[data-open="true"] .news-article__more-news:hover span[aria-hidden="true"],
  .news-landing[data-open="true"] .news-article__more-news:focus-visible span[aria-hidden="true"] {
    transform: translateX(0.4rem);
  }
}

.news-landing__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100%;
  background: var(--menu-base) url("../../assets/uudised/uudised-panel-bg.webp") center center / cover no-repeat;
  background-image: image-set(url("../../assets/uudised/uudised-panel-bg.webp") type("image/webp"));
  color: var(--c-on-dark);
  padding: var(--pad-y) var(--pad-x);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(0);
  transition: transform var(--dur-panel) var(--ease-brand);
  will-change: transform;
  overflow: hidden;
}

.news-landing[data-open="true"] .news-landing__panel {
  transform: translateX(-100%);
}

.news-panel__ghost {
  display: none;
}

.news-panel__top {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.news-panel__more {
  font-size: 0.78rem;
  font-weight: 580;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-on-dark-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0;
  position: relative;
  transition: color 220ms var(--ease-soft);
}

.news-panel__more::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--menu-hover);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 600ms var(--ease-brand);
}

.news-panel__more:hover,
.news-panel__more:focus-visible {
  color: var(--c-on-dark);
}

.news-panel__more:hover::after,
.news-panel__more:focus-visible::after {
  transform: scaleX(1);
}

.news-panel__more-arrow {
  display: inline-block;
  transition: transform 400ms var(--ease-brand);
}

.news-panel__more:hover .news-panel__more-arrow,
.news-panel__more:focus-visible .news-panel__more-arrow {
  transform: translateX(0.4rem);
}

.news-panel__center {
  max-width: 32rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 901px) {
  .news-panel__center {
    position: absolute;
    left: var(--panel-safe-left, var(--pad-x));
    top: var(--panel-safe-top, var(--pad-y));
    width: var(--panel-safe-width, 32rem);
    height: var(--panel-safe-height, auto);
    max-width: none;
    transform: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }
}

.news-panel__meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
}

.news-panel__date,
.news-panel__author {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.news-panel__date {
  color: var(--c-on-dark-muted);
  flex: 0 0 auto;
}

.news-panel__author {
  color: var(--c-on-dark-muted);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-panel__heading {
  margin: 0;
  font-weight: inherit;
}

@media (min-width: 901px) {
  .news-panel__heading {
    width: 100%;
  }
}

.news-panel__title {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
  font: inherit;
  font-size: clamp(1.55rem, 4.35vw, 3.65rem);
  font-weight: 590;
  letter-spacing: 0.003em;
  line-height: 1.04;
  color: var(--c-on-dark);
  transition: opacity var(--dur-fade) var(--ease-soft);
}

@media (min-width: 901px) {
  .news-panel__title {
    text-align: left;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: normal;
  }
}

.news-panel__title em {
  font-style: normal;
  color: var(--menu-hover);
}

.news-panel__title-arrow {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.55em;
  vertical-align: 0.18em;
  color: var(--menu-hover);
  opacity: 0.72;
  transform: translateX(0);
  transition: opacity 400ms var(--ease-brand), transform 400ms var(--ease-brand);
}

.news-panel__title:hover .news-panel__title-arrow,
.news-panel__title:focus-visible .news-panel__title-arrow {
  opacity: 1;
  transform: translateX(0.35em);
}

.news-panel__title:focus-visible {
  outline: none;
}

.news-panel__toggle {
  display: flex;
  gap: 1rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.news-toggle__item {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1.5rem 0;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.news-toggle__item::before,
.news-toggle__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}

.news-toggle__item::before {
  background: rgba(255, 255, 240, 0.22);
  transition: background 300ms var(--ease-soft);
}

.news-toggle__item:hover::before {
  background: var(--color-panel-light-hover);
}

.news-toggle__item::after {
  background: var(--c-on-dark);
  transform: scaleX(0);
  transform-origin: left;
}

.news-toggle__item.is-active::after {
  animation: news-progress var(--autoplay) linear forwards;
}

.news-landing.is-paused .news-toggle__item.is-active::after {
  animation-play-state: paused;
}

@keyframes news-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.news-panel__close {
  position: absolute;
  top: var(--pad-y);
  left: var(--pad-x);
  --size: 64px;
  width: var(--size);
  height: var(--size);
  background: transparent;
  border: none;
  padding: 0;
  color: var(--c-on-dark);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-soft) 600ms;
  z-index: 3;
}

@media (min-width: 901px) {
  .news-panel__close {
    top: calc(var(--pad-y) - 1.2rem);
  }
}

.news-panel__close svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.news-panel__close .diamond,
.news-panel__close .chevron {
  opacity: 0.55;
  transition: opacity 400ms var(--ease-brand);
}

.news-panel__close:hover .diamond,
.news-panel__close:hover .chevron,
.news-panel__close:focus-visible .diamond,
.news-panel__close:focus-visible .chevron {
  opacity: 1;
}

.news-panel__close .chevron {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 500ms var(--ease-brand), opacity 400ms var(--ease-brand);
}

.news-panel__close:hover .chevron,
.news-panel__close:focus-visible .chevron {
  transform: translateX(-3px);
}

.news-panel__close:focus-visible {
  outline: none;
}

.news-landing[data-open="true"] .news-panel__close {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .news-landing {
    min-height: calc(100svh - 72px);
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    background: var(--c-ivory);
    touch-action: pan-y;
  }

  .news-landing__image {
    position: relative;
    order: 1;
    width: 100vw;
    height: clamp(11.5rem, 31svh, 16.5rem);
    inset: auto;
    flex: 0 0 auto;
  }

  .news-landing__image-layer {
    background-size: cover;
    background-position: center 18%;
  }

  .news-landing__article {
    position: relative;
    order: 3;
    width: 100vw;
    height: auto;
    top: auto;
    right: auto;
    bottom: auto;
    scroll-margin-top: 72px;
  }

  .news-landing__panel {
    position: relative;
    order: 2;
    width: 100vw;
    min-height: calc(100svh - 72px - clamp(11.5rem, 31svh, 16.5rem));
    height: auto;
    top: auto;
    right: auto;
    bottom: auto;
    padding: clamp(1.2rem, 4.6vw, 1.75rem) 1.5rem 1.15rem;
    transform: none;
    overflow: hidden;
    justify-content: flex-end;
    gap: 0;
    background-image: image-set(url("../../assets/uudised/uudised-panel-bg-mobile.webp") type("image/webp"));
    background-position: center center;
    background-size: cover;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
  }

  .news-landing__panel::after {
    content: "↓";
    position: absolute;
    left: 50%;
    bottom: clamp(2.35rem, 4.8svh, 3.2rem);
    z-index: 2;
    color: rgba(255, 248, 240, 1);
    font-size: 2.15rem;
    line-height: 1;
    text-shadow: 0 0 16px var(--color-line-on-dark-medium);
    opacity: 1;
    transform: translateX(-50%);
    transition: opacity 160ms var(--ease-soft);
    pointer-events: none;
  }

  .news-landing[data-open="true"] .news-landing__panel::after {
    opacity: 0;
  }

  .news-landing[data-open="true"] .news-landing__panel {
    transform: none;
  }

  .news-panel__top {
    display: none;
  }

  .news-panel__more {
    color: rgba(255, 244, 236, 0.7);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    -webkit-tap-highlight-color: transparent;
  }

  .news-panel__center {
    position: absolute;
    left: 19.5%;
    right: 19%;
    top: 18.5%;
    bottom: 34%;
    width: auto;
    max-width: none;
    display: flex;
    align-items: flex-start;
  }

  .news-panel__meta {
    display: none;
  }

  .news-panel__date,
  .news-panel__author {
    font-size: 0.62rem;
    letter-spacing: 0.13em;
  }

  .news-panel__title {
    font-size: clamp(1.52rem, 7.45vw, 2.55rem);
    line-height: 1.08;
    -webkit-tap-highlight-color: transparent;
  }

  .news-panel__title-arrow {
    display: none;
  }

  .news-panel__toggle {
    gap: 0.65rem;
    margin-top: 0;
  }

  .news-toggle__item {
    padding: 0.85rem 0 0.1rem;
  }

  .news-panel__ghost {
    font-size: 10rem;
    right: -2rem;
  }

  .news-panel__close {
    display: none;
  }

  .news-landing__article {
    background: var(--color-bg);
    padding: 0 1.5rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-0.75rem);
    transition:
      max-height 700ms var(--ease-brand),
      opacity 360ms var(--ease-soft),
      transform 520ms var(--ease-brand),
      padding 520ms var(--ease-brand);
  }

  .news-landing[data-open="true"] .news-landing__article {
    max-height: none;
    opacity: 1;
    overflow: visible;
    padding: 2.2rem 1.5rem 3rem;
    transform: translateY(0);
  }

  .news-article__inner {
    max-width: 38rem;
    margin: 0 auto;
  }

  .news-article__meta {
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    margin-bottom: 1.2rem;
    white-space: nowrap;
  }

  .news-article__meta > span {
    white-space: nowrap;
  }

  .news-article__meta::before {
    width: 1.6rem;
  }

  .news-article__title {
    font-size: clamp(1.65rem, 7vw, 2.45rem);
    line-height: 1.08;
    color: var(--color-shadow-dark-72);
    margin-bottom: 1.35rem;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .news-article__body {
    font-size: 1rem;
    line-height: 1.62;
    color: var(--color-shadow-dark-72);
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
  }

  .news-article__body a {
    overflow-wrap: anywhere;
  }

  .news-article__body [data-landing-article-link] {
    display: none;
  }

  .news-article__more-news {
    color: var(--menu-base);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.11em;
    margin-top: 1.4rem;
    padding-bottom: 0.18rem;
    position: relative;
    text-decoration: none;
    text-transform: uppercase;
  }

}

@media (max-width: 480px) {
  .news-landing__panel {
    min-height: calc(100svh - 72px - clamp(11.5rem, 31svh, 16.5rem));
  }

  .news-panel__center {
    left: 19.5%;
    right: 19%;
    top: 18.5%;
    bottom: 34%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .news-toggle__item.is-active::after {
    animation: none;
    transform: scaleX(1);
  }

  .news-landing__panel {
    transition-duration: 200ms;
  }
}
