/* Suomen Materiaalitutkimus: the whole site's styles. */

/* ---- Colors and fonts: change these to restyle the site ---- */

:root {
  --accent: #40c91a;        /* links, open service rows, list markers */
  --text: #777;
  --heading: #444;
  --page-bg: #f5f5f5;
  --footer-bg: #1f1f1f;
  --band: #595959;          /* grey strip at the bottom of the front page */
  --line: #ddd;
  --max-width: 1100px;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans.woff2") format("woff2");
  font-weight: 300 800;     /* one variable font file covers all weights */
  font-display: swap;
}

@font-face {
  font-family: "Anton";
  src: url("/fonts/anton.woff2") format("woff2");
  font-display: swap;
}

/* ---- Basics ---- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: 14px/1.7 "Open Sans", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.4;
  margin: 1.5em 0 0.5em;
}
h2 { font-size: 18px; }
h3 { font-size: 14px; }

p { margin: 0 0 1.4em; }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

small { font-size: 80%; }

/* Lists get a green "›" instead of a dot. */
.content ul { list-style: none; padding: 0; margin: 0 0 1.4em; }
.content ul li::before { content: "›"; color: var(--accent); margin-right: 0.6em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header: logo on the left, links on the right ---- */

.site-header {
  background: #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.22);
  padding: 20px 0;
  position: relative;       /* keeps the shadow above the hero photo */
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;          /* on phones the links drop below the logo */
  align-items: center;
  justify-content: space-between;
  gap: 10px 30px;
}
.site-header .logo img { display: block; height: 100px; width: auto; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 5px 25px; }
.site-header nav a { color: #555; font-size: 13px; }
.site-header nav a:hover,
.site-header nav a.current { color: var(--accent); text-decoration: none; }

/* ---- Front page photo with the heading and button ---- */

.hero {
  background: #000 center / cover no-repeat;
  min-height: 650px;
  display: flex;
  align-items: center;
}
.hero .container { width: 100%; }
.hero h1 {
  font: 32px/1.7 "Anton", Impact, sans-serif;
  letter-spacing: 0.5px;
  margin: 0 0 20px;
}
.hero h1 span {
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero .button {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.hero .button:hover { border-color: var(--accent); text-decoration: none; }

@media (max-width: 1000px) { .hero { min-height: 450px; } }
@media (max-width: 690px)  { .hero { min-height: 325px; } .hero h1 { font-size: 22px; } }

/* ---- Page content ---- */

.content { padding-top: 20px; padding-bottom: 40px; }

/* Customer logos in one row; they wrap onto more rows on narrow screens. */
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 25px 30px;
}
.content .logos li::before { content: none; }
.logos img { display: block; max-height: 50px; max-width: 110px; }

/* Grey strip at the bottom of the front page. */
.band { background: var(--band); height: 8px; }

/* ---- Services that open on click (<details> in palvelumme.md) ---- */

details { margin-bottom: 15px; }
summary {
  cursor: pointer;
  list-style: none;         /* hide the browser's own arrow */
  background: rgba(0, 0, 0, 0.045);
  color: #888;
  text-transform: uppercase;
  padding: 12px 14px;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.5em; font-weight: 700; }
details[open] summary { background: var(--accent); color: #fff; }
details[open] summary::before { content: "–"; }
details > :not(summary) { margin-left: 14px; margin-right: 14px; }
details h3 { text-transform: uppercase; }

/* ---- Side-by-side columns (<div class="columns"> in the Markdown) ---- */

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}
.columns.wide-first { grid-template-columns: 2fr 1fr; }
.columns h3:first-child { margin-top: 0; }
.columns hr { margin: 20px 0; }

@media (max-width: 690px) {
  .columns, .columns.wide-first { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid #3a3a3a;
  color: var(--text);
  font-size: 12px;
  padding: 20px 0;
}
