/* Río Guayo Sanctuary — shared styles.
   Most layout lives inline in each page (exported from the design canvas);
   this file holds the global rules, animations and responsive fixes. */

:root {
  --paper: #F5EDE1;
  --kraft: #EBDCC6;
  --ink: #2A211B;
  --ink-soft: #5A4A3C;
  --farm: #5E3F2E;
  --cherry: #B4532F;
  --island-blue: #2D4A86;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--ink); }
a:hover { color: var(--cherry); }
input, select, button, textarea { font: inherit; }
button { touch-action: manipulation; }

:focus-visible { outline: 2px solid var(--cherry); outline-offset: 3px; }
input:focus, select:focus { outline: none; border-bottom-color: var(--cherry) !important; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Header nav: anchor targets land below the sticky header */
section[id], #main { scroll-margin-top: 120px; }

/* Annual report covers */
.rg-book { transition: transform .35s ease, box-shadow .35s ease; }
.rg-book:hover { transform: translateY(-8px) rotateY(-10deg); box-shadow: 18px 22px 30px -14px rgba(43,38,32,.55); }

@keyframes livedot { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@keyframes rgpulse { 0% { box-shadow: 0 0 0 0 rgba(180,83,47,.6) } 100% { box-shadow: 0 0 0 18px rgba(180,83,47,0) } }
@keyframes rgdash { to { stroke-dashoffset: -24 } }

/* Drink filter */
[data-cat][hidden] { display: none !important; }

/* Phones and small tablets */
@media (max-width: 760px) {
  header > div:first-child { padding: 14px 20px !important; gap: 12px !important; }
  header nav { order: 3; width: 100%; gap: 18px !important; font-size: 14px !important; overflow-x: auto; white-space: nowrap; }
  header > div:last-child > div { padding: 8px 20px !important; }
  section > div, footer > div, main > div { padding-left: 20px !important; padding-right: 20px !important; }
  section[style*="max-width: 1320px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="grid-template-columns: repeat(2, minmax(0, 1fr))"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) 120px"] { grid-template-columns: 1fr auto !important; }
  [style*="grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) 120px"] > span:nth-child(2) { grid-column: 1 / -1; order: 3; }
  [style*="min-height: 820px"] { min-height: 680px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Phone refinements */
@media (max-width: 760px) {
  header { position: static !important; }
  header > div:last-child > div { flex-wrap: nowrap !important; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  header > div:last-child > div::-webkit-scrollbar { display: none; }
  [style*="min-height: 820px"] > div[style*="padding: 110px 40px 80px 56px"] { padding: 64px 20px 56px 36px !important; }
  [style*="min-height: 820px"] > div:last-child > div { padding-left: 36px !important; }
  [style*="linear-gradient(90deg, rgba(32,22,15,0.88)"] { background: rgba(32,22,15,0.66) !important; }
}

/* Gentle reveal as sections scroll into view (added by main.js only) */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* Date and time pickers in the meeting form */
input[type="date"] { min-height: 44px; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
select { min-height: 44px; cursor: pointer; }

/* ---------- Phone layout (final pass) ---------- */
h3 { line-height: 1.15; }
@media (max-width: 760px) {
  /* compact sticky header: logo + one button */
  header { position: sticky !important; top: 0; }
  header > div:first-child { flex-wrap: nowrap !important; padding: 10px 16px !important; }
  header nav { display: none !important; }
  header a[href="#meeting"] { padding: 11px 14px !important; font-size: 12px !important; white-space: nowrap; }
  header > div:last-child[aria-hidden] { height: 6px !important; }
  /* no double side padding inside contained sections */
  section[style*="max-width: 1320px"] > div, section[style*="max-width: 1320px"] > figure { padding-left: 0 !important; padding-right: 0 !important; }
  section[style*="max-width: 1320px"] { padding-top: 52px !important; padding-bottom: 52px !important; gap: 32px !important; }
  /* hero: clear the flag stripe, full-width buttons */
  section > div[style*="padding: 40px 40px 40px 56px"] { padding: 48px 20px 48px 40px !important; align-items: flex-end !important; }
  section[style*="height: calc(100vh - 82px)"] { height: auto !important; min-height: 68svh !important; }
  section[style*="height: calc(100vh - 82px)"] h1 { font-size: 44px !important; margin-bottom: 28px !important; }
  section[style*="height: calc(100vh - 82px)"] a { padding: 13px 18px !important; font-size: 12.5px !important; }
  /* map: the step list below already names each stop */
  #js-tag { display: none !important; }
  /* coffee bag box */
  #coffee figure { height: 440px !important; }
  /* buttons read cleanly */
  #work-with-us a, #coffee a, #js-submit { padding: 13px 20px !important; font-size: 12.5px !important; }
  /* meeting time rows fit a phone */
  [style*="grid-template-columns: 56px minmax(0, 1.3fr) minmax(0, 1fr)"] { grid-template-columns: 22px minmax(0, 1.25fr) minmax(0, 1fr) !important; gap: 12px !important; }
  /* 16px+ stops iPhone from zooming into form fields */
  input, select, textarea { font-size: 17px !important; }
}
@media (max-width: 760px) {
  header a > span { white-space: nowrap; }
  section[style*="height: calc(100vh - 82px)"] h1 { font-size: 38px !important; }
  p[style*="font-size: 64px"] { margin-bottom: 36px !important; }
}
@media (max-width: 760px) {
  section h2 { font-size: clamp(30px, 8.4vw, 36px) !important; }
  p[style*="font-size: 64px"] { font-size: 32px !important; }
  section p[style*="font-size: 20px"], section p[style*="font-size: 19px"] { font-size: 17px !important; }
  #coffee figure { height: 380px !important; }
  #work-with-us figure { max-width: 300px; margin: 0 auto !important; }
  #journey > div, section[style*="background: #EBDCC6"] > div { padding-top: 52px !important; padding-bottom: 52px !important; }
}
@media (max-width: 760px) {
  header a[href="index.html"] svg, header a[href="/"] svg { height: 34px !important; }
  header a[href="index.html"] span[style*="font-size: 30px"] { font-size: 24px !important; }
}
@media (max-width: 760px) {
  /* hero: thinner flag stripe, text further from it and a bit smaller */
  section[style*="height: calc(100vh - 82px)"] > div[aria-hidden] > span:nth-child(1),
  section[style*="height: calc(100vh - 82px)"] > div[aria-hidden] > span:nth-child(3) { width: 5px !important; }
  section[style*="height: calc(100vh - 82px)"] > div[aria-hidden] > span:nth-child(2) { width: 3px !important; }
  section > div[style*="padding: 40px 40px 40px 56px"] { padding: 44px 28px 44px 48px !important; }
  section[style*="height: calc(100vh - 82px)"] h1 { font-size: 32px !important; line-height: 1.1 !important; margin: 16px 0 24px !important; }
  section[style*="height: calc(100vh - 82px)"] div[style*="letter-spacing: 0.12em"] { font-size: 11px !important; gap: 10px !important; }
  section[style*="height: calc(100vh - 82px)"] div[style*="letter-spacing: 0.12em"] svg { width: 24px !important; height: 16px !important; }
  section[style*="height: calc(100vh - 82px)"] a { padding: 11px 15px !important; font-size: 11.5px !important; }
}
@media (max-width: 760px) {
  section[style*="height: calc(100vh - 82px)"] > div[aria-hidden] { padding: 0 !important; }
  section > div[style*="padding: 40px 40px 40px 56px"] { padding-left: 40px !important; }
  section[style*="height: calc(100vh - 82px)"] div[style*="letter-spacing: 0.12em"] { letter-spacing: 0.07em !important; }
}
@media (max-width: 760px) {
  header a[href="index.html"] { gap: 8px !important; min-width: 0; }
  header a[href="index.html"] span[style*="letter-spacing: 0.22em"] { font-size: 8.5px !important; letter-spacing: 0.1em !important; white-space: nowrap; }
  header a[href="#meeting"] { padding: 10px 11px !important; font-size: 11px !important; }
}
@media (max-width: 760px) {
  header a[href="index.html"] img:first-child { height: 38px !important; }
  header a[href="index.html"] img:last-child { height: 30px !important; }
}

/* ================= Polish pass: heritage, engraved feel ================= */
/* 1. Soft paper grain over the whole page */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .29 0 0 0 0 .18 0 0 0 0 .13 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* 2. Photos framed like vintage prints */
#family figure img, #coffee figure { outline: 1px solid rgba(74,46,34,.35); outline-offset: 10px; }
#work-with-us figure img { outline: 1px solid rgba(239,230,214,.45); outline-offset: 10px; }
#family figure, #coffee figure, #work-with-us figure { padding: 11px; }
#family figure img, #work-with-us figure img, #coffee figure img { box-shadow: 0 18px 40px -22px rgba(42,28,20,.55); }
/* 3. Faint engraved emblem watermark */
#meeting, section[style*="background: #EBDCC6; box-shadow"] { position: relative; isolation: isolate; }
#meeting::before, section[style*="background: #EBDCC6; box-shadow"]::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; opacity: .07;
  background: url("../images/logo-emblem.png") no-repeat center / contain;
}
section[style*="background: #EBDCC6; box-shadow"]::before { right: -2%; top: 8%; width: 420px; height: 280px; }
#meeting::before { left: -4%; bottom: 6%; width: 380px; height: 250px; opacity: .06; }
/* 4. Buttons and links: gentle life */
a[href^="#"][style*="background: #B4532F"], a[href^="#"][style*="background: #2A211B"], button[type="submit"], #js-submit {
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, filter .25s ease;
}
a[href^="#"][style*="background: #B4532F"]:hover, button[type="submit"]:hover, #js-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(140,60,30,.65); filter: brightness(1.06); }
a[href^="#"][style*="background: #2A211B"]:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(30,20,14,.7); }
a[href^="#"][style*="background: #B4532F"]::after { content: " →"; display: inline-block; transition: transform .25s ease; }
a[href^="#"][style*="background: #B4532F"]:hover::after { transform: translateX(4px); }
header nav a { position: relative; }
header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
header nav a:hover::after { transform: scaleX(1); }
header { box-shadow: 0 6px 20px -16px rgba(42,28,20,.6); }
/* 5. Cards lift slightly */
section[style*="background: #EBDCC6"] [style*="grid-template-columns"] > div, section[style*="background: #EBDCC6"] article { transition: transform .35s ease; }
section[style*="background: #EBDCC6"] [style*="grid-template-columns"] > div:hover, section[style*="background: #EBDCC6"] article:hover { transform: translateY(-4px); }
/* 6. Slow drift on the hero photo */
@keyframes rgdrift { from { transform: scale(1.0); } to { transform: scale(1.07); } }
@media (prefers-reduced-motion: no-preference) {
  section[style*="height: calc(100vh - 82px)"] > img { animation: rgdrift 24s ease-out forwards; transform-origin: 70% 60%; }
}
/* 7. Form fields feel crafted */
#meeting input, #meeting select { transition: border-color .2s ease, background-color .2s ease; }
#meeting input:focus, #meeting select:focus { background-color: rgba(255,250,242,.7); border-bottom-color: #B4532F !important; outline: none; }
@media (max-width: 760px) {
  section[style*="background: #EBDCC6; box-shadow"]::before, #meeting::before { width: 240px; height: 160px; }
  #family figure, #coffee figure, #work-with-us figure { padding: 8px; }
  #family figure img, #coffee figure, #work-with-us figure img { outline-offset: 7px; }
}
a[href^="#"][style*="background: #B4532F"]::after { content: "→"; margin-left: .55em; }
#family figure figcaption { margin-top: 20px !important; }
html, body { overflow-x: clip; }
section[style*="background: #EBDCC6; box-shadow"], #meeting { overflow: clip; overflow-clip-margin: 0; }
#work-with-us figure { padding: 11px; }
#work-with-us figure > div { padding: 0; }
@media (max-width: 760px) {
  #work-with-us figure { max-width: 360px !important; margin: 0 auto !important; gap: 16px !important; }
  #work-with-us figure > div:last-child { margin-top: 40px !important; }
}
@media (max-width: 760px) { #work-with-us figure { max-width: 320px !important; display: block !important; } }
@media (max-width: 760px) {
  #coffee dl { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #coffee h2 { font-size: 40px !important; }
  #bean > div { padding: 52px 20px !important; }
  #bean div[style*="border-left"] { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid rgba(245,237,225,0.28); padding-top: 28px; }
}
/* bag: no rectangular shadow, only a soft shadow that follows the bag's shape */
#coffee figure img { box-shadow: none !important; filter: drop-shadow(0 2px 2px rgba(42,28,18,.30)) drop-shadow(0 16px 22px rgba(42,28,18,.24)) !important; }
