/*
Theme Name:   Balloonservice
Theme URI:    https://balloonservice.lt
Description:  Four-language theme for balloonservice.lt — hot air balloon repair, technical inspection, and a spare parts catalogue. Child of Twenty Twenty-Five, so it inherits core block styling and security updates while keeping its own palette, typography and templates.
Author:       balloonservice.lt
Template:     twentytwentyfive
Version:      2.0.0
Requires PHP: 7.4
Text Domain:  balloonservice
*/

/* ==========================================================================
   Palette and type live in theme.json. This file covers what block styles
   cannot express: the navigation, the language switcher, the parts grid, and
   the classic-editor HTML that came across from the old site.

   The accent is #40c0f0 — sampled from the logo itself rather than guessed.
   It is too light to sit on white as text, so links and buttons use a deeper
   tone of the same hue (#0b7ca9) and the bright value is kept for rules,
   underlines and hover states where it reads as the brand without failing
   contrast.
   ========================================================================== */

/* Fonts are self-hosted and enqueued separately in functions.php — an @import
   here would serialise the request behind this stylesheet. They are served
   from the theme rather than Google's CDN so that visitors in the EU are not
   making a request to a third party just to read the page. */

/* --------------------------------------------------------------------------
   Site logo
   -------------------------------------------------------------------------- */

.wp-block-site-logo img {
	height: auto;
	max-height: 58px;
	width: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.bs-header {
	backdrop-filter: saturate(140%) blur(6px);
}

/* --------------------------------------------------------------------------
   Primary navigation
   -------------------------------------------------------------------------- */

.bs-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.65rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bs-nav__list li { margin: 0; }

.bs-nav__list a {
	position: relative;
	display: inline-block;
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-size: 0.945rem;
	font-weight: 500;
	letter-spacing: -0.012em;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	padding: 3px 0;
	transition: color .16s ease;
}

/* Underline grows from the left rather than snapping on — quieter than a
   colour flip and it keeps the row height stable. */
.bs-nav__list a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 100%;
	background: var(--wp--preset--color--brand);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s ease;
}

.bs-nav__list a:hover,
.bs-nav__list a:focus-visible { color: var(--wp--preset--color--deep); }

.bs-nav__list a:hover::after,
.bs-nav__list a:focus-visible::after,
.bs-nav__list .current-menu-item > a::after,
.bs-nav__list .current_page_item > a::after { transform: scaleX(1); }

.bs-nav__list .current-menu-item > a,
.bs-nav__list .current_page_item > a {
	color: var(--wp--preset--color--deep);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.bs-nav__list a::after { transition: none; }
}

/* --------------------------------------------------------------------------
   Dropdown

   Opens on :hover and :focus-within — the second is not optional. A hover-only
   dropdown is unreachable by keyboard, which would strand Repair and
   Advertising behind a control nobody tabbing through the site can open.
   -------------------------------------------------------------------------- */

.bs-nav__list > li { position: relative; }

/*
 * Caret on items that have a submenu.
 *
 * It has to be ::before, because ::after already carries the growing
 * underline. Positioned absolutely against padding reserved on the anchor so
 * it sits after the label rather than in front of it — which is where an
 * inline ::before would land.
 */
.bs-nav__list > li.menu-item-has-children > a {
	padding-right: 15px;
}

.bs-nav__list > li.menu-item-has-children > a::before {
	content: "";
	position: absolute;
	right: 1px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	opacity: .5;
	transition: opacity .16s ease;
}

.bs-nav__list > li.menu-item-has-children:hover > a::before,
.bs-nav__list > li.menu-item-has-children:focus-within > a::before { opacity: 1; }

.bs-nav__list .sub-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: -14px;
	z-index: 60;
	min-width: 244px;
	margin: 0;
	padding: 7px;
	list-style: none;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(14, 51, 70, .13);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-5px);
	transition: opacity .17s ease, transform .17s ease, visibility .17s;
}

/* Invisible bridge across the gap, so the menu does not close when the
   pointer travels from the parent down onto it. */
.bs-nav__list .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -12px;
	height: 12px;
}

.bs-nav__list > li:hover > .sub-menu,
.bs-nav__list > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.bs-nav__list .sub-menu li { margin: 0; }

.bs-nav__list .sub-menu a {
	display: block;
	padding: .5rem .7rem;
	border-radius: 7px;
	font-size: .92rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--wp--preset--color--ink);
	transition: background .14s ease, color .14s ease;
}

.bs-nav__list .sub-menu a::after { display: none; }

.bs-nav__list .sub-menu a:hover,
.bs-nav__list .sub-menu a:focus-visible {
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--deep);
}

.bs-nav__list .sub-menu .current-menu-item > a {
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--deep);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.bs-nav__list .sub-menu { transition: opacity .17s ease, visibility .17s; }
	.bs-nav__list > li:hover > .sub-menu,
	.bs-nav__list > li:focus-within > .sub-menu { transform: none; }
}

@media (max-width: 900px) {
	.bs-nav__list { gap: .35rem 1.15rem; }
	.bs-nav__list a { font-size: .89rem; }
}

/* --------------------------------------------------------------------------
   Mobile menu toggle

   Checkbox-driven rather than JavaScript or <details>: :checked is dependable
   everywhere, and forcing a <details> back open at desktop widths means
   fighting the user-agent stylesheet.
   -------------------------------------------------------------------------- */

.bs-nav-toggle__input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
}

.bs-nav-toggle {
	display: none;
	align-items: center;
	gap: .6rem;
	cursor: pointer;
	padding: .5rem .95rem .5rem .8rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-size: .875rem;
	font-weight: 600;
	color: var(--wp--preset--color--deep);
	background: var(--wp--preset--color--base);
	user-select: none;
	width: fit-content;
	transition: border-color .16s ease;
}

.bs-nav-toggle:hover { border-color: var(--wp--preset--color--brand); }

.bs-nav-toggle__bars,
.bs-nav-toggle__bars::before,
.bs-nav-toggle__bars::after {
	display: block;
	width: 16px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

.bs-nav-toggle__bars { position: relative; }

.bs-nav-toggle__bars::before,
.bs-nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.bs-nav-toggle__bars::before { top: -5px; }
.bs-nav-toggle__bars::after  { top: 5px; }

.bs-nav-toggle__input:focus-visible + .bs-nav-toggle {
	outline: 2px solid var(--wp--preset--color--brand-ink);
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.bs-nav-toggle { display: flex; }
	.bs-nav-wrap .bs-nav { display: none; }

	/*
	 * Two selectors on purpose. The shortcode block runs its output through
	 * wpautop, which injects a stray </p> between the label and the <nav>.
	 * Browsers recover by inserting an empty paragraph, so the sibling
	 * combinator still resolves — but only by accident of error handling.
	 * :has() on the wrapper is immune to however the markup ends up nested.
	 */
	.bs-nav-toggle__input:checked ~ .bs-nav,
	.bs-nav-wrap:has(.bs-nav-toggle__input:checked) .bs-nav {
		display: block;
		padding-top: .85rem;
	}

	.bs-nav-wrap .bs-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.bs-nav-wrap .bs-nav__list a {
		display: block;
		padding: .62rem 0;
		font-size: 1rem;
		border-bottom: 1px solid var(--wp--preset--color--line);
	}

	.bs-nav-wrap .bs-nav__list a::after { display: none; }
	.bs-nav-wrap .bs-nav__list > li:last-child > a { border-bottom: 0; }

	/*
	 * Inside the collapsed menu the dropdown becomes a plain indented list.
	 * An absolutely-positioned panel would open off-screen on a phone, and
	 * there is no room for a second tap target to reveal it, so the two
	 * service pages are simply always visible here.
	 */
	.bs-nav-wrap .bs-nav__list .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		min-width: 0;
		margin: 0;
		padding: 0 0 0 1rem;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
	}

	.bs-nav-wrap .bs-nav__list .sub-menu::before { display: none; }

	.bs-nav-wrap .bs-nav__list .sub-menu a {
		padding: .5rem 0;
		border-radius: 0;
		font-size: .94rem;
		color: var(--wp--preset--color--ink-soft);
		border-bottom: 1px solid var(--wp--preset--color--line);
	}

	.bs-nav-wrap .bs-nav__list .sub-menu a:hover,
	.bs-nav-wrap .bs-nav__list .sub-menu a:focus-visible,
	.bs-nav-wrap .bs-nav__list .sub-menu .current-menu-item > a {
		background: transparent;
		color: var(--wp--preset--color--deep);
	}

	.bs-nav-wrap .bs-nav__list .sub-menu li:last-child a { border-bottom: 0; }

	/* The caret points down as a hint, not a control — nothing to toggle. */
	.bs-nav-wrap .bs-nav__list > li.menu-item-has-children > a::before { opacity: .4; }
}

/* --------------------------------------------------------------------------
   Language switcher
   -------------------------------------------------------------------------- */

.bs-langs ul {
	display: flex;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bs-langs li { margin: 0; }

.bs-langs li + li::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 10px;
	margin: 0 9px;
	background: var(--wp--preset--color--line);
	vertical-align: middle;
}

.bs-langs a {
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-size: .74rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	text-decoration: none;
	transition: color .16s ease;
}

.bs-langs a:hover,
.bs-langs a:focus-visible { color: var(--wp--preset--color--brand-ink); }

.bs-langs .current-lang a { color: var(--wp--preset--color--deep); }

/* --------------------------------------------------------------------------
   Parts catalogue grid
   -------------------------------------------------------------------------- */

.bs-parts-grid .wp-block-post {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	overflow: hidden;
	transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.bs-parts-grid .wp-block-post:hover {
	border-color: var(--wp--preset--color--brand);
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(14, 51, 70, .09);
}

@media (prefers-reduced-motion: reduce) {
	.bs-parts-grid .wp-block-post { transition: border-color .18s ease; }
	.bs-parts-grid .wp-block-post:hover { transform: none; }
}

.bs-parts-grid .wp-block-post-featured-image { margin: 0; }

.bs-parts-grid .wp-block-post-featured-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	display: block;
}

.bs-parts-grid .wp-block-post-title {
	margin: 0;
	padding: 1.05rem 1.2rem 1.25rem;
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.015em;
}

.bs-parts-grid .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--deep);
}

.bs-parts-grid .wp-block-post-title a:hover { color: var(--wp--preset--color--brand-ink); }

/* --------------------------------------------------------------------------
   Single part: price and enquiry
   -------------------------------------------------------------------------- */

.bs-part__back {
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-weight: 500;
	text-decoration: none;
	color: var(--wp--preset--color--ink-soft);
}

.bs-part__back:hover { color: var(--wp--preset--color--brand-ink); }

/* --------------------------------------------------------------------------
   Migrated content

   These pages are classic-editor HTML — bare <p>, <ul>, <table>, <img> and
   [gallery] shortcodes. These rules make that legible without anyone having
   to reformat seven pages by hand.
   -------------------------------------------------------------------------- */

.bs-content { font-size: 1.0625rem; }

.bs-content p { margin: 0 0 1.35rem; }

.bs-content > *:first-child { margin-top: 0; }

.bs-content a {
	color: var(--wp--preset--color--brand-ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.bs-content a:hover { color: var(--wp--preset--color--deep); }

.bs-content ul,
.bs-content ol { padding-left: 1.35rem; margin: 0 0 1.35rem; }

.bs-content li + li { margin-top: .4rem; }
.bs-content li::marker { color: var(--wp--preset--color--brand); }

.bs-content img {
	height: auto;
	max-width: 100%;
	border-radius: 10px;
}

.bs-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.9rem 0;
	font-size: .95rem;
}

.bs-content table th,
.bs-content table td {
	border: 1px solid var(--wp--preset--color--line);
	padding: .65rem .85rem;
	text-align: left;
	vertical-align: top;
}

.bs-content table th {
	background: var(--wp--preset--color--mist);
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-weight: 600;
	color: var(--wp--preset--color--deep);
}

/* Galleries came across as [gallery] shortcodes. */
.bs-content .gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 1.9rem 0;
}

.bs-content .gallery br { display: none; }

.bs-content .gallery-item {
	margin: 0 !important;
	width: auto !important;
}

.bs-content .gallery-item img {
	border: 0 !important;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 10px;
	transition: transform .18s ease, box-shadow .18s ease;
}

.bs-content .gallery-item a:hover img {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(14, 51, 70, .13);
}

@media (prefers-reduced-motion: reduce) {
	.bs-content .gallery-item img { transition: none; }
	.bs-content .gallery-item a:hover img { transform: none; }
}

/* --------------------------------------------------------------------------
   Contact Form 7
   -------------------------------------------------------------------------- */

.wpcf7 { margin-top: 1.5rem; }

.wpcf7 p { margin: 0 0 1.1rem; }

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
	width: 100%;
	padding: .72rem .9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 9px;
	font: inherit;
	font-size: 1rem;
	background: var(--wp--preset--color--base);
	color: inherit;
	transition: border-color .16s ease, box-shadow .16s ease;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--brand);
	box-shadow: 0 0 0 3px rgba(64, 192, 240, .22);
}

.wpcf7 textarea { min-height: 160px; resize: vertical; }

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--brand-ink);
	color: #fff;
	border: 0;
	border-radius: 9px;
	padding: .8rem 1.9rem;
	font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .16s ease;
}

.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--deep); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.bs-footer a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, .22);
	transition: border-color .16s ease;
}

.bs-footer a:hover,
.bs-footer a:focus-visible { border-bottom-color: var(--wp--preset--color--brand); }

@media (max-width: 600px) {
	.wp-block-site-logo img { max-height: 46px; }
}
