/* banfalvilaszlo.hu – mobile first */

@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/roboto-slab-300-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Roboto Slab';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/roboto-slab-300-latin.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #000;
  --dim: #767676;
  --accent: #305c9e;
  --paper: #fff;
  --target: 44px;
  --edge: 1rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-block-size: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(var(--edge), env(safe-area-inset-top, 0px))
    max(var(--edge), env(safe-area-inset-right, 0px))
    max(var(--edge), env(safe-area-inset-bottom, 0px))
    max(var(--edge), env(safe-area-inset-left, 0px));
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 300;
  font-size-adjust: from-font;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: break-word;
}

/* The vignette frames the viewport, not the scrolling page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 10vmin rgb(0 0 0 / 0.1);
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.dim { color: var(--dim); }

/* Home: the menu is the page. */
.intro { text-align: center; }

.intro h1 {
  color: var(--accent);
  margin: 0 0 1.25em;
  font-size: clamp(1.75rem, min(1.2rem + 3vw, 1.2rem + 3.5vh), 3.75rem);
  font-weight: 300;
  line-height: 1.2;
  text-wrap: balance;
}

.menu {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.375rem, min(1rem + 2.5vw, 1rem + 3vh), 3rem);
}

.menu a {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 0.25em;
  min-block-size: var(--target);
  padding-inline: 0.25em;
}

@media (min-width: 60em) {
  body::before { box-shadow: inset 0 0 20vh rgb(0 0 0 / 0.2); }
}

/* Short landscape phones: keep the whole menu on one screen. */
@media (max-height: 30em) {
  .intro h1 { margin-block-end: 0.25em; }
}

/* Text pages: a readable column under a quiet way home. */
body.page {
  display: block;
  place-items: normal; /* block layout honours justify-items too */
}

.top,
.prose {
  max-inline-size: 60ch;
  margin-inline: auto;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

.home {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target);
  color: var(--accent);
  font-size: 0.85em;
}

.prose {
  max-inline-size: 60ch;
  padding-block: 1.5rem 4rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.prose h1,
.prose h2 {
  font-weight: 300;
  line-height: 1.2;
  text-wrap: balance;
}

.prose h1 {
  margin: 0 0 1em;
  font-size: clamp(2rem, min(1.5rem + 2.5vw, 1.5rem + 4vh), 3.5rem);
}

.prose h2 {
  color: var(--accent);
  margin: 2.25em 0 0.5em;
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
}

.prose p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--dim);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.prose a:hover { text-decoration-color: currentColor; }

.draft { color: var(--dim); }

/* Contact links while the check runs, or after it failed. */
.menu a[aria-busy='true'] { opacity: 0.5; }
.menu a[aria-busy='true']::after { content: '…'; }
.menu a[data-state='failed']::after {
  content: 'try again';
  color: var(--dim);
  font-size: 0.6em;
}

.note {
  margin: 1.5em 0 0;
  color: var(--dim);
  font-size: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
}
.menu a[data-state='tap']::after {
  content: 'tap again';
  color: var(--dim);
  font-size: 0.6em;
}

.prose .lead {
  margin: -0.5em 0 0;
  color: var(--dim);
  font-size: 1.15em;
  text-wrap: balance;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25em 1.25em;
  margin: 0;
}
.details dt { color: var(--dim); }
.details dd { margin: 0; }

@media (max-width: 24em) {
  .details { grid-template-columns: 1fr; }
  .details dd { margin-block-end: 0.5em; }
}

/* Lead line on the left, logo on the right (the logo stays first in the DOM as the h1). */
.masthead {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin-block-end: 1em;
}
.prose h1.logo { line-height: 0; margin: 0; flex: none; }
.prose h1.logo img {
  inline-size: clamp(9rem, 8rem + 6vw, 12rem);
  block-size: auto;
}
.masthead .lead { margin: 0; flex: 1 1 auto; min-inline-size: 0; font-size: 1em; line-height: 1.4; text-wrap: balance; }

/* Phones: the lead line on top, the logo centred under it. */
@media (max-width: 40em) {
  .masthead { flex-direction: column-reverse; align-items: stretch; gap: 1.75em; }
  .prose h1.logo { text-align: center; }
}

.menu a[data-state='failed']:lang(hu)::after { content: 'próbáld újra'; }
.menu a[data-state='tap']:lang(hu)::after { content: 'koppints újra'; }

/* Language switcher: quiet, top right, thumb-sized targets. */
.lang {
  display: flex;
  gap: 0.25em;
  font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
}
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--target);
  min-inline-size: var(--target);
  color: var(--dim);
}
.lang a[aria-current='page'] { color: var(--accent); }
.lang a:hover { color: var(--accent); }

body > .lang {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top, 0px));
  right: max(0.5rem, env(safe-area-inset-right, 0px));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
}

/* A quiet hairline between the "who" links and the contact links. */
.menu .divided::before {
  content: '';
  display: block;
  inline-size: 2.5em;
  block-size: 1px;
  margin: 0.6em auto;
  background: rgb(0 0 0 / 0.2);
}
