/* =========================================================
   Self-hosted heading font (Fugaz One)
   Assigned to headings via the child theme.json.
   ========================================================= */
@font-face {
	font-family: 'Fugaz One';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/fugaz-one.woff2') format('woff2');
}
/* =========================================================
   Sticky header
   ========================================================= */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 999;
	/* Solid backdrop so page content doesn't show through on scroll. */
	background: var(--wp--preset--color--base, #fff);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Offset the sticky header below the WP admin bar when logged in. */
.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

/* The admin bar becomes non-fixed (scrolls away) on very small screens. */
@media screen and (max-width: 600px) {
	.admin-bar header.wp-block-template-part {
		top: 0;
	}
}

/* Keep dropdown menus above page content while header is sticky. */
header.wp-block-template-part .drop,
header.wp-block-template-part .hinaus-lang__list {
	z-index: 1000;
}

/* =========================================================
   Header shortcodes: [hinaus_247] and [hinaus_language]
   ========================================================= */

/* ---- 24/7 availability badge ---------------------------- */
.hinaus-247 {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 0.9em;
	border: 1px solid #d9dde3;
	border-radius: 999px;
	background: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	color: #1a1a1a;
	white-space: nowrap;
	margin-left: 1rem !important;
}

.hinaus-247__dot {
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: #28a745;
	flex: 0 0 auto;
	box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5);
	animation: hinaus-247-pulse 2s ease-out infinite;
}

@keyframes hinaus-247-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
	70%  { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
	100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.hinaus-247__dot { animation: none; }
}

/* ---- Polylang language switcher (flag + dropdown) ------- */
.hinaus-lang {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin-left: 1rem !important;
	margin-right: 1rem !important;
}

.hinaus-lang__current {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.3em 0.4em;
	margin: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

.hinaus-lang__current:hover,
.hinaus-lang__current:focus-visible {
	background: rgba(0, 0, 0, 0.05);
}

/* Flags: inline SVG (rendered by the shortcode) or Polylang's <img> fallback. */
.hinaus-lang img,
.hinaus-lang .hinaus-flag {
	display: block;
	width: 24px;
	height: auto;
	border-radius: 2px;
}

/* Subtle outline so the white-heavy Finnish flag stays visible on white. */
.hinaus-lang .hinaus-flag {
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Last-resort text fallback (e.g. "EN") if a language has no flag. */
.hinaus-lang__code {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.hinaus-lang__caret {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.6;
}

.hinaus-lang__list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 100;
	min-width: max-content;
	margin: 0;
	padding: 0.3em;
	list-style: none;
	background: #fff;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

	/* Hidden until hover/focus */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Reveal on hover or keyboard focus within the switcher */
.hinaus-lang:hover .hinaus-lang__list,
.hinaus-lang:focus-within .hinaus-lang__list {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.hinaus-lang__item a {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.45em 0.7em;
	border-radius: 6px;
	text-decoration: none;
	color: #1a1a1a;
	font-size: 0.95rem;
	white-space: nowrap;
}

.hinaus-lang__item a:hover,
.hinaus-lang__item a:focus-visible {
	background: rgba(0, 0, 0, 0.05);
}

.hinaus-lang__name {
	line-height: 1;
}

/* =========================================================
   Header nav — site-specific responsive tweaks (added by Claude)
   ========================================================= */

/* Pin the hamburger to the far right once the nav collapses.
   The webaula nav collapses at <=1280px; this covers tablet (<=1024px)
   and mobile by making the nav the last flex item in the header row. */
@media ( max-width: 1280px ) {
	.webaula-nav {
		order: 10;
		margin-left: 0;
	}
}

/* On phones the full phone number has no room — show a compact icon-only
   call button (rounded rectangle), with space around it and a little
   vertical breathing room in the header bar. */
@media ( max-width: 600px ) {
	header.wp-block-template-part .has-base-background-color {
		padding-top: 8px !important;
		padding-bottom: 8px !important;
	}
	.nav-btn {
		margin-left: 6px !important;
		margin-right: 12px !important;
	}
	.nav-btn .wp-block-button {
		width: auto !important;
	}
	.nav-btn .wp-block-button__link {
		font-size: 0 !important;
		width: auto;
		min-width: 0;
		height: 40px;
		min-height: 40px;
		padding: 0 12px !important;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		border-radius: 10px !important;
		line-height: 0;
	}
	.nav-btn .wp-block-button__link::before {
		content: "";
		display: block;
		width: 20px;
		height: 20px;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.4.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.4c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.4 0 .8-.3 1L6.6 10.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	}
}
