/*
Theme Name: Jausmo protas
Theme URI: https://jausmoprotas.lt
Description: Jausmo protas block theme (child of Twenty Twenty-Five). LT / EN / RU via Polylang.
Template: twentytwentyfive
Version: 1.1.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: jausmoprotas
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--night); }
:where(.wp-site-blocks) a:focus-visible { outline: 2px solid var(--wp--preset--color--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header (sticky, glass) ---------- */
.jp-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(11, 10, 28, .97);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	backdrop-filter: saturate(160%) blur(14px);
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.admin-bar .jp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .jp-header { top: 46px; } }
.jp-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
.jp-brand img { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 0 10px rgba(243,207,107,.45)); }
.jp-brand__name { white-space: nowrap; font-family: var(--wp--preset--font-family--literata); font-size: 1.35rem; font-style: italic; letter-spacing: .01em; color: #fff; }
.jp-header .wp-block-navigation { --navigation-layout-justification-setting: flex-end; }
.jp-header .wp-block-navigation a { text-decoration: none; }
.jp-header .wp-block-navigation .wp-block-navigation-item__content { padding: .35rem .2rem; }
.jp-header .wp-block-navigation__submenu-container {
	background: #1d1b3f !important; color: #fff !important; border: 1px solid rgba(255,255,255,.1) !important;
	border-radius: 14px; padding: .4rem !important; min-width: 260px !important; box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.jp-header .wp-block-navigation__submenu-container a { border-radius: 8px; padding: .45rem .7rem !important; }
.jp-header .wp-block-navigation__submenu-container a:hover { background: rgba(255,255,255,.08); }
.jp-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--night) !important; color: #fff !important; padding: 2rem; }
.jp-header .wp-block-search__button { background: transparent; color: #fff; border: 0; }

/* language switcher */
.jp-lang { display: flex; gap: .25rem; list-style: none; margin: 0; padding: .2rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
.jp-lang a { display: block; padding: .2rem .6rem; border-radius: 999px; color: rgba(255,255,255,.75); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.jp-lang a:hover { color: #fff; }
.jp-lang .is-current a { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--night); }

/* ---------- Animated banner + intro ---------- */
.jp-banner { margin: 0 !important; background: #0b0a1c; line-height: 0; overflow: hidden; }
.jp-banner video { display: block; width: 100%; height: auto; aspect-ratio: 960 / 253; object-fit: cover; object-position: 20% 50%; }
.jp-banner--home video { max-height: 560px; }
.jp-banner--inner video { height: clamp(120px, 17vw, 260px); }
@media (prefers-reduced-motion: reduce) { .jp-banner video { animation: none; } }
.jp-intro { background: linear-gradient(180deg, #0b0a1c 0%, #15143a 60%, #1d2152 100%); }
.jp-intro .wp-block-buttons { gap: .75rem; }
.jp-eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; margin: 0; }
.jp-btn-ghost .wp-block-button__link { background: transparent !important; color: #fff !important; border: 1px solid rgba(255,255,255,.4) !important; }
.jp-btn-ghost .wp-block-button__link:hover { border-color: #fff !important; background: rgba(255,255,255,.06) !important; }

/* ---------- Cards ---------- */
.jp-card {
	background: #fff; border-radius: 20px; overflow: hidden; height: 100%;
	border: 1px solid var(--wp--preset--color--line);
	transition: transform .25s ease, box-shadow .25s ease;
}
.jp-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -20px rgba(30, 28, 70, .35); }
.jp-card .wp-block-post-featured-image { margin: 0; aspect-ratio: 16/9; overflow: hidden; background: var(--wp--preset--color--line); }
.jp-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.jp-card .wp-block-post-featured-image img { transition: transform .5s ease; }
.jp-card:hover .wp-block-post-featured-image img { transform: scale(1.035); }
.jp-card .wp-block-post-title a { text-decoration: none; }
.jp-card .wp-block-post-title a:hover { color: var(--wp--preset--color--indigo); }
.jp-card .wp-block-post-excerpt__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jp-feature .jp-card { display: grid; grid-template-columns: 1.15fr 1fr; }
.jp-feature .jp-card > .wp-block-post-featured-image { height: 100%; }
.jp-feature .jp-card > .wp-block-post-featured-image img { height: 100%; min-height: 360px; }
@media (max-width: 860px) { .jp-feature .jp-card { grid-template-columns: 1fr; } .jp-feature .jp-card > .wp-block-post-featured-image img { min-height: 0; } }
.jp-noimg { aspect-ratio: 16/9; background: radial-gradient(circle at 70% 30%, #f3cf6b55 0, transparent 40%), linear-gradient(135deg, #2b2a5c, #568ebf); }

.jp-chip a, .jp-chip { text-decoration: none; }
.jp-chip a { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: var(--wp--preset--color--mist); color: var(--wp--preset--color--indigo); font-size: .75rem; font-weight: 700; letter-spacing: .04em; }

/* ---------- Books ---------- */
.jp-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.jp-book { text-decoration: none; color: #fff; display: flex; flex-direction: column; gap: .9rem; }
.jp-book__cover { aspect-ratio: 2/3; border-radius: 6px 14px 14px 6px; overflow: hidden; background: linear-gradient(135deg,#2b2a5c,#568ebf);
	box-shadow: 0 30px 50px -24px rgba(0,0,0,.7), inset 6px 0 10px -6px rgba(0,0,0,.4); transition: transform .3s ease; }
.jp-book:hover .jp-book__cover { transform: translateY(-6px) rotate(-1deg); }
.jp-book__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jp-book__title { font-family: var(--wp--preset--font-family--literata); font-size: 1.05rem; line-height: 1.35; }

/* ---------- Reading ---------- */
.jp-article .wp-block-post-content > p:first-of-type { font-size: 1.15em; }
.wp-block-post-content a { text-decoration-thickness: 1px; text-underline-offset: .2em; }
.wp-block-post-content img { border-radius: 12px; height: auto; }
.wp-block-post-content .wp-block-quote { border-left: 3px solid var(--wp--preset--color--gold); padding-left: 1.4rem; font-family: var(--wp--preset--font-family--literata); font-style: italic; }
.wp-block-post-content .alignleft { margin-right: 1.5rem; }
.wp-block-post-content .alignright { margin-left: 1.5rem; }
.wp-block-post-content iframe { max-width: 100%; }
.wp-playlist { border-radius: 14px; border: 1px solid var(--wp--preset--color--line); padding: 1rem; }
.wp-playlist-tracks { max-height: 420px; overflow: auto; }
.jp-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--wp--preset--color--gold), #f3cf6b); z-index: 100; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: .5rem; }
.wp-block-query-pagination-numbers .page-numbers { display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; border-radius: 999px; text-decoration: none; }
.wp-block-query-pagination-numbers .page-numbers.current { background: var(--wp--preset--color--night); color: #fff; }

/* ---------- Footer ---------- */
.jp-footer a { color: inherit; }
.jp-footer .wp-block-navigation a { text-decoration: none; opacity: .8; }
.jp-footer .wp-block-navigation a:hover { opacity: 1; }

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

/* Home: first post = featured, full width, horizontal */
body:not(.paged) .jp-home .jp-grid > li:first-child { grid-column: 1 / -1; }
body:not(.paged) .jp-home .jp-grid > li:first-child .jp-card { display: grid; grid-template-columns: 1.2fr 1fr; align-items: stretch; }
body:not(.paged) .jp-home .jp-grid > li:first-child .wp-block-post-featured-image { height: 100%; aspect-ratio: auto; }
body:not(.paged) .jp-home .jp-grid > li:first-child .wp-block-post-featured-image img,
body:not(.paged) .jp-home .jp-grid > li:first-child .jp-noimg { height: 100%; min-height: 380px; aspect-ratio: auto !important; }
body:not(.paged) .jp-home .jp-grid > li:first-child .jp-card > .wp-block-group { padding: clamp(1.5rem, 4vw, 3.25rem) !important; display: flex; flex-direction: column; justify-content: center; }
body:not(.paged) .jp-home .jp-grid > li:first-child .wp-block-post-title { font-size: clamp(1.6rem, 2.6vw, 2.3rem) !important; }
body:not(.paged) .jp-home .jp-grid > li:first-child .wp-block-post-excerpt__excerpt { -webkit-line-clamp: 5; }
@media (max-width: 860px) { body:not(.paged) .jp-home .jp-grid > li:first-child .jp-card { grid-template-columns: 1fr; } body:not(.paged) .jp-home .jp-grid > li:first-child .wp-block-post-featured-image img { min-height: 0; aspect-ratio: 16/9 !important; } }
body.paged .jp-home .jp-intro, body.paged .jp-home #knygos { display: none; }
body.paged .jp-home .jp-banner--home video { height: clamp(120px, 17vw, 260px); }
.jp-section-title { position: relative; padding-left: 1.1rem; }
.jp-section-title::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: var(--wp--preset--color--gold); }

/* Collapse the header menu to a burger earlier than core does (long RU/EN menu labels) */
@media (min-width: 600px) and (max-width: 1279px) {
	.jp-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.jp-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
.jp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { background: transparent !important; border: 0 !important; box-shadow: none; }
.jp-header .wp-block-navigation .wp-block-navigation-item { white-space: nowrap; }
@media (min-width: 600px) and (max-width: 1700px) {
	.jp-lang-ru .jp-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.jp-lang-ru .jp-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 600px) {
	.jp-brand__name { display: none; }
	.jp-header .wp-block-search { display: none; }
	.jp-lang a { padding: .2rem .45rem; }
}
