/* Ligipaasetavus - Tori Valla Raamatukogu */
/* Hange 305341 */
/* Vasakul pealkiri, aadress ja galerii - kleepub kerides. Paremal tekst. */

/* ------------------------------------------------------------------ */
/* Lahtestus - teema seab nuppudele fikseeritud korguse ja tupograafia */
/* ------------------------------------------------------------------ */

.lp-leht button {
  box-sizing: border-box;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
}

.lp-leht h2.lpo-pealkiri::before,
.lp-leht h2.lpo-pealkiri::after,
.lp-leht .lpo-paneel h2::before,
.lp-leht .lpo-paneel h2::after,
.lp-leht .lpo-paneel h3::before,
.lp-leht .lpo-paneel h3::after {
  content: none !important;
  display: none !important;
}

/* ------------------------------------------------------------------ */

.lp-leht {
  --lp-aktsent: #BD363B;
  --lp-tekst: #1C1817;
  --lp-hall: #7A7270;
  --lp-joon: #E6E2E0;
  color: var(--lp-tekst);
  margin: 0;
  padding: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* Kirje */

.lp-leht .lpo-kirje {
  position: relative;
  border-bottom: 1px solid var(--lp-joon);
}

.lp-leht .lpo-kirje:first-child {
  border-top: 1px solid var(--lp-joon);
}

/* Veerud - suletuna uks, avatuna kaks */

.lp-leht .lpo-veerud {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.lp-leht .lpo-kirje.on-avatud .lpo-veerud {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 3rem;
}

/* Vasak plokk - pealkiri, aadress, galerii. See kleepub. */

.lp-leht .lpo-vasak {
  align-self: start;
  min-width: 0;
  background: transparent;
}

.lp-leht .lpo-vasak.on-kleepub {
  z-index: 5;
  background: #fff;
  padding-bottom: 1.25rem;
}

/* Kitsal ekraanil kleepub ainult pealkiri, kaardina varjuga */

.lp-leht .lpo-pealkiri.on-kaart {
  z-index: 6;
  box-sizing: border-box;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid var(--lp-joon);
  box-shadow: 0 4px 14px rgba(28, 24, 23, 0.12);
}

@supports not (backdrop-filter: blur(8px)) {
  .lp-leht .lpo-pealkiri.on-kaart {
    background: #fff;
  }
}

@media (max-width: 900px) {
  .lp-leht .lpo-kirje.on-avatud .lpo-veerud {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Pealkiri */

.lp-leht h2.lpo-pealkiri {
  position: static;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--lp-tekst);
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.lp-leht button.lpo-nupp {
  box-sizing: border-box;
  position: static;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0.1rem;
  width: 100%;
  margin: 0 !important;
  padding: 2rem 3.5rem 2rem 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none;
  box-shadow: none !important;
  color: var(--lp-tekst);
  font-family: inherit;
  text-align: left;
  text-transform: none;
  cursor: pointer;
  transition: color 200ms ease-out;
  -webkit-user-select: none;
  user-select: none;
}

.lp-leht button.lpo-nupp:hover {
  color: var(--lp-aktsent);
  background: none;
}

.lp-leht button.lpo-nupp:focus {
  outline: none;
}

.lp-leht button.lpo-nupp:focus-visible .lpo-nimi {
  outline: 2px solid var(--lp-aktsent);
  outline-offset: 6px;
}

.lp-leht .lpo-nimi {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-transform: none;
}

.lp-leht .lpo-aadress {
  display: block;
  width: 100%;
  color: var(--lp-hall);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  text-transform: none;
}

/* Nool - paremal, ringi sees, selgelt nahtav */

/* Nool on kirje otsene laps, mitte nupu sees - nii jaab see kerides
   paigale ka siis, kui vasak plokk on fikseeritud. */

.lp-leht .lpo-nool {
  position: absolute;
  z-index: 6;
  top: 2rem;
  right: 0;
  cursor: pointer;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: 0;
  border: 1px solid var(--lp-joon) !important;
  border-radius: 50%;
  transform: none;
  transition: border-color 200ms ease-out, background 200ms ease-out;
}

.lp-leht .lpo-nool::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: 0;
  border-right: 2px solid var(--lp-tekst);
  border-bottom: 2px solid var(--lp-tekst);

  /* Poordumine kaib keskpunkti umber. translate teeb optilise
     paranduse, sest kolmnurga raskuskese ei ole ruudu keskel. */
  transform: translate(-50%, -70%) rotate(45deg);
  transform-origin: center;
  transition: transform 250ms ease-out, border-color 200ms ease-out;
}

/* Nool on kirje laps, mitte nupu sees - reeglid kaivad kirje jargi */

.lp-leht .lpo-nool:hover,
.lp-leht .lpo-kirje:has(.lpo-nupp:hover) .lpo-nool {
  border-color: var(--lp-aktsent) !important;
  background: var(--lp-aktsent);
}

.lp-leht .lpo-nool:hover::after,
.lp-leht .lpo-kirje:has(.lpo-nupp:hover) .lpo-nool::after {
  border-right-color: #fff;
  border-bottom-color: #fff;
}

/* Avatud olek kaib aria-expanded jargi, mitte klassi jargi -
   nii ei saa varv kunagi tegelikust olekust lahku minna. */

.lp-leht .lpo-kirje:has(.lpo-nupp[aria-expanded="true"]) .lpo-nool {
  border-color: var(--lp-aktsent) !important;
  background: var(--lp-aktsent);
}

.lp-leht .lpo-kirje:has(.lpo-nupp[aria-expanded="false"]) .lpo-nool {
  border-color: var(--lp-joon) !important;
  background: none;
}

.lp-leht .lpo-kirje:has(.lpo-nupp[aria-expanded="true"]) .lpo-nool::after {
  transform: translate(-50%, -30%) rotate(225deg);
  border-right-color: #fff;
  border-bottom-color: #fff;
}

.lp-leht .lpo-kirje:has(.lpo-nupp[aria-expanded="false"]) .lpo-nool::after {
  transform: translate(-50%, -70%) rotate(45deg);
  border-right-color: var(--lp-tekst);
  border-bottom-color: var(--lp-tekst);
}

.lp-leht .lpo-nupp[aria-expanded="true"] .lpo-nimi {
  color: var(--lp-aktsent);
}

.lp-leht .lpo-nupp[aria-expanded="false"] .lpo-nimi {
  color: var(--lp-tekst);
}

/* Galerii vasakus plokis */

/* hidden atribuut peab voitma - galerii on suletuna nahtamatu */

.lp-leht .lpo-pildid[hidden],
.lp-leht [hidden] {
  display: none !important;
}

.lp-leht .lpo-pildid {
  display: block;
  margin-top: 0.25rem;
  overflow: visible;
}

.lp-leht .lp-galerii {
  display: grid;
  gap: 0.4rem;
}

.lp-leht .lp-galerii .lp-foto {
  margin: 0;
  overflow: hidden;
}

.lp-leht button.lp-suurenda {
  display: block;
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: none;
  cursor: zoom-in;
}

.lp-leht button.lp-suurenda:focus-visible {
  outline: 2px solid var(--lp-aktsent);
  outline-offset: 4px;
}

.lp-leht .lp-galerii .lp-foto img.lp-foto__suur {
  display: block;
  width: 100%;
  height: auto;
}

.lp-leht .lp-pisipildid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-leht .lp-pisipildid li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-leht button.lp-pisipilt {
  position: relative;
  display: block;
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: none;
  cursor: pointer;
  opacity: 0.45;
  overflow: hidden;
  transition: opacity 250ms ease-out;
}

.lp-leht button.lp-pisipilt img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lp-leht button.lp-pisipilt:hover {
  opacity: 0.75;
}

.lp-leht button.lp-pisipilt.on-aktiivne {
  opacity: 1;
  cursor: default;
}

.lp-leht button.lp-pisipilt:focus-visible {
  outline: 2px solid var(--lp-aktsent);
  outline-offset: 4px;
  opacity: 1;
}

/* Parem veerg - tekst */

/* Tekst on alati teises veerus. Ilma selleta hupab see esimesse,
   kui vasak plokk kleepudes voost lahkub. */

.lp-leht .lpo-kirje.on-avatud .lpo-paneel {
  grid-column: 2;
  grid-row: 1;
}

@media (max-width: 900px) {
  .lp-leht .lpo-kirje.on-avatud .lpo-paneel {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Ulemine polster tuleb JavaScriptist - see joondab teksti galeriiga */

.lp-leht .lpo-paneel {
  min-width: 0;
  padding: 0 0 3.5rem;
}

.lp-leht .lpo-paneel h2 {
  margin: 2.5rem 0 1.25rem !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--lp-hall) !important;
  font-family: inherit !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.18em !important;
  line-height: 1.4 !important;
  text-transform: uppercase !important;
}

.lp-leht .lpo-paneel h2:first-child {
  margin-top: 0 !important;
}

.lp-leht .lpo-paneel h3 {
  display: block !important;
  margin: 1.75rem 0 0.1rem !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--lp-hall) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  line-height: 1.5 !important;
  text-transform: none !important;
}

.lp-leht p {
  margin: 0 0 0.5rem;
  line-height: 1.75;
}

.lp-leht .lpo-paneel > p:first-of-type {
  margin-bottom: 1.25rem;
}

/* Kontaktid */

.lp-leht .lp-kontakt {
  margin-top: 1.25rem;
  padding: 0;
  background: none;
  border: 0;
}

.lp-leht .lp-kontakt p {
  margin: 0 0 0.2rem;
  overflow-wrap: anywhere;
}

.lp-leht .lp-kontakt p:first-child {
  margin-bottom: 0.5rem;
}

.lp-leht .lp-kontakt p:last-child {
  margin-bottom: 0;
}

.lp-leht .lp-kontakt a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lp-tekst);
  font-size: inherit;
  letter-spacing: normal;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-color: var(--lp-joon);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-transform: none;
  transition: text-decoration-color 200ms ease-out, color 200ms ease-out;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.lp-leht .lp-kontakt a:hover {
  color: var(--lp-aktsent);
  text-decoration-color: var(--lp-aktsent);
}

.lp-leht .lpo-valislink {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  opacity: 0.5;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 2.5H3A1 1 0 0 0 2 3.5v9A1 1 0 0 0 3 13.5h9a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M9.5 2.5H13.5V6.5'/%3E%3Cpath d='M13.5 2.5L7.5 8.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 2.5H3A1 1 0 0 0 2 3.5v9A1 1 0 0 0 3 13.5h9a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M9.5 2.5H13.5V6.5'/%3E%3Cpath d='M13.5 2.5L7.5 8.5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.lp-peidus {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Pildi suurendus */

.lpo-aken {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.lpo-aken::backdrop {
  background: rgba(28, 24, 23, 0.95);
}

.lpo-aken__sisu {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 4.5rem 5rem 5rem;
}

.lpo-aken__pilt {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
}

.lpo-aken__riba {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.75rem 1.5rem;
  font-size: 0.85rem;
  pointer-events: none;
}

.lpo-aken__pealdis,
.lpo-aken__loend {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.lpo-aken__pealdis {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lpo-aken__loend {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.lpo-aken button {
  position: absolute;
  padding: 0 !important;
  border: 0 !important;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  line-height: 1;
  transition: color 200ms ease-out;
}

.lpo-aken button:hover {
  color: #fff;
}

.lpo-aken button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.lpo-aken__eelmine,
.lpo-aken__jargmine {
  top: 50%;
  width: 56px !important;
  height: 56px !important;
  margin-top: -28px;
  font-size: 40px;
  font-weight: 200;
}

.lpo-aken__eelmine {
  left: 1rem;
}

.lpo-aken__jargmine {
  right: 1rem;
}

.lpo-aken__sulge {
  top: 1.25rem;
  right: 1.5rem;
  width: 44px !important;
  height: 44px !important;
  font-size: 30px;
  font-weight: 200;
}

/* Ulevaatamise kuupaev */

.lp-ule-vaadatud {
  margin-top: 2.5rem;
  color: var(--lp-hall);
  font-size: 0.8rem;
}

/* Ligipaasetavuse teatis */

.lpt-olek {
  margin: 0 0 1rem;
  padding: 0;
  background: none;
  border: 0;
}

.lpt-loetelu {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.75;
}

.lpt-loetelu li {
  margin-bottom: 0.4rem;
}

/* Kitsas ekraan */

@media (max-width: 600px) {
  .lp-leht {
    font-size: 1rem;
  }

  .lp-leht button.lpo-nupp {
    padding: 1.5rem 3rem 1.5rem 0 !important;
  }

  .lp-leht .lpo-nimi {
    font-size: 1.15rem;
  }

  .lp-leht .lpo-nool {
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
  }

  .lp-leht .lpo-paneel {
    padding: 1.5rem 0 2.5rem;
  }

  .lp-leht .lpo-paneel h2 {
    margin-top: 2.25rem !important;
  }

  .lp-leht .lp-pisipildid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lpo-aken__sisu {
    padding: 3.5rem 1rem 4rem;
  }

  .lpo-aken__eelmine,
  .lpo-aken__jargmine {
    width: 44px !important;
    height: 44px !important;
    margin-top: -22px;
    font-size: 32px;
  }

  .lpo-aken__eelmine {
    left: 0.25rem;
  }

  .lpo-aken__jargmine {
    right: 0.25rem;
  }
}

/* Fookus ja liikumine */

.lp-leht a:focus-visible {
  outline: 2px solid var(--lp-aktsent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .lp-leht *,
  .lp-leht *::before,
  .lp-leht *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Kitsas ekraan - viimasena, et voita varasemaid reegleid             */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {

  /* Taisserv: konteineri kulgpolster tuhistatakse negatiivse marginiga */

  .lp-leht {
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    width: 100vw;
    max-width: 100vw;
  }

  /* Taust ulatub servani, tekst on polstriga sees */

  .lp-leht .lpo-paneel {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .lp-leht button.lpo-nupp {
    padding-left: 1rem !important;
    padding-right: 3rem !important;
  }

  .lp-leht .lpo-pildid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .lp-leht .lpo-nool {
    right: 1rem;
  }

  /* Kleepuv riba: valge, ohuke allaar, sama korgus mis tavaolekus */

  .lp-leht h2.lpo-pealkiri.on-kaart {
    padding: 0 !important;
    background: #fff !important;
    border-bottom: 1px solid var(--lp-joon);
    box-shadow: 0 4px 14px rgba(28, 24, 23, 0.12) !important;
  }

  .lp-leht h2.lpo-pealkiri.on-kaart button.lpo-nupp {
    padding: 1.5rem 3rem 1.5rem 1rem !important;
  }
}/* ==================================================================
   LIGIPÄÄSETAVUSE RIBA JALUSE ALL
   Hange 305341, leping p 4.4.2 ja 4.6

   Fail: wp-content/mu-plugins/ligipaasetavus/ligipaasetavus.css

   VÄRVID – MÕÕDETUD 13.08.2026

   Elemendil #colophon on taust #FF0000, kuid see EI OLE NÄHTAV –
   selle peal on DIV.footer-t värviga #655848 (361 px kõrge).
   Punane on jäänuk ja seda ei tohi aluseks võtta.

     nähtav jalus     #655848
     riba             #4F4538   (sama toon, veidi tumedam)
     valge tekst      9,37:1    (nõue 4,5:1)

   Kui kujundus nõuab teist tooni, muuda AINULT kahte muutujat –
   fookuseraam on nendega seotud ja kohandub kaasa.
   ================================================================== */

.lpo-riba {
	--lpo-riba-taust: #4F4538;
	--lpo-riba-tekst: #FFFFFF;

	background: var(--lpo-riba-taust);
	color: var(--lpo-riba-tekst);
	padding: 10px 20px;
	font-size: 15px;
	line-height: 1.5;
	width: 100%;
	box-sizing: border-box;
}

.lpo-riba__sisu {
	max-width: 1200px;
	margin: 0 auto;
}

.lpo-riba__loend {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	justify-content: center;
}

.lpo-riba__loend li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lpo-riba__loend li::before,
.lpo-riba__loend li::marker {
	content: none;
}

/*
 * Viited on allakriipsutatud ja märgendiga, sest teemad lülitavad
 * allakriipsutuse sageli välja. Peatuse saidil juhtus täpselt see –
 * ilma märgendita andis mõõtmine `text-decoration-line: none`.
 *
 * Klikiala vähemalt 24x24 px (WCAG 2.5.8). Reavahe 1,5 juures on
 * 15 px tekst umbes 22 px kõrgune, seega lisame vertikaalset polstrit.
 */
.lpo-riba__loend a {
	color: var(--lpo-riba-tekst) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
	display: inline-block;
	padding: 4px 2px;
}

.lpo-riba__loend a:hover,
.lpo-riba__loend a:focus {
	color: var(--lpo-riba-tekst) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
}

/*
 * Fookuseraam. Riba on tume, seega raam on VALGE ja kontuur tume –
 * nii jääb ta nähtavaks ka siis, kui riba värvi heledamaks muuta.
 */
.lpo-riba__loend a:focus-visible {
	outline: 3px solid var(--lpo-riba-tekst) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px var(--lpo-riba-taust) !important;
	border-radius: 2px;
}

@supports not selector(:focus-visible) {
	.lpo-riba__loend a:focus {
		outline: 3px solid var(--lpo-riba-tekst) !important;
		outline-offset: 2px !important;
	}
}

/* Kitsas kuvas üksteise all, et klikialad ei läheks liiga lähestikku */
@media (max-width: 480px) {
	.lpo-riba__loend {
		flex-direction: column;
		align-items: center;
		gap: 4px;
	}
}
