/* Beauby — shared styles (all pages) */

@font-face {
  font-family: "Matcha Style";
  src: url("../fonts/matcha-style.otf") format("opentype"),
       url("../fonts/matcha-style.ttf") format("truetype");
  font-display: swap;
}

:root {
  --calamine-blue: #4e9bc9;
  --cream-yellow: #fff4c2;
  --grenadine-pink: #f2577a;
  --turquoise-green: #2fb59a;
  --ink: #2b3a42;

  /* Side spacing grows with the screen, plus room for phone notches */
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* { margin: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream-yellow);
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 2; /* keeps the language dropdown above the page content */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 1rem max(var(--gutter), env(safe-area-inset-left));
  text-align: left;
}

.logo {
  font-family: "Matcha Style", cursive;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--grenadine-pink);
  text-decoration: none;
}

/* ---------- Language dropdown (flags) ---------- */

.lang-switch { position: relative; }
.lang-switch[hidden] { display: none; }

.flag {
  display: block;
  width: 1.5rem;
  height: 1rem;
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem; /* comfortable tap target */
  padding: 0.4rem 0.6rem 0.4rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--calamine-blue);
  cursor: pointer;
}

.lang-toggle .caret {
  width: 0.7rem;
  height: 0.7rem;
  transition: transform 0.15s;
}

.lang-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 10;
  min-width: 10rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 6px 24px rgba(78, 155, 201, 0.25);
}

.lang-menu[hidden] { display: none; }

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--calamine-blue);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.lang-menu li[aria-selected="true"] {
  color: var(--grenadine-pink);
  font-weight: 600;
}

.lang-menu li.active { background: var(--cream-yellow); }

.lang-toggle:focus-visible {
  outline: 2px solid var(--turquoise-green);
  outline-offset: 2px;
}

.lang-menu:focus { outline: none; } /* the highlighted option shows keyboard position */

@media (hover: hover) {
  .lang-toggle:hover { background: #fff; }
}

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

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 1rem max(var(--gutter), env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  font-family: "Matcha Style", cursive;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: normal;
  color: var(--calamine-blue);
  text-align: center;
}

.site-footer a {
  display: inline-block;
  padding: 0.5rem 0.25rem; /* comfortable tap target on touch screens */
  color: inherit;
  text-decoration: none;
}

.site-footer span { padding: 0.5rem 0.25rem; }

@media (hover: hover) {
  .site-footer a:hover { color: var(--grenadine-pink); }
}

a:focus-visible {
  outline: 2px solid var(--grenadine-pink);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Phones: one footer item per line */
@media (max-width: 30rem) {
  .site-footer {
    flex-direction: column;
    gap: 0;
  }
}
