/*
 * CASA Blogit – yläpalkki, uutiskirje ja footer (koko sivusto).
 * Korvaa vanhan .navbar / .newsletter-banner / #footer / .copyright -ulkoasun.
 */

:root {
	--cx-ink: #1d1b19;
	--cx-text: #3a3632;
	--cx-muted: #5f5952;
	--cx-line: #ece6dd;
	--cx-cream: #f6f2ec;
	--cx-accent: #a34a00;
	--cx-glow: #ff9a3d;
	--cx-bar-h: 80px;     /* pääpalkki */
	--cx-strip-h: 34px;   /* tumma yläraita */
}

.cx-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Yläpalkki ---------- */
/* Palkki on kiinteä (fixed); header varaa sille tilan, jotta sisältö ei jää alle */
.cx-header { position: relative; z-index: 1000; padding-top: calc(var(--cx-bar-h) + var(--cx-strip-h)); }
.cx-bar {
	position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
	background: rgba(255, 255, 255, .96);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--cx-line);
	transition: transform .25s ease, box-shadow .25s ease;
}
/* Vieritettäessä raita liukuu piiloon ja palkki saa varjon */
.cx-scrolled .cx-bar { transform: translateY(calc(-1 * var(--cx-strip-h))); box-shadow: 0 6px 24px rgba(29,27,25,.08); }
.admin-bar .cx-bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .cx-bar { top: 46px; } }

/* Tumma yläraita */
.cx-strip { background: var(--cx-ink); color: #d9d1c6; font-size: 12.5px; letter-spacing: .06em; }
.cx-strip .cx-inner { display: flex; align-items: center; justify-content: space-between; height: var(--cx-strip-h); gap: 20px; }
.cx-strip-tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-strip-links { display: flex; align-items: center; gap: 14px; flex: none; }
.cx-strip-links a { color: #f3ede5; text-decoration: none; display: inline-flex; align-items: center; }
.cx-strip-links a:hover { color: var(--cx-glow); text-decoration: none; }
.cx-strip-links a:hover img { opacity: .75; }
.cx-strip-links img { width: 15px; height: 15px; display: block; }
.cx-strip-sep { width: 1px; height: 14px; background: rgba(255,255,255,.2); }

.cx-main {
	display: flex; align-items: center; gap: 28px;
	height: var(--cx-bar-h);
}
.cx-logo { display: flex; align-items: center; flex: none; }
.cx-logo img { height: 56px; width: auto; display: block; }

.cx-nav { margin-left: auto; }
/* Aikakauslehtimäinen valikko: pienet harvennetut versaalit, kasvava alleviivaus */
.cx-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.cx-nav a {
	position: relative;
	display: block;
	padding: 12px 14px;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--cx-text);
	text-decoration: none;
	transition: color .15s;
}
.cx-nav a::after {
	content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px;
	background: var(--cx-ink); border-radius: 2px;
	transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.cx-nav a:hover { color: var(--cx-ink); text-decoration: none; }
.cx-nav a:hover::after { transform: scaleX(1); }
.cx-nav a[aria-current="page"] { color: var(--cx-ink); }
.cx-nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--cx-glow); }

.cx-actions { display: flex; align-items: center; gap: 4px; }
.cx-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--cx-ink);
	cursor: pointer; transition: background-color .15s;
}
.cx-icon-btn:hover, .cx-icon-btn[aria-expanded="true"] { background: var(--cx-cream); }
.cx-icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cx-header a:focus-visible, .cx-icon-btn:focus-visible { outline: 3px solid var(--cx-glow); outline-offset: 2px; }

.cx-burger { display: none; flex-direction: column; gap: 5px; }
.cx-burger span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.cx-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cx-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cx-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Haku- ja mobiilipaneelit */
.cx-panel { border-top: 1px solid var(--cx-line); background: #fff; }
.cx-panel[hidden] { display: none; }
.cx-search form { display: flex; gap: 10px; padding-top: 16px; padding-bottom: 16px; }
.cx-search input {
	flex: 1; min-width: 0; height: 48px; padding: 0 20px;
	border: 1px solid var(--cx-line); border-radius: 999px; background: var(--cx-cream);
	font-size: 16px; color: var(--cx-ink);
}
.cx-search input:focus { outline: none; border-color: var(--cx-ink); background: #fff; }
.cx-search button, .cx-nl-form button {
	height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
	background: var(--cx-ink); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.cx-search button:hover, .cx-nl-form button:hover { background: #000; }

.cx-mobile ul { list-style: none; margin: 0; padding: 8px 24px 20px; }
.cx-mobile a {
	display: block; padding: 14px 4px; font-size: 18px; color: var(--cx-ink);
	border-bottom: 1px solid var(--cx-line); text-decoration: none;
}
.cx-mobile li:last-child a { border-bottom: 0; }
.cx-mobile a[aria-current="page"] { color: var(--cx-accent); font-weight: 600; }

/* Vanhan kiinteän palkin tilavaraus pois (palkki on nyt sticky) */
.cx-header .top-banner { padding-top: 0; }
.cx-header .top-banner:empty { display: none; }
.cx-header .header-image { margin-top: 0; }

@media (max-width: 991px) {
	.cx-nav { display: none; }
	.cx-burger { display: inline-flex; }
	.cx-actions { margin-left: auto; }
	:root { --cx-bar-h: 66px; }
	.cx-logo img { height: 46px; }
}
@media (max-width: 767px) {
	.cx-strip-tagline { display: none; }
	.cx-strip .cx-inner { justify-content: center; }
	:root { --cx-strip-h: 32px; }
}

/* ---------- Uutiskirje ---------- */
#newsletter.cx-newsletter { position: static; top: auto; visibility: visible; display: block; scroll-margin-top: 100px; }
.cx-newsletter {
	background: var(--cx-cream);
	padding: 56px 0;
	border-top: 1px solid var(--cx-line);
}
.cx-newsletter > .cx-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cx-nl-text h2 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; color: var(--cx-ink); font-weight: 400; text-transform: none; }
.cx-nl-text p { margin: 0; color: var(--cx-muted); font-size: 16px; }
.cx-nl-form { display: flex; gap: 10px; flex: 0 1 480px; }
.cx-nl-form input {
	flex: 1; min-width: 0; height: 52px; padding: 0 22px;
	border: 1px solid #d9d0c4; border-radius: 999px; background: #fff;
	font-size: 16px; color: var(--cx-ink);
}
.cx-nl-form input:focus { outline: none; border-color: var(--cx-ink); }
.cx-nl-form button { height: 52px; padding: 0 30px; }

/* ---------- Footer ---------- */
#footer.cx-footer { background: var(--cx-ink); color: #cfc7bc; padding: 64px 0 0; }
.cx-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; }
.cx-footer-logo img { height: 72px; width: auto; display: block; margin-bottom: 18px; }
.cx-footer-brand p { margin: 0 0 20px; max-width: 280px; line-height: 1.6; font-size: 15px; }
.cx-social { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.cx-social a {
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255,255,255,.08); transition: background-color .15s;
}
.cx-social a:hover { background: rgba(255,154,61,.25); }
.cx-social img { width: 18px; height: 18px; }
.cx-footer-col h2 {
	font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: #fff; margin: 8px 0 18px;
}
.cx-footer-col ul { list-style: none; margin: 0; padding: 0; }
.cx-footer-col li { margin-bottom: 10px; }
.cx-footer a { color: #e6dfd5; text-decoration: none; }
.cx-footer a:hover { color: var(--cx-glow); text-decoration: none; }
.cx-footer a:focus-visible { outline: 3px solid var(--cx-glow); outline-offset: 2px; }
.cx-footer address { font-style: normal; line-height: 1.8; font-size: 15px; }
.cx-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: 14px; color: #b3aa9e; }
.cx-footer-bottom .cx-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 991px) {
	.cx-footer-grid { grid-template-columns: 1fr 1fr; }
	.cx-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
	.cx-inner { padding: 0 20px; }
	.cx-newsletter { padding: 44px 0; }
	.cx-newsletter > .cx-inner { flex-direction: column; align-items: stretch; gap: 22px; }
	.cx-nl-text h2 { font-size: 24px; }
	.cx-nl-form { flex-basis: auto; }
	.cx-nl-form button { padding: 0 22px; }
	#footer.cx-footer { padding-top: 48px; }
	.cx-footer-grid { gap: 32px 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.cx-header *, .cx-footer * { transition: none !important; }
}
