/**
 * Mobile + tablet polish. Loaded last so it can override HTML/WP/Finovate CSS.
 */

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

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe {
  max-width: 100%;
}

h1,
h2,
h3,
.footer-callout h2,
.spot-fin-services__title,
.approach-heading h2 {
  overflow-wrap: anywhere;
}

/* iOS renders ↗ as a color emoji — draw a real arrow instead. */
.spot-arrow {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  flex: 0 0 auto;
  font-size: 0;
  line-height: 0;
  color: inherit;
  background: currentColor;
  -webkit-mask: var(--spot-arrow-mask) no-repeat center / contain;
  mask: var(--spot-arrow-mask) no-repeat center / contain;
  vertical-align: -0.05em;
}

.round-arrow,
.spot-fin-arrow,
.story-arrow,
.footer-cta > span {
  font-size: 0 !important;
  line-height: 0;
}

.round-arrow::before,
.spot-fin-arrow::before,
.story-arrow::before,
.footer-cta > span::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--spot-arrow-mask) no-repeat center / contain;
  mask: var(--spot-arrow-mask) no-repeat center / contain;
}

.footer-cta > span::before {
  width: 13px;
  height: 13px;
}

.spot-fin-arrow {
  color: var(--spot-fin-ink);
}

.spot-fin-svc-card:hover .spot-fin-arrow {
  color: #fff;
}

.page-hero[data-ghost="↗"]::after,
.spot-page-hero[data-ghost="↗"]::after {
  content: "" !important;
  width: min(28vw, 180px);
  height: min(28vw, 180px);
  background: var(--spot-ghost-color, currentColor);
  opacity: 0.12;
  -webkit-mask: var(--spot-arrow-mask) no-repeat center / contain;
  mask: var(--spot-arrow-mask) no-repeat center / contain;
}

/* Center the floating header without transform so the mobile drawer
   is not trapped in a containing block. */
.site-header {
  left: 0;
  right: 0;
  width: min(1380px, calc(100% - 28px));
  margin-inline: auto;
  transform: none;
  top: max(14px, env(safe-area-inset-top));
}

.site-header.scrolled {
  top: max(7px, env(safe-area-inset-top));
}

body.admin-bar .site-header {
  top: max(14px, calc(32px + env(safe-area-inset-top)));
}

.menu-btn {
  position: relative;
  z-index: 3;
  cursor: pointer;
  flex: 0 0 44px;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn span {
  transform-origin: center;
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.brand {
  min-width: 0;
  max-width: calc(100% - 56px);
}

.brand-logo {
  max-width: 100%;
  object-fit: contain;
}

.nav {
  min-width: 0;
}

body.menu-open,
html.menu-open {
  overflow: hidden;
}

.nav-links .nav-cta {
  margin-left: 4px;
  color: #fff;
}

/* ——— Tablet (incl. iPad portrait + landscape) ——— */
@media (max-width: 1100px) {
  .container {
    width: min(var(--max), calc(100% - 40px));
  }

  .section {
    padding: 84px 0;
  }

  h1 {
    font-size: clamp(42px, 6.4vw, 88px);
  }

  h2 {
    font-size: clamp(30px, 4.6vw, 56px);
  }

  .hero {
    min-height: 0;
    padding: 148px 0 48px;
  }

  .page-hero {
    min-height: 0;
    padding: 160px 0 64px;
  }

  .spot-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spot-featured-media .featured-mask {
    width: 190px;
    height: 190px;
  }

  .spot-fin-services {
    padding: 18px 8px 8px;
  }

  .spot-fin-services__panel {
    padding: 40px 28px 28px;
    border-radius: 32px;
  }

  .spot-fin-why__card {
    width: min(560px, calc(100% - 40px));
    margin: 32px 20px;
  }

  .spot-product-modal {
    padding: 18px;
  }

  .footer-callout h2 {
    font-size: clamp(28px, 4.6vw, 44px);
  }

  .footer-callout .footer-cta,
  .footer-cta {
    white-space: normal;
  }

  .single-post h1 {
    font-size: clamp(32px, 6vw, 52px);
  }

  .single-post h2 {
    font-size: clamp(24px, 4vw, 36px);
  }
}

@media (max-width: 1050px) {
  .nav {
    position: relative;
    z-index: 2;
    gap: 12px;
  }

  .brand,
  .menu-btn {
    position: relative;
    z-index: 3;
  }

  .menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    width: auto;
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding: max(120px, calc(env(safe-area-inset-top) + 108px)) 28px
      max(32px, env(safe-area-inset-bottom));
    background: rgba(245, 244, 239, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(110%, 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.28s ease,
      visibility 0.28s ease;
    z-index: 1;
  }

  .nav-links.open {
    display: flex;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links .menu,
  .nav-links ul,
  .nav-links.open .menu,
  .nav-links.open ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav-links li,
  .nav-links.open li {
    display: block;
    width: 100%;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 0;
    font: 800 clamp(26px, 6vw, 36px) / 1.12 Manrope, sans-serif;
    letter-spacing: -0.04em;
    color: var(--ink);
  }

  .nav-links .current-menu-item > a,
  .nav-links .current_page_item > a,
  .nav-links a.active,
  .nav-links a:hover {
    color: var(--green);
  }

  .nav-links a:after,
  .nav-links .current-menu-item > a:after,
  .nav-links .current_page_item > a:after,
  .nav-links a.active:after {
    content: none;
    display: none;
  }

  .nav-links .nav-cta,
  .nav-links.open .nav-cta {
    display: inline-flex;
    align-self: flex-start;
    width: auto;
    min-height: 48px;
    margin: 22px 0 0;
    padding: 14px 22px;
    font-size: 14px;
    font-family: "DM Sans", sans-serif;
    letter-spacing: 0;
    font-weight: 800;
  }

  body.menu-open .menu-btn span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  body.menu-open .menu-btn span:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
  }

  .hero-grid,
  .split,
  .contact-grid,
  .machine-grid {
    grid-template-columns: 1fr;
  }

  .split .lead,
  .approach-heading > p {
    justify-self: start;
  }

  .showcase-grid,
  .reference-card-grid,
  .story-grid,
  .approach-grid,
  .blog-grid,
  .spot-product-grid,
  .spot-process-grid,
  .spot-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spot-team-single {
    grid-template-columns: 1fr;
  }
}

/* iPad portrait and large phones: keep two columns, tighten cards */
@media (max-width: 900px) {
  .nav {
    height: 72px;
    padding: 0 14px;
  }

  .brand-logo {
    width: 50px!important;
    height: 50px!important;
  }

  .hero-media {
    height: 380px;
    margin-top: 28px;
    border-radius: 26px;
  }

  .showcase-card,
  .story-card {
    height: auto;
    min-height: 420px;
  }

  .reference-card {
    height: 340px;
  }

  .spot-fin-services__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spot-fin-svc-card {
    min-height: 260px;
  }

  .spot-fin-why {
    --why-pin-top: 92px;
    padding: 16px 8px 24px;
  }

  .page-hero:after {
    width: 130px;
    bottom: -18px;
  }
}

/* ——— Phones ——— */
@media (max-width: 700px) {
  .container {
    width: min(100% - 32px, var(--max));
  }

  .section {
    padding: 56px 0;
  }

  h1 {
    font-size: clamp(34px, 11vw, 46px);
    letter-spacing: -0.04em;
  }

  h2 {
    font-size: clamp(26px, 8vw, 36px);
  }

  h3 {
    font-size: clamp(18px, 5.4vw, 24px);
  }

  .lead {
    font-size: 16px;
    line-height: 1.55;
  }

  .nav {
    height: 64px;
    padding: 0 10px 0 14px;
    gap: 8px;
  }

  .brand-logo {
    width: 44px!important;
    height: 44px!important;
  }
  .footer-premium .footer-brand .brand-logo {
      width: 90px!important;
      height: 90px!important;
  }
  .hero {
    min-height: 0;
    padding: 118px 0 32px;
  }

  .hero:before {
    width: 280px;
    height: 280px;
    right: -110px;
    top: -120px;
    box-shadow: 0 0 0 50px rgba(16, 170, 82, 0.035);
  }

  .hero-grid {
    gap: 22px;
  }

  .hero-side p {
    font-size: 16px;
  }

  .hero-media {
    height: 240px;
    margin-top: 20px;
    border-radius: 22px;
  }

  .hero-seal {
    width: 84px;
    height: 84px;
    right: 12px;
    top: 12px;
    font-size: 9px;
  }

  .page-hero {
    min-height: 0;
    padding: 126px 0 44px;
  }

  .page-hero:after {
    width: 92px;
    opacity: 0.22;
  }

  .story-grid,
  .approach-grid,
  .value-grid,
  .blog-grid,
  .showcase-grid,
  .reference-card-grid,
  .spot-featured-grid,
  .spot-product-grid,
  .spot-process-grid,
  .spot-team-grid,
  .product-grid,
  .footer-grid,
  .footer-premium .footer-grid {
    grid-template-columns: 1fr;
  }

  .story-card,
  .approach-card,
  .story-card:last-child,
  .approach-card:last-child,
  .showcase-card,
  .showcase-card:last-child,
  .reference-card,
  .reference-card:last-child,
  .product-card,
  .product-card.wide,
  .spot-product-card.is-wide {
    grid-column: auto;
  }

  .story-card,
  .showcase-card {
    min-height: 0;
    height: auto;
  }

  .showcase-card {
    padding: 20px;
  }

  .showcase-photo,
  .showcase-cutout {
    height: 220px;
  }

  .showcase-lime .showcase-cutout--organic {
    height: 240px;
  }

  .showcase-lime .showcase-cutout--organic img {
    margin: 0;
  }

  .showcase-bottom {
    padding: 0 58px 18px 8px;
  }

  .reference-card {
    height: auto;
    min-height: 280px;
    overflow: hidden;
  }

  .reference-card:after {
    display: none;
  }

  .reference-card .reference-card-content {
    margin-bottom: 56px;
  }

  .spot-approach {
    padding: 56px 0 72px;
  }

  .approach-heading {
    margin-bottom: 28px;
    gap: 16px;
  }

  .approach-heading h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .image-marquee {
    grid-template-columns: 1fr;
  }

  .image-marquee figure {
    height: 220px;
  }

  .product-card.tall .product-image,
  .product-image {
    height: 220px;
  }

  .process-step {
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 22px 0;
  }

  .process-step p {
    grid-column: 2;
  }

  .machine-feature {
    height: 280px;
  }

  .machine-stack figure {
    height: 180px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 22px 12px;
  }

  .stat strong {
    font-size: clamp(28px, 8vw, 40px);
  }

  .form {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .field.full {
    grid-column: auto;
  }

  .cta {
    padding: 56px 16px;
  }

  .value-card h3 {
    margin: 36px 0 14px;
  }

  .spot-featured-media {
    aspect-ratio: 16 / 10;
  }

  .spot-featured-media .featured-mask {
    width: 120px;
    height: 120px;
  }

  .spot-featured-copy {
    padding: 18px 18px 22px;
  }

  .spot-fin-services {
    padding: 8px 0 4px;
  }

  .spot-fin-services__panel {
    padding: 26px 16px 16px;
    border-radius: 24px;
  }

  .spot-fin-services__grid,
  .spot-fin-svc-card {
    grid-template-columns: 1fr;
  }

  .spot-fin-svc-card {
    min-height: 0;
  }

  .spot-fin-svc-card__media {
    min-height: 160px;
  }

  .spot-fin-why {
    padding: 8px 0 20px;
  }

  .spot-fin-why__stage {
    min-height: 0;
  }

  .spot-fin-why__bg {
    border-radius: 24px;
  }

  .spot-fin-why__card {
    position: relative;
    top: auto;
    width: auto;
    margin: 16px 12px 20px;
    padding: 20px 16px;
  }

  .spot-fin-why__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .spot-fin-pill {
    white-space: normal;
    text-align: center;
  }

  .footer-callout {
    padding: 48px 0 36px;
    gap: 22px;
  }

  .footer-callout .footer-cta {
    width: 100%;
    justify-content: center;
  }

  .footer-premium:before {
    font-size: 28vw;
    right: -6vw;
    bottom: -6vw;
  }

  .footer-premium .footer-bottom {
    gap: 12px;
    padding-bottom: 8px;
  }

  .spot-product-modal {
    padding: 0;
    align-items: end;
  }

  .spot-product-modal__dialog {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 24px 24px 0 0;
    padding: 28px 16px calc(16px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .spot-product-modal__dialog .spot-product-modal_content {
    max-height: none;
    overflow: visible;
  }

  .contact-form-modal {
    max-height: none;
    overflow: visible;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .spot-entry {
    padding: 24px 0 64px;
  }

  .spot-entry-title {
    font-size: clamp(28px, 9vw, 40px);
  }

  .article img,
  .spot-team-card img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 24px, var(--max));
  }

  .site-header {
    width: calc(100% - 16px);
    border-radius: 14px;
  }

  .nav-links {
    padding-left: 22px;
    padding-right: 22px;
  }

  .nav-links a {
    font-size: 24px;
    min-height: 48px;
  }

  .stats,
  .spot-fin-services__grid {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .hero-media {
    height: 200px;
  }

  .hero-seal {
    display: none;
  }

  .btn,
  .nav-cta,
  .footer-cta,
  .spot-btn {
    min-height: 44px;
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: max(8px, calc(46px + env(safe-area-inset-top)));
  }
}

/* Widget-specific mobile/tablet (plugin CSS loads earlier). */
@media (max-width: 1100px) {
  .elementor-widget-spot_hero .spot-video-hero h1 {
    font-size: clamp(36px, 5.6vw, 72px);
    line-height: 1;
  }

  .elementor-widget-spot_hero .spot-video-hero__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .elementor-widget-spot_featured_products .spot-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Elementor widget typography is saved as desktop px/rem and otherwise overflows. */
@media (max-width: 1100px) {
  .page-hero h1,
  .spot-page-hero h1,
  .elementor-page .page-hero h1,
  .elementor-page .spot-page-hero h1,
  .elementor-widget-spot_hero .hero h1,
  .elementor-widget-spot_hero .spot-video-hero h1 {
    font-size: clamp(34px, 5.4vw, 58px) !important;
    line-height: 1.05 !important;
    max-width: 100%;
  }

  .page-hero .lead,
  .spot-page-hero .lead,
  .elementor-page .page-hero .lead,
  .elementor-page .spot-page-hero .lead {
    font-size: 17px !important;
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .page-hero h1,
  .spot-page-hero h1,
  .elementor-page .page-hero h1,
  .elementor-page .spot-page-hero h1,
  .elementor-widget-spot_hero .hero h1,
  .elementor-widget-spot_hero .spot-video-hero h1 {
    font-size: clamp(28px, 8.2vw, 36px) !important;
    line-height: 1.06 !important;
  }

  .page-hero .lead,
  .spot-page-hero .lead,
  .elementor-page .page-hero .lead,
  .elementor-page .spot-page-hero .lead,
  .elementor-widget-spot_hero .spot-video-hero__footer p {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }

  .elementor-page .section h2,
  .spot-about-company__copy h2,
  .spot-section-head h2,
  .spot-sustainability__head h2,
  .approach-heading h2 {
    font-size: clamp(26px, 7.5vw, 36px) !important;
  }

  .elementor-widget-spot_hero .spot-video-hero__footer p {
    max-width: 100%;
  }

  .elementor-widget-spot_featured_products .spot-featured-grid,
  .elementor-widget-spot_products_grid .product-grid,
  .elementor-widget-spot_blog_grid .blog-grid {
    grid-template-columns: 1fr;
  }

  .spot-page-hero,
  .page-hero {
    min-height: 0;
    padding: 126px 0 44px;
  }

	.spot-about-company__small {
		right: 8px;
	}

	.spot-about-company__grid {
		grid-template-columns: 1fr !important;
		gap: 28px !important;
	}

	.spot-journey__gallery,
	.spot-journey__gallery.has-3 {
		grid-template-columns: 1fr !important;
		max-height: none !important;
	}
}

/* Mobile: natural image height, no object-fit cover. */
@media (max-width: 768px) {
  img {
    height: 100% !important;
    max-height: none !important;
    object-fit: unset !important;
  }

  .elementor-widget-spot_about_company .spot-about-company__media img,
  .elementor-widget-spot_featured_products .spot-featured-media img,
  .elementor-widget-spot_products_grid .product-image img,
  .elementor-widget-spot_process_journey .spot-journey__media img,
  .elementor-widget-spot_machines .machine-grid img,
  .elementor-widget-spot_blog_grid .article img,
  .elementor-widget-spot_sustainability_pillars .spot-sustainability__pillar img,
  .elementor-widget-spot_certificates .spot-certificate__media img,
  .elementor-widget-spot_marquee .image-marquee img {
    height: 100% !important;
    object-fit: unset !important;
  }

  .spot-sustainability__pillar figure,
  .spot-about-company__main,
  .spot-about-company__small,
  .hero-media,
  .showcase-photo,
  .showcase-cutout,
  .product-image,
  .spot-featured-media,
  .spot-journey__media,
  .spot-certificate__media,
  .article img,
  .spot-product-media {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .spot-sustainability__pillar figure {
    overflow: visible;
  }
}
