/* Base */
:root {
  --color-primary: #FE6410;
  --color-dark: #041825;
  --color-text: #111111;
  --color-muted: #111111;
  --color-bg-light: #f6f6f6;
  --page-gutter: clamp(24px, 5vw, 84px);
  --fixed-header-h: 32px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: #ffffff;
  font-size:18px;
}

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

.container {
  width: min(1120px, 90%);
  margin: 0 auto;
}

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

h2{
  line-height:1.2;
}

body:not(.home) h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

body:not(.home) h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

body:not(.home) h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

body:not(.home) h4 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

body:not(.home) h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

body:not(.home) h6 {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

body:not(.home) .site-main {
  padding-top:80px;
  min-height: calc(100vh - 78px);
}

body:not(.home) .site-header {
  background-color:#052132;
}

body:not(.home) .section{
  min-height:unset;
}

/* Header */

.site-header {
  background: rgba(4, 24, 37, 0.9);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 34px 0;
}

.site-logo {
  font-weight: 700;
  text-decoration: none;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  display: block;
  max-height: 50px;
  width: auto;
  height: auto;
}

.main-nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.main-nav .menu a {
  position: relative;
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  padding: 4px 0;
}

.main-nav a:hover {
  color: var(--color-primary);
}

/* Hero */

.hero {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent),
    linear-gradient(180deg, rgba(4,24,37,0.75), rgba(4,24,37,0.08)),
    var(--hero-bg-image, none),
    #041825;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  padding: 140px 0 120px;
  padding-top: 180px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content:center;
}

.hero > .wp-block-group__inner-container {
  width: min(1120px, 90%);
  margin-left: auto;
  margin-right: auto;
}

.hero .eyebrow{
  color: var(--color-primary);
}

.hero .hero-inner {
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

.hero .wp-block-group.hero-inner {
  margin-left: 0 !important;
  margin-right: auto !important;
}

h1.hero-title {
  font-family: "Arimo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2.1rem, 3vw + 1.5rem, 2.8rem);
  line-height: 1.2;
  font-weight:400 !important;
  margin: 0 0 18px;
  text-wrap:balance;
  max-width: 820px;
}

.hero-text {
  font-size: 21px;
  max-width: 620px;
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
}

.btn-ghost:hover {
  border-color: #ffffff;
}

/* Sections */

.section {
  padding: 80px 0;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content:center;
}

.section-light {
  background: var(--color-bg-light);
}

.wp-block-group.container {
  width: min(1120px, 90%);
  margin-left: auto;
  margin-right: auto;
}

.wp-block-group.section-inner {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-inner h2 {
  font-size: 36px;
  margin-top: 0;
  margin-bottom: 18px;
  text-wrap:balance;
}

.section-inner p {
  margin-bottom: 14px;
  color: var(--color-muted);
  line-height: 1.5;
}

.section-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

a.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #000;
  font-weight: 500;
  position: relative;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.btn-link:hover {
  color:#FE6410;
}

.btn-link::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("../img/arrow-right-black.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
    transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.btn-link:hover::after {

  background-image: url("../img/arrow-right-orange.svg");
}

.hero .btn-link{
  color:#fff;
}

.hero .btn-link::after {
  background-image: url("../img/arrow-right-white.svg");
}

.btn-link:hover::after {
  transform: translateX(0);
}

ul.wp-block-list li {
  list-style-type: square;
}

ul.wp-block-list li::marker {
  color: var(--color-primary);
}

/* Two-column layout */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 48px;
  align-items: flex-start;
}

/* Image grid */

.image-grid .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-grid .grid-item {
  background: #cccccc;
  height: 140px;
}

.image-grid .grid-item.tall {
  height: 300px;
}

.image-grid .grid-item.wide {
  height: 200px;
}

p.eyebrow {
  letter-spacing: 1.5px;
  font-size: 14px;
  color: var(--color-primary);
  margin: 0 0 12px;
  text-transform:uppercase;
}

/* Team */

.team-row{
	background-color:#fff;
	padding:60px 40px;
}

.team-row h3{
	margin-bottom:-14px;
}

/* Contact */

.contact-section .contact-details p {
  margin: 0 0 8px;
}

.contact-section a {
  color: var(--color-primary);
  text-decoration: none;
}

.contact-section a:hover {
  text-decoration: underline;
}

.site-footer {
  background: #052132;
  color: #ffffff;
  padding: 20px 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-inner a{
	color:#fff;
	margin:0 10px;
}

.site-footer .footer-inner span{
	display:flex;
	
}

.site-footer .footer-inner span p{
	padding:0;
	margin:0;
}

.footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

html[lang="fi"]{
	.footer-en{
		display:none;
	}
}


html[lang="en-US"]{
	.footer-fi{
		display:none;
	}
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .main-nav a {
    margin-left: 0;
    margin-right: 16px;
  }

  .hero {
    padding: 110px 0 80px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

html {
  scroll-behavior: smooth;
}

.hero,
.section {
  scroll-margin-top: 80px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  color: #ffffff;
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(4, 24, 37, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.main-nav a {
  margin-left: 24px;
  text-decoration: none;
  color: #ffffff;
  font-size: 0.95rem;
  position: relative;
}

.main-nav a.is-active {
  color: var(--color-primary);
}

.index-post {
  padding: 24px 0;
  border-bottom: 1px solid #e2e2e2;
}

.index-post-title {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.index-post-title a {
  color: var(--color-dark);
  text-decoration: none;
}

.index-post-title a:hover {
  color: var(--color-primary);
}

.index-post-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.index-post-excerpt {
  margin-bottom: 8px;
}

.pagination {
  margin-top: 32px;
}

.wp-block-button.btn .wp-block-button__link {
  background: transparent;
  padding: 0;
  border: 0;
  color: inherit;
  text-decoration: none;
}

.wp-block-buttons .wp-block-button .wp-element-button.btn {
  display: inline-flex;
}

body.admin-bar .site-header {
  top: 32px; 
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

body.admin-bar .hero,
body.admin-bar .section {
  scroll-margin-top: 112px; 
}

@media (max-width: 782px) {
  body.admin-bar .hero,
  body.admin-bar .section {
    scroll-margin-top: 126px;
  }
}

.site-header .header-inner {
  padding: 18px 0;              
  transition: padding 0.25s ease;
}

.site-logo img {
  max-height: 58px;             
  transition: max-height 0.25s ease;
}

.main-nav .menu a {
  font-size: 0.98rem;
  transition: font-size 0.25s ease;
}

.site-header.is-scrolled .header-inner {
  padding: 9px 0;             
}

.site-header.is-scrolled .site-logo img {
  max-height: 34px;         
}

.site-header.is-scrolled .main-nav .menu a {
  font-size: 0.92rem;
}

.two-column{
  display: grid;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.section{
  position: relative;
  overflow: visible;
}

@media (min-width: 1000px){

  .section--has-mosaic.section--mosaic-left{
    padding-right: 0;
    padding-left: min(560px, 46vw);
  }

  .section__mosaic{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top:var(--fixed-header-h);
    width: min(520px, 44vw);
    padding: 0 clamp(16px, 2vw, 32px);
  }

  .section--mosaic-right .section__mosaic{ right: 0; }
  .section--mosaic-left  .section__mosaic{ left: 0; }
}

@media (max-width: 999px){
  .section--has-mosaic{
    padding-left: 0;
    padding-right: 0;
  }

  .section__mosaic{
    position: static;
    transform: none;
    width: min(520px, calc(100% - 48px));
    margin: 24px auto 0;
    padding: 0;
  }
}

@media (min-width: 1000px){

  .section.section--has-mosaic{ overflow:hidden; }

  .section__mosaic{
    height: auto;              
    max-height: none;
  }

  .section__mosaic .ps-mosaic{
    aspect-ratio: 2 / 3;            
    height: auto;
  }

  .ps-mosaic__grid{
    height: 100%;
  }
}

/* Mobile: show single image instead of tiles (single mode) */
@media (max-width: 999px){
  .ps-mosaic[data-mode="single"] .ps-mosaic__grid{
    display: none;
  }

  .ps-mosaic[data-mode="single"]{
    border-radius: 0;           
    overflow: hidden;
    aspect-ratio: 1 / 1;         
    background-image: var(--ps-mosaic-image);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;  
  }
}

@media (min-width: 1000px){
  .section--has-mosaic .section-inner{
    margin-left: auto;
    margin-right: auto;
  }

  .section--has-mosaic.section--mosaic-left .section-inner{
    margin-left: auto;
    margin-right: 0;
  }

  .section--has-mosaic.section--mosaic-right .section-inner{
    margin-left: 0;
    margin-right: auto;
  }
}

@media (max-width: 999px){
  .section{
    display: block;
    padding: 42px 0;
    min-height: auto;
  }

  .section-inner{
    max-width: none;
    padding: 42px 0;
  }

  .wp-block-group.section-inner {
    max-width:80vw;
  }

  .section-links{
    margin-top: 18px;
  }
}

/* Toggle placement */
.nav-toggle{
  display:none;
  width:44px;
  height:44px;
  border:0;
  background:transparent;
  cursor:pointer;
  padding:10px;
  position: relative;
  z-index: 120; /* above the menu */
}

/* Bars */
.nav-toggle__bar{
  display:block;
  height:2px;
  background:#fff;
  border-radius:2px;
  margin:6px 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

/* ========== Mobile menu (overlay) ========== */

/* Toggle button (hamburger / X) */
.nav-toggle{
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 10000; /* always above overlay */
}

.nav-toggle__bar{
  display: block;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  margin: 6px 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

/* Desktop nav stays as-is */
@media (min-width: 901px){
  .nav-toggle{ display: none; }
}

/* Mobile overlay nav */
@media (max-width: 900px){

  /* Place toggle top-right in header */
  .nav-toggle{
    display: block;
    position: absolute;
    top: 12px;
    right: 12px;
  }

  /* Make sure header can host the overlay without clipping */
  .site-header{
    overflow: visible;
  }

  /* Fullscreen menu panel */
  .main-nav .menu{
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;

    display: flex;
    flex-direction: column;
    gap: 0;

    padding: 160px 0 24px; /* room for logo + toggle */
    background: rgba(4, 24, 37, 0.98);
    backdrop-filter: blur(10px);

    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
  }

  /* Menu items */
  .main-nav .menu a{
    display: block;
    padding: 16px 24px;
    font-size: 1.15rem;
    color: #ffffff;
    text-decoration: none;
  }

  .main-nav .menu a:hover{
    color: var(--color-primary);
  }

  /* Open state */
  .site-header.nav-open .main-nav .menu{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Hamburger -> X */
  .site-header.nav-open .nav-toggle__bar:nth-child(1){
    transform: translateY(8px) rotate(45deg);
  }
  .site-header.nav-open .nav-toggle__bar:nth-child(2){
    opacity: 0;
  }
  .site-header.nav-open .nav-toggle__bar:nth-child(3){
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* Lock page scroll when menu is open */
body.nav-open{
  overflow: hidden;
}

@media (max-width: 900px){
  /* Mobile menu links: always large, ignore scroll state */
  .main-nav .menu a{
    font-size: 1.25rem;
    line-height: 1.4;
    padding: 18px 24px;
    text-align:center;
  }

  /* Override scrolled header shrink */
  .site-header.is-scrolled .main-nav .menu a{
    font-size: 1.25rem;
  }
}

@media (min-width: 1000px){

  .section--has-mosaic{
	  overflow: clip;}
  .section__mosaic{
    height: min(80vh, 820px);
    max-height: 80vh;
    aspect-ratio: 2 / 3;

    width: auto;
    max-width: min(520px, 44vw);

    top: 50%;
    transform: translateY(-50%);
  }

  .section__mosaic .ps-mosaic,
  .section__mosaic .ps-mosaic__grid{
    height: 100%;
  }

  .ps-mosaic__tile{
    aspect-ratio: 1 / 1;
  }
}

/* CUSTOMIZER */

.section--mosaic-left .section-inner{
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
}

.footer-inner .footer-right a {
	margin:0;
	text-transform:uppercase;
	color:#E5B80B;
	text-decoration:none;
}

.footer-inner .footer-right{
	text-transform:uppercase;
	font-family: "Arimo", serif;
	letter-spacing:1px;
	font-size:12px;
}

@media (max-width: 768px) {
  .site-footer .footer-inner{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }
	
  .site-footer .footer-inner span {
    justify-content: center;
		display:block;
  }
  .site-footer .footer-inner .footer-right {
    justify-content: center;
  }
}

.wp-block-list li{
	margin:6px 0;
}

#ota-yhteytta a:last-of-type, #contact-us a:last-of-type{
	margin-top:20px;
}

.hero .btn-link:hover{
	color: var(--color-primary);
}

.hero .btn-link:hover::after {
    background-image: url(../img/arrow-right-orange.svg);
}

@media (max-width: 999px){
	.section--mosaic-left .section-inner{
		grid-template-columns: 1fr !important;
	}
	
	.team-row{
		margin:10px;
		padding:20px;
		gap:0;
	}
	h1, h2, h3{
		hyphens:auto;
	}
	
	.section-inner h2{
		font-size:28px;
	}
	
	.section-inner p {
		font-size:17px;
	}
	
	p.eyebrow {
		font-size:15px;
	}
	
	.section--has-mosaic{
		padding:20px 0 0 0;
	}
	
	.section__mosaic{
		width:unset;
	}
	
	.wp-block-group.section-inner{
		max-width:100vw;
	}
	
	.two-column__content > .wp-block-group__inner-container{
		padding:2rem;
	}
	
	.section-inner{
		padding:0;
	}
	
	.wp-block-spacer{
		height:10px !important;
	}
	
	.site-header.is-scrolled .nav-toggle {
		top:4px;
	}
	
	.header-inner{
		gap:0;
	}
	
}
