/* Tarp šiaurės ir pietų — one stylesheet for the map and the jurisdiction pages. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-400-normal-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-400-normal-latin-ext.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-400-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-400-italic-latin-ext.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fafaf9;
  --ink: #1c1f26;
  --ink-soft: #555c69;
  --hair: #e3e5e9;
  --accent: #2f5d9b;
  --map-seam: #ffffff;
  --map-edge: #9db0c7;
  --shade-1: #e8eef5;
  --shade-2: #d6e1ee;
  --shade-3: #bfd0e3;
  --shade-4: #a3bbd6;
  --shade-5: #7f9fc4;
  --shade-6: #4f74a3;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --gutter: clamp(20px, 4.4vw, 64px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 240ms;
  color-scheme: light;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--shade-3); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html { scrollbar-color: var(--shade-4) var(--bg); }
a { color: inherit; text-decoration-color: #b6bdc8; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink-soft); }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Voices */
.caps { font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.ital { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* Top bar: back link and language toggle */
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(var(--gutter) * .55) var(--gutter) 0;
  min-height: 2.5rem;
}
.bar .back { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: .5em; }
.bar .back svg { width: .9em; height: .9em; }
.lang { display: inline-flex; align-items: center; gap: .5em; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin-left: auto; }
.lang button { padding: .25em .15em; color: var(--ink-soft); border-bottom: 1px solid transparent; }
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.lang .dot { color: var(--hair); }

/* Home: the atlas sheet */
.sheet {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--gutter) * .9);
  padding: calc(var(--gutter) * .5) var(--gutter) var(--gutter);
  align-items: start;
}
.side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.site-title { margin: 0; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.85rem); line-height: 1.2; max-width: 14em; }
.site-title a { text-decoration: none; }
.site-sentence { margin: 0; font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem); line-height: 1.35; color: var(--ink-soft); max-width: 24ch; }

.panel { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; min-width: 0; }
.panel-name { margin: 0; font-size: 1.375rem; line-height: 1.2; letter-spacing: .12em; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.panel-name .open { font-size: .8rem; letter-spacing: .12em; text-decoration: none; border-bottom: 1px solid var(--hair); padding-bottom: .1em; }
.panel-name .open:hover { border-bottom-color: var(--ink); }
.mosaic { display: block; position: relative; aspect-ratio: 1; width: min(100%, 420px); outline: 1px solid var(--hair); background: #fff; view-transition-name: mosaic; }
a.mosaic:hover { outline-color: var(--ink-soft); }
a.mosaic:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mosaic-note { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.mosaic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel-count { margin: 0; font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); line-height: 1.35; text-wrap: balance; }
.panel-count b { font-weight: 400; }
.author { margin: auto 0 0; padding-top: 1.5rem; font-size: 1rem; color: var(--ink-soft); }

.atlas { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.map { width: 100%; height: auto; display: block; overflow: visible; }
.map .region path {
  stroke: var(--map-seam); stroke-width: 1.6; stroke-linejoin: round;
  transition: filter var(--dur) var(--ease), stroke var(--dur) var(--ease), stroke-width var(--dur) var(--ease);
}
.map .region text { font-family: var(--serif); font-style: italic; fill: var(--ink); pointer-events: none; }
.map .region text.on-dark { fill: #fff; }
.map .region:hover path, .map .region.is-selected path { filter: brightness(.9) saturate(1.15); stroke: var(--ink); stroke-width: 2; }
.map .region:active path { filter: brightness(.86) saturate(1.2); stroke: var(--ink); stroke-width: 2; }
.map .region:focus-visible { outline: none; }
.map .region:focus-visible path { stroke: var(--accent); stroke-width: 3; }
.map .country { fill: none; stroke: var(--map-edge); stroke-width: 1; pointer-events: none; }
.map .region { cursor: pointer; }

.legend { display: flex; flex-direction: column; gap: .45rem; color: var(--ink-soft); }
.legend .note { margin: 0; font-size: .85rem; }
.legend .keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .9rem; }
.legend .keys li { display: inline-flex; align-items: center; gap: .45rem; }
.legend .keys i { display: block; width: 1.6rem; height: .8rem; border: 1px solid rgba(28, 31, 38, .12); }

/* What the map does, said once above it; the wording follows the input the visitor actually has. */
.hint { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-touch { display: block; }
  .hint-pointer { display: none; }
}

/* The seven dioceses as plain, obviously tappable rows, each with its own mosaic. Phones and tablets only. */
.dlist { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.dlist h2 { margin: 0; font-size: .85rem; letter-spacing: .16em; }
.dlist ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.dlist a {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: .9rem;
  padding: .6rem .25rem .6rem 0; border-bottom: 1px solid var(--hair); text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}
.dlist a:active, .dlist a:hover { background: var(--shade-1); }
.dlist img { width: 56px; height: 56px; object-fit: cover; outline: 1px solid var(--hair); }
.dlist .nm { display: block; font-size: 1rem; font-weight: 500; }
.dlist .ct { display: block; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink-soft); }
.dlist svg { width: 1rem; height: 1rem; color: var(--ink-soft); }

@media (max-width: 899.98px) {
  /* phone and tablet: title, subtitle, map, then the mosaic panel; the footer carries the author */
  .side { display: contents; }
  .site-title { order: 1; }
  .site-sentence { order: 2; }
  .atlas { order: 3; }
  .panel { order: 4; margin-top: 0; }
  .side .author { display: none; }
  /* never taller than the window, even on a landscape tablet or a short laptop window */
  .atlas { width: min(100%, max(18rem, calc((100svh - 21rem) * 1.313))); justify-self: center; }
  .mosaic { width: min(100%, 560px, calc(100svh - 8rem)); }
}

@media (max-width: 559.98px) {
  .legend .keys { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 1.5rem; }
}

@media (min-width: 900px) {
  /* One screen: the map, its legend and the mosaic are sized from the window height, so nothing needs scrolling. */
  .sheet {
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 80px);
    padding-bottom: calc(var(--gutter) * .5);
    min-height: min(calc(100svh - 4.7rem), 1000px);
    align-items: stretch;
  }
  .side { gap: clamp(.75rem, 1.8svh, 1.25rem); }
  .panel .mosaic { width: clamp(200px, calc(100svh - 32rem), 420px); }
  .atlas { width: min(100%, calc((100svh - 15rem) * 1.313)); justify-self: center; align-self: start; }
  .author { margin-top: auto; }
  .dlist { display: none; }
}

/* Jurisdiction pages: an overview that fits one screen, then the full list, then the pager.
   Nothing is sticky, so the whole page scrolls as one sheet. */
.detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: calc(var(--gutter) * 1.1);
  padding: calc(var(--gutter) * .5) var(--gutter) var(--gutter);
}
.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--gutter) * .9);
  align-items: start;
}
.detail .lead { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.detail .page-name { margin: 0; font-size: 1.375rem; line-height: 1.2; letter-spacing: .12em; }
.detail .mosaic { width: min(100%, 560px, calc(100svh - 8rem)); }
.detail .sentence { margin: 0; font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem); line-height: 1.3; max-width: 26ch; }

.facts { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.facts h2, .breakdown h2 { margin: 0; font-size: .85rem; letter-spacing: .16em; }
.facts .where-title { margin-top: 1rem; }
.facts .map { width: min(100%, 520px); }
.mats { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.strip { display: flex; width: 100%; height: 2.6rem; outline: 1px solid rgba(28, 31, 38, .14); background: var(--bg); }
.strip i { display: block; height: 100%; min-width: 1px; }
.strip i + i { border-left: 1px solid rgba(28, 31, 38, .14); }

.breakdown { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* ranked list, read top to bottom, then across */
.rows { list-style: none; margin: 0; padding: 0; columns: 19rem; column-gap: clamp(2rem, 4vw, 4rem); border-bottom: 1px solid var(--hair); }
.rows li {
  break-inside: avoid;
  display: grid; grid-template-columns: 1.5rem 1fr auto; column-gap: .9rem; align-items: baseline;
  padding: .6rem 0; border-top: 1px solid var(--hair);
}
.rows .sw { width: 1.5rem; height: 1.5rem; align-self: center; border: 1px solid rgba(28, 31, 38, .16); }
.rows .nm { font-size: 1rem; font-weight: 500; }
.rows .mat { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: .15rem; }
.rows .ct { font-family: var(--serif); font-style: italic; font-size: 1.25rem; min-width: 2.2em; text-align: right; }

.pager { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.pager a { text-decoration: none; display: inline-flex; align-items: center; gap: .5em; border-bottom: 1px solid var(--hair); padding-bottom: .15em; max-width: 48%; line-height: 1.35; }
.pager a[rel="next"] { text-align: right; }
.pager svg { flex: none; }
.pager a:hover { border-bottom-color: var(--ink); }
.pager svg { width: .9em; height: .9em; }

@media (min-width: 900px) {
  .overview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); }
  /* the overview fits the window: mosaic and map shrink on short screens */
  .detail .mosaic { width: min(100%, 560px, calc(100svh - 15rem)); }
  .facts .map { width: min(100%, 520px, calc((100svh - 22rem) * 1.313)); }
}

/* Footer */
.foot {
  padding: calc(var(--gutter) * .75) var(--gutter) var(--gutter);
  border-top: 1px solid var(--hair);
  display: grid; gap: 1.5rem;
  font-size: .9rem; color: var(--ink-soft);
}
.foot .who { font-size: 1rem; color: var(--ink); margin: 0; }
.foot ul { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.foot h3 { margin: 0; font-size: .8rem; letter-spacing: .16em; color: var(--ink-soft); }
.foot .credits { font-size: .8rem; max-width: 70ch; line-height: 1.5; }
.foot .credits p { margin: .3rem 0 0; }
@media (min-width: 720px) { .foot { grid-template-columns: 1fr 1fr 1.4fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
  @view-transition { navigation: none; }
}
