/*
 * speleo.lt — modernised design (Claude Design canvas "Speleo.lt redesign",
 * https://claude.ai/artifact/DzS6d2Ea36SJaBW3BZqc29).
 * Dark header/footer, light ground, white cards; Manrope for headings,
 * Source Sans 3 for text (self-hosted, latin + latin-ext for Lithuanian).
 */

/* --- fonts (SIL OFL, see static/fonts/OFL-*.txt) --- */
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("../fonts/manrope-latin.b222d83cc274.woff2") format("woff2");
    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: "Manrope";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("../fonts/manrope-latin-ext.ea827930fb29.woff2") format("woff2");
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin.6e4bd172ce22.woff2") format("woff2");
    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: "Source Sans 3";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-ext.60938528c183.woff2") format("woff2");
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Source Sans 3";
    font-style: italic;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-italic-latin.b4b0c0233ac0.woff2") format("woff2");
    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: "Source Sans 3";
    font-style: italic;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-italic-latin-ext.df7018ecd5ea.woff2") format("woff2");
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- tokens --- */
:root {
    --ink: #15171c;
    --ink-2: #3b404b;
    --muted: #5a6070;
    --ground: #f5f6f8;
    --card: #fff;
    --line: #e2e5eb;
    --soft: #eef1f6;
    --link: #1d4aa8;
    --link-hover: #0f2f75;
    --dark: #0e1116;
    --dark-2: #1a1e26;
    --dark-line: #3a404c;
    --on-dark: #e9ecf2;
    --on-dark-muted: #a9b0bd;
    --accent: #e8952b;
    --radius: 8px;
    --font-head: "Manrope", system-ui, sans-serif;
    --font-text: "Source Sans 3", system-ui, sans-serif;
    --gutter: 24px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 18px;
    line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

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

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; }

.container { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container--narrow { max-width: calc(760px + 2 * var(--gutter)); }
.container--medium { max-width: calc(860px + 2 * var(--gutter)); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; z-index: 10; padding: 8px 14px; background: var(--card); }
.skip-link:focus { left: 8px; top: 8px; }

.button {
    display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
    border: 1px solid transparent; border-radius: 6px;
    background: var(--accent); color: var(--ink);
    font: inherit; font-weight: 600; cursor: pointer;
}
.button:hover { color: var(--ink); text-decoration: none; filter: brightness(1.06); }
.button--ghost { background: transparent; border-color: #4a515e; color: #fff; }
.button--ghost:hover { color: #fff; border-color: var(--on-dark-muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* --- header --- */
.site-header { background: var(--dark); color: #fff; border-top: 4px solid var(--accent); }

.site-header__top {
    padding-top: 18px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}

.brand { display: flex; align-items: baseline; gap: 12px; color: #fff; }
.brand:hover { color: #fff; text-decoration: none; }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 28px; letter-spacing: -0.5px; }
.brand__tag { font-size: 15px; color: var(--on-dark-muted); }

.site-header__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* The focused input shows an accent border flush with the button, not a detached ring. */
.header-search { display: flex; }
.header-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.header-search input {
    width: 220px; height: 44px; padding: 0 14px;
    border: 1px solid var(--dark-line); border-right: none; border-radius: 6px 0 0 6px;
    background: var(--dark-2); color: #fff; font: inherit; font-size: 16px;
}
.header-search input::placeholder { color: var(--on-dark-muted); }
.header-search button {
    height: 44px; padding: 0 16px; border: none; border-radius: 0 6px 6px 0;
    background: var(--accent); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}

.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #fff; }
.icon-button:hover { color: var(--accent); }
.header-search-link { display: none; }

.lang-link { color: #fff; font-size: 15px; font-weight: 600; padding: 10px 4px; }
.lang-link:hover { color: #fff; }
.lang-link__short { display: none; }

.menu-toggle {
    display: none; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
    border: 1px solid var(--dark-line); border-radius: 6px; background: transparent;
    color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}

.main-menu {
    padding-top: 14px;
    display: flex; flex-wrap: wrap; gap: 4px 18px;
    font-family: var(--font-head); font-weight: 600; font-size: 15px;
}
.main-menu a { padding: 10px 0 14px; color: var(--on-dark); border-bottom: 4px solid transparent; }
.main-menu a:hover { color: #fff; text-decoration: none; border-bottom-color: var(--dark-line); }
.main-menu a[aria-current] { color: #fff; border-bottom-color: var(--accent); }
.main-menu a.is-highlight { color: var(--accent); }

/* --- home: hero --- */
.hero { background: var(--dark); color: #fff; }
.hero__inner {
    padding-top: 24px; padding-bottom: 64px;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: center;
}
.hero__inner--text { grid-template-columns: minmax(0, 46rem); }
.hero__text { display: flex; flex-direction: column; gap: 20px; }
.hero__kicker {
    margin: 0; font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent); font-weight: 600;
}
.hero h1 { margin: 0; font-weight: 800; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.1; letter-spacing: -1px; }
.hero__intro { font-size: 20px; line-height: 1.55; color: #d5d9e1; }
.hero__intro > * { margin: 0 0 10px; }
.hero__intro blockquote { margin: 0 0 10px; }
.hero__intro blockquote + p { font-size: 16px; color: var(--on-dark-muted); }
.hero__intro a { color: inherit; text-decoration: underline; text-decoration-color: var(--dark-line); text-underline-offset: 3px; }
.hero__intro a:hover { color: #fff; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__figure { margin: 0; }
.hero__figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.hero__figure figcaption { margin-top: 8px; font-size: 14px; color: var(--on-dark-muted); }

/* --- home: sections --- */
.home-sections { padding-top: 56px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 64px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-weight: 800; font-size: 32px; letter-spacing: -0.5px; }
.section-head a { font-weight: 600; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

.news-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.news-card time { font-size: 15px; color: var(--muted); }
.news-card h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.news-card h3 a { color: var(--ink); }
.news-card h3 a:hover { color: var(--link-hover); }
.news-card p { margin: 0; font-size: 17px; color: var(--ink-2); }

.home-about { max-width: 760px; }

.feature-card { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.feature-card:hover { color: var(--ink); text-decoration: none; border-color: #c4cad6; }
.feature-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.feature-card__body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.feature-card__title { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.feature-card:hover .feature-card__title { color: var(--link-hover); }
.feature-card__text { font-size: 17px; color: var(--ink-2); }

/* --- content pages: side menu + article --- */
.layout { padding-top: 32px; padding-bottom: 80px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.layout__main { flex: 999 1 560px; min-width: 0; max-width: 760px; }
.layout__main:only-child { margin: 0 auto; }

.section-menu { flex: 1 1 260px; max-width: 280px; font-size: 16px; line-height: 1.35; }
.section-menu summary {
    margin: 0 0 10px; list-style: none;
    font-family: var(--font-head); font-weight: 800; font-size: 14px;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.section-menu summary::-webkit-details-marker { display: none; }
.section-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.section-menu ul ul { margin: 2px 0 6px 12px; padding-left: 10px; border-left: 1px solid #d5dae3; }
.section-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: #2a2e37; }
.section-menu ul ul a { padding-top: 7px; padding-bottom: 7px; }
.section-menu a:hover { color: var(--link-hover); background: var(--soft); text-decoration: none; }
.section-menu a.is-open { font-weight: 600; }
.section-menu a[aria-current] { background: var(--card); box-shadow: 0 0 0 1px var(--line); font-weight: 600; color: var(--link-hover); }

.page-single { padding-top: 32px; padding-bottom: 80px; }

.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; }

.page-title { margin: 12px 0 16px; font-weight: 800; font-size: clamp(30px, 4vw, 44px); line-height: 1.15; letter-spacing: -1px; }
.page-single > .page-title:first-child { margin-top: 0; }
.page-meta { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.page-meta--byline { margin: 0 0 32px; font-size: 16px; }
.lead-muted { margin: 0 0 40px; color: var(--muted); }

.prev-next {
    clear: both; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 600;
}
.prev-next a { display: inline-flex; align-items: center; min-height: 44px; }
.prev-next__next { margin-left: auto; text-align: right; }
.prev-next--labelled { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.prev-next--labelled a { flex-direction: column; align-items: flex-start; gap: 2px; }
.prev-next--labelled .prev-next__next { grid-column: 2; align-items: flex-end; }
.prev-next--labelled span { font-size: 15px; font-weight: 400; color: var(--muted); }

/* --- rich text --- */
.prose::after { content: ""; display: table; clear: both; }
.prose p { margin: 0 0 18px; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose h2 { margin: 36px 0 12px; font-weight: 700; font-size: 26px; }
.prose h3 { margin: 28px 0 10px; font-weight: 700; font-size: 21px; }
.prose h4 { margin: 24px 0 8px; font-weight: 700; font-size: 18px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 0 0 18px; padding-left: 16px; border-left: 4px solid var(--accent); color: var(--ink-2); }
.prose hr { clear: both; margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.prose h2, .prose h3, .prose h4 { clear: both; }

.richtext-image { border-radius: 4px; }
.richtext-image.left, .block-image--left { float: left; margin: 4px 24px 16px 0; }
.richtext-image.right, .block-image--right { float: right; margin: 4px 0 16px 24px; }
.richtext-image.full-width, .richtext-image.small, .richtext-image.medium { display: block; margin: 8px 0 18px; }
.block-image { margin: 8px 0 18px; }
.block-image img { display: block; border-radius: 4px; }

.table-scroll {
    clear: both; margin: 24px 0; overflow-x: auto;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.table-scroll table { border-collapse: collapse; font-size: 16px; min-width: 100%; }
.table-scroll th, .table-scroll td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-scroll tr:last-child > * { border-bottom: none; }
.table-scroll thead { background: var(--soft); font-family: var(--font-head); font-size: 14px; }
.table-scroll caption { padding: 10px 14px; text-align: left; font-weight: 600; }

.doc-card {
    display: flex; align-items: center; gap: 16px; margin: 24px 0; padding: 16px 20px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--link);
}
.prose .doc-card { text-decoration: none; }
.doc-card:hover { text-decoration: none; border-color: #c4cad6; }
.doc-card > span { display: flex; flex-direction: column; }
.doc-card__title { font-weight: 600; }
.doc-card:hover .doc-card__title { text-decoration: underline; }
.doc-card__meta { font-size: 15px; color: var(--muted); }

.embed { clear: both; margin: 24px 0; }
.embed iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

/* --- news list --- */
.news-featured { padding: 28px 32px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 10px; }
.news-featured__meta { margin: 0; font-size: 15px; color: var(--muted); }
.news-featured h2 { margin: 0; font-weight: 800; font-size: 28px; }
.news-featured h2 a { color: var(--ink); }
.news-featured h2 a:hover { color: var(--link-hover); }
.news-featured p { margin: 0; color: var(--ink-2); }
.news-featured__more { font-weight: 600; }

.news-year { margin-bottom: 32px; }
.news-year h2 { margin: 0 0 8px; font-size: 15px; letter-spacing: 1.5px; color: var(--muted); }
.news-year ul { list-style: none; margin: 0; padding: 0; }
.news-year li { display: flex; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.news-year time { flex: 0 0 110px; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.news-year a { font-weight: 600; color: var(--ink); }
.news-year a:hover { color: var(--link-hover); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 40px; font-weight: 600; font-size: 16px; }
.pager a {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px;
    padding: 0 6px; border-radius: 6px; color: var(--ink);
}
.pager a:hover { background: var(--soft); text-decoration: none; }
.pager a[aria-current] { background: var(--dark); color: #fff; }
.pager__gap { padding: 0 6px; color: var(--muted); }
.pager .pager__step { padding: 0 14px; color: var(--link); }
.pager .pager__step--next { margin-left: auto; }

/* --- search, forms --- */
.search-form { display: flex; gap: 8px; margin-bottom: 32px; }
.search-form input, .form input:not([type="checkbox"], [type="radio"]), .form textarea, .form select {
    flex: 1; min-width: 0; height: 48px; padding: 0 14px;
    border: 1px solid #c4cad6; border-radius: 6px; background: var(--card); font: inherit;
}
.form textarea { height: auto; min-height: 10em; padding: 10px 14px; width: 100%; }
.form > div { margin-bottom: 18px; display: flex; flex-direction: column; gap: 4px; }
.form label { font-weight: 600; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li { padding: 14px 0; border-top: 1px solid var(--line); }
.search-results a { font-weight: 600; }
.search-results p { margin: 4px 0 0; font-size: 16px; color: var(--ink-2); }

/* --- footer --- */
.site-footer { background: var(--dark); color: var(--on-dark-muted); font-size: 16px; }
.site-footer__inner { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer__club { display: flex; flex-direction: column; gap: 6px; }
.site-footer__name { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: #fff; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: #fff; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }

/* --- phones and small tablets --- */
@media (max-width: 59.99em) {
    :root { --gutter: 16px; }

    .site-header__top { padding-top: 10px; padding-bottom: 10px; flex-wrap: nowrap; gap: 8px; }
    .brand__name { font-size: 24px; }
    .brand__tag { display: none; }
    .site-header__tools { gap: 4px; flex-wrap: nowrap; }
    .header-search { display: none; }
    .header-search-link { display: inline-flex; }
    .lang-link { display: inline-flex; align-items: center; height: 44px; padding: 0 8px; }
    .lang-link__long { display: none; }
    .lang-link__short { display: inline; }

    /* without JS the menu simply stays visible */
    .js .menu-toggle { display: inline-flex; }
    .js .main-menu:not(.is-open) { display: none; }
    .main-menu { flex-direction: column; gap: 0; padding-top: 0; padding-bottom: 12px; font-size: 17px; }
    .main-menu a { padding: 10px 0; border-bottom: 1px solid var(--dark-2); }
    .main-menu a:hover { border-bottom-color: var(--dark-2); }
    .main-menu a[aria-current] { border-bottom-color: var(--dark-2); box-shadow: inset 4px 0 0 var(--accent); padding-left: 12px; }

    .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; padding-bottom: 48px; }
    .hero__intro { font-size: 18px; }
    .home-sections { padding-top: 40px; padding-bottom: 56px; gap: 48px; }
    .section-head h2 { font-size: 26px; }

    .layout { padding-top: 20px; padding-bottom: 48px; flex-direction: column; gap: 0; }
    .layout__main { flex: none; width: 100%; }
    .page-single { padding-top: 20px; padding-bottom: 48px; }

    /* side menu folds into a disclosure above the article */
    .section-menu { order: -1; flex: none; width: 100%; max-width: none; margin-bottom: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
    .section-menu summary {
        margin: 0; min-height: 44px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer;
        font-family: var(--font-text); font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink);
    }
    .section-menu summary::after { content: "▾"; color: var(--muted); }
    .section-menu[open] summary::after { content: "▴"; }
    .section-menu nav { padding: 0 8px 10px; }

    .richtext-image.left, .richtext-image.right, .block-image--left, .block-image--right { float: none; margin: 8px 0 18px; }
    .prev-next--labelled { grid-template-columns: minmax(0, 1fr); }
    .prev-next--labelled .prev-next__next { grid-column: 1; }
    .news-featured { padding: 20px; }
    .news-year li { gap: 14px; }
    .news-year time { flex-basis: 52px; }
}

@media (min-width: 60em) {
    /* on wide screens the section menu is a plain heading + list, not a toggle */
    .js .section-menu summary { pointer-events: none; }
}
