/*
Theme Name: PH Hammaslaite
Theme URI: https://phhammaslaite.fi
Author: PH Hammaslaite Oy
Author URI: https://phhammaslaite.fi
Description: Hammashoidon laitteiden huoltoliikkeen block-teema. Valkoinen, sininen, asiallinen.
Version: 1.2.0
Requires at least: 6.5
Tested up to: 7.1
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: ph-hammaslaite
*/

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

:root {
  --ph-shadow-sm: 0 1px 2px rgba(14, 33, 65, 0.05), 0 2px 8px rgba(14, 33, 65, 0.06);
  --ph-shadow-md: 0 12px 32px rgba(14, 33, 65, 0.12), 0 2px 8px rgba(14, 33, 65, 0.06);
  --ph-shadow-lg: 0 24px 60px rgba(14, 33, 65, 0.16), 0 4px 12px rgba(14, 33, 65, 0.06);
  --ph-radius: 12px;
  --ph-radius-sm: 8px;
  --ph-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ph-green: #1f9d5a;
  --ph-amber: #d98a11;
}

html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { -webkit-font-smoothing: antialiased; }
p { margin-block-start: 0; }
strong { font-weight: 600; }
::selection { background: var(--wp--preset--color--primary); color: #fff; }

.wp-site-blocks > footer { margin-block-start: 0; }
.wp-site-blocks > main { margin-block-start: 0; }

.has-navy-background-color :is(h1, h2, h3, h4),
.has-primary-background-color :is(h1, h2, h3, h4) { color: inherit; }

/* Animated link underline in body copy */
.entry-content p > a:not(.wp-block-button__link),
.entry-content li > a:not(.wp-block-button__link) {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s var(--ph-ease);
}
.entry-content p > a:not(.wp-block-button__link):hover,
.entry-content li > a:not(.wp-block-button__link):hover { background-size: 100% 2px; }

/* === Buttons ============================================================= */

.wp-block-button__link {
  transition: transform 0.2s var(--ph-ease), box-shadow 0.2s var(--ph-ease), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28, 78, 156, 0.22); }
.wp-block-button__link:active { transform: translateY(0); box-shadow: none; }
.is-style-outline .wp-block-button__link:hover { box-shadow: 0 8px 20px rgba(28, 78, 156, 0.12); }

.has-arrow .wp-block-button__link::after {
  content: "";
  display: inline-block;
  width: 0.9em; height: 0.9em;
  margin-left: 0.5em;
  vertical-align: -0.1em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s var(--ph-ease);
}
.has-arrow .wp-block-button__link:hover::after { transform: translateX(4px); }

/* Phone icon buttons */
.header-phone .wp-block-button__link::before,
.phone-cta .wp-block-button__link::before {
  content: "";
  display: inline-block;
  width: 0.95em; height: 0.95em;
  margin-right: 0.55em;
  vertical-align: -0.12em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.header-phone .wp-block-button__link { padding: 0.65rem 1.25rem; white-space: nowrap; }
.phone-cta .wp-block-button__link { font-size: 1.125rem; padding: 0.95rem 1.9rem; }

/* Pulsing ring on the hero phone button */
.hero .phone-cta { position: relative; }
.hero .phone-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid var(--wp--preset--color--primary);
  opacity: 0;
  animation: phRing 3s ease-out 1.2s infinite;
  pointer-events: none;
}
@keyframes phRing {
  0%   { transform: scale(1); opacity: 0.6; }
  60%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

.phone-big {
  font-family: var(--wp--preset--font-family--heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.phone-big a { text-decoration: none; background: none !important; }
.phone-big a:hover { text-decoration: underline; }

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

.wp-site-blocks > header {
  position: sticky;
  top: 0;
  z-index: 200;
}

.top-bar {
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  max-height: 60px;
  transition: max-height 0.35s var(--ph-ease), padding 0.35s var(--ph-ease), opacity 0.25s ease;
  overflow: hidden;
}
.top-bar a { color: #fff; text-decoration: none; font-weight: 500; }
.top-bar a:hover { text-decoration: underline; }
.top-bar .top-bar-phone { font-family: var(--wp--preset--font-family--heading); font-weight: 600; }

.site-header {
  border-bottom: 1px solid rgba(214, 222, 231, 0.7);
  background: rgba(255, 255, 255, 0.86) !important;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
          backdrop-filter: saturate(180%) blur(12px);
  transition: padding 0.3s var(--ph-ease), box-shadow 0.3s ease;
}
.is-scrolled .top-bar { max-height: 0; padding-top: 0 !important; padding-bottom: 0 !important; opacity: 0; }
.is-scrolled .site-header { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; box-shadow: 0 6px 24px rgba(14, 33, 65, 0.08); }

.brand-mark img { width: 42px; height: 42px; transition: transform 0.3s var(--ph-ease); }
.brand-mark a:hover img { transform: rotate(-6deg) scale(1.05); }
.site-header .wp-block-site-title { white-space: nowrap; }

.site-header .wp-block-navigation .wp-block-navigation-item__content {
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.15s ease;
}
.site-header .wp-block-navigation .wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--wp--preset--color--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ph-ease);
}
.site-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after,
.site-header .wp-block-navigation .wp-block-navigation-item__content:hover::after { transform: scaleX(1); }

@media (max-width: 900px) {
  .top-bar-left { display: none; }
  .top-bar .wp-block-group { justify-content: center; }
  .wp-block-buttons.header-phone { display: none; }
  .site-header .wp-block-site-title { font-size: 1.05rem; }
}

/* Mobile navigation overlay */
.wp-block-navigation__responsive-container.is-menu-open { padding: 5rem 2rem 2rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 1.25rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-size: 1.375rem;
  font-weight: 600;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after { display: none; }
.wp-block-navigation__responsive-container-close { color: #fff; }

/* === Hero ================================================================ */

.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  isolation: isolate;
  overflow: hidden;
}
.hero > .alignwide { width: 100%; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wp--preset--gradient--hero-fade);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 60vw; height: 60vw;
  max-width: 900px; max-height: 900px;
  left: -20vw; top: -30vw;
  background: radial-gradient(circle, rgba(28, 78, 156, 0.10) 0%, rgba(28, 78, 156, 0) 62%);
  pointer-events: none;
}
.hero h1 { color: var(--wp--preset--color--primary); max-width: 20ch; font-size: clamp(2.5rem, 4.6vw, 3.75rem); }
.hero .hero-lead { max-width: 46ch; font-size: 1.125rem; }
.hero-eyebrow,
.eyebrow {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wp--preset--color--primary);
}
.hero-hours { font-size: 0.9375rem; color: var(--wp--preset--color--muted); }
.hero-hours strong { color: var(--wp--preset--color--contrast); }

.page-hero { border-bottom: 1px solid var(--wp--preset--color--border); position: relative; overflow: hidden; }
.page-hero::after {
  content: "";
  position: absolute;
  right: -10%; top: -60%;
  width: 50vw; height: 50vw;
  max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(28, 78, 156, 0.10) 0%, rgba(28, 78, 156, 0) 62%);
  pointer-events: none;
}
.page-hero > * { position: relative; }
.page-hero h1 { color: var(--wp--preset--color--primary); }
.page-hero .hero-lead { max-width: 52ch; }

@media (max-width: 781px) {
  .hero { min-height: 0; }
  .hero::before { background: rgba(255,255,255,0.92); }
}

/* Availability indicator */
.avail {
  display: inline-flex !important;
  align-items: center;
  gap: 0.6rem !important;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  box-shadow: var(--ph-shadow-sm);
  font-size: 0.875rem;
  font-weight: 500;
}
.avail .avail-text { margin: 0; }
.avail-dot {
  position: relative;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--wp--preset--color--muted);
  flex: 0 0 10px;
}
.avail-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
}
.avail.is-open .avail-dot { background: var(--ph-green); color: var(--ph-green); }
.avail.is-open .avail-dot::after { animation: phPulse 2s ease-out infinite; }
.avail.is-urgent .avail-dot { background: var(--ph-amber); color: var(--ph-amber); }
.avail.is-urgent .avail-dot::after { animation: phPulse 2s ease-out infinite; }
.avail.is-closed .avail-dot { background: #9aa5b3; }
@keyframes phPulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Chips */
.chips { gap: 0.5rem !important; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--wp--preset--color--surface-blue);
  color: var(--wp--preset--color--primary-dark);
  font-size: 0.8125rem;
  font-weight: 500;
}
.chip::before {
  content: "";
  width: 0.9em; height: 0.9em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* === Cards =============================================================== */

.card {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius);
  box-shadow: var(--ph-shadow-sm);
  height: 100%;
  overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card h3 { margin-bottom: 0.5rem; }
.card .card-img { margin: 0; overflow: hidden; }
.card .card-img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ph-ease);
}
.card:hover .card-img img { transform: scale(1.05); }
.card-list { margin: 0; padding-left: 1.1rem; color: var(--wp--preset--color--muted); font-size: 0.9375rem; }
.card-list li + li { margin-top: 0.3rem; }

.hover-lift { transition: transform 0.3s var(--ph-ease), box-shadow 0.3s var(--ph-ease), border-color 0.3s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--ph-shadow-md); border-color: rgba(28, 78, 156, 0.25); }

.equal-cards > .wp-block-column { display: flex; flex-direction: column; flex-grow: 0; }
.equal-cards > .wp-block-column > .wp-block-group { display: flex; flex-direction: column; flex-grow: 1; }
.equal-cards .cta-bottom { margin-top: auto; }

.card-plain {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius);
  padding: 1.5rem;
  height: 100%;
  transition: transform 0.3s var(--ph-ease), box-shadow 0.3s var(--ph-ease), border-color 0.3s ease;
}
.card-plain:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow-md); border-color: rgba(28, 78, 156, 0.25); }
.card-plain h3, .card-plain h4 { margin-bottom: 0.4rem; }
.card-plain p:last-child { margin-bottom: 0; }

/* Icon headings: <h3 class="has-icon icon-clock"> */
.has-icon::before {
  content: "";
  display: block;
  width: 52px; height: 52px;
  border-radius: 14px;
  margin-bottom: 1rem;
  background-color: var(--wp--preset--color--surface-blue);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px;
  transition: transform 0.3s var(--ph-ease), background-color 0.3s ease;
}
:is(.card-plain, .feature-item, .promise):hover .has-icon::before { transform: translateY(-2px) rotate(-4deg); }
.icon-tag::before      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E"); }
.icon-clock::before    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.icon-layers::before   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); }
.icon-phone::before    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
.icon-chat::before     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E"); }
.icon-calendar::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.icon-book::before     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.icon-tool::before     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.icon-check::before    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.icon-file::before     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E"); }
.icon-zap::before      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.is-highlight .has-icon::before { background-color: rgba(255,255,255,0.14); filter: brightness(0) invert(1); }
.is-highlight .has-icon::before { background-color: rgba(255,255,255,0.14); }

/* Promise cards (etusivu) */
.promise {
  padding: 1.75rem;
  border-radius: var(--ph-radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(214, 222, 231, 0.9);
  height: 100%;
  transition: transform 0.3s var(--ph-ease), box-shadow 0.3s var(--ph-ease), background 0.3s ease;
}
.promise:hover { transform: translateY(-4px); box-shadow: var(--ph-shadow-md); background: #fff; }
.promise h3 { margin-bottom: 0.4rem; }
.promise p:last-child { margin-bottom: 0; color: var(--wp--preset--color--muted); }

/* Numbered badge (steps / lists) */
.num-badge {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wp--preset--color--primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.num-badge::before {
  content: "";
  display: inline-block;
  width: 2rem; height: 2px;
  background: var(--wp--preset--color--primary);
  vertical-align: middle;
  margin-right: 0.6rem;
}

/* Step process (Kartoitus → Ehdotus → Päätös) with drawing line */
.step {
  position: relative;
  padding-top: 1.25rem;
  height: 100%;
}
.step::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 3px; width: 100%;
  background: var(--wp--preset--color--border);
  border-radius: 2px;
}
.step::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 3px; width: 100%;
  background: var(--wp--preset--color--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ph-ease);
}
.steps.is-visible .wp-block-column:nth-child(1) .step::after { transform: scaleX(1); transition-delay: 0.1s; }
.steps.is-visible .wp-block-column:nth-child(2) .step::after { transform: scaleX(1); transition-delay: 0.7s; }
.steps.is-visible .wp-block-column:nth-child(3) .step::after { transform: scaleX(1); transition-delay: 1.3s; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  color: #fff;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 16px rgba(28, 78, 156, 0.25);
}
.step h3 { margin-bottom: 0.4rem; }
.step p:last-child { margin-bottom: 0; }

/* Check list */
.check-list { list-style: none; padding-left: 0; margin: 0; }
.check-list li { position: relative; padding-left: 2.25rem; margin-bottom: 1rem; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.1em;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--wp--preset--color--surface-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}
.check-list strong { display: block; color: var(--wp--preset--color--navy); }

/* Feature grid (huoltosopimus) */
.feature-item {
  padding: 1.5rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius);
  background: var(--wp--preset--color--base);
  height: 100%;
  transition: transform 0.3s var(--ph-ease), box-shadow 0.3s var(--ph-ease), border-color 0.3s ease;
}
.feature-item:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow-md); border-color: rgba(28, 78, 156, 0.25); }
.feature-item h3 { font-size: 1.0625rem; margin-bottom: 0.4rem; }
.feature-item p { margin-bottom: 0; color: var(--wp--preset--color--muted); font-size: 0.9375rem; }
.feature-item.is-highlight {
  background: linear-gradient(135deg, var(--wp--preset--color--primary) 0%, var(--wp--preset--color--primary-dark) 100%);
  border-color: var(--wp--preset--color--primary);
  color: #fff;
}
.feature-item.is-highlight h3, .feature-item.is-highlight p { color: #fff; }
@media (max-width: 781px) {
  .feature-grid { grid-template-columns: 1fr !important; }
  .feature-grid > * { grid-column: auto !important; }
}

/* Comparison */
.compare { border-radius: var(--ph-radius); overflow: hidden; box-shadow: var(--ph-shadow-sm); }
.compare .wp-block-column { padding: 2rem; }
.compare .compare-head {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 1.0625rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--wp--preset--color--border);
}
.compare .is-plus { background: linear-gradient(160deg, var(--wp--preset--color--primary) 0%, var(--wp--preset--color--primary-dark) 100%) !important; }
.compare .is-plus .compare-head { border-bottom-color: rgba(255,255,255,0.25); }
.compare ul { list-style: none; padding: 0; margin: 0; }
.compare li { padding: 0.45rem 0 0.45rem 1.75rem; position: relative; font-size: 0.9375rem; }
.compare li::before { position: absolute; left: 0; top: 0.45rem; font-weight: 700; }
.compare .is-minus li::before { content: "–"; color: var(--wp--preset--color--muted); }
.compare .is-plus li::before { content: "+"; color: #fff; }
@media (max-width: 781px) { .compare .wp-block-column { padding: 1.25rem; } }

/* Stats (count-up) */
.stat-number {
  font-family: var(--wp--preset--font-family--heading);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--wp--preset--color--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--wp--preset--color--muted); margin: 0; font-size: 0.9375rem; }
.stats .wp-block-column { padding: 1.5rem 0; border-left: 1px solid var(--wp--preset--color--border); padding-left: 1.5rem; }
.stats .wp-block-column:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 781px) {
  .stats .wp-block-column { border-left: 0; padding-left: 0; padding: 0.75rem 0; }
}

/* Marquee (brands) */
.marquee {
  display: flex !important;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  flex: 0 0 auto;
  margin: 0;
  padding-right: 3rem;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--wp--preset--color--navy);
  letter-spacing: 0.01em;
  animation: phMarquee 55s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes phMarquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.brand-strip {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--wp--preset--color--muted);
  line-height: 2;
}

/* Tabs */
.ph-tabs-nav { gap: 0.5rem !important; margin-bottom: var(--wp--preset--spacing--40); }
.ph-tabs-nav .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--navy);
  border-color: var(--wp--preset--color--border);
  box-shadow: none;
  transform: none;
}
.ph-tabs-nav .wp-block-button__link:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary); background: var(--wp--preset--color--surface-blue); }
.ph-tabs-nav .is-active .wp-block-button__link,
.ph-tabs-nav .is-active .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(28, 78, 156, 0.25);
}
.ph-tab-panel { display: none; }
.ph-tab-panel.is-active { display: block; animation: phTabIn 0.5s var(--ph-ease); }
@keyframes phTabIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ph-tab-panel .tab-img img {
  border-radius: var(--ph-radius);
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  box-shadow: var(--ph-shadow-md);
}
@media (max-width: 781px) { .ph-tab-panel .tab-img img { height: 240px; } }

/* Floating overlay card on an image */
.float-wrap { position: relative; }
.float-card {
  position: absolute;
  left: -2rem; bottom: -1.5rem;
  max-width: 300px;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--ph-shadow-lg);
  animation: phFloat 7s ease-in-out infinite;
}
.float-card p { margin: 0; }
.float-card .float-title { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 0.9375rem; color: var(--wp--preset--color--navy); margin-bottom: 0.15rem; }
.float-card .float-text { font-size: 0.875rem; color: var(--wp--preset--color--muted); }
.float-card .float-title::before {
  content: "";
  display: inline-block;
  width: 1.1em; height: 1.1em;
  margin-right: 0.45em;
  vertical-align: -0.2em;
  border-radius: 50%;
  background: var(--wp--preset--color--surface-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 60% no-repeat;
}
@keyframes phFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 781px) {
  .float-card { position: relative; left: 0; bottom: 0; max-width: none; margin-top: -1.5rem; margin-left: 1rem; margin-right: 1rem; }
}

/* Images */
.img-rounded img { border-radius: var(--ph-radius); display: block; }
.wp-block-media-text.img-rounded .wp-block-media-text__media img { border-radius: var(--ph-radius); }
.wp-block-image img { height: auto; }
.reveal-img img { clip-path: inset(0 0 0 0 round var(--ph-radius)); transform: scale(1); }
.reveal-img { clip-path: inset(6% 6% 6% 6% round var(--ph-radius)); opacity: 0; transition: clip-path 1s var(--ph-ease), opacity 0.8s ease; }
.reveal-img.is-visible { clip-path: inset(0 0 0 0 round var(--ph-radius)); opacity: 1; }
.img-shadow img { box-shadow: var(--ph-shadow-md); }

/* Info panels, hours, notices */
.info-panel { border-left: 3px solid var(--wp--preset--color--primary); padding-left: 1.25rem; }
.info-panel p { margin-bottom: 0.25rem; }
.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  margin-bottom: 0.15rem !important;
}
.info-value { font-weight: 500; margin-bottom: 1rem !important; }

.wp-block-table.hours-table table { border: 0; }
.wp-block-table.hours-table td { border: 0; border-bottom: 1px solid var(--wp--preset--color--border); padding: 0.65rem 0; }
.wp-block-table.hours-table td:last-child { text-align: right; font-weight: 600; font-family: var(--wp--preset--font-family--heading); }
.wp-block-table.hours-table tr:last-child td { border-bottom: 0; }

.notice-box {
  border: 1px solid var(--wp--preset--color--border);
  border-left: 4px solid var(--wp--preset--color--primary);
  border-radius: var(--ph-radius-sm);
  background: var(--wp--preset--color--surface-blue);
  padding: 1.25rem 1.5rem;
}
.notice-box p:last-child { margin-bottom: 0; }

/* FAQ */
.faq .wp-block-details { margin-bottom: 0; border-bottom: 1px solid var(--wp--preset--color--border); transition: background 0.2s ease; }
.faq .wp-block-details summary {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--wp--preset--color--navy);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
  transition: color 0.2s ease;
}
.faq .wp-block-details summary:hover { color: var(--wp--preset--color--primary); }
.faq .wp-block-details summary::-webkit-details-marker { display: none; }
.faq .wp-block-details summary::after {
  content: "";
  position: absolute; right: 0; top: 50%;
  width: 1.75rem; height: 1.75rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--wp--preset--color--surface-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C4E9C' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
  transition: transform 0.3s var(--ph-ease), background-color 0.2s ease;
}
.faq .wp-block-details[open] summary::after { transform: translateY(-50%) rotate(45deg); background-color: var(--wp--preset--color--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E"); }
.faq .faq-body { overflow: hidden; transition: height 0.35s var(--ph-ease); }
.faq .wp-block-details p { margin-top: 0.75rem; color: var(--wp--preset--color--muted); }

/* Section titles */
.section-title { max-width: 24ch; }
.section-lead { color: var(--wp--preset--color--muted); max-width: 60ch; font-size: 1.0625rem; }
.lang-row { color: var(--wp--preset--color--muted); font-size: 0.9375rem; }

/* Subtle dot texture for surface sections */
.has-dots {
  background-image: radial-gradient(rgba(28, 78, 156, 0.10) 1px, transparent 1px);
  background-size: 22px 22px;
}

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

.site-footer { font-size: 0.9375rem; position: relative; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .footer-heading {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.75rem;
}
.site-footer .wp-block-navigation .wp-block-navigation-item__content { color: #fff; }
.site-footer .wp-block-navigation { font-family: var(--wp--preset--font-family--body); font-weight: 400; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.8125rem; color: rgba(255,255,255,0.65); }
.footer-brand { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.125rem; }
.footer-muted { color: rgba(255,255,255,0.7); }

/* === Contact Form 7 ====================================================== */

.wpcf7 { font-size: 0.9375rem; }
.wpcf7 form { display: grid; gap: 1rem; }
.wpcf7 .form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .wpcf7 .form-row { grid-template-columns: 1fr; } }
.wpcf7 label { display: block; font-weight: 500; color: var(--wp--preset--color--navy); }
.wpcf7 .hint { display: block; font-weight: 400; color: var(--wp--preset--color--muted); font-size: 0.8125rem; margin-top: 0.15rem; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius-sm);
  background: #fff;
  font: inherit;
  color: var(--wp--preset--color--contrast);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wpcf7 input:focus, .wpcf7 textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 4px rgba(28, 78, 156, 0.14);
}
.wpcf7 textarea { min-height: 120px; resize: vertical; }
.wpcf7 .wpcf7-radio { display: grid; gap: 0.4rem; margin-top: 0.5rem; }
.wpcf7 .wpcf7-radio .wpcf7-list-item { margin: 0; display: block; }
.wpcf7 .wpcf7-radio label {
  font-weight: 400;
  display: flex; gap: 0.6rem; align-items: flex-start;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wpcf7 .wpcf7-radio label:hover { border-color: var(--wp--preset--color--primary); background: var(--wp--preset--color--surface-blue); }
.wpcf7 .wpcf7-radio label:has(input:checked) { border-color: var(--wp--preset--color--primary); background: var(--wp--preset--color--surface-blue); }
.wpcf7 .wpcf7-radio input { margin-top: 0.3rem; accent-color: var(--wp--preset--color--primary); }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.875rem; color: var(--wp--preset--color--muted); cursor: pointer; }
.wpcf7 .wpcf7-acceptance input { margin-top: 0.25rem; accent-color: var(--wp--preset--color--primary); }
.wpcf7 .wpcf7-submit {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 0.9375rem;
  background: var(--wp--preset--color--primary);
  color: #fff;
  border: 2px solid var(--wp--preset--color--primary);
  border-radius: 999px;
  padding: 0.85rem 1.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.2s var(--ph-ease), box-shadow 0.2s var(--ph-ease);
  justify-self: start;
}
.wpcf7 .wpcf7-submit:hover { background: var(--wp--preset--color--primary-dark); border-color: var(--wp--preset--color--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(28, 78, 156, 0.22); }
.wpcf7 .wpcf7-spinner { margin-left: 0.5rem; }
.wpcf7 .wpcf7-not-valid-tip { color: #b42318; font-size: 0.8125rem; margin-top: 0.25rem; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 0.85rem 1rem; border-radius: var(--ph-radius-sm); border: 1px solid var(--wp--preset--color--border); }
.wpcf7 form.sent .wpcf7-response-output { border-color: #1f8a4c; background: #edf8f1; }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: #b42318; background: #fdf1f0; }
.wpcf7 .form-note { color: var(--wp--preset--color--muted); font-size: 0.875rem; margin: 0; }

.form-panel {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--ph-radius);
  box-shadow: var(--ph-shadow-md);
  padding: 2rem;
}
@media (max-width: 600px) { .form-panel { padding: 1.25rem; } }

/* Media-text on mobile */
@media (max-width: 600px) {
  .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { padding: 1.5rem 0 0; }
}

/* === Motion ============================================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ph-ease), transform 0.7s var(--ph-ease);
}
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: phFadeUp 0.8s var(--ph-ease) forwards;
}
.fade-up-delay-1 { animation-delay: 0.12s; }
.fade-up-delay-2 { animation-delay: 0.24s; }
.fade-up-delay-3 { animation-delay: 0.36s; }
.fade-up-delay-4 { animation-delay: 0.48s; }
@keyframes phFadeUp { to { opacity: 1; transform: translateY(0); } }

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ph-ease), transform 0.6s var(--ph-ease);
}
.stagger-children.is-visible > * { opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.45s; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.55s; }
.stagger-children.is-visible > *:nth-child(7) { transition-delay: 0.65s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll, .fade-up, .stagger-children > *, .reveal-img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .marquee-track { animation: none; }
  .step::after { transform: scaleX(1) !important; }
}

/* === Editor: keep everything visible while editing ======================= */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .animate-on-scroll,
.editor-styles-wrapper .stagger-children > *,
.editor-styles-wrapper .reveal-img {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  animation: none !important;
  transition: none !important;
}
.editor-styles-wrapper .ph-tab-panel { display: block; }
.editor-styles-wrapper .ph-tab-panel + .ph-tab-panel { margin-top: 2rem; border-top: 1px dashed var(--wp--preset--color--border); padding-top: 2rem; }
.editor-styles-wrapper .marquee { -webkit-mask-image: none; mask-image: none; }
.editor-styles-wrapper .marquee-track { animation: none; white-space: normal; }
.editor-styles-wrapper .float-card { animation: none; }
.editor-styles-wrapper .wp-site-blocks > header { position: static; }
.editor-styles-wrapper .step::after { transform: scaleX(1); }
