:root {
    /* Grounds */
    --ink: #20241E;
    --limestone: #EFEDE7;
    --parchment: #F8F7F3;
    --line: #D9D5C9;

    /* Accent */
    --gilt: #B98F2E;
    --gilt-deep: #7E6113;

    /* Muted text on light grounds */
    --ink-soft: #555A50;

    /* Diocese hues */
    --dio-telsiai: #2F6E78;
    --dio-siauliai: #49678D;
    --dio-panevezys: #647B3F;
    --dio-kaunas: #A84A3B;
    --dio-vilkaviskis: #A65E6A;
    --dio-kaisiadorys: #7A5A36;
    --dio-vilnius: #7C4D79;
    --dio-riga: #D6413B;
    --dio-jelgava: #E0A100;
    --dio-liepaja: #2E9E5B;
    --dio-rezekne: #6247C6;
    --dio-tallinn: #2E86AB;

    /* Type */
    --font-display: 'Palatino Linotype', Palatino, 'Book Antiqua', 'Iowan Old Style', Georgia, serif;
    --font-ui: 'Avenir Next', Avenir, 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-data: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

    /* Shadows */
    --shadow-2: 0 10px 25px rgba(32, 36, 30, 0.12);
    --shadow-3: 0 20px 40px rgba(32, 36, 30, 0.18);

    /* Layout */
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* On-ink (dark ground) */
    --gilt-bright: #D2AC4E;
    --on-ink: #ECE9DE;
    --on-ink-soft: #A8AB9B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background: var(--limestone);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Layout wrap — hero/actionbar are full-bleed bands, content constrained inside */
.dp-wrap {
    max-width: 1160px;
    margin: 0 auto;
    width: 100%;
}

/* Back Button — dark glass over the hero */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(18, 21, 15, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--on-ink);
    border: none;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
}

.back-button:hover {
    background: rgba(18, 21, 15, 0.75);
}

.back-button svg {
    width: 22px;
    height: 22px;
}

/* Language Switcher — dark glass pill */
.dp-langs {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 2px;
    padding: 4px;
    background: rgba(18, 21, 15, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
}

.dp-langs a {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--on-ink-soft);
    transition: color var(--transition);
}

.dp-langs a:hover {
    color: var(--on-ink);
}

.dp-langs a.active {
    background: var(--gilt-bright);
    color: var(--ink);
}

/* Hero */
.dp-hero {
    background:
        radial-gradient(520px 260px at 82% 0%, rgba(210, 172, 78, 0.16), transparent 70%),
        linear-gradient(180deg, #1B1F19 0%, var(--ink) 100%);
    color: var(--on-ink);
    padding: 96px 40px 44px;
    position: relative;
    overflow: hidden;
}

.dp-hero .dp-wrap {
    position: relative;
}

.dp-arch {
    position: absolute;
    right: 36px;
    bottom: -34px;
    width: 150px;
    height: 190px;
    border: 1.5px solid rgba(210, 172, 78, 0.4);
    border-bottom: 0;
    border-radius: 78px 78px 0 0;
    pointer-events: none;
}

.dp-arch::before {
    content: "";
    position: absolute;
    inset: 14px 14px 0;
    border: 1px solid rgba(210, 172, 78, 0.22);
    border-bottom: 0;
    border-radius: 62px 62px 0 0;
}

.dp-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    color: var(--on-ink-soft);
    margin-bottom: 22px;
}

.dp-crumbs a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

.dp-crumbs a:hover {
    color: var(--on-ink);
}

.dp-crumbs i {
    font-style: normal;
    opacity: 0.55;
}

.dp-crumbs b {
    color: var(--gilt-bright);
    font-weight: 500;
}

.dp-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gilt-bright);
    margin-bottom: 10px;
}

.dp-eyebrow i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.dp-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(27px, 4vw, 38px);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
    max-width: 24ch;
    margin: 0 0 16px;
}

.dp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    font-family: var(--font-data);
    font-size: 12px;
    color: var(--on-ink-soft);
    font-variant-numeric: tabular-nums;
}

.dp-stats span {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dp-stats b {
    color: var(--on-ink);
    font-weight: 500;
}

/* Action Bar */
.dp-actionbar {
    padding: 14px 40px;
    background: var(--parchment);
    border-bottom: 1px solid var(--line);
}

.dp-actionbar .dp-wrap {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.dp-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    background: var(--ink);
    color: #F3EBD3;
    padding: 10px 16px;
    min-height: 40px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    text-decoration: none;
    transition: filter var(--transition), border-color var(--transition), color var(--transition);
}

.dp-btn:hover {
    filter: brightness(1.15);
}

.dp-btn.ghost {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    font-weight: 500;
}

.dp-btn.ghost:hover {
    filter: none;
    border-color: var(--ink-soft);
    color: var(--ink);
}

.dp-btn.star {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--gilt-deep);
}

.dp-btn.star:hover {
    filter: none;
    border-color: var(--ink-soft);
}

.dp-btn.star[aria-pressed="true"] {
    color: var(--gilt-deep);
    border-color: var(--gilt-deep);
}

.dp-btn.star i {
    font-style: normal;
    font-size: 15px;
    line-height: 1;
}

.carat {
    opacity: 0.55;
    font-size: 11px;
    padding-left: 2px;
}

/* Route dropdown */
.dp-route {
    position: relative;
}

.dp-nav-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-2);
    overflow: hidden;
    z-index: 20;
}

.dp-nav-menu[hidden] {
    display: none;
}

.dp-nav-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    cursor: pointer;
}

.dp-nav-menu button:hover {
    background: var(--limestone);
}

.dp-nav-menu button + button {
    border-top: 1px solid var(--line);
}

/* Content Columns */
.dp-cols {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 34px;
    padding: 34px 40px 64px;
    align-items: start;
}

.dp-main {
    min-width: 0;
}

/* Churches with no description/gallery: side cards become the whole page */
.dp-cols.single {
    grid-template-columns: 1fr;
    max-width: 720px;
}

.dp-cols.single .dp-photo-media {
    height: 420px;
}

.dp-block h2 {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
    margin: 0 0 10px;
}

.dp-block + .dp-block {
    margin-top: 34px;
}

.dp-prose {
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink-soft);
    max-width: 66ch;
}

.dp-empty {
    font-size: 13.5px;
    color: var(--ink-soft);
    font-style: normal;
    margin: 0;
}

/* Image fit box — the whole image is shown with contain, and a blurred copy
   of it fills the leftover space instead of cropping it. Height comes from
   whichever component the box sits in. */
.dp-fit {
    position: relative;
    overflow: hidden;
    background: #E8E4D8;
}

.dp-fit img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dp-fit-bg {
    object-fit: cover;
    filter: blur(14px) saturate(1.15);
    /* Blur samples past the edges; scale up so no faded border shows */
    transform: scale(1.2);
}

.dp-fit-img {
    object-fit: contain;
}

/* Gallery */
.dp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.dp-res {
    margin: 0;
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}

.dp-res-media {
    height: 200px;
}

.dp-res figcaption {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--ink-soft);
}

.dp-res-meta {
    font-family: var(--font-data);
    font-size: 12px;
    margin-bottom: 4px;
}

.dp-res-info {
    line-height: 1.6;
}

/* Sidebar Cards */
.dp-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dp-card {
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 18px 20px;
    font-size: 13px;
}

.dp-card h2 {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 12px;
}

.dp-card.dp-photo {
    padding: 0;
    overflow: hidden;
}

.dp-photo-media {
    height: 280px;
}

.mass-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #E5E2D7;
    font-size: 13.5px;
}

.mass-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.mass-row span {
    color: var(--ink-soft);
}

.mass-row b {
    font-family: var(--font-data);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
    overflow-wrap: break-word;
    min-width: 0;
}

.atlaidai-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #E5E2D7;
    font-size: 13.5px;
}

.atlaidai-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.atlaidai-row span {
    min-width: 0;
}

.atlaidai-row span small {
    display: block;
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 2px;
}

.atlaidai-row b {
    font-family: var(--font-data);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
    color: var(--gilt-deep, #8A6D1F);
}

.facts-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid #E5E2D7;
    font-size: 13px;
}

.facts-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.facts-row span {
    color: var(--ink-soft);
}

.facts-row b {
    font-weight: 500;
    text-align: right;
    overflow-wrap: break-word;
    min-width: 0;
}

.facts-row a {
    color: var(--gilt-deep);
    text-decoration: none;
}

.facts-row a:hover {
    color: var(--ink);
}

/* Map Card */
.dp-card.dp-map {
    padding: 0;
    overflow: hidden;
    height: 320px;
}

#map {
    width: 100%;
    height: 100%;
}

/* Focus */
.back-button:focus-visible,
.dp-langs a:focus-visible,
.dp-btn:focus-visible {
    outline: 2px solid var(--gilt-bright);
    outline-offset: 2px;
}

.dp-btn.ghost:focus-visible,
.dp-btn.star:focus-visible,
.dp-nav-menu button:focus-visible {
    outline: 2px solid var(--gilt-deep);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .dp-hero {
        padding: 84px 20px 36px;
    }

    .dp-arch {
        right: -30px;
        opacity: 0.6;
    }

    .dp-actionbar {
        padding: 14px 20px;
    }

    .dp-cols {
        grid-template-columns: 1fr;
        padding: 34px 20px 64px;
    }

    .back-button {
        top: 16px;
        left: 16px;
    }

    .dp-langs {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .dp-stats {
        gap: 14px 18px;
    }
}

/* Nearby churches band (church page) */
.dp-nearby {
    padding: 0 40px 72px;
}

.dp-nearby h2 {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 14px;
}

.dp-nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.dp-nearby-card {
    display: block;
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--ink);
    transition: border-color var(--transition);
}

.dp-nearby-card:hover {
    border-color: var(--gilt);
}

.dp-nearby-card b {
    display: block;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 4px;
}

.dp-nearby-card span {
    font-size: 12px;
    color: var(--ink-soft);
}

.dp-nearby-all {
    display: inline-block;
    margin-top: 16px;
    color: var(--gilt-deep);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}

.dp-nearby-all:hover {
    color: var(--ink);
}

/* Report-a-mistake footer note (church page) */
.dp-report {
    padding: 0 40px 56px;
    text-align: center;
}

.dp-report p {
    margin: 0;
    font-size: 13px;
    color: var(--ink-soft);
}

.dp-report a {
    color: var(--gilt-deep);
    font-weight: 500;
    text-decoration: none;
}

.dp-report a:hover {
    color: var(--ink);
}

/* Directory pages (/baznycios) */
.dl-main {
    padding: 38px 40px 72px;
}

.dl-group + .dl-group,
.dl-others {
    margin-top: 34px;
}

.dl-group h2,
.dl-others h2 {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.dl-list {
    list-style: none;
    columns: 3;
    column-gap: 28px;
}

.dl-list li {
    break-inside: avoid;
}

.dl-list a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    text-decoration: none;
    transition: color var(--transition);
}

.dl-list a:hover {
    color: var(--gilt-deep);
}

.dl-dioceses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.dl-dio-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 15px 17px;
    text-decoration: none;
    color: var(--ink);
    transition: border-color var(--transition);
}

.dl-dio-card:hover {
    border-color: var(--gilt);
}

.dl-dio-card i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    grid-row: 1 / 3;
}

.dl-dio-card b {
    font-weight: 600;
    font-size: 14.5px;
    line-height: 1.3;
}

.dl-dio-card span {
    grid-column: 2;
    font-size: 12px;
    color: var(--ink-soft);
}

.dl-others-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.dl-others-links a {
    font-size: 13.5px;
    color: var(--gilt-deep);
    text-decoration: none;
    padding: 3px 0;
}

.dl-others-links a:hover {
    color: var(--ink);
}

@media (max-width: 900px) {
    .dl-list {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .dp-nearby {
        padding: 0 20px 56px;
    }

    .dp-report {
        padding: 0 20px 44px;
    }

    .dl-main {
        padding: 30px 20px 56px;
    }
}

@media (max-width: 560px) {
    .dl-list {
        columns: 1;
    }
}

/* Defer below-the-fold section rendering */
.dp-block,
.dp-card:not(.dp-map) {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
