/* ============================================================
   extras.css — loaded after styles.css on every page.
   1) Lighter grain and header for phones  2) Donation page
   ============================================================ */

/* ---------- side menu ---------- */
/* Stretch between top and bottom instead of using a height unit: phone browsers
   update dvh only after the address bar finishes moving, which left a gap. */
.site-nav {
  top: 0;
  bottom: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  justify-content: safe center;
  padding-top: calc(var(--space-4) + 42px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
}
/* Short screens: start from the top so the first item is never cut off. */
@media (max-height: 820px) {
  .site-nav { justify-content: flex-start; }
}
.site-nav a, .site-nav .nav-disabled { flex-shrink: 0; }

/* The page behind doesn't scroll while the menu is open. */
body.nav-open { overflow: hidden; }

/* ---------- donation page ---------- */
.needs-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.needs-list li {
  color: var(--ink-dim);
  padding: 0.55rem 0 0.55rem 1.4rem;
  position: relative;
}
.needs-list li::before {
  content: "";
  position: absolute; left: 0.1rem; top: 1.15rem;
  width: 0.55rem; height: 1px; background: var(--oak);
}
.methods {
  max-width: 42rem; margin: 0 auto;
  padding: 0 var(--space-3) var(--space-3);
  display: grid; gap: var(--space-2);
}
.methods h2 {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 1.7rem; margin: var(--space-3) 0 var(--space-1);
}
.method {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-panel); padding: var(--space-2) var(--space-2) calc(var(--space-2) + 0.2rem);
}
.method-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.method h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.35rem; margin: 0; }
.method p { color: var(--ink-dim); margin: 0.3rem 0 0; font-size: 0.95rem; }
.method-value {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.35rem 0.35rem 0.9rem;
}
.method-value code {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink);
}
.copy-btn {
  flex-shrink: 0; height: 32px; padding: 0 0.9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-dim);
  font-family: var(--mono); font-size: 0.72rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.copy-btn:hover { border-color: var(--verdigris); color: var(--ink); }
.copy-btn.done { border-color: var(--verdigris); color: var(--verdigris); }
.method .pill-link { margin-top: 0.9rem; }
.methods-empty { color: var(--ink-dim); }
.thanks-line {
  text-align: center; font-family: var(--display); font-style: italic;
  font-size: 1.6rem; color: var(--ink); padding: var(--space-3) 0 var(--space-5);
}

/* ---------- menu hint (first visits only) ---------- */
/* The drawer itself slides out a few centimetres and back: it shows there is a
   menu without putting any label on top of the page. */
.site-nav.peek { animation: navPeek 1.9s cubic-bezier(0.4, 0, 0.25, 1) 1; }
@keyframes navPeek {
  0%   { transform: translateX(-102%); }
  38%  { transform: translateX(-102%) translateX(54px); }
  62%  { transform: translateX(-102%) translateX(54px); }
  100% { transform: translateX(-102%); }
}
.menu-btn.menu-hint .menu-mark { animation: menuHint 1.9s cubic-bezier(0.4, 0, 0.25, 1) 1; }
@keyframes menuHint {
  0%   { transform: rotate(0); }
  38%  { transform: rotate(-55deg); }
  62%  { transform: rotate(-55deg); }
  100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav.peek, .menu-btn.menu-hint .menu-mark { animation: none; }
}

/* ---------- contact page: reason pills ---------- */
.reason-wrap { max-width: 42rem; margin: 0 auto; padding: 0 var(--space-3) var(--space-3); }
.reason-label { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-dim); letter-spacing: 0.04em; margin: 0 0 0.7rem; }
.reasons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reason {
  display: inline-flex; align-items: center; height: 36px; padding: 0 1rem;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-dim); cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.reason:hover { border-color: var(--verdigris); color: var(--ink); }
.reason[aria-pressed="true"] { border-color: var(--verdigris); color: var(--ink); background: rgba(110, 143, 130, 0.12); }
.only-vol { display: none; }
body.reason-voluntariado .only-vol { display: block; }
body.reason-voluntariado .field-row.only-vol { display: grid; }
body.reason-voluntariado label.check.only-vol { display: flex; }

/* ---------- philosophy: the line under the title reads as body text ---------- */
.page-head .quote { margin: 0; max-width: 42rem; }
.page-head .quote p {
  font-family: var(--body);
  font-style: normal;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ---------- contact form: show/hide per reason (beats the page's own rules) ---------- */
body:not(.reason-voluntariado) .only-vol { display: none !important; }
body.reason-voluntariado .only-other { display: none !important; }

/* ---------- contact form: send button first, own-email link second ---------- */
.form-actions { display: block; }
.or-email {
  margin-top: var(--space-2);
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.or-email a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.or-email a:hover { color: var(--ink); border-color: var(--verdigris); }

/* ---------- side menu: the whole row is the link ---------- */
.site-nav a, .site-nav .nav-disabled {
  display: block;
  width: 100%;
  padding: 0.45rem var(--space-1);
  margin: -0.45rem 0;
  border-radius: 8px;
}
.site-nav a { transition: color 0.2s ease, background 0.2s ease; }
.site-nav a:hover { background: rgba(237, 234, 217, 0.04); }

/* ---------- side menu: El Hórreo, pinned to the bottom ---------- */
/* A different part of the site, so it gets its own kind of button: a framed
   card at the foot of the drawer instead of another line in the list.
   Tall screen: the auto margins push it to the bottom and keep the list
   centred above it. Short screen: it stays stuck to the bottom of the
   drawer and the list scrolls underneath it. */
.site-nav { padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); }
.site-nav > :first-child { margin-top: auto; }
/* clear room under the last item, so when the list is scrolled to the end
   it sits fully above the card's fade instead of half inside it */
.site-nav > :nth-last-child(2) { margin-bottom: 2.5rem; }
.site-nav .nav-horreo {
  position: sticky; bottom: 0; z-index: 1;
  margin-top: auto;
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 0.8rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(140, 106, 79, 0.45);
  border-radius: 12px;
  background: #202218;                 /* panel colour with a little oak in it */
  /* the list fades out behind the card instead of showing through it */
  box-shadow: 0 0 0 var(--space-3) var(--bg-panel),
              0 -1.2rem 1.4rem var(--space-3) var(--bg-panel);
  font-family: var(--mono); font-style: normal;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.site-nav .nav-horreo em {
  font-style: normal; font-size: 0.62rem; letter-spacing: 0.05em;
  text-transform: none; color: var(--ink-faint); opacity: 0.8;
}
.site-nav a.nav-horreo::after { content: "\2192"; color: var(--oak); }
.site-nav a.nav-horreo:hover { border-color: var(--oak); background: #2a291d; color: var(--ink); }
.site-nav .nav-horreo.is-soon { color: var(--ink-dim); cursor: default; }

/* a page that exists in one language only (e.g. /proyecto) has no language switch */
html[data-only-lang] .lang-toggle { display: none !important; }
