/*
Theme Name: MereTallinn
Theme URI: https://meretallinn.ee/
Author: SEO agentuur
Author URI: https://seo-agentuur.ee/
Description: Hand-coded theme for meretallinn.ee. Reproduces the previous Elementor + Crocoblock design without any page-builder dependency.
Version: 1.0.14
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meretallinn
Tags: blog, one-column, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--navy: #29294b;
	--body: #3b3d42;
	--muted: #696981;
	--blue: #0072ce;
	--link: #398ffc;
	--line: #e1e1e8;
	--rule: #ededf3;
	--bg: #fafaff;
	--bg-header: #fdfdff;
	--bg-footer: #f8f7ff;
	--pill: #f2f2f6;
	--white: #fff;

	--radius: 16px;
	--radius-sm: 8px;
	--radius-pill: 6px;

	--shadow: 0 5px 25px rgba(114, 114, 255, .12);
	--shadow-sm: 0 5px 20px rgba(114, 114, 255, .15);

	--sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--ui: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--container: 1296px;
	--gutter: 24px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--body);
	font: 300 14px/1.6 var(--ui);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
}

img,
svg,
video { max-width: 100%; height: auto; display: block; }

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

button { font: inherit; }

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--sans);
	color: var(--navy);
	font-weight: 700;
}

p { margin: 0 0 1em; }

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--white);
	color: var(--navy);
	padding: 12px 18px;
	border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; top: 8px; }

:where(a, button, input, [tabindex]):focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header { background: var(--bg); }

.topbar { padding-top: 5px; }

.topbar-menu,
.nav-menu,
.drawer__menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.topbar-menu { justify-content: center; flex-wrap: wrap; }

.topbar-menu li + li,
.nav-menu li + li { margin-left: 10px; }

.topbar-menu a,
.nav-menu a {
	display: flex;
	align-items: center;
	padding: 7px 13px 8px 12px;
	border-radius: var(--radius-sm);
	color: var(--navy);
	font: 300 14px/1.6 var(--ui);
	white-space: nowrap;
	transition: background-color .18s ease;
}

.topbar-menu a:hover,
.nav-menu a:hover { background: var(--pill); text-decoration: none; }

.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a { background: var(--pill); }

.header-main {
	background: var(--bg-header);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 88px;
}

.wordmark {
	font-family: var(--sans);
	font-weight: 700;
	font-size: 39px;
	line-height: 1;
	color: var(--navy);
}
.wordmark:hover { text-decoration: none; }
.wordmark--sm { font-size: 26px; }

.nav-toggle {
	display: none;
	background: none;
	border: 0;
	padding: 8px;
	cursor: pointer;
	color: var(--navy);
}
.nav-toggle__bars { display: block; width: 26px; }
.nav-toggle__bars span {
	display: block;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}
.nav-toggle__bars span + span { margin-top: 6px; }

/* Mobile drawer */

.drawer {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(100%, 420px);
	background: var(--white);
	z-index: 120;
	padding: 24px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform .28s ease;
}
.drawer[hidden] { display: block; visibility: hidden; }
.drawer.is-open { transform: translateX(0); visibility: visible; }

.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 28px;
}

.drawer__close {
	background: none;
	border: 0;
	font-size: 32px;
	line-height: 1;
	color: var(--navy);
	cursor: pointer;
	padding: 0 4px;
}

.drawer__menu { flex-direction: column; gap: 4px; }
.drawer__menu + .drawer__menu { margin-top: 4px; }
.drawer__menu li + li { margin-left: 0; }
.drawer__menu a {
	display: block;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	color: var(--navy);
	font: 300 16px/1.5 var(--ui);
}
.drawer__menu a:hover { background: var(--pill); text-decoration: none; }

.drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(41, 41, 75, .45);
	z-index: 110;
	opacity: 0;
	transition: opacity .28s ease;
}
.drawer-backdrop[hidden] { display: block; visibility: hidden; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

body.drawer-open { overflow: hidden; }

/* ==========================================================================
   Layout
   ========================================================================== */

.site-content { margin: 30px 0; }

.with-sidebar { display: grid; gap: 80px; align-items: start; }
.with-sidebar--home { grid-template-columns: 790fr 426fr; }
.with-sidebar--single { grid-template-columns: 811fr 405fr; }

.sidebar { display: grid; gap: 20px; }
.sidebar .widget { margin: 0; }
.sidebar img { border-radius: var(--radius); }

.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 20px;
	row-gap: 0;
}

/* ==========================================================================
   Pills, buttons
   ========================================================================== */

.badge {
	display: inline-block;
	padding: 5px 10px;
	border-radius: var(--radius-pill);
	background: var(--white);
	color: var(--navy);
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 800;
	line-height: 13px;
	letter-spacing: 0;
	text-transform: uppercase;
	box-shadow: var(--shadow-sm);
}
.badge:hover { text-decoration: none; }

.badge--on-image {
	background: rgba(255, 255, 255, .22);
	color: var(--white);
	box-shadow: none;
	backdrop-filter: blur(2px);
}

.badge--float {
	position: absolute;
	top: 15px;
	left: 15px;
	z-index: 2;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	padding: 10px 18px;
	border: 2px solid var(--blue);
	border-radius: var(--radius-sm);
	background: var(--blue);
	color: var(--white);
	font-family: var(--sans);
	font-size: 16px;
	font-weight: 800;
	line-height: 19px;
	text-transform: uppercase;
	transition: background-color .18s ease, color .18s ease;
}
.btn:hover {
	background: transparent;
	color: var(--blue);
	text-decoration: none;
}

/* ==========================================================================
   Front page
   ========================================================================== */

.home-top__grid {
	display: grid;
	grid-template-columns: 648fr 608fr;
	gap: 40px;
	padding: 48px 0 64px;
	border-bottom: 1px solid var(--line);
}

.home-top__hero { align-self: start; }
.home-top__list { display: flex; flex-direction: column; }

/* Large hero card */

.card-featured {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	align-self: start;
}

.card-featured__media {
	position: relative;
	aspect-ratio: 648 / 400;
	background: var(--pill);
}

.card-featured__media > a:not(.badge) {
	display: block;
	width: 100%;
	height: 100%;
}

.card-featured__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card-featured__media .badge--on-image {
	position: absolute;
	top: 25px;
	left: 30px;
	z-index: 2;
}

.card-featured__body { padding: 40px; }

.card-featured__title {
	font-size: 42px;
	line-height: 50px;
	margin-bottom: 20px;
}
.card-featured__title a { color: var(--navy); }
.card-featured__title a:hover { text-decoration: none; opacity: .8; }

.card-featured__excerpt {
	margin: 0;
	font-family: var(--sans);
	font-size: 18px;
	font-weight: 400;
	line-height: 28px;
	color: var(--muted);
}

/* Compact card */

.card-compact {
	display: grid;
	grid-template-columns: 353fr 235fr;
	gap: 20px;
	padding-bottom: 25px;
	border-bottom: 1px solid var(--line);
}
.card-compact + .card-compact { margin-top: 20px; }

.card-compact__text {
	display: flex;
	flex-direction: column;
	gap: 15px;
	padding-top: 20px;
	align-items: flex-start;
}

.card-compact__title {
	font-size: 21px;
	line-height: 25px;
	margin: 0;
}
.card-compact__title a { color: var(--navy); }
.card-compact__title a:hover { text-decoration: none; opacity: .8; }

.card-compact__excerpt,
.card-grid__excerpt,
.card-row__excerpt {
	margin: 0;
	font-family: var(--sans);
	font-size: 16px;
	font-weight: 400;
	line-height: 25px;
	color: var(--muted);
}

.card-compact__media {
	display: block;
	align-self: center;
	width: 100%;
}
.card-compact__media img {
	width: 100%;
	height: 195px;
	object-fit: cover;
	border-radius: var(--radius);
}

/* Banner */

.home-banner { padding: 64px 0; }
.home-banner img { width: 100%; }

/* Row card */

.card-row {
	display: grid;
	grid-template-columns: 385fr 385fr;
	gap: 20px;
	padding-bottom: 35px;
	border-bottom: 1px solid var(--line);
}
.card-row + .card-row { margin-top: 30px; }

.card-row__media {
	position: relative;
	align-self: center;
	width: 100%;
}
.card-row__media > a:not(.badge) { display: block; }

.card-row__media img {
	width: 100%;
	height: 225px;
	object-fit: cover;
	border-radius: var(--radius);
}

.card-row__text {
	display: flex;
	flex-direction: column;
	gap: 15px;
	padding-top: 20px;
	align-items: flex-start;
}

.card-row__title {
	font-size: 24px;
	line-height: 29px;
	margin: 0;
}
.card-row__title a { color: var(--navy); }
.card-row__title a:hover { text-decoration: none; opacity: .8; }

/* Grid card */

.card-grid { padding: 30px 0; }

.card-grid__media {
	position: relative;
	width: 100%;
}
.card-grid__media > a:not(.badge) { display: block; }

.card-grid__media img {
	width: 100%;
	height: 235px;
	object-fit: cover;
	border-radius: var(--radius);
}

.card-grid__title {
	font-size: 21px;
	line-height: 25px;
	margin: 20px 0 0;
}

.card-grid__excerpt { margin-top: 10px; }
.card-grid__title a { color: var(--navy); }
.card-grid__title a:hover { text-decoration: none; opacity: .8; }

/* Pagination */

.pager { margin-top: 40px; }
.pager ul {
	display: flex;
	justify-content: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.pager a,
.pager span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 32px;
	padding: 8px 12px 8px 13px;
	border-radius: var(--radius-pill);
	font-family: var(--sans);
	font-size: 16px;
	font-weight: 700;
	line-height: 16px;
	color: var(--navy);
}
.pager .current { background: var(--white); }
.pager a:hover { background: var(--white); text-decoration: none; }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.crumbs {
	font-family: var(--sans);
	font-size: 12px;
	line-height: 19px;
	padding-top: 17px;
	padding-bottom: 40px;
}

body.page .crumbs {
	padding-top: 47px;
	padding-bottom: 43px;
}
.crumbs a { color: var(--navy); }
.crumbs .sep { color: var(--muted); margin: 0 2px; }
.crumbs .current { color: var(--muted); }

/* ==========================================================================
   Single post
   ========================================================================== */

.single-hero__grid {
	display: grid;
	grid-template-columns: 561fr 685fr;
	gap: 50px;
	align-items: start;
	padding-bottom: 64px;
	border-bottom: 1px solid var(--line);
}

.single-hero__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	height: 100%;
}

.single-hero__title {
	font-size: 52px;
	line-height: 62px;
	margin: 15px 0 38px;
}

.single-hero__lead {
	font-family: var(--sans);
	font-size: 18px;
	font-weight: 400;
	line-height: 28px;
	color: var(--navy);
	margin: 0;
}

.single-hero__terms { margin-top: auto; }

.single-hero__media img {
	width: 100%;
	border-radius: var(--radius);
	aspect-ratio: 685 / 405;
	object-fit: cover;
}

.with-sidebar--single { padding-top: 63px; }

/* Article body */

.entry-content {
	font-family: var(--sans);
	font-size: 18px;
	font-weight: 400;
	line-height: 28px;
	color: var(--navy);
}

.entry-content > * { margin-top: 0; margin-bottom: 0; }
.entry-content > * + * { margin-top: 15px; }

.entry-content h2 {
	font-family: var(--ui);
	font-weight: 400;
	font-size: 40px;
	line-height: 56px;
	color: var(--body);
}

.entry-content h3 {
	font-family: var(--ui);
	font-weight: 400;
	font-size: 30px;
	line-height: 42px;
	color: var(--body);
}

.entry-content h4 {
	font-family: var(--sans);
	font-size: 22px;
	line-height: 30px;
}

.entry-content a { color: var(--link); }

.entry-content img,
.entry-content figure img { border-radius: var(--radius); }
.entry-content figure { margin: 0; }

.entry-content ul,
.entry-content ol { padding-left: 22px; margin: 0; }
.entry-content li + li { margin-top: 10px; }

.entry-content blockquote {
	margin: 0;
	padding: 8px 0 8px 24px;
	border-left: 3px solid var(--blue);
	color: var(--body);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}
.entry-content th,
.entry-content td {
	border: 1px solid var(--line);
	padding: 10px 12px;
	text-align: left;
}

.entry-content .wp-block-image { margin: 0; }

/* Related */

.related { padding: 56px 0 24px; }

.related__title {
	font-family: var(--mono);
	font-size: 33px;
	font-weight: 700;
	line-height: 40px;
	margin-bottom: 30px;
}

/* ==========================================================================
   Pages, archives, search, 404
   ========================================================================== */

.page-hero {
	padding-bottom: 64px;
	border-bottom: 1px solid var(--line);
}

.page-hero--split {
	display: grid;
	grid-template-columns: 561fr 685fr;
	gap: 50px;
	align-items: start;
}

.page-hero__title {
	font-size: 52px;
	line-height: 62px;
	margin: 15px 0 42px;
}

.page-hero__media img {
	width: 100%;
	border-radius: var(--radius);
}

.archive { padding-bottom: 48px; }

.archive__head {
	padding-bottom: 77px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--line);
}

.archive__title {
	font-size: 32px;
	line-height: 40px;
}

.archive__desc {
	margin-top: 16px;
	font-family: var(--sans);
	font-size: 18px;
	line-height: 28px;
	color: var(--muted);
	max-width: 70ch;
}

.archive__search { margin-top: 24px; max-width: 520px; }

.empty {
	font-family: var(--sans);
	font-size: 18px;
	color: var(--muted);
}

.notfound {
	padding: 40px 0 96px;
	text-align: center;
}
.notfound__title {
	font-size: 48px;
	line-height: 58px;
	margin-bottom: 16px;
}
.notfound__text {
	font-family: var(--sans);
	font-size: 18px;
	line-height: 28px;
	color: var(--muted);
	margin-bottom: 28px;
}
.notfound__search { max-width: 520px; margin-inline: auto; }

.searchform { display: flex; gap: 8px; }
.searchform input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 11px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--white);
	font: 400 15px/1.4 var(--sans);
	color: var(--navy);
}
.searchform button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--blue);
	color: var(--white);
	cursor: pointer;
}
.searchform button:hover { opacity: .9; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--bg-footer); }

.footer-inner {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 48px 0;
	border-top: 1px solid var(--line);
}

.footer-brand { max-width: 385px; }

.footer-note {
	margin: 17px 0 0;
	font-family: var(--sans);
	font-size: 14px;
	font-weight: 400;
	line-height: 22px;
	color: var(--navy);
}

.footer-copy {
	margin: 20px 0 0;
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 400;
	line-height: 19px;
	color: var(--muted);
}
.footer-copy a { color: #000; }

.footer-nav .nav-menu { flex-wrap: wrap; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
	.with-sidebar--home,
	.with-sidebar--single { gap: 48px; }

	.home-top__grid { gap: 32px; }

	.card-featured__title { font-size: 34px; line-height: 42px; }
	.single-hero__title,
	.page-hero__title { font-size: 42px; line-height: 52px; }
	.entry-content h2 { font-size: 32px; line-height: 44px; }
}

@media (max-width: 1023px) {
	.grid-3 { grid-template-columns: repeat(2, 1fr); column-gap: 20px; }

	.with-sidebar--home,
	.with-sidebar--single { grid-template-columns: 1fr; gap: 48px; }

	.sidebar {
		grid-template-columns: repeat(2, 1fr);
		align-items: start;
	}
	.sidebar img { margin-inline: auto; }
}

@media (max-width: 900px) {
	.home-top__grid { grid-template-columns: 1fr; padding-top: 32px; }

	.single-hero__grid,
	.page-hero--split { grid-template-columns: 1fr; gap: 28px; }

	.single-hero__grid { padding-bottom: 32px; }
	.single-hero__text { order: 2; }
	.single-hero__media { order: 1; }
	.single-hero__terms { margin-top: 8px; }
}

@media (max-width: 782px) {
	:root { --gutter: 20px; }

	.site-nav { display: none; }
	.nav-toggle { display: block; }
	.topbar { display: none; }

	.header-inner {
		min-height: 72px;
		flex-direction: column;
		justify-content: center;
		gap: 6px;
		padding-block: 14px;
	}

	.wordmark { font-size: 32px; }

	.card-compact,
	.card-row { grid-template-columns: 1fr; gap: 0; }

	.card-compact__media,
	.card-row__media { order: -1; }

	.card-compact__media img,
	.card-row__media img,
	.card-grid__media img {
		height: auto;
		aspect-ratio: 16 / 10;
	}

	.card-compact__text,
	.card-row__text { padding-top: 20px; }

	.card-compact { display: flex; flex-direction: column; }
	.card-compact__media { order: -1; }

	

	.footer-inner { flex-direction: column; }
	.footer-copy { margin-top: 32px; }
	.footer-nav .nav-menu { margin-left: -12px; }

	.card-featured__body { padding: 28px; }
	.card-featured__title { font-size: 28px; line-height: 36px; }

	.entry-content { font-size: 17px; line-height: 27px; }
	.entry-content h2 { font-size: 28px; line-height: 38px; }
	.entry-content h3 { font-size: 24px; line-height: 32px; }

	.related { padding-top: 40px; }
	.related__title { font-size: 26px; line-height: 34px; }
}

@media (max-width: 640px) {
	.grid-3 { grid-template-columns: 1fr; }
	.sidebar { grid-template-columns: 1fr; }

	.single-hero__title,
	.page-hero__title,
	.archive__title,
	.notfound__title { font-size: 34px; line-height: 42px; }
}

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