/* Magistralfoto — tokens, base, shell (header/footer), shared components */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin-ext.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --mf-orange: #f99a52;
  --mf-orange-deep: #e2731f;
  --mf-black: #121212;
  --mf-ink: #1c1a18;
  --mf-paper: #f4f2ee;
  --mf-grey: #e4e0d9;
  --mf-muted: #6b665f;
  --mf-white: #ffffff;
  --mf-green: #3fae6a;
  --mf-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --mf-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mf-content: min(1240px, calc(100% - 40px));
  --mf-radius: 6px;
  --mf-header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--mf-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--mf-ink);
  background: var(--mf-paper);
}
body.is-menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--mf-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 4.2rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1rem + 2.2vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--mf-orange-deep); outline-offset: 3px; }

.mf-container { width: var(--mf-content); margin-inline: auto; }
.mf-eyebrow {
  font-family: var(--mf-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mf-orange-deep);
  margin: 0 0 1rem;
}
.mf-lede { font-size: 1.2rem; max-width: 36rem; color: var(--mf-muted); }

/* Buttons */
.mf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.4em;
  font-family: var(--mf-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--mf-radius);
  border: 2px solid transparent;
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
  cursor: pointer;
}
.mf-btn:hover { transform: translateY(-1px); }
.mf-btn--orange { background: var(--mf-orange); color: var(--mf-black); }
.mf-btn--orange:hover { background: var(--mf-orange-deep); }
.mf-btn--black { background: var(--mf-black); color: var(--mf-white); }
.mf-btn--black:hover { background: #2a2a2a; }
.mf-btn--ghost { border-color: currentColor; background: transparent; }
.mf-btn--ghost:hover { background: rgba(0, 0, 0, 0.06); }
.mf-btn--ghost-light { border-color: rgba(255, 255, 255, 0.5); color: var(--mf-white); background: transparent; }
.mf-btn--ghost-light:hover { border-color: var(--mf-white); }
.mf-arrow::after { content: "→"; font-family: var(--mf-body); font-weight: 400; }

.mf-skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--mf-orange); color: var(--mf-black); padding: 0.6rem 1rem; border-radius: var(--mf-radius);
}
.mf-skip-link:focus { top: 1rem; }

/* Header */
.mf-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--mf-black); color: var(--mf-white);
}
.mf-header__inner { white-space: nowrap;
  display: flex; align-items: center; gap: 1.5rem;
  min-height: var(--mf-header-h);
}
.mf-header__brand { flex-shrink: 0; }
.mf-header__brand img { width: 100px; height: auto; }
.mf-nav { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.mf-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex: 1; justify-content: center; }
.mf-menu a { white-space: nowrap;
  display: block; padding: 0.5rem 0.7rem; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; color: rgba(255, 255, 255, 0.86); border-radius: var(--mf-radius);
}
.mf-menu a:hover, .mf-menu .current-menu-item > a { color: var(--mf-orange); }
.mf-nav__side { display: flex; align-items: center; gap: 1rem; }
.mf-status {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.85rem; font-weight: 600; text-decoration: none; color: rgba(255, 255, 255, 0.86); white-space: nowrap;
}
.mf-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--mf-green); box-shadow: 0 0 0 3px rgba(63, 174, 106, 0.25); }
.mf-status.is-closed i { background: #c9473a; box-shadow: 0 0 0 3px rgba(201, 71, 58, 0.25); }
.mf-menu-toggle { display: none; }

/* Desktop header has no room for the open/closed pill; it lives in the mobile menu and the visit blocks. */
@media (min-width: 1201px) {
  .mf-nav .mf-status { display: none; }
}
@media (max-width: 1200px) {
  .mf-menu-toggle {
    display: inline-flex; align-items: center; gap: 0.6rem; margin-left: auto;
    background: none; border: 0; color: var(--mf-white); font: inherit; font-weight: 600; cursor: pointer; padding: 0.5rem;
  }
  .mf-menu-toggle__icon { display: grid; gap: 4px; }
  .mf-menu-toggle__icon i { display: block; width: 22px; height: 2px; background: currentColor; transition: transform 0.2s, opacity 0.2s; }
  .is-menu-open .mf-menu-toggle__icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .is-menu-open .mf-menu-toggle__icon i:nth-child(2) { opacity: 0; }
  .is-menu-open .mf-menu-toggle__icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mf-nav {
    display: none; position: fixed; inset: var(--mf-header-h) 0 0; background: var(--mf-black);
    flex-direction: column; align-items: stretch; padding: 1rem 20px 2rem; overflow: auto;
  }
  .is-menu-open .mf-nav { display: flex; }
  .mf-menu { flex-direction: column; gap: 0; flex: 0 0 auto; justify-content: flex-start; }
  .mf-menu a { font-family: var(--mf-display); font-size: 1.3rem; padding: 0.8rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .mf-nav__side { flex-direction: column; align-items: stretch; margin-top: 1.5rem; }
  .mf-status { display: inline-flex; justify-content: center; }
  .mf-btn { justify-content: center; }
}

/* Generic page */
.mf-page__content { padding: 3rem 0 5rem; max-width: 760px; }
.mf-page__content h1 { margin-bottom: 1rem; }

/* Footer */
.mf-footer { background: var(--mf-black); color: rgba(255, 255, 255, 0.8); margin-top: 0; }
.mf-footer__inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
  padding: 3.5rem 0 2.5rem;
}
.mf-footer__brand img { width: 120px; margin-bottom: 1rem; }
.mf-footer__brand p { max-width: 28rem; font-size: 0.95rem; }
.mf-footer h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mf-orange); margin-bottom: 0.9rem; }
.mf-footer p { font-size: 0.95rem; }
.mf-footer a { text-decoration: none; }
.mf-footer a:hover { color: var(--mf-orange); }
.mf-footer__nav .mf-menu { flex-direction: column; gap: 0; }
.mf-footer__nav .mf-menu a { padding: 0.15rem 0; font-weight: 400; font-size: 0.95rem; }
.mf-footer__legal {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.2rem 0 1.6rem; border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 900px) {
  .mf-footer__inner { grid-template-columns: 1fr 1fr; }
  .mf-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .mf-footer__inner { grid-template-columns: 1fr; }
}

/* Saarefoto ordering plugin: recolour its teal to the Magistralfoto orange. */
.saarefoto-print, .saarefoto_ordering {
  --saarefoto-print-teal: var(--mf-orange-deep);
  --saarefoto-print-teal-dark: #b85a12;
  --saarefoto-print-ink: var(--mf-ink);
  --saarefoto-print-muted: var(--mf-muted);
  --saarefoto-print-warm: var(--mf-paper);
  --saarefoto-print-line: var(--mf-grey);
  --saarefoto-print-pink: var(--mf-orange);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.saarefoto-print-page .mf-page__content { max-width: none; padding-top: 1rem; }

/* Language switcher */
.mf-lang { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.1rem; font-family: var(--mf-display); font-size: 0.78rem; font-weight: 600; }
.mf-lang a { display: block; padding: 0.35rem 0.45rem; text-decoration: none; color: rgba(255, 255, 255, 0.55); border-radius: var(--mf-radius); }
.mf-lang a:hover { color: var(--mf-white); }
.mf-lang a[aria-current="page"] { color: var(--mf-orange); }
@media (max-width: 1200px) { .mf-lang { justify-content: center; font-size: 1rem; } }
