@charset "UTF-8";
@font-face {font-family:'Exo 2';src:url(Exo2-VariableFont_wght.ttf) format(truetype)}
@font-face {font-family:'Exo 2';font-style:italic;src:url(Exo2-Italic-VariableFont_wght.ttf) format(truetype)}

:root {
  --background: #ddd;
  --color: #444;
  --strong: #000;
  --link: #33f;
  --accent: #fc3;
  --secondary-background: #146;
  --secondary-color: #eee;
  --h2-color: var(--secondary-background);
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #000;
    --color: #ddd;
    --strong: #fff;
    --link: #aaf;
    --secondary-background: #146;
    --secondary-color: #eee;
    --h2-color: var(--accent);
  }
}
::view-transition {
  perspective: 1000px;
  background: #000;
  inset: 0;
}
::view-transition-group(root),
::view-transition-image-pair(root) {
  transform-style: preserve-3d;
  isolation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
  backface-visibility: hidden;
  animation: none;
}
@keyframes group-rotate {
  to {
    transform: rotateY(-90deg);
  }
}
@keyframes fade-out-a-bit {
  to {
    opacity: 0.5;
  }
}
@keyframes fade-in-a-bit {
  from {
    opacity: 0.5;
  }
}
::view-transition-group(root) {
  transform-origin: 50% 50% -50vw;
  animation: 300ms ease-in-out forwards group-rotate;
}
::view-transition-old(root) {
  animation: 300ms ease-in-out forwards fade-out-a-bit;
}
::view-transition-new(root) {
  transform-origin: 0 0;
  transform: rotateY(90deg);
  inset: 0 auto 0 100%;
  animation: 300ms ease-in-out forwards fade-in-a-bit;
}
::-webkit-scrollbar { width: .2rem }
::-webkit-scrollbar-track { background: none }
::-webkit-scrollbar-thumb { background: #8888 }
::-webkit-scrollbar-thumb:hover { background: var(--accent) }
header a, header a h1 {
  color: #ddd;
}
header a.active, header a.active h1 {
  color: var(--accent);
}
li {
  margin-left: 2em;
}
* {
  margin: 0;
  padding: 0;
}
figcaption {
  margin: 0 1em;
  font-style: italic;
  font-weight: 600;
}
strong {
  color: var(--strong);
}
h1, h2, h3 {
  break-inside: avoid;
  break-after: avoid;
}
ul {
  break-inside: avoid;
}
p {
  break-inside:auto;
  margin-bottom: .5em;
}

html {
  color: var(--color);
  background: var(--background);
  font-family: 'Exo 2', sans-serif;
  height: 100vh;
  overflow: hidden overlay;
}

body {
  display: grid;
  flex-direction: column;
  grid-template-columns: 1fr 1fr;
}

header {
  grid-area: 1 / 1 / span 1 / span 1;
  top: 0;
  min-height: 8em;
}

footer {
  grid-area: 1 / 2 / span 1 / span 1;
  top: 0;
  right: 0;
  position: fixed;
}

main {
  grid-area: 2 / 1 / span 1 / span 2;
}

dialog {
  text-shadow: none;
  min-width: 20em;
}
header {
  width: 100%;
  padding-bottom: 1em;
  position: fixed;
  background: #0008;
  color: var(--secondary-color);
  text-shadow: .1em .1em .5em black;
  display: flex;
  flex: 0 0;
  flex-wrap: wrap;
  justify-content: start;
  font-size: 0.8em;
}
#contact {
  font-size: 1.2em;
}

main {
  flex: 0 1 auto;
  columns: 20em 2;
  gap: 0;
  margin-bottom: 3em;
}
main > * {
  margin: 0 2rem 0 1rem;
}
main > figure.wide {
  margin: 0;
}
main figure.wide, main h2 {
  column-span: all;
}
main > .flex {
  column-span: all;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}
main > .flex img {
  object-fit: contain;
  max-height: 12em;
}
figcaption {
  color: var(--strong);
}
main > div.box {
  overflow: hidden;
  border-radius: .4em 1em .4em 1em;
  box-shadow: .1em .1em .5em #0008;
  background: var(--secondary-background);
  color: var(--secondary-color);
  min-width: 20em;
  padding: 0 1em 1em 1em;
  margin: .5em;
}
main figure {
  margin: .5em;
  break-inside: avoid;
}
figure img {
  width: 100%;
  object-fit: cover;
  max-height: 30em;
  object-position: 50% 30%;
}
figure.left, figure.right {
  max-width: 20em;
}
figure.right {
  float: right;
}
figure.left {
  float: left;
}
main > div > div {
  padding: 0 .5em .5em .5em;
}
address {
  font-style: normal;
  cursor: pointer;
}
p {
  text-align: justify;
  hyphens: auto;
  padding: .3em 0 0 1rem;
}
#logo {
  display: flex;
  align-items: stretch;
  font-size: 5em;
  padding: 0 .4em;
}
#logo::before {
  content: " ";
  background: url(Hattu.webp) no-repeat;
  background-size: contain;
  background-position: center;
  width: 1.5em;
  height: 1.5em;
  margin-right: .1em;
}
#headerinfo {
  color: #fff;
  display: grid;
  grid-template-columns: 2fr 2.5fr;
  font-size: 0.9em;
  align-items: center;
  filter: brightness(0.9);
  white-space: pre;
}
#headerinfo a:hover, #headerinfo a:focus {
  filter: brightness(1.0);
}
#headerinfo a:hover svg, #headerinfo a:focus svg {
  fill: var(--accent);
}
#headerinfo svg {
  fill: #fff;
  width: 1.2em;
  height: 1.2em;
}
#headerinfo #address {
  grid-area: 1 / 1 / span 1 / span 1;
  display: flex;
}
#headerinfo #tel {
  grid-area: 2 / 1 / span 1 / span 1;
  display: flex;
}
#headerinfo #email {
  grid-area: 3 / 1 / span 1 / span 2;
  display: flex;
}
#tilaajavastuu {
  grid-area: 1 / 2 / span 1 / span 1;
  display: block;
  margin: auto;
  padding-bottom: 2.7em;
  color: #49ae46;
  font-size: .8em;
  font-weight: bold;
  text-shadow: 0 0 .1em black;
}
#tilaajavastuu img {
  position: absolute;
  z-index: 1;
  margin-top: 0.3em;
  height: 2.7em;
  transition: all 100ms;
}
#tilaajavastuu:hover img, #tilaajavastuu:focus img {
  box-shadow: .1em .1em .5em black;
  transform: scale(1.1);
}
#badge {
  grid-area: 1 / 3 / span 4 / span 1;
  height: 8em;
  box-shadow: .1em .1em .5em black;
  border-radius: 5em;
  transition: all 100ms;
}
#badge:hover {
  transform: scale(1.1);
}
a {
  color: var(--strong);
  font-weight: 600;
  text-decoration: none;
}
a:focus {
  outline: none;
}
a:hover, a:focus {
  color: var(--link);
}
header a, footer a {
  color: #fff;
}
header a:hover, header a:focus,
header a:hover h1, header a:focus h1,
footer a:hover, footer a:focus {
  text-shadow: 0 0 .3em black;
  color: var(--accent);
}
#logo {
  transition: 100ms ease-in-out;
  transition-property: transform, text-shadow, color;
}
header a:hover #logo {
  transform: scale(1.05);
  text-shadow: 0 0 .2em black;
  color: var(--accent);
}
h1 { color: var(--accent) }
h2 { color: var(--h2-color) }
h2, h3 {
  padding-top: .5em;
}
h2 {
  border-bottom: .1em solid #888;
}
header nav {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}
header nav div {
  font-size: 2em;
}

@media print {
  /* Hide browser's header and footer */
  @page { margin: 0; }
  :root {
    --color: black;
    --strong: black;
    --link: black;
    --background: none;

  }
  html { margin: 10mm; }
  html {
    /* Print background images and colors */
    print-color-adjust: exact;
    background: transparent;
    color: black;
    font-size: 11pt;
  }
  #headerinfo {
    font-size: .8em;
  }
  main {
    row-gap: 0;
    margin: 0;
  }
  main > div > div {
    padding: 0;
  }

  p {
    color: black;
    padding: 0;
  }
  p + p {
    text-indent: 1em;
  }

  a {
    color: black;
  }
  main strong {
    color: black;
  }
  main > div {
    background: white;
  }
  nav {
    display: none;
  }
  #badge {
    transform: scale(1.3);
  }
  h2, h3 {
    padding: 0.1em 0 0 0;
    color: black;
  }
  * {
    text-shadow: none !important;
    box-shadow: none !important;
  }
}

@media (max-width: 512px) or (max-height: 512px) {
  footer {
    font-size: calc(min(100vw, 100vh) / 512 * 16);
  }
}

@media (max-width: 768px) or (max-height: 768px) {
  header {
    font-size: calc(min(100vw, 100vh) / 768 * 0.8 * 16);
  }
}

@media (max-width: 1024px) {
  header {
    grid-area: 1 / 1 / span 1 / span 2;
  }
  footer {
    grid-area: 3 / 1 / span 1 / span 2;
    position: sticky;
    bottom: 0;
    background: #0008;
    margin-top: 1em;
    border-top: .1em solid #888;
  }
  main {
    grid-area: 2 / 1 / span 1 / span 2;
  }
  /* Address and contact info side by side */
  #headerinfo {
    grid-template-columns: 2fr 2fr 1fr;
    align-items: center;
    text-wrap: nowrap;
    overflow: hidden;
  }
  #headerinfo #address {
    grid-area: 1 / 1 / span 2 / span 1;
  }
  #headerinfo #tel {
    grid-area: 1 / 2 / span 1 / span 1;
  }
  #headerinfo #email {
    grid-area: 2 / 2 / span 1 / span 1;
  }
  #tilaajavastuu {
    grid-area: 1 / 3 / span 2 / span 1;
  }

}
