/* ============================================================
   ATLAS GUIDE — TRAVEL WALL
   travel-wall.css
   Requires: global.css + header-footer.css loaded first
   ============================================================ */

/* ============================================================
   LOCAL TOKEN BRIDGE
   The Wall has its own warm ink/cork palette intentionally
   distinct from the main brand. Greens bridge to global tokens;
   warm cork/sand tones kept local — they define the aesthetic.
   ============================================================ */
:root {
  --teal:    var(--ag-green-800);
  --teal-d:  var(--ag-green-900);
  --teal-l:  var(--ag-green-600);
  --coral:   var(--ag-terra-500);
  --coral-l: #D4845A;
  --sand:    var(--ag-gold-500);

  --ink:     var(--ag-ink);
  --mid:     var(--ag-ink-mid);
  --dim:     var(--ag-ink-light);

  --bg:      var(--ag-warm-white);
  --bg-warm: var(--ag-parchment);
  --card:    var(--ag-white);
  --line:    rgba(42, 36, 32, .12);

  /* Cork palette — kept raw, defines the wall's visual identity */
  --cork:   #C9A96E;
  --cork-d: #B8935A;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  z-index: 10000; transition: width .15s linear;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; height: 52vh; min-height: 380px;
  overflow: hidden; display: flex; align-items: flex-end;
}
.hero-bg {
  position: absolute; inset: 0; will-change: transform;
  background: linear-gradient(135deg, var(--ag-green-900) 0%, var(--ag-green-800) 45%, #1f7a6e 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(255,255,255,.02) 40px, rgba(255,255,255,.02) 41px);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,33,24,.75) 0%, transparent 55%); z-index: 1;
}

/* Torn paper edge */
.hero-tear {
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 32px; z-index: 3; background: var(--bg);
  clip-path: polygon(0% 100%,0% 60%,1% 45%,2% 60%,3% 40%,4% 55%,5% 35%,6% 50%,7% 30%,8% 50%,9% 38%,10% 55%,11% 42%,12% 60%,13% 45%,14% 62%,15% 48%,16% 65%,17% 50%,18% 40%,19% 55%,20% 38%,21% 52%,22% 35%,23% 48%,24% 32%,25% 50%,26% 38%,27% 55%,28% 40%,29% 58%,30% 44%,31% 60%,32% 46%,33% 62%,34% 48%,35% 40%,36% 55%,37% 42%,38% 58%,39% 44%,40% 60%,41% 46%,42% 38%,43% 52%,44% 36%,45% 50%,46% 34%,47% 48%,48% 32%,49% 46%,50% 30%,51% 44%,52% 28%,53% 42%,54% 26%,55% 40%,56% 55%,57% 42%,58% 58%,59% 44%,60% 60%,61% 48%,62% 38%,63% 52%,64% 40%,65% 56%,66% 44%,67% 60%,68% 46%,69% 40%,70% 54%,71% 42%,72% 58%,73% 46%,74% 62%,75% 48%,76% 38%,77% 52%,78% 40%,79% 55%,80% 42%,81% 58%,82% 45%,83% 60%,84% 48%,85% 40%,86% 55%,87% 42%,88% 58%,89% 45%,90% 60%,91% 48%,92% 62%,93% 50%,94% 65%,95% 52%,96% 45%,97% 58%,98% 45%,99% 60%,100% 50%,100% 100%);
}

.hero-content {
  position: relative; z-index: 2; width: 100%;
  max-width: 1280px; margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px) clamp(40px, 6vh, 64px);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px;
  background: transparent; border: 2px solid rgba(255,255,255,.25); border-radius: 4px;
  font-size: .68rem; font-weight: 800; color: rgba(255,255,255,.75);
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.2rem; position: relative;
}
.hero-badge::before {
  content: ''; position: absolute; inset: -4px;
  border: 1px dashed rgba(255,255,255,.15); border-radius: 6px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 600;
  color: #fff; line-height: 1.05; letter-spacing: -.04em; margin-bottom: .6rem;
}
.hero h1 em { font-style: italic; color: var(--ag-gold-500); font-weight: 400; }
.hero-sub   { font-size: clamp(.84rem, 1.2vw, 1rem); color: rgba(255,255,255,.5); max-width: 460px; line-height: 1.75; }
.hero-stats { display: flex; gap: clamp(20px, 4vw, 48px); margin-top: 1.6rem; }
.h-stat-n   { font-family: var(--font-display); font-size: clamp(1.6rem, 2.5vw, 2.2rem); font-weight: 600; color: #fff; line-height: 1; }
.h-stat-l   { font-size: .65rem; color: rgba(255,255,255,.38); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-top: 4px; }

/* ============================================================
   BREADCRUMB BAR
   ============================================================ */
.breadcrumb-bar   { padding: .9rem 0; border-bottom: 1px solid var(--line); background: var(--card); }
.breadcrumb-inner { max-width: 1280px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 64px); display: flex; align-items: center; font-size: .8rem; color: var(--dim); }
.breadcrumb-inner a       { color: var(--mid); font-weight: 600; transition: color .2s; }
.breadcrumb-inner a:hover { color: var(--teal); }
.breadcrumb-inner .sep    { margin: 0 .5rem; font-size: .7rem; }

/* ============================================================
   COMPOSE FORM
   ============================================================ */
.compose-wrap {
  max-width: 720px; margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(24px, 5vw, 64px) 0;
}
.compose {
  background: var(--card); border-radius: 4px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--line);
  transform: rotate(-.3deg); transition: transform .3s ease, box-shadow .3s ease;
}
.compose:focus-within {
  transform: rotate(0);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(26,58,43,.2);
}
.compose-strip { height: 6px; background: linear-gradient(90deg, var(--teal), var(--ag-gold-500), var(--coral)); }
.compose-inner { padding: clamp(24px, 3vw, 36px); }
.compose-inner::after {
  content: '✈'; position: absolute; top: 28px; right: 28px;
  font-size: 2.5rem; opacity: .04; pointer-events: none; color: var(--ink);
}
.compose-head {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
  color: var(--ink); margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.compose-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Ruled paper background */
.compose-ruled { position: relative; margin-bottom: 14px; }
.compose-ruled::before {
  content: ''; position: absolute; left: 16px; right: 16px; top: 28px; bottom: 14px; z-index: 0;
  background: repeating-linear-gradient(to bottom, transparent, transparent 27px, rgba(26,58,43,.06) 27px, rgba(26,58,43,.06) 28px);
  pointer-events: none; border-radius: 8px;
}

.cr      { display: flex; gap: 12px; margin-bottom: 14px; }
.cr.col  { flex-direction: column; }

.compose textarea {
  position: relative; z-index: 1; width: 100%; min-height: 96px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px;
  font-family: var(--font-body); font-size: .88rem; color: var(--ink);
  background: rgba(245,240,232,.5); resize: vertical; outline: 0;
  transition: border-color .25s, background .25s; line-height: 1.75;
}
.compose textarea:focus { border-color: var(--teal); background: #fff; }
.compose textarea::placeholder { color: var(--dim); }

.compose input[type="text"],
.compose select {
  border: 1.5px solid var(--line); border-radius: 100px;
  padding: 11px 18px; font-family: var(--font-body); font-size: .84rem;
  color: var(--ink); background: var(--bg-warm); outline: 0;
  transition: border-color .25s, background .25s; flex: 1; min-width: 0;
}
.compose input[type="text"]:focus,
.compose select:focus { border-color: var(--teal); background: #fff; }
.compose select {
  cursor: pointer; appearance: none;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="7"><path d="M1 1l5 5 5-5" stroke="%239A8E85" fill="none" stroke-width="1.5" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.compose input::placeholder { color: var(--dim); }
.cc         { font-size: .7rem; color: var(--dim); text-align: right; margin-top: -8px; margin-bottom: 8px; }
.cc.warn    { color: var(--coral); }

.c-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--teal); color: #fff; border: none;
  padding: 14px 32px; border-radius: 100px;
  font-weight: 800; font-size: .86rem; font-family: var(--font-body);
  cursor: pointer; transition: all .3s cubic-bezier(.4,0,.2,1);
  width: 100%; letter-spacing: .02em; box-shadow: 0 4px 16px rgba(26,58,43,.2);
}
.c-btn:hover:not(:disabled) { background: var(--teal-d); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(26,58,43,.3); }
.c-btn:disabled { opacity: .4; cursor: not-allowed; }
.c-ok          { display: none; text-align: center; padding: 24px; color: var(--teal); font-weight: 700; font-size: .92rem; line-height: 1.6; }
.c-ok.show     { display: block; }
.c-form.hid    { display: none; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar { max-width: 1280px; margin: 0 auto; padding: clamp(1.8rem, 3vw, 2.5rem) clamp(24px, 5vw, 64px) 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filter-bar label  { font-size: .72rem; font-weight: 800; color: var(--mid); letter-spacing: .08em; text-transform: uppercase; }
.filter-bar select {
  border: 1.5px solid var(--line); border-radius: 100px;
  padding: 9px 36px 9px 18px; font-family: var(--font-body); font-size: .82rem;
  color: var(--ink); background: var(--card); outline: 0; cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="7"><path d="M1 1l5 5 5-5" stroke="%239A8E85" fill="none" stroke-width="1.5" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat; background-position: right 14px center;
  transition: border-color .2s, box-shadow .2s; box-shadow: var(--shadow-sm);
}
.filter-bar select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,58,43,.10); }
.pcc { margin-left: auto; font-size: .78rem; color: var(--dim); font-weight: 600; }

/* ============================================================
   CORKBOARD
   ============================================================ */
.corkboard { max-width: 1280px; margin: 0 auto; padding: clamp(1.5rem, 3vw, 2.5rem) clamp(24px, 5vw, 64px) 5rem; }
.wall {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 32px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(160,110,60,.03) 3px, rgba(160,110,60,.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(160,110,60,.03) 3px, rgba(160,110,60,.03) 4px),
    linear-gradient(135deg, #f0e8d8 0%, #e8dcc8 50%, #eae0cc 100%);
  border-radius: 16px;
  box-shadow: inset 0 2px 8px rgba(100,65,20,.12), 0 4px 24px rgba(44,24,16,.08);
  border: 1px solid rgba(160,110,60,.15);
}

/* ============================================================
   POSTCARDS
   ============================================================ */
.postcard {
  background: var(--card); border-radius: 4px;
  position: relative; overflow: visible; display: flex; flex-direction: column;
  box-shadow: var(--shadow-pin); transition: all .4s cubic-bezier(.4,0,.2,1);
  transform: rotate(-.8deg);
}
.postcard:nth-child(2n) { transform: rotate(.5deg); }
.postcard:nth-child(3n) { transform: rotate(-1.2deg); }
.postcard:nth-child(4n) { transform: rotate(.9deg); }
.postcard:nth-child(5n) { transform: rotate(-.4deg); }
.postcard:nth-child(6n) { transform: rotate(1.1deg); }
.postcard:hover { transform: rotate(0) translateY(-6px) scale(1.02) !important; box-shadow: 0 24px 64px rgba(44,24,16,.22); z-index: 10; }

/* Pin */
.postcard::before {
  content: ''; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%; z-index: 20;
  background: radial-gradient(circle at 35% 35%, #e8e8e8, #999);
  box-shadow: 0 2px 6px rgba(0,0,0,.3), inset 0 1px 2px rgba(255,255,255,.4);
}

/* Colour strip */
.pc-strip { height: 6px; display: flex; border-radius: 0; }
.pc-strip .s { flex: 1; }

/* Postage stamp */
.pc-postage {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 44px; border: 1.5px solid var(--line);
  border-radius: 2px; background: var(--bg-warm);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line);
}

/* Card body */
.pc-body { padding: 14px 16px 10px; flex: 1; }
.pc-flag { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pc-flag img  { width: 28px; height: 19px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.pc-flag span { font-family: var(--font-display); font-size: .88rem; font-weight: 600; color: var(--ink); }

/* Ruled text area */
.pc-text {
  font-size: .84rem; color: var(--mid); line-height: 1.75; margin-bottom: 10px; word-wrap: break-word;
  background: repeating-linear-gradient(to bottom, transparent, transparent 27px, rgba(26,58,43,.05) 27px, rgba(26,58,43,.05) 28px);
  padding-bottom: 2px;
}
.pc-divider { height: 1px; margin: 0 16px; background: repeating-linear-gradient(90deg, var(--line) 0, var(--line) 4px, transparent 4px, transparent 8px); }

/* Footer row */
.pc-foot    { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 14px; gap: 8px; }
.pc-who     { font-size: .7rem; color: var(--dim); font-weight: 600; font-style: italic; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pc-like {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px;
  background: var(--bg-warm); border: 1.5px solid var(--line); border-radius: 100px;
  font-size: .68rem; font-weight: 700; color: var(--dim); cursor: pointer;
  transition: all .25s; font-family: var(--font-body);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.pc-like:hover     { border-color: var(--coral); color: var(--coral); background: rgba(194,75,58,.06); }
.pc-like.liked     { background: rgba(194,75,58,.08); border-color: var(--coral); color: var(--coral); }
.pc-like.liked .lk-heart { transform: scale(1.2); }
.lk-heart          { font-size: .8rem; transition: transform .3s cubic-bezier(.4,0,.2,1); display: inline-block; }

.pc-share {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  background: var(--bg-warm); border: 1.5px solid var(--line); border-radius: 100px;
  font-size: .66rem; font-weight: 700; color: var(--mid); cursor: pointer;
  transition: all .25s; font-family: var(--font-body);
  letter-spacing: .02em; text-transform: uppercase;
}
.pc-share:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.pc-share svg   { width: 11px; height: 11px; fill: currentColor; }

/* ============================================================
   EMPTY + LOADING STATES
   ============================================================ */
.wall-empty { text-align: center; padding: 4rem 2rem; color: var(--dim); grid-column: 1 / -1; }
.wall-empty .ei { font-size: 3rem; margin-bottom: 1rem; opacity: .4; display: block; }
.wall-empty p   { font-size: .9rem; line-height: 1.75; }
.wall-loading   { text-align: center; padding: 3rem; color: var(--dim); font-size: .86rem; grid-column: 1 / -1; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--teal); color: #fff;
  padding: 13px 32px; border-radius: 100px;
  font-size: .84rem; font-weight: 700; z-index: 9999;
  transition: transform .4s cubic-bezier(.16,1,.3,1);
  pointer-events: none; box-shadow: 0 8px 32px rgba(26,58,43,.35);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
[data-r]   { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
[data-r].v { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .wall { grid-template-columns: repeat(2, 1fr); padding: 24px; gap: 20px; }
}
@media (max-width: 640px) {
  .wall        { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .postcard    { transform: none !important; }
  .hero        { height: 44vh; min-height: 320px; }
  .hero-tear   { height: 20px; }
  .cr          { flex-direction: column; }
  .filter-bar  { flex-direction: column; align-items: stretch; }
  .pcc         { margin-left: 0; }
  .compose     { transform: none; }
}
@media (max-width: 480px) {
  .wall-loading,
  .wall-empty { font-size: .82rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .hero-bg          { background: transparent !important; }
  .hero h1,
  .hero-sub         { color: var(--ink) !important; }
  .c-btn,
  .progress-bar     { display: none; }
  .wall             { background: transparent; box-shadow: none; }
  .postcard         { box-shadow: 0 0 0 1px var(--line); transform: none !important; }
  .postcard::before { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .postcard, .compose    { transform: none !important; }
}