/*
Theme Name: Minimaailm
Theme URI: https://minimaailm.ee
Author: Koit
Description: Light, low-maintenance theme for Minimaailm MTÜ. It provides the header, footer and all design values (colours, fonts, spacing); page content is built with Elementor (free) or the normal editor. Needs no plugins of its own.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minimaailm
*/

/* ==========================================================================
   1. Fonts (self-hosted, so no visitor data goes to Google)
   ========================================================================== */
@font-face {
	font-family: "Unbounded";
	src: url("assets/fonts/Unbounded-Variable.woff2") format("woff2");
	font-weight: 200 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Figtree";
	src: url("assets/fonts/Figtree-Variable.woff2") format("woff2");
	font-weight: 300 900;
	font-style: normal;
	font-display: swap;
}

/* ==========================================================================
   2. Design values: the ONLY place colours, fonts and spacing are defined.
      Change a value here and the whole site follows.
   ========================================================================== */
:root {
	/* Colours, light (white pages) */
	--yellow: #fff600;
	--yellow-hover: #e8de00;
	--black: #000000;
	--on-brand: #000000;
	--surface: #ffffff;
	--surface-alt: #f3f2e6;
	--yellow-tint: #fffbc2;
	--ink: #121212;
	--muted: #505050;
	--border-strong: #767676;
	--hairline: #d8d6c4;
	--focus: #121212;
	--link: #121212;
	--danger: #b3261e;
	--success: #1d6b3a;
	--shadow-hard: 4px 4px 0 #121212;

	/* Spacing (4px base) */
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 24px;
	--space-6: 32px;
	--space-7: 48px;
	--space-8: 64px;
	--space-9: 96px;
	--container-width: 1080px;

	/* Corners */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 16px;
	--radius-pill: 999px;

	/* Fonts */
	--font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
	--font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Colours, dark (black header, footer and any block with class "on-dark") */
.site-header,
.site-footer,
.on-dark {
	--yellow-hover: #fffa66;
	--surface: #000000;
	--surface-alt: #161616;
	--yellow-tint: #2b2a00;
	--ink: #f5f5f0;
	--muted: #b5b5ad;
	--border-strong: #8f8f8f;
	--hairline: #2e2e2e;
	--focus: #fff600;
	--link: #fff600;
	--danger: #ff8f85;
	--success: #7ddb9b;
	--shadow-hard: 4px 4px 0 #fff600;
	background: var(--surface);
	color: var(--ink);
}

/* ==========================================================================
   3. Base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--surface);
	color: var(--ink);
	font: 400 17px/28px var(--font-sans);
	-webkit-text-size-adjust: 100%;
}

img {
	max-width: 100%;
	height: auto;
}

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

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-4);
	font-family: var(--font-display);
	color: var(--ink);
}
h1 { font-size: 36px; line-height: 44px; font-weight: 700; }
h2 { font-size: 28px; line-height: 36px; font-weight: 700; }
h3,
h4,
h5,
h6 { font-size: 20px; line-height: 28px; font-weight: 600; }

p { margin: 0 0 var(--space-4); }
small,
.small { font-size: 14px; line-height: 22px; color: var(--muted); }

@media (max-width: 767px) {
	h1 { font-size: 26px; line-height: 34px; }
	h2 { font-size: 22px; line-height: 30px; }
	h3,
	h4,
	h5,
	h6 { font-size: 18px; line-height: 26px; }
}

/* Layout helper: one centred column, 16px gutters on phones */
.container {
	width: min(100% - 2 * var(--space-4), var(--container-width));
	margin-inline: auto;
}

.screen-reader-text,
.skip-link:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	position: fixed;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 1000;
	padding: var(--space-3) var(--space-4);
	background: var(--yellow);
	color: var(--on-brand);
	font-weight: 700;
	border: 2px solid var(--black);
	border-radius: var(--radius-md);
}

/* ==========================================================================
   4. Buttons and form fields
   ========================================================================== */
.button,
.wp-block-button__link,
.wp-element-button,
input[type="submit"],
button[type="submit"] {
	display: inline-block;
	min-height: 48px;
	padding: 12px 24px;
	font: 700 16px/20px var(--font-sans);
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	background: var(--yellow);
	color: var(--on-brand);
	border: 2px solid var(--black);
	border-radius: var(--radius-md);
}
.button:hover,
.wp-block-button__link:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
	background: var(--yellow-hover);
}
.button.is-secondary {
	background: transparent;
	color: var(--ink);
	border-color: var(--ink);
}
.button.is-secondary:hover {
	background: var(--yellow-tint);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
textarea,
select {
	width: 100%;
	min-height: 48px;
	padding: var(--space-3);
	font: 400 17px/28px var(--font-sans);
	color: var(--ink);
	background: var(--surface);
	border: 2px solid var(--border-strong);
	border-radius: var(--radius-md);
}
textarea { min-height: 112px; }
label { font-weight: 700; }

/* ==========================================================================
   5. Header
   ========================================================================== */
.site-header {
	padding: var(--space-4) var(--space-5) 0;
	text-align: center;
}
.site-header__logo {
	display: inline-block;
}
.site-header__logo img {
	display: block;
	width: auto;
	height: 56px;
	margin: 0 auto var(--space-3);
}

.nav-toggle {
	display: none;
	align-items: center;
	gap: var(--space-2);
	min-height: 48px;
	padding: 0 var(--space-4);
	font: 700 16px/20px var(--font-sans);
	color: var(--ink);
	background: transparent;
	border: 2px solid var(--ink);
	border-radius: var(--radius-md);
	cursor: pointer;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0 var(--space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav a {
	display: block;
	padding: 12px 0 9px;
	font: 600 16px/20px var(--font-sans);
	letter-spacing: 0.01em;
	color: var(--ink);
	text-decoration: none;
	border-bottom: 3px solid transparent;
}
.site-nav a:hover {
	color: var(--yellow);
}
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a,
.site-nav .current_page_item > a {
	color: var(--yellow);
	border-bottom-color: var(--yellow);
}

/* Language switch (Polylang puts items with class "lang-item" into the menu).
   Shown as text pills, no flags. Check against the translation plugin you choose. */
.site-nav .lang-item a {
	padding: 2px 12px;
	font-size: 14px;
	border: 2px solid var(--border-strong);
	border-radius: var(--radius-pill);
}
.site-nav .lang-item img { display: none; }
.site-nav .lang-item.current-lang a {
	background: var(--yellow);
	color: var(--on-brand);
	border-color: var(--yellow);
}

@media (max-width: 767px) {
	.site-header { padding: 0; text-align: left; }
	.site-header__bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: var(--space-3) var(--space-4);
	}
	.site-header__logo img { height: 36px; margin: 0; }
	.nav-toggle { display: inline-flex; }
	.js .site-nav { display: none; }
	.js .site-nav.is-open { display: block; }
	.site-nav ul {
		display: block;
		padding: 0 var(--space-4) var(--space-3);
	}
	.site-nav a {
		padding: 14px 0;
		border-bottom: 1px solid var(--border-strong);
	}
	.site-nav .lang-item a {
		display: inline-block;
		margin-top: var(--space-3);
	}
}

/* ==========================================================================
   6. Footer
   ========================================================================== */
.site-footer {
	padding: var(--space-7) 0;
}
.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
}
.site-footer__logo img {
	display: block;
	width: auto;
	height: 56px;
}
.site-footer h2,
.site-footer .widget-title {
	margin: 0 0 var(--space-2);
	font-size: 18px;
	line-height: 26px;
	font-weight: 600;
}
.site-footer p { margin: 0 0 var(--space-2); }
.site-footer__legal {
	margin-top: var(--space-6);
	font-size: 14px;
	line-height: 22px;
	color: var(--muted);
}
@media (max-width: 767px) {
	.site-footer { padding: var(--space-7) 0; }
	.site-footer__logo img { height: 40px; }
}

/* ==========================================================================
   7. Page content (plain pages and posts; Elementor pages style themselves)
   ========================================================================== */
.entry-wrap {
	padding-block: var(--space-7);
}
.entry-content > * + * { margin-top: var(--space-4); }
.entry-content ul,
.entry-content ol { padding-left: var(--space-5); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th,
.entry-content td { padding: var(--space-2); border: 1px solid var(--hairline); text-align: left; }
.entry-summary { padding-block: var(--space-5); border-bottom: 1px solid var(--hairline); }
.entry-summary .entry-title { margin-bottom: var(--space-1); }
.entry-meta { color: var(--muted); font-size: 14px; line-height: 22px; }
.is-elementor .entry-content > * + * { margin-top: 0; }
.page-404 { padding-block: var(--space-8); }

/* ==========================================================================
   8. Elementor bridge (free version).
      Makes Elementor buttons and links match the theme without extra settings.
      Test on the site; the one-time Site Settings in README.md are still needed.
   ========================================================================== */
.elementor-widget-button .elementor-button {
	font-family: var(--font-sans);
	font-weight: 700;
	letter-spacing: 0.01em;
	background-color: var(--yellow);
	color: var(--on-brand);
	border: 2px solid var(--black);
	border-radius: var(--radius-md);
}
.elementor-widget-button .elementor-button:hover {
	background-color: var(--yellow-hover);
	color: var(--on-brand);
}
