/* =========================================================
   index.htm — iPhone, iPad and web app
   Safe areas, tap targets and touch behaviour. Loaded after
   style5.css and before ptr.css.
   ========================================================= */

:root {
  --edge: clamp(8px, 1.2vw, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* ---------- The page may run under the notch and the home indicator ---------- */

/* In de webapp (standalone) is svh soms kleiner dan het echte scherm, met een
   lege strook onderaan als gevolg. dvh is altijd de zichtbare hoogte, en
   main3.js zet --app-height op de gemeten vensterhoogte als vangnet. */
html,
body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: var(--app-height, 100dvh);
}

.masthead {
  height: 100vh;
  height: 100svh;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
}

/* The content is pinned to the masthead; a stray min-height from a media
   query could otherwise push the name below the fold. */
.masthead .content {
  min-height: 0;
}

.topbar {
  padding-top: calc(var(--pad) + 6px + var(--safe-top));
  padding-right: calc(var(--pad) + var(--safe-right));
  padding-left: calc(var(--pad) + var(--safe-left));
}

.content {
  padding-right: calc(var(--pad) + var(--safe-right));
  padding-left: calc(var(--pad) + var(--safe-left));
}

.footer {
  padding-right: calc(var(--pad) + var(--safe-right));
  padding-bottom: calc(var(--pad) + 2px + var(--safe-bottom));
  padding-left: calc(var(--pad) + var(--safe-left));
}

.frame {
  inset:
    calc(var(--edge) + var(--safe-top))
    calc(var(--edge) + var(--safe-right))
    calc(var(--edge) + var(--safe-bottom))
    calc(var(--edge) + var(--safe-left));
}

.side-label {
  left: calc(var(--pad) - 18px + var(--safe-left));
}

/* ---------- Tap targets: 44 px, the iOS minimum ---------- */

.theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  gap: 0;
}

.theme-toggle__label {
  display: none;
}

.linkedin {
  position: relative;
}

/* The hit area grows without moving the icon */
.linkedin::after {
  content: "";
  position: absolute;
  inset: -6px;
}

/* ---------- Touch behaviour ---------- */

a,
button {
  touch-action: manipulation;
}

/* The portrait is decoration: no long-press menu, no accidental selection */
.portrait {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Larger screens: keep the label, keep the 44 px target ---------- */

@media (min-width: 901px) {
  .theme-toggle {
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 7px 14px 7px 8px;
    justify-content: flex-start;
    gap: 9px;
  }

  .theme-toggle__label {
    display: inline;
  }
}
