/*
Theme Name: Tekstimeister
Theme URI: https://www.tekstimeister.ee
Author: Tekstimeister
Description: Plokiteema Tekstimeistri kodulehele, ehitatud Tekstimeistri visuaalse identiteedi järgi (värvid, fondid, logo, kaheksanurk). Sisaldab kontaktivormi lühikoodi [tekstimeister_kontaktivorm].
Version: 2.12.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: tekstimeister
*/

:root {
	/* Pointy-top octagon from the logo mark */
	--tm-octagon: polygon(50% 0, 85.36% 14.64%, 100% 50%, 85.36% 85.36%, 50% 100%, 14.64% 85.36%, 0 50%, 14.64% 14.64%);
}

/* ---------- layout rhythm ---------- */
.tm-main { padding-top: 0; padding-bottom: var(--wp--preset--spacing--60); }
.tm-front { padding-bottom: 0; }
.tm-main > .tm-pagehead { margin-top: 0; }
.tm-content { margin-top: var(--wp--preset--spacing--50); }
.tm-section { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); margin-top: 0 !important; position: relative; overflow: hidden; }
.tm-section > * { max-width: var(--wp--style--global--wide-size) !important; position: relative; z-index: 1; }
.wp-site-blocks > * { margin-block-start: 0 !important; }
.tm-split { gap: clamp(2rem, 6vw, 5rem) !important; }

/* ---------- header ---------- */
.tm-header { padding-top: .9rem; padding-bottom: .9rem; background: var(--wp--preset--color--base); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 var(--wp--preset--color--line); }
.admin-bar .tm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tm-header { top: 46px; } }

/* Logo: the site title text stays in the markup (SEO, screen readers); the brand wordmark is shown instead. */
.tm-logo a { display: block; width: 150px; aspect-ratio: 640 / 228; background: url(assets/img/logo-plum.png) no-repeat left center / contain; color: transparent !important; overflow: hidden; white-space: nowrap; font-size: 1rem; }
.tm-logo { margin: 0; line-height: 1; }
.tm-footer .tm-logo a { width: 190px; }

.tm-header .wp-block-navigation { gap: 1.6rem; }
.tm-header .wp-block-navigation-item a { padding: .25rem 0; }
.tm-header .wp-block-navigation-item a:hover { color: var(--wp--preset--color--red); }
.tm-header .wp-block-navigation .current-menu-item > a,
.tm-header .wp-block-navigation .current-menu-ancestor > a { color: var(--wp--preset--color--red); }
/* Desktop dropdowns (only when the menu is NOT the mobile overlay) */
.tm-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container { border: 0 !important; border-radius: 6px; padding: .5rem 0; box-shadow: 0 12px 32px rgba(91,14,45,.14); background: var(--wp--preset--color--base) !important; min-width: 15rem !important; }
.tm-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container a { padding: .45rem 1.1rem !important; font-weight: 400; }

/* Mobile overlay menu: left-aligned list, submenus inline under their parent */
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--peach) !important; color: var(--wp--preset--color--plum) !important; padding: 1.25rem clamp(1.25rem, 6vw, 2rem) 2rem !important; }
.wp-block-navigation__responsive-container.is-menu-open::after { content: ""; position: absolute; width: 22rem; aspect-ratio: 1; right: -8rem; bottom: -8rem; background: var(--wp--preset--color--base); opacity: .5; clip-path: var(--tm-octagon); pointer-events: none; }
.is-menu-open .wp-block-navigation__responsive-close { max-width: none !important; }
.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 3.25rem !important; align-items: stretch !important; gap: 0 !important; position: relative; z-index: 1; }
.is-menu-open .wp-block-navigation__container,
.is-menu-open .wp-block-page-list { align-items: stretch !important; justify-content: flex-start !important; gap: 0 !important; width: 100%; }
.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; justify-content: flex-start !important; text-align: left !important; width: 100%; border-bottom: 1px solid rgba(91,14,45,.15); }
.is-menu-open .wp-block-navigation-item > a { text-align: left !important; justify-content: flex-start !important; font-family: var(--wp--preset--font-family--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.2; padding: .8rem 0 !important; width: 100%; }
.is-menu-open .wp-block-navigation-item.current-menu-item > a { color: var(--wp--preset--color--red); }
.is-menu-open .wp-block-navigation__submenu-icon { display: none !important; }
.is-menu-open .wp-block-navigation__submenu-container { position: static !important; box-shadow: none !important; background: transparent !important; border: 0 !important; border-left: 2px solid var(--wp--preset--color--red) !important; border-radius: 0 !important; padding: 0 0 0 1rem !important; margin: 0 0 1rem .1rem !important; min-width: 0 !important; width: auto !important; opacity: 1 !important; visibility: visible !important; height: auto !important; gap: 0 !important; }
.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { border: 0; }
.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item > a { font-family: var(--wp--preset--font-family--sans); font-size: 1.1rem; padding: .35rem 0 !important; }
.is-menu-open .wp-block-navigation__responsive-container-close { color: var(--wp--preset--color--plum); }
.wp-block-navigation__responsive-container-open svg, .wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }

/* ---------- type helpers ---------- */
.tm-eyebrow { font-family: var(--wp--preset--font-family--heading); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; font-weight: 700; color: var(--wp--preset--color--red); margin-bottom: .35rem; }
.tm-eyebrow a { color: inherit; text-decoration: none; }
.tm-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.55; }
.tm-small { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.tm-display { font-size: clamp(2.5rem, 5.4vw, 4.4rem) !important; line-height: 1.04 !important; }
.tm-more a { font-family: var(--wp--preset--font-family--heading); font-weight: 700; text-decoration: none; color: var(--wp--preset--color--red); }
.tm-more a:hover { text-decoration: underline; }
a { text-decoration-color: var(--wp--preset--color--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--wp--preset--color--peach); color: var(--wp--preset--color--plum); }

/* ---------- octagon motif ----------
   Decorations hang off page structure (not content classes), so they work with any imported content. */
.tm-section::before, .tm-section::after,
.tm-pagehead::before, .tm-pagehead::after,
.tm-cta::before, .tm-cta::after,
.tm-footer::before, .tm-footer::after,
.tm-hero .wp-block-image::before, .tm-hero .wp-block-image::after { content: ""; position: absolute; clip-path: var(--tm-octagon); pointer-events: none; z-index: 0; }

/* Front page hero: big peach octagon behind the headline + small red one */
.tm-front .wp-block-post-content > .tm-section:first-child::before { width: min(62vw, 54rem); aspect-ratio: 1; background: var(--wp--preset--color--peach); left: -14vw; top: -22vw; }

/* Hero photo: offset peach octagon behind it and a small plum one on top */
.tm-hero .wp-block-image { position: relative; isolation: isolate; }
.tm-hero .wp-block-image img { position: relative; z-index: 1; }
.tm-hero .wp-block-image::after { width: 18%; aspect-ratio: 1; left: -2%; top: 4%; background: var(--wp--preset--color--plum); z-index: 2; }

/* Peach sections: white octagons, like the stylescape */
.tm-section.has-peach-background-color::before, .tm-section.has-surface-background-color::before { width: 24rem; aspect-ratio: 1; background: var(--wp--preset--color--base); right: -7rem; bottom: -9rem; }

/* White / light sections on the front page: peach octagons peeking in from the edge */
.tm-front .wp-block-post-content > .tm-section:not(:first-child):not(.has-background)::after { width: 2.4rem; aspect-ratio: 1; background: var(--wp--preset--color--red); right: 3%; top: 1.4rem; }
.tm-section.has-peach-light-background-color::before { width: 18rem; aspect-ratio: 1; background: var(--wp--preset--color--peach); right: -6rem; top: -5rem; }

/* CTA band */
.tm-cta::before { width: 26rem; aspect-ratio: 1; background: var(--wp--preset--color--red); opacity: .35; right: -8rem; top: -6rem; }

/* Page header */
.tm-pagehead::after { width: clamp(10rem, 22vw, 18rem); aspect-ratio: 1; background: var(--wp--preset--color--base); right: max(-3rem, calc(50% - 40rem)); top: 50%; transform: translateY(-50%); }

/* Footer */
.tm-footer { position: relative; overflow: hidden; }
.tm-footer > * { position: relative; z-index: 1; }
.tm-footer::before { width: 20rem; aspect-ratio: 1; background: var(--wp--preset--color--base); right: -6rem; bottom: -9rem; }

/* ---------- hero ---------- */
.tm-hero { gap: clamp(2rem, 5vw, 4.5rem) !important; }
.tm-hero .wp-block-image { margin: 0; position: relative; }
.tm-hero .wp-block-image img { clip-path: var(--tm-octagon); border-radius: 0; aspect-ratio: 1; object-fit: cover; object-position: 30% 22%; width: 100%; }
.tm-hero .wp-block-image figcaption { text-align: center; }
.tm-hero .wp-block-buttons { margin-top: 2rem; }

/* ---------- services: numbered editorial list ---------- */
.tm-services { counter-reset: tm-service; border-top: 2px solid var(--wp--preset--color--plum); }
.tm-service { counter-increment: tm-service; position: relative; display: grid !important; grid-template-columns: 4.2rem 1fr 2rem; column-gap: 1rem; align-items: baseline; padding: 1.6rem .5rem 1.6rem 0; border-bottom: 1px solid var(--wp--preset--color--line); transition: background .2s ease, padding .2s ease; }
.tm-service > * { grid-column: 2; margin: 0 !important; }
.tm-service::before { content: counter(tm-service, decimal-leading-zero); grid-column: 1; grid-row: 1 / span 2; font-family: var(--wp--preset--font-family--serif); font-size: 2.4rem; line-height: 1; color: var(--wp--preset--color--red); }
.tm-service::after { content: "→"; grid-column: 3; grid-row: 1; font-size: 1.4rem; color: var(--wp--preset--color--red); transition: transform .2s ease; justify-self: end; }
.tm-service h3 { font-size: 1.45rem; margin-bottom: .35rem !important; }
.tm-service h3 a { color: var(--wp--preset--color--plum); text-decoration: none; }
.tm-service h3 a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.tm-service p { color: var(--wp--preset--color--muted); }
.tm-service:hover { background: var(--wp--preset--color--peach-light); padding-left: .75rem; }
.tm-service:hover::after { transform: translateX(6px); }
.tm-service:hover h3 a { color: var(--wp--preset--color--red); }
.tm-content .tm-services { margin: 2.5rem 0; }

/* ---------- cards (blog) ---------- */
.tm-cards { gap: 1.5rem !important; }
.tm-cards.is-layout-grid { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)) !important; }
.tm-card { background: var(--wp--preset--color--base); border-radius: 6px; height: 100%; }
.tm-postcard { overflow: hidden; display: flex; flex-direction: column; gap: .5rem; padding-bottom: 1.4rem; transition: transform .2s ease, box-shadow .2s ease; position: relative; }
.tm-postcard:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(91,14,45,.1); }
.tm-postcard > *:not(.wp-block-post-featured-image) { padding-left: 1.4rem; padding-right: 1.4rem; margin: 0 !important; }
.tm-postcard .wp-block-post-featured-image { margin: 0 0 .6rem !important; }
.tm-postcard .wp-block-post-featured-image img { border-radius: 0; }
.tm-postcard h2, .tm-postcard h3 { font-family: var(--wp--preset--font-family--heading); font-size: 1.25rem; line-height: 1.3; }
.tm-postcard .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
/* No featured image → branded placeholder */
.tm-postcard:not(:has(.wp-block-post-featured-image))::before { content: ""; display: block; aspect-ratio: 16 / 10; margin-bottom: .6rem; background: url(assets/img/icon-red.png) center / 4.5rem no-repeat, var(--wp--preset--color--peach); }
.has-peach-light-background-color .tm-card { background: var(--wp--preset--color--base); }
.tm-content .tm-postcard { background: var(--wp--preset--color--peach-light); }
.wp-block-post-excerpt__more-link { font-family: var(--wp--preset--font-family--heading); font-weight: 700; text-decoration: none; color: var(--wp--preset--color--red); position: relative; z-index: 2; }
.wp-block-query { margin-top: 2rem; }

/* ---------- quotes: large red „ instead of decorative dots ---------- */
.tm-quotes { gap: 2.5rem 3rem !important; margin-top: 2rem; }
.tm-quotes.is-layout-grid { grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)) !important; }
.tm-quotes .wp-block-quote { margin: 0; border: 0; padding: 0; }
.tm-quotes .wp-block-quote { position: relative; padding-top: 3.2rem !important; }
.tm-quotes .wp-block-quote::before { content: "„"; position: absolute; left: -.15rem; top: -3.7rem; font-family: var(--wp--preset--font-family--serif); font-size: 6rem; line-height: 1; color: var(--wp--preset--color--red); }
.tm-quotes .wp-block-quote p { font-size: 1.1rem; }
.tm-quotes .wp-block-quote cite { display: block; margin-top: 1rem; font-family: var(--wp--preset--font-family--heading); font-style: normal; font-size: .95rem; font-weight: 700; color: var(--wp--preset--color--plum); }
.tm-quotes .wp-block-quote cite a { color: inherit; }
.wp-block-quote:not(.tm-quotes .wp-block-quote) { border-left: 3px solid var(--wp--preset--color--red); padding-left: 1.4rem; }

/* ---------- page header ---------- */
.tm-pagehead { position: relative; overflow: hidden; padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); }
.tm-pagehead > * { position: relative; z-index: 1; }
.tm-pagehead .wp-block-post-title, .tm-pagehead h1 { margin: 0; }
.tm-pagehead::after { width: clamp(10rem, 22vw, 18rem); aspect-ratio: 1; background: var(--wp--preset--color--base); right: max(-3rem, calc(50% - 40rem)); top: 50%; transform: translateY(-50%); opacity: .7; }

/* ---------- logos ---------- */
.tm-logos { gap: 1rem !important; margin-top: 1.5rem; align-items: center; }
.tm-logos .wp-block-image { margin: 0; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 6px; padding: 1rem; height: 7rem; display: flex; align-items: center; justify-content: center; }
.tm-logos .wp-block-image img { max-height: 5rem; width: auto; object-fit: contain; border-radius: 0; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.tm-logos .wp-block-image:hover img { filter: none; opacity: 1; }

/* ---------- CTA band ---------- */
.tm-cta { background-color: var(--wp--preset--color--plum) !important; padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); margin-top: 0 !important; text-align: center; position: relative; overflow: hidden; }
.tm-cta > * { position: relative; z-index: 1; }
.tm-cta, .tm-cta h2, .tm-cta a { color: #fff; }
.tm-cta h2 { max-width: 40rem !important; margin-left: auto !important; margin-right: auto !important; }
.tm-cta .wp-block-buttons { justify-content: center; }
.tm-cta .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--plum); }
.tm-cta .tm-small { color: var(--wp--preset--color--peach); }

/* ---------- price table ---------- */
.tm-prices table { border-collapse: collapse; border: 0; table-layout: auto !important; }
.tm-prices th, .tm-prices td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 1rem .25rem; text-align: left; }
.tm-prices thead th { font-family: var(--wp--preset--font-family--heading); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wp--preset--color--red); border-bottom: 2px solid var(--wp--preset--color--plum); }
.tm-prices td:last-child, .tm-prices th:last-child { text-align: right; white-space: nowrap; }
.tm-prices td:last-child { font-family: var(--wp--preset--font-family--serif); font-size: 1.3rem; }

/* ---------- details ---------- */
.wp-block-details summary { cursor: pointer; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.15rem; }
.wp-block-details summary::marker { color: var(--wp--preset--color--red); }
.wp-block-details[open] summary { margin-bottom: .5rem; }

/* ---------- lists ---------- */
.tm-content ul.wp-block-list li::marker { color: var(--wp--preset--color--red); }

/* ---------- buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--plum); border: 2px solid var(--wp--preset--color--plum); padding: calc(.8rem - 2px) calc(1.7rem - 2px); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--plum); color: #fff; }

/* ---------- post nav ---------- */
.tm-postnav { margin-top: var(--wp--preset--spacing--50); padding-top: 1.5rem; border-top: 1px solid var(--wp--preset--color--line); font-family: var(--wp--preset--font-family--heading); font-weight: 700; }

/* ---------- footer ---------- */
.tm-footer { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); margin-top: 0 !important; font-size: 1rem; }
.tm-footer h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .14em; color: var(--wp--preset--color--red); }

/* ---------- contact form ---------- */
.tm-form { display: grid; gap: 1rem; background: var(--wp--preset--color--peach-light); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2rem); }
.tm-form label { display: block; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: .98rem; margin-bottom: .3rem; }
.tm-form input[type=text], .tm-form input[type=email], .tm-form textarea { width: 100%; box-sizing: border-box; padding: .75rem .9rem; border: 1px solid var(--wp--preset--color--line); border-radius: 4px; background: #fff; font: inherit; color: inherit; }
.tm-form input:focus, .tm-form textarea:focus { outline: 2px solid var(--wp--preset--color--red); outline-offset: 1px; border-color: transparent; }
.tm-form textarea { min-height: 9rem; resize: vertical; }
.tm-form .tm-check { display: flex; gap: .6rem; align-items: flex-start; font-family: var(--wp--preset--font-family--sans); font-weight: 400; }
.tm-form .tm-check input { margin-top: .4rem; accent-color: var(--wp--preset--color--red); }
.tm-form .tm-hp { position: absolute; left: -9999px; }
.tm-form button { justify-self: start; border: 0; cursor: pointer; }
.tm-notice { border-radius: 6px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.tm-notice.ok { background: var(--wp--preset--color--peach); color: var(--wp--preset--color--plum); }
.tm-notice.err { background: #FBE1E4; color: #8A1426; }

@media (max-width: 781px) {
	.tm-hero .wp-block-column:last-child { order: -1; max-width: 20rem; margin: 0 auto; }
	.tm-front .wp-block-post-content > .tm-section:first-child::before { width: 120vw; left: -40vw; top: -50vw; }
	.tm-front .wp-block-post-content > .tm-section:first-child::after { display: none; }
	.tm-service { grid-template-columns: 3rem 1fr 1.5rem; }
	.tm-service::before { font-size: 1.8rem; }
}

/* Content imported with the v1 theme used different colour names – map them to the brand palette */
.has-forest-background-color, .has-ink-background-color { background-color: var(--wp--preset--color--plum) !important; }
.has-surface-background-color { background-color: var(--wp--preset--color--peach) !important; }
.has-paper-background-color { background-color: var(--wp--preset--color--base) !important; }
.has-paper-color { color: #fff !important; }
.has-ink-color { color: var(--wp--preset--color--plum) !important; }

@media (max-width: 600px) {
	.tm-cta::before { width: 16rem; right: -9rem; top: -5rem; opacity: .25; }
	.tm-section.has-peach-background-color::before, .tm-section.has-surface-background-color::before { width: 14rem; right: -6rem; bottom: -6rem; }
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):not(.has-background)::before { width: 9rem; left: -6rem; }
	.tm-pagehead::before { display: none; }
}

/* v1 content: the old service cards are rendered as the numbered list */
.tm-cards:not(.wp-block-post-template) { display: block !important; counter-reset: tm-service; border-top: 2px solid var(--wp--preset--color--plum); margin-top: 2rem; }
.tm-cards:not(.wp-block-post-template) > .tm-card { counter-increment: tm-service; position: relative; display: grid !important; grid-template-columns: 4.2rem 1fr 2rem; column-gap: 1rem; align-items: baseline; padding: 1.6rem .5rem 1.6rem 0; margin: 0 !important; border-bottom: 1px solid rgba(91,14,45,.18); border-radius: 0; background: transparent !important; height: auto; transition: background .2s ease, padding .2s ease; }
.tm-cards:not(.wp-block-post-template) > .tm-card > * { grid-column: 2; margin: 0 !important; }
.tm-cards:not(.wp-block-post-template) > .tm-card::before { content: counter(tm-service, decimal-leading-zero); grid-column: 1; grid-row: 1 / span 2; font-family: var(--wp--preset--font-family--serif); font-size: 2.4rem; line-height: 1; color: var(--wp--preset--color--red); }
.tm-cards:not(.wp-block-post-template) > .tm-card::after { content: "→"; grid-column: 3; grid-row: 1; font-size: 1.4rem; color: var(--wp--preset--color--red); transition: transform .2s ease; justify-self: end; }
.tm-cards:not(.wp-block-post-template) > .tm-card h3 { font-size: 1.45rem; margin-bottom: .35rem !important; }
.tm-cards:not(.wp-block-post-template) > .tm-card h3 a { color: var(--wp--preset--color--plum); text-decoration: none; }
.tm-cards:not(.wp-block-post-template) > .tm-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tm-cards:not(.wp-block-post-template) > .tm-card .tm-more { display: none; }
.tm-cards:not(.wp-block-post-template) > .tm-card:hover { background: rgba(255,255,255,.45) !important; padding-left: .75rem; }
.tm-cards:not(.wp-block-post-template) > .tm-card:hover::after { transform: translateX(6px); }
.tm-cards:not(.wp-block-post-template) > .tm-card:hover h3 a { color: var(--wp--preset--color--red); }
.has-peach-background-color .tm-service:hover, .has-surface-background-color .tm-service:hover { background: rgba(255,255,255,.45); }
@media (max-width: 781px) {
	.tm-cards:not(.wp-block-post-template) > .tm-card { grid-template-columns: 3rem 1fr 1.5rem; }
	.tm-cards:not(.wp-block-post-template) > .tm-card::before { font-size: 1.8rem; }
}
.tm-hero .wp-block-image figcaption { position: relative; z-index: 2; }
.tm-hero .wp-block-image::before { height: auto; bottom: auto; }
@media (max-width: 781px) {
	.tm-section.has-peach-background-color::after, .tm-section.has-surface-background-color::after,
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):not(.has-background)::before,
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):not(.has-background)::after,
	.tm-cta::after { display: none; }
}

/* ===================== v2.2: sales-focused components ===================== */
.tm-center { text-align: center; }

/* Price line in the service list and on offers */
.tm-price { font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: var(--wp--preset--color--red) !important; font-size: .95rem; margin-top: .45rem !important; }
.tm-price-big { font-family: var(--wp--preset--font-family--serif); font-weight: 400; font-size: 2.6rem; line-height: 1; color: var(--wp--preset--color--plum) !important; margin-bottom: 1rem !important; }

/* Logo strip under the hero */
.tm-logostrip { padding-top: 2.2rem; padding-bottom: 2.4rem; margin-top: 0 !important; border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); }
.tm-logostrip .tm-eyebrow { color: var(--wp--preset--color--muted); margin-bottom: 1.2rem; }
.tm-logobar { gap: 1.2rem 2.6rem !important; align-items: center; max-width: var(--wp--style--global--wide-size) !important; margin-left: auto !important; margin-right: auto !important; }
.tm-logobar .wp-block-image { margin: 0; }
.tm-logobar .wp-block-image img { height: 3.4rem; width: auto; max-width: 9rem; object-fit: contain; border-radius: 0; filter: grayscale(1); opacity: .65; transition: filter .2s, opacity .2s; }
.tm-logobar .wp-block-image:hover img { filter: none; opacity: 1; }

/* Audience cards ("Kellele kirjutan") */
.tm-audiences { gap: 1.25rem !important; margin-top: 2rem; }
.tm-audiences.is-layout-grid { grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)) !important; }
.tm-audience { background: var(--wp--preset--color--base) !important; border-radius: 6px; padding: 1.8rem 1.6rem; border-top: 4px solid var(--wp--preset--color--red); }
.tm-audience h3 { margin-top: 0; font-size: 1.3rem; }
.tm-audience > * + * { margin-top: .8rem; }

/* Process steps */
.tm-steps { counter-reset: tm-step; gap: 1.5rem 2rem !important; margin-top: 2rem; }
.tm-steps.is-layout-grid { grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)) !important; }
.tm-step { counter-increment: tm-step; position: relative; padding-top: 3.6rem; }
.tm-step::before { content: counter(tm-step); position: absolute; top: 0; left: 0; width: 2.7rem; height: 2.7rem; display: grid; place-items: center; background: var(--wp--preset--color--red); color: #fff; font-family: var(--wp--preset--font-family--serif); font-size: 1.3rem; clip-path: var(--tm-octagon); }
.tm-step h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.tm-step p { margin: 0; }

/* Consultation offer band */
.tm-offer .wp-block-buttons { margin-top: 0; }
@media (min-width: 782px) { .tm-offer .wp-block-column:last-child { text-align: right; } .tm-offer .wp-block-buttons { justify-content: flex-end; } }

/* One testimonial on service pages */
.tm-quote-single { margin-top: 2.5rem !important; margin-bottom: 2rem !important; padding: 1.8rem 1.8rem 1.6rem; background: var(--wp--preset--color--peach-light); border-radius: 6px; }
.tm-quote-single.is-layout-grid, .tm-quote-single { display: block !important; }
.tm-quote-single .wp-block-quote { padding-top: 2.8rem !important; }
.tm-quote-single .wp-block-quote::before { top: -3.5rem; }

/* CTA band: two buttons */
.tm-cta .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; border-color: #fff; }
.tm-cta .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--plum); }

/* CTA under blog posts */
.tm-postcta { margin-top: var(--wp--preset--spacing--50) !important; padding: 1.8rem 2rem; border-radius: 6px; }
.tm-postcta h3 { margin-top: 0; }

/* Contact form extras */
.tm-form select { width: 100%; box-sizing: border-box; padding: .75rem .9rem; border: 1px solid var(--wp--preset--color--line); border-radius: 4px; background: #fff; font: inherit; color: inherit; }
.tm-form input[type=url] { width: 100%; box-sizing: border-box; padding: .75rem .9rem; border: 1px solid var(--wp--preset--color--line); border-radius: 4px; background: #fff; font: inherit; color: inherit; }
.tm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .tm-form-row { grid-template-columns: 1fr; } }
.tm-opt { font-weight: 400; color: var(--wp--preset--color--muted); font-size: .85em; }
.tm-form ::placeholder { color: #a98f99; }
.tm-values-note { margin-top: 2rem !important; font-family: var(--wp--preset--font-family--serif); font-size: 1.25rem; line-height: 1.5; max-width: 44rem; }

/* Language switcher (ET | EN) */
.tm-header-right { gap: 1.4rem !important; }
.tm-lang { display: flex; align-items: center; gap: .15rem; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: .85rem; letter-spacing: .06em; padding-left: 1.2rem; border-left: 1px solid var(--wp--preset--color--line); }
.tm-lang a { text-decoration: none; color: var(--wp--preset--color--muted); padding: .25rem .35rem; border-radius: 3px; }
.tm-lang a:hover { color: var(--wp--preset--color--red); }
.tm-lang a.is-active { color: var(--wp--preset--color--plum); background: var(--wp--preset--color--peach); }
.tm-header-right > p:empty { display: none; }
@media (max-width: 600px) { .tm-lang { padding-left: .6rem; } .tm-header-right { gap: .8rem !important; } }

/* Select: custom chevron with breathing room (native arrow sits against the border) */
.tm-form select {
	-webkit-appearance: none; -moz-appearance: none; appearance: none;
	padding-right: 3rem;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%235B0E2D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1.1rem center;
	background-size: 14px 9px;
	cursor: pointer;
}
.tm-form select:focus { outline: 2px solid var(--wp--preset--color--red); outline-offset: 1px; border-color: transparent; }
.tm-form select::-ms-expand { display: none; }

/* Deadline + website: full-width rows (a URL needs the room) */
.tm-form-row { grid-template-columns: 1fr !important; }

/* Homepage services: compact numbered tiles */
.tm-services-head { margin-bottom: 0 !important; }
.tm-services-head p:last-child { margin-bottom: 0; }
@media (min-width: 782px) { .tm-more-right { text-align: right; } }
.tm-tiles { counter-reset: tm-tile; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem !important; }
.tm-tile { counter-increment: tm-tile; position: relative; background: var(--wp--preset--color--peach-light); border-radius: 6px; padding: 1.4rem 1.4rem 3.2rem; min-height: 9.5rem; display: flex; flex-direction: column; transition: background .2s ease, transform .2s ease; }
.tm-tile::before { content: counter(tm-tile, decimal-leading-zero); font-family: var(--wp--preset--font-family--serif); font-size: 2rem; line-height: 1; color: var(--wp--preset--color--red); margin-bottom: .8rem; }
.tm-tile::after { content: "→"; position: absolute; right: 1.3rem; bottom: 1.1rem; font-size: 1.3rem; color: var(--wp--preset--color--red); transition: transform .2s ease; }
.tm-tile h3 { margin: 0 !important; font-size: 1.25rem; line-height: 1.25; }
.tm-tile h3 a { color: var(--wp--preset--color--plum); text-decoration: none; }
.tm-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.tm-tile:hover { background: var(--wp--preset--color--peach); transform: translateY(-2px); }
.tm-tile:hover::after { transform: translateX(5px); }
@media (max-width: 1000px) { .tm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tm-tiles { grid-template-columns: 1fr; } .tm-tile { min-height: 0; padding-bottom: 1.4rem; flex-direction: row; align-items: baseline; gap: 1rem; } .tm-tile::before { margin: 0; font-size: 1.6rem; } }
.tm-tiles > .tm-tile { margin: 0 !important; }

/* v2.8.1: service tiles without numbers */
.tm-tile::before { content: none !important; display: none !important; }
.tm-tile { min-height: 0; padding: 1.5rem 3.2rem 1.5rem 1.5rem; justify-content: center; border-left: 3px solid var(--wp--preset--color--red); }
.tm-tile::after { top: 50%; bottom: auto; transform: translateY(-50%); }
.tm-tile:hover::after { transform: translate(5px, -50%); }
/* steps section sits on peach now: white step badges outline for contrast */
.has-peach-background-color .tm-step::before { background: var(--wp--preset--color--red); }
.tm-section.has-peach-background-color:has(> .tm-audiences)::before { width: 16rem; right: -8rem; bottom: -9rem; }

/* Homepage tiles: 5 services → 3 + 2 */
.tm-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tm-tiles > .tm-tile { grid-column: span 2; }
.tm-tiles > .tm-tile:nth-child(4), .tm-tiles > .tm-tile:nth-child(5) { grid-column: span 3; }
@media (max-width: 1000px) { .tm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-tiles > .tm-tile, .tm-tiles > .tm-tile:nth-child(4) { grid-column: span 1; } .tm-tiles > .tm-tile:nth-child(5) { grid-column: span 2; } }
@media (max-width: 520px) { .tm-tiles { grid-template-columns: 1fr; } .tm-tiles > .tm-tile, .tm-tiles > .tm-tile:nth-child(4), .tm-tiles > .tm-tile:nth-child(5) { grid-column: auto; } }

/* ===================== v2.9: front-page octagons – zigzag left/right, varied size and colour ===================== */
/* Every rule sets all four sides so older positions never leak through. */
.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-audiences)::before { width: 13rem; aspect-ratio: 1; background: var(--wp--preset--color--base); opacity: 1; left: -7rem; right: auto; top: auto; bottom: -6rem; }
.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-audiences)::after { width: 1.9rem; aspect-ratio: 1; background: var(--wp--preset--color--red); left: auto; right: 6%; top: 2.6rem; bottom: auto; }

.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-tiles)::before { width: 15rem; aspect-ratio: 1; background: var(--wp--preset--color--peach); left: auto; right: -8.5rem; top: 34%; bottom: auto; }
.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-tiles)::after { width: 1.4rem; aspect-ratio: 1; background: var(--wp--preset--color--plum); left: 4%; right: auto; top: 3.2rem; bottom: auto; }

.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-steps)::before { width: 11rem; aspect-ratio: 1; background: var(--wp--preset--color--base); left: -6.5rem; right: auto; top: auto; bottom: 3.5rem; }

.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-quotes)::before { width: 26rem; aspect-ratio: 1; background: var(--wp--preset--color--peach); left: auto; right: -12rem; top: auto; bottom: -13rem; }
.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-quotes)::after { width: 2.3rem; aspect-ratio: 1; background: var(--wp--preset--color--red); left: 3.5%; right: auto; top: 2.4rem; bottom: auto; }

.tm-cta::before { width: 24rem; aspect-ratio: 1; background: var(--wp--preset--color--red); opacity: .35; left: -8rem; right: auto; top: -12rem; bottom: auto; }
.tm-cta::after { width: 2.6rem; aspect-ratio: 1; background: var(--wp--preset--color--peach); left: auto; right: 9%; top: auto; bottom: 2.6rem; }

@media (max-width: 781px) {
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-audiences)::before { width: 9rem; left: -5.5rem; bottom: -4rem; }
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-steps)::before { width: 8rem; left: -5rem; bottom: 2rem; }
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):has(> .tm-quotes)::before { display: block; width: 12rem; right: -6rem; bottom: -7rem; }
	.tm-front .wp-block-post-content > .tm-section:not(:first-child):is(:has(> .tm-audiences), :has(> .tm-tiles), :has(> .tm-quotes))::after { display: none; }
	.tm-cta::before { width: 15rem; left: -7rem; top: -8rem; opacity: .3; }
}
@media (max-width: 520px) { .tm-tile { justify-content: flex-start; align-items: center; } }

/* ===================== v2.11: Tehtud tööd / Work page ===================== */
.tm-content:has(> .tm-section:first-child) { margin-top: 0 !important; }

/* All testimonials as cards, masonry columns */
.tm-quote-cards { columns: 3 17rem; column-gap: 1.25rem; margin-top: 2.2rem !important; }
.tm-work-quotes .tm-quote-cards > .wp-block-quote { break-inside: avoid; display: inline-block; width: 100%; box-sizing: border-box; vertical-align: top; position: relative; margin: 0 0 1.25rem !important; padding: 2.9rem 1.6rem 1.5rem; border: 0; border-radius: 6px; background: var(--wp--preset--color--peach-light); }
.tm-work-quotes .tm-quote-cards > .wp-block-quote::before { content: "„"; position: absolute; left: 1.4rem; top: -1.25rem; font-family: var(--wp--preset--font-family--serif); font-size: 4rem; line-height: 1; color: var(--wp--preset--color--red); }
.tm-quote-cards .wp-block-quote p { font-size: 1rem; margin: 0; }
.tm-quote-cards .wp-block-quote cite { display: block; margin-top: .9rem; font-family: var(--wp--preset--font-family--heading); font-style: normal; font-size: .9rem; font-weight: 700; color: var(--wp--preset--color--plum); }
.tm-quote-cards .wp-block-quote cite a { color: inherit; }
.tm-work-quotes .tm-small { margin-top: .5rem; }

/* Logos on peach */
.tm-work-logos .tm-logos { margin-top: 1.8rem; }
.tm-work-logos .tm-logos .wp-block-image { border-color: transparent; }

/* Octagons: zigzag down the page */
.tm-section.tm-work-quotes::before { width: 14rem; aspect-ratio: 1; background: var(--wp--preset--color--peach); left: -8rem; right: auto; top: auto; bottom: 10%; }
.tm-section.tm-work-quotes::after { width: 1.4rem; aspect-ratio: 1; background: var(--wp--preset--color--plum); left: auto; right: 4.5%; top: 3.2rem; bottom: auto; }
.tm-section.tm-work-logos::before { width: 18rem; aspect-ratio: 1; background: var(--wp--preset--color--base); left: auto; right: -7rem; top: auto; bottom: -8rem; }
@media (max-width: 781px) {
	.tm-section.tm-work-quotes::after { display: none; }
	.tm-section.tm-work-quotes::before { width: 8rem; left: -5rem; bottom: 2rem; }
	.tm-section.tm-work-logos::before { width: 11rem; right: -5rem; bottom: -5rem; }
}
