/*
Theme Name: Elektrimaailm
Theme URI: https://elektrimaailm.ee
Author: Elektrimaailm OÜ
Description: Elektrimaailm OÜ kodulehe plokiteema. Kogu sisu (avaleht, teenused, galerii, meist, kontakt) on muudetav tavalise WordPressi plokiredaktoriga – lehepõhja ega lisapluginaid pole vaja. Aktiveerimisel luuakse lehed, menüü ja galerii automaatselt.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.9
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: elektrimaailm
*/

/* ---------- Päis ---------- */
.em-header {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 0 var(--wp--preset--color--line);
}
.admin-bar .em-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .em-header { top: 46px; } }

.em-header .wp-block-site-logo img { height: auto; }
.em-header .wp-block-navigation .wp-block-navigation-item__content { padding: 0.35rem 0; }
.em-header .wp-block-navigation .current-menu-item > a,
.em-header .wp-block-navigation a[aria-current="page"] {
	box-shadow: inset 0 -3px 0 var(--wp--preset--color--accent);
}
.em-header .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 8px;
	padding: 0.4rem !important;
	box-shadow: 0 12px 30px rgba(22, 24, 29, 0.12);
	min-width: 230px !important;
}
.em-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.5rem 0.75rem !important; }
@media (max-width: 600px) {
	.em-header .em-header-cta { display: none; }
}

/* ---------- Väike pealkirja kohal olev silt ---------- */
.em-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 600;
	font-size: 0.8rem !important;
}
.em-eyebrow::before {
	content: "";
	display: inline-block;
	width: 1.75rem;
	height: 3px;
	margin-right: 0.6rem;
	vertical-align: middle;
	background: var(--wp--preset--color--accent);
}

/* ---------- Kaardid ---------- */
.is-style-em-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	padding: var(--wp--preset--spacing--40);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
	height: 100%;
}
.is-style-em-card:hover {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 14px 34px rgba(22, 24, 29, 0.10);
}
.is-style-em-card .wp-block-image img { border-radius: 0; }
.is-style-em-card h3 a { text-decoration: none; }
.is-style-em-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--accent); }

/* Ikooni ümbris */
.em-icon {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	background: var(--wp--preset--color--accent);
	margin-bottom: 0.25rem !important;
}
.em-icon img { width: 34px !important; height: 34px !important; border-radius: 0 !important; }
.has-contrast-background-color .em-icon,
.has-contrast-2-background-color .em-icon { background: var(--wp--preset--color--accent); }

/* "Loe lähemalt" link */
.em-more a { text-decoration: none; font-weight: 600; }
.em-more a::after { content: " →"; transition: margin .2s; }
.em-more a:hover::after { margin-left: 4px; }

/* Kontuuriga nupp tumedal taustal */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 2px;
	background: transparent;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast) !important;
}

/* Sammud */
.em-step-nr {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 2rem !important;
	line-height: 1 !important;
	color: var(--wp--preset--color--accent-dark);
}

/* Linnukesega loend */
.em-checklist { list-style: none; padding-left: 0 !important; }
.em-checklist li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.6rem;
}
.em-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}

/* Galerii */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 8px; }
.wp-block-gallery.has-nested-images figure.wp-block-image { overflow: hidden; border-radius: 8px; }
.wp-block-gallery.has-nested-images figure.wp-block-image img { transition: transform .35s ease; }
.wp-block-gallery.has-nested-images figure.wp-block-image:hover img { transform: scale(1.04); }

/* Jalus */
.em-footer a { text-decoration: none; }
.em-footer a:hover { color: var(--wp--preset--color--accent) !important; text-decoration: underline; }
.em-footer ul { list-style: none; padding-left: 0 !important; }
.em-footer li { margin-bottom: 0.4rem; }

/* Tabel (rekvisiidid) */
.em-table table { border-collapse: collapse; width: 100%; }
.em-table td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 0.7rem 0.25rem; vertical-align: top; }
.em-table td:first-child { color: var(--wp--preset--color--muted); width: 40%; }

/* Kaart */
.em-map iframe { width: 100%; height: 380px; border: 0; border-radius: 10px; display: block; }

/* ---------- Kontaktivorm ---------- */
.em-form { display: grid; gap: 1rem; }
.em-form .em-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .em-form .em-row { grid-template-columns: 1fr; } }
.em-form label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.em-form input[type="text"],
.em-form input[type="email"],
.em-form input[type="tel"],
.em-form select,
.em-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.8rem 0.9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	background: var(--wp--preset--color--base);
	font: inherit;
	color: inherit;
}
.em-form input:focus, .em-form select:focus, .em-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 0;
	border-color: var(--wp--preset--color--accent-dark);
}
.em-form textarea { min-height: 150px; resize: vertical; }
.em-form .em-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.em-form button {
	justify-self: start;
	cursor: pointer;
	border: 0;
	border-radius: 6px;
	padding: 0.9rem 1.8rem;
	font: inherit;
	font-weight: 600;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}
.em-form button:hover { background: var(--wp--preset--color--accent-dark); }
.em-form small { color: var(--wp--preset--color--muted); }
.em-notice { padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.em-notice.ok { background: #E8F6EC; border: 1px solid #9CD3AC; }
.em-notice.err { background: #FDECEC; border: 1px solid #F1A7A7; }

/* ---------- Lehe ülesehitus ---------- */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }
.em-pagehead {
	background-color: var(--wp--preset--color--contrast);
	background-image: linear-gradient(90deg, rgba(14,16,22,.96) 35%, rgba(14,16,22,.55)), url(assets/images/hero.jpg);
	background-size: cover;
	background-position: center right;
}
.em-pagehead .wp-block-post-title { margin: 0; }
.em-page-content { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--70); }
.em-page-content > .alignfull:last-child { margin-bottom: calc(-1 * var(--wp--preset--spacing--70)); }
.em-page-content > .alignfull:first-child { margin-top: calc(-1 * var(--wp--preset--spacing--60)); }
.em-front-content > .alignfull:last-child { margin-bottom: 0; }
/* Tekstiplokid lehtedel loetava laiusega, kuid joondatud pealkirjaribaga */
.em-page-content > p,
.em-page-content > ul,
.em-page-content > ol,
.em-page-content > h2,
.em-page-content > h3,
.em-page-content > h4,
.em-page-content > .wp-block-quote,
.em-page-content > .wp-block-table {
	max-width: 780px;
	margin-left: max(0px, calc((100% - 1200px) / 2)) !important;
	margin-right: auto !important;
}
.em-footer .wp-block-separator { opacity: 1; border-color: #2c313b; background-color: #2c313b; }
.em-badge img { background: #fff; border-radius: 50% !important; padding: 4px; box-sizing: border-box; }
/* Ühtlase kõrgusega galeriipildid */
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	aspect-ratio: 4 / 3;
	height: auto;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex-grow: 0; }
/* Orbitron on lai – pikad sõnad murduvad kitsal ekraanil */
h1, h2, h3, .wp-block-post-title { overflow-wrap: break-word; }
/* Suurem logo päises */
.em-header .wp-block-site-logo img { width: clamp(220px, 26vw, 340px) !important; height: auto !important; }
.em-header .wp-block-site-logo { flex-shrink: 0; }
