/*
 * The header, footer and language sheet every public page shares
 * (Tools/site/chrome.js): the legal pages and the Secret Santa landing pages.
 *
 * Loaded after the page's own stylesheet (legal.css or santa.css), which
 * defines the colors and fonts used here. On a phone the header is the
 * wordmark and the language button; from 900px it adds the navigation and
 * Get Keepwell. Logical properties, so Arabic mirrors itself.
 */

/* MARK: Header */

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding-inline: 20px 16px; }
.site-header .wordmark:hover { color: var(--ink); }
.site-header .topnav, .site-header .get { display: none; }
.lang {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(19, 59, 52, 0.2); background: transparent;
  color: var(--forest); font: 600 14px var(--sans); text-decoration: none; cursor: pointer;
}
.lang:hover { color: var(--forest); background: rgba(19, 59, 52, 0.04); }
.lang .i { width: 16px; height: 16px; }

/* MARK: Footer */

.foot {
  margin-top: 44px; padding: 24px 20px calc(44px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair); font-size: 13px; color: var(--muted);
  display: flex; flex-direction: column; gap: 12px;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot nav a { font-size: 14px; font-weight: 600; text-decoration: none; }
.foot .desk-only { display: none; }
.foot-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* MARK: Language sheet */

.lang-sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 600px; max-height: 92dvh; margin: 0 auto;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); border: 0; border-radius: 28px 28px 0 0;
  background: var(--cream); color: var(--ink); box-shadow: 0 -12px 40px rgba(14, 41, 35, 0.18); overflow-y: auto;
}
/* Without the script, the #languages link still shows the sheet. */
.lang-sheet:target { display: block; z-index: 10; }
.lang-sheet[open] { animation: lang-sheet-in 260ms cubic-bezier(0.22, 1, 0.36, 1); }
.lang-sheet::backdrop { background: rgba(14, 41, 35, 0.32); }
@keyframes lang-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.lang-sheet .grab { width: 40px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: rgba(14, 41, 35, 0.18); }
.lang-sheet .head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 52px; }
.lang-sheet h2 { margin: 0; text-align: center; font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.lang-sheet .x { width: 44px; height: 44px; border-radius: 22px; color: #7A8076; display: inline-flex; align-items: center; justify-content: center; }
.lang-sheet .x:hover { color: var(--ink); background: rgba(14, 41, 35, 0.06); }
.lang-sheet .options {
  margin: 6px 0 0; padding: 0; list-style: none; border-radius: 24px; background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-card); overflow: hidden;
}
.lang-sheet .opt { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 16px; border-top: 1px solid var(--hair); color: var(--ink); font-size: 16px; text-decoration: none; }
.lang-sheet li:first-child .opt { border-top: 0; }
.lang-sheet .opt:hover { color: var(--ink); background: rgba(19, 59, 52, 0.03); }
.lang-sheet .nat { flex: 1; font-weight: 600; }
.lang-sheet .other { font-size: 14px; color: var(--muted); }
.lang-sheet .ck { color: var(--green); }
.lang-sheet .note { margin: 12px 6px 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .lang-sheet[open] { animation: none; }
}

/* MARK: Desktop (from 900px) */

@media (min-width: 900px) {
  .site-header { flex-wrap: wrap; justify-content: flex-start; gap: 12px 28px; min-height: 76px; padding: 0; }
  .site-header .wordmark { font-size: 23px; }
  .site-header .leaf { width: 24px; height: 24px; }
  .site-header .topnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
  .topnav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-3); font-size: 15px; font-weight: 600; text-decoration: none; }
  .topnav a:hover { color: var(--ink); }
  .topnav a[aria-current="page"] { background: rgba(19, 59, 52, 0.07); color: var(--ink); }
  .lang { min-height: 40px; }
  .site-header .get {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 14px;
    background: var(--forest); color: var(--paper); font-size: 15px; font-weight: 600; text-decoration: none;
    box-shadow: 0 8px 20px rgba(19, 59, 52, 0.18);
  }
  .site-header .get:hover { color: var(--paper); }

  .foot { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 72px; padding: 28px 0 40px; font-size: 14px; }
  .foot nav { flex: 1; gap: 6px 22px; }
  .foot .desk-only { display: inline; }
  .foot .phone-only { display: none; }

  .lang-sheet { inset: 0; max-width: 440px; max-height: 80dvh; margin: auto; border-radius: 28px; padding-bottom: 24px; }
  .lang-sheet .grab { display: none; }
}
