@import url("https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,400..700;1,7..72,400..700&family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap");

:root {
  --rose: #fc6ba4;
  --rose-deep: #a81e5b;
  --rose-soft: #ffe9f1;
  --rose-line: #f3cfdd;
  --ink: #241019;
  --ink-soft: #6a5059;
  --paper: #ffffff;

  --measure: 35rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--rose-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 0;
}

/* ---------- Titulinis: vientisas rožinis laukas ---------- */

.home {
  background: var(--rose);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) 0;
}

.home__mark {
  width: clamp(150px, 18vw, 220px);
  margin-bottom: clamp(4rem, 14vh, 9rem);
}

.home__title {
  font-size: clamp(2.5rem, 8.5vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}

.home__lede {
  margin: 1.75rem 0 clamp(3.5rem, 10vh, 6rem);
  max-width: 52rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 500;
  color: #4a2130;
}

/* Dokumentų registras */

.docs {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.docs__item {
  border-bottom: 1px solid rgba(36, 16, 25, 0.28);
}

.docs__item:last-child {
  border-bottom: 2px solid var(--ink);
}

.docs__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 2rem;
  align-items: baseline;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) 0;
  color: inherit;
  text-decoration: none;
}

.docs__name {
  grid-column: 1;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: transform 0.25s ease;
}

.docs__link:hover .docs__name,
.docs__link:focus-visible .docs__name {
  transform: translateX(0.5rem);
}

.docs__note {
  grid-column: 1;
  max-width: 46ch;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  color: #4a2130;
  margin: 0;
}

.docs__state {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 2rem;
}

.docs__item--draft .docs__link {
  cursor: default;
}

.docs__item--draft .docs__name,
.docs__item--draft .docs__note {
  opacity: 0.62;
}

.docs__item--draft .docs__state {
  border-style: dashed;
  opacity: 0.62;
}

.home__foot {
  margin-top: auto;
  padding: 2.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4a2130;
}

/* ---------- Straipsnio puslapis ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--rose);
  border-bottom: 1px solid rgba(36, 16, 25, 0.2);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem var(--gutter);
}

.bar__mark {
  width: 108px;
}

.bar__back {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 16, 25, 0.45);
  padding-bottom: 1px;
}

.bar__back:hover {
  border-bottom-color: var(--ink);
}

.progress {
  height: 3px;
  background: var(--rose-deep);
  width: 0;
  transform-origin: left;
}

.wrap {
  padding: 0 var(--gutter);
}

.head {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.head__title {
  font-size: clamp(1.9rem, 4.6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

.head__lede {
  margin: 1.5rem 0 0;
  max-width: 52rem;
  line-height: 1.6;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  font-weight: 500;
  color: var(--ink-soft);
}

.head__meta {
  margin: 2.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--rose);
}

.head__meta > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.head__meta dt {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.head__meta dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Turinio išdėstymas */

.layout {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 62rem;
  margin: 0 auto;
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

/* Tinklelio elemento numatytasis min-width yra auto, t. y. jis nesusitraukia
   siauriau, nei reikia jo turiniui. Dėl to karuselės takelis išplečia .prose
   plačiau už ekraną ir visas puslapis pradeda slinkti į šoną. */

.layout > * {
  min-width: 0;
}

@media (min-width: 62rem) {
  .layout {
    grid-template-columns: 14rem minmax(0, 1fr);
    align-items: start;
  }
}

/* Turinys */

.toc {
  font-size: 0.875rem;
  border-top: 1px solid var(--rose-line);
  padding-top: 1rem;
}

.toc__title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc__title::-webkit-details-marker {
  display: none;
}

.toc__marker {
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.toc details[open] .toc__marker {
  transform: rotate(90deg);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toc a {
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover,
.toc a.is-current {
  color: var(--ink);
  border-left-color: var(--rose);
}

@media (min-width: 62rem) {
  .toc {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }

  .toc__title {
    pointer-events: none;
  }

  .toc__marker {
    display: none;
  }
}

/* Tekstas */

.prose {
  max-width: var(--measure);
}

.prose section {
  scroll-margin-top: 6rem;
}

.prose h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rose-line);
}

.prose > section:first-child h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose p {
  margin: 0 0 1.35rem;
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

/* Chronologija */

.chrono {
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--rose-line);
}

.chrono > li {
  position: relative;
  padding-bottom: 1.75rem;
}

.chrono > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 8px);
  top: 0.55rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--paper);
}

.chrono__date {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
}

.chrono p {
  margin: 0.25rem 0 0;
}

.chrono__end {
  margin: 0.5rem 0 1.35rem;
  font-weight: 600;
}

/* Citata iš platinimo sąlygų */

.quote {
  margin: 0 0 1.35rem;
  padding: 1.25rem 1.5rem;
  background: var(--rose-soft);
  border-left: 3px solid var(--rose);
}

.quote p {
  margin: 0;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.65;
}

.quote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Ruošiamo dokumento būsena */

.pending {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) 0 clamp(5rem, 14vw, 9rem);
}

.pending h1 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1.5rem;
}

.pending__box {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px dashed var(--rose-line);
  background: var(--rose-soft);
}

.pending__box p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Poraštė */

.foot {
  background: var(--ink);
  color: #f6e7ee;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
}

.foot__inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.foot__mark {
  width: 132px;
  opacity: 0.9;
}

.foot p {
  margin: 0;
  max-width: 32rem;
  line-height: 1.6;
}

.foot a {
  color: var(--rose);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Papildymai: trijų dalių navigacija ---------- */

.docs__index {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a2130;
  margin-bottom: 0.35rem;
}

.docs__link {
  grid-template-rows: auto auto auto;
}

.docs__index + .docs__name {
  grid-row: 2;
}

.docs__link .docs__state {
  grid-row: 1;
  align-self: center;
}

.head__kicker {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.prose h3 {
  font-size: clamp(1.05rem, 1.9vw, 1.2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.85rem;
}

.prose h3 + p {
  margin-top: 0;
}

.quote p + p {
  margin-top: 0.85rem;
}

/* Kitų dalių nuorodos straipsnio apačioje */

.pager {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 0 clamp(4rem, 10vw, 6rem);
}

.pager__title {
  margin: 0 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--rose);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pager__grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .pager__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pager__item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--rose-line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pager__item:hover {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.pager__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.pager__name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.pager__item--current {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.pager__item--current .pager__name {
  opacity: 0.6;
}

/* ---------- Nuotrauka ---------- */

.figure {
  margin: 2.25rem 0;
}

.figure img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--rose-soft);
}

.figure figcaption {
  margin: 0.7rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.figure__credit {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.8;
}

@media (min-width: 62rem) {
  .figure--wide {
    width: calc(100% + 7rem);
    max-width: none;
  }
}

/* ---------- Nuotraukų karuselė ---------- */

.gallery {
  margin: 2.25rem 0;
}

.gallery__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 0.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

.gallery__slide {
  margin: 0;
  scroll-snap-align: start;
  min-width: 0;
}

.gallery__slide img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--rose-soft);
}

.gallery__slide figcaption {
  margin: 0.7rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.gallery__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.gallery__dots {
  display: flex;
  gap: 0.4rem;
  margin-right: auto;
}

.gallery__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rose-line);
  cursor: pointer;
}

.gallery__dot.is-current {
  background: var(--rose-deep);
}

.gallery__btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rose-line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.gallery__btn:hover {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.gallery__btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.gallery__count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.gallery--a4 .gallery__slide img,
.figure--a4 img {
  display: block;
  width: 100%;
  height: clamp(20rem, 76vh, 44rem);  /* rėmelio aukštis */
  aspect-ratio: auto;                 /* atšaukia 3:2 */
  object-fit: contain;                /* lapas įtalpinamas, neapkerpamas */
  object-position: center;
  background: #fff;
}

@media (min-width: 62rem) {
  .gallery--wide .gallery__track {
    width: calc(100% + 7rem);
  }
}

/* ---------- Skaitymo šriftas ---------- */

:root {
  --font-text: "Literata", Charter, Georgia, "Times New Roman", serif;
}

.prose {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.78;
}

.prose h2,
.prose h3 {
  font-family: var(--font);
}

.prose strong {
  font-weight: 600;
}

.head__lede {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.65;
}

/* Smulkūs, tarnybiniai elementai lieka Montserrat */

.chrono__date,
.quote cite,
.figure figcaption,
.gallery__slide figcaption,
.gallery__count {
  font-family: var(--font);
}

.quote p {
  font-family: var(--font-text);
  font-size: 1.0625rem;
}

/* ---------- Titulinis puslapis siaurame ekrane ---------- */

/* iOS tekstą visada piešia pilkųjų atspalvių glotninimu ir nestorina
   raidžių kotelių, todėl Montserrat 500 rožinio lauko fone telefone
   atrodo daug plonesnis nei kompiuteryje. Straipsnių puslapiams tai jau
   pataisyta aukščiau esančioje @media (max-width: 47.99rem) sąlygoje,
   o titulinio elementai į ją nebuvo įtraukti.

   Blokas yra failo gale tyčia: .docs__index ir .docs__link aprašyti
   skyriuje „Papildymai“, t. y. vėliau už anąją sąlygą, todėl tokio pat
   specifiškumo perrašymas ten neveiktų. */

@media (max-width: 47.99rem) {
  .home__lede,
  .docs__note,
  .home__foot {
    font-weight: 600;
    color: var(--ink);
  }

  .docs__index {
    color: var(--ink);
  }

  .docs__state {
    font-weight: 700;
  }

  .docs__item {
    border-bottom-color: rgba(36, 16, 25, 0.45);
  }

  /* Telefone užvedimo nėra, o perėjimas gali priversti „Safari“ perkelti
     antraštę į atskirą piešimo sluoksnį — tada tekstas dar labiau
     suplonėja ir išsilieja. */
  .docs__name {
    transition: none;
  }
}

@media (max-width: 47.99rem) {
  .prose { font-size: 1.125rem; font-weight: 500; line-height: 1.7; }
  .prose strong { font-weight: 700; }
  .quote p { font-size: 1.0625rem; font-weight: 500; }
  .head__lede { font-weight: 500; color: var(--ink); }
  .chrono__date { font-size: 1rem; }

  .figure figcaption,
  .gallery__slide figcaption,
  .toc a,
  .head__meta dt { color: var(--ink); }

  .figure figcaption,
  .gallery__slide figcaption { font-size: 0.9375rem; }
}