/* The frame around the content: white side columns, the yellow band with the
   logo, the bottom bar and the full-screen menu. Content styles: content.css. */

:root { --mist: url("../images/bg-mist.png"); --mist-static: url("../images/bg-mist-static.png"); }

/* Global */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-y: scroll; -webkit-text-size-adjust: 100%; }
body {
  --bar: 52px;      /* bottom bar height */
  --frame: 0px;     /* white side frames */
  --band: 136px;    /* fixed yellow band behind the logo */
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  padding: 0 var(--frame) var(--bar);
}
@media (min-width: 768px) { body { --bar: 80px; --frame: 80px; --band: 192px; } }
body:has(details.menu[open]) { overflow: hidden; }
.container { margin: 0 auto; padding: 0 16px; width: 100%; }
@media (min-width: 768px) { .container { max-width: 1100px; padding: 0 32px; } }
.skip { position: absolute; left: -999px; z-index: 300; }
.skip:focus { left: 16px; top: 16px; background: #000; color: var(--primary); padding: 8px 16px; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* Grunge texture (only when the original images are present) */
.grunge, .grunge0 { display: none; }
@media (min-width: 768px) {
  @keyframes mist {
    0% { opacity: .4; transform: rotate(0); } 25% { opacity: .1; transform: rotate(1deg); }
    50% { opacity: .3; transform: rotate(0); } 75% { opacity: .1; transform: rotate(1deg) scale(1.01); }
    100% { opacity: .4; transform: rotate(0); }
  }
  body:has(.grunge0) { background-image: none; }
  /* Resting opacity: the animation varies it 0.1–0.4 as on the old site; without
     motion (prefers-reduced-motion) the grain stays still at a faint 0.25. */
  .grunge { display: block; position: fixed; z-index: -1; background: var(--mist) repeat; border-radius: 200px; opacity: .25; }
  .grunge1 { bottom: 3%; left: 31%; width: 48%; height: 43%; animation: mist 7s cubic-bezier(.45,.05,.55,.95) infinite alternate; }
  .grunge2 { bottom: 39%; right: 2%; width: 40%; height: 47%; animation: mist 10s cubic-bezier(.45,.05,.55,.95) infinite alternate-reverse; }
  .grunge3 { bottom: 47%; left: 10%; width: 39%; height: 37%; animation: mist 8s cubic-bezier(.45,.05,.55,.95) infinite alternate; }
  .grunge0 { display: block; position: fixed; z-index: -1; background: var(--mist-static) repeat; inset: 0; opacity: .15; border-radius: 10%; }
  @media (prefers-reduced-motion: reduce) { .grunge { animation: none; } }
}

/* Frame: white side columns + bottom bar */
.side-overlays { background: var(--white); }
#overlay-left, #overlay-right { display: none; }
@media (min-width: 768px) {
  #overlay-left, #overlay-right { display: block; position: fixed; top: 0; height: 100%; width: var(--frame); z-index: 120; }
  #overlay-left { left: 0; }
  #overlay-right { right: 0; }
}
#overlay-bottom { position: fixed; bottom: 0; left: 0; width: 100%; height: var(--bar); z-index: 200; }
.leftnavlink, .rightnavlink { position: absolute; bottom: 0; width: calc(50% - 25px); text-align: center; }
.leftnavlink { left: 0; }
.rightnavlink { right: 0; }
.leftnavlink a, .rightnavlink a { color: var(--black-primary); font-weight: 900; font-size: 15px; display: inline-block; height: var(--bar); line-height: calc(var(--bar) + 4px); padding: 0 16px; }
.leftnavlink a:hover, .leftnavlink a:focus, .rightnavlink a:hover, .rightnavlink a:focus { text-decoration: none; color: var(--black-primary); }
.rightnavlink a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (min-width: 768px) { .leftnavlink a, .rightnavlink a { font-size: 16px; line-height: var(--bar); } }
@media (min-width: 992px) { .leftnavlink a, .rightnavlink a { font-size: 18px; } }

/* Logo + the yellow band it sits on (content scrolls underneath) */
.logo { position: fixed; z-index: 220; width: 90px; height: 112px; top: 7px; left: calc(50% - 45px); }
.logo img { display: block; width: 100%; height: 100%; }
.yellow-overlay { position: fixed; top: 0; left: var(--frame); right: var(--frame); height: var(--band); z-index: 110; background: var(--primary) url("../images/speckle.svg"); }
@media (min-width: 768px) { .logo { width: 110px; height: 138px; top: 40px; left: calc(50% - 55px); } }

/* Language switch (EN/FI), top right as on the old site */
.langmenu { position: fixed; top: 13px; right: 12px; z-index: 220; font-weight: 900; }
.langmenu a, .langmenu span { margin: 0 4px; color: var(--black-primary); }
.langmenu span { color: var(--white); }
.langmenu a:hover, .langmenu a:focus { text-decoration: none; color: var(--white); }
@media (min-width: 768px) { .langmenu { top: 33px; right: calc(var(--frame) + 2px); } }

/* Burger menu (a <details>; no JavaScript needed) */
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.navbar-toggler { position: absolute; bottom: 0; left: calc(50% - 25px); width: 50px; height: var(--bar); padding: 0 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; z-index: 210; }
.navbar-toggler:active { background: rgba(0,0,0,.15); }
.icon-bar { display: block; width: 100%; height: 2px; margin: 2px 0; background: #212121; transition: all .2s ease-in-out; }
.menu[open] .top-bar { transform: translateY(6px) rotate(45deg); }
.menu[open] .middle-bar { opacity: 0; }
.menu[open] .bottom-bar { transform: translateY(-6px) rotate(-45deg); }
body:has(.menu[open]) #overlay-bottom { background: var(--primary); }

#mainmenu-collapse {
  position: fixed; top: 0; left: 0; width: 100%; height: calc(100% - var(--bar));
  overflow-y: auto; padding: 136px 0 24px; background: var(--primary); z-index: 130; text-align: center;
  animation: menu-in .25s ease-out;
}
@keyframes menu-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #mainmenu-collapse { animation: none; } }
.navbar-nav { list-style: none; margin: 0; padding: 0; }
.navbar-nav li { margin: 0; }
.navbar-nav a { display: block; padding: 2px 16px; color: var(--black-primary); text-transform: uppercase; font-weight: 900; font-size: 20px; }
.navbar-nav a:hover, .navbar-nav a:focus, .navbar-nav a[aria-current] { text-decoration: none; color: var(--white); }
.some { margin: 18px 0 20px; }
.some a { display: inline-block; color: #000; margin: 0 12px; }
.some svg { height: 30px; width: auto; display: block; }
#mainmenu-collapse > p { color: var(--white); font-weight: bold; font-size: 13px; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
#mainmenu-collapse > p a { color: var(--white); }
@media (min-width: 768px) {
  #mainmenu-collapse { padding-top: 196px; }
  .navbar-nav a { font-size: 24px; }
}
@media (min-width: 992px) { .navbar-nav a { font-size: 26px; } }


/* Content area */
.expand { flex: 1 0 auto; display: flex; }
.grid { display: grid; grid-template-columns: 100%; padding: 40px 0 0; }
.content-centered { max-width: 820px; width: 100%; margin: 96px auto 32px; }
@media (min-width: 768px) {
  .grid { padding: 80px 0 0; }
  .content-centered { margin: 116px auto 48px; }
}
.home .grid { align-items: center; }
.home .content-centered { text-align: center; max-width: 900px; margin: 96px auto 12px; }
@media (min-width: 768px) { .home .content-centered { margin: 116px auto 48px; } }

@media print {
  .side-overlays, .logo, .yellow-overlay, .grunge, .grunge0 { display: none !important; }
  body { background: none; padding: 0; }
  .content-centered { margin-top: 0; }
}
