/* The Last Harvest popup on the shop's homepage (markup: home-popup.html).
   Uses the shop theme's tokens and fonts when present, with the same values as fallbacks,
   so it reads as part of the store. Every rule is scoped to .jlhp. */

.jlhp {
  --jlhp-forest: var(--c-forest, #24411F);
  --jlhp-forest-hover: var(--c-forest-hover, #3D5A2A);
  --jlhp-cream: var(--c-cream, #FBF7EE);
  --jlhp-butter: var(--c-butter, #F6DC95);
  --jlhp-butter-line: var(--c-butter-line, #E9CB7A);
  --jlhp-muted: var(--c-muted, #5C6652);
  --jlhp-line: var(--c-line, #E8E0CC);
  --jlhp-serif: "DM Serif Display", Georgia, serif;
  --jlhp-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  width: min(880px, calc(100vw - 48px));
  max-width: none; max-height: calc(100dvh - 48px);
  margin: auto; padding: 0; border: 0; border-radius: 4px; overflow: hidden;
  background: var(--jlhp-cream); color: var(--jlhp-forest);
  font-family: var(--jlhp-sans); font-size: 15px; line-height: 1.55;
  box-shadow: 0 30px 80px rgb(18 32 15 / .35);
}
.jlhp::backdrop { background: rgb(26 46 22 / .55); backdrop-filter: blur(3px); }
.jlhp *, .jlhp *::before, .jlhp *::after { box-sizing: border-box; }

.jlhp-card { position: relative; display: grid; grid-template-columns: 5fr 6fr; max-height: inherit; }

/* image: the vessel on its grey ground */
.jlhp-media { position: relative; min-height: 100%; background: #e9e9e7; }
.jlhp-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }

.jlhp-body { overflow-y: auto; padding: 44px 48px 40px; }
.jlhp-eyebrow { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--jlhp-muted); }

/* الحصاد الأخير — Arabic reads right to left, so الحصاد sits on the right */
.jlhp-callig { display: flex; align-items: center; gap: 6px; height: 46px; margin-bottom: 10px; opacity: .9; }
.jlhp-callig img { height: 100%; width: auto; }

.jlhp-title { margin: 0 0 14px; font-family: var(--jlhp-serif); font-weight: 400; font-size: clamp(34px, 4.2vw, 46px); line-height: 1.02; letter-spacing: 0; text-transform: uppercase; color: var(--jlhp-forest); }
.jlhp-lede { margin: 0 0 22px; color: var(--jlhp-forest); }
.jlhp-lede strong { font-weight: 600; }

.jlhp-ways { margin: 0 0 28px; padding: 0; list-style: none; border-top: 1px solid var(--jlhp-line); }
.jlhp-ways li { display: flex; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--jlhp-line); font-size: 14px; }
.jlhp-ways span {
  flex: none; min-width: 92px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.jlhp-ways span::before { content: ""; width: 7px; height: 7px; rotate: 45deg; background: var(--c-mustard, #D9A228); }

.jlhp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.jlhp-cta {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px;
  background: var(--jlhp-butter); border: 1px solid var(--jlhp-butter-line); border-radius: 2px;
  font-weight: 600; font-size: 15px; color: var(--jlhp-forest); text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.jlhp-cta:hover, .jlhp-cta:focus-visible { background: var(--jlhp-forest); border-color: var(--jlhp-forest); color: var(--jlhp-cream); }
.jlhp-cta span { transition: translate .2s; }
.jlhp-cta:hover span { translate: 3px 0; }
.jlhp-later {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--jlhp-muted); text-decoration: underline; text-underline-offset: 3px;
}
.jlhp-later:hover { color: var(--jlhp-forest); }
.jlhp :focus-visible { outline: 2px solid var(--jlhp-forest); outline-offset: 3px; }

.jlhp-x {
  position: absolute; top: 12px; right: 12px; z-index: 1; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--jlhp-forest); transition: background .2s;
}
.jlhp-x:hover { background: rgb(36 65 31 / .08); }
.jlhp-x span { position: relative; display: block; width: 18px; height: 1.5px; background: currentColor; rotate: 45deg; }
.jlhp-x span::after { content: ""; position: absolute; inset: 0; background: currentColor; rotate: 90deg; }

/* open / close */
.jlhp[open] { animation: jlhp-in .5s cubic-bezier(.2, .7, .2, 1) both; }
.jlhp[open]::backdrop { animation: jlhp-fade .4s ease both; }
.jlhp.is-closing { animation: jlhp-out .25s ease both; }
.jlhp.is-closing::backdrop { animation: jlhp-fade .25s ease reverse both; }
@keyframes jlhp-in { from { opacity: 0; translate: 0 18px; scale: .98; } }
@keyframes jlhp-out { to { opacity: 0; translate: 0 10px; } }
@keyframes jlhp-fade { from { opacity: 0; } }

html.jlhp-lock { overflow: hidden; }
.jlhp:focus { outline: none; }

/* tablet: a little tighter */
@media (max-width: 860px) {
  .jlhp-body { padding: 40px 32px 32px; }
}

/* phones: a bottom sheet with the photo as a strip on top */
@media (max-width: 640px) {
  .jlhp {
    width: 100%; max-height: calc(100dvh - 24px);
    margin: auto 0 0; border-radius: 14px 14px 0 0;
  }
  .jlhp-card { grid-template-columns: 1fr; overflow-y: auto; max-height: calc(100dvh - 24px); }
  .jlhp-media { min-height: 0; height: min(30vh, 220px); }
  .jlhp-media img { object-position: 50% 40%; }
  .jlhp-body { overflow: visible; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .jlhp-callig { height: 38px; }
  .jlhp-title { font-size: 34px; }
  .jlhp-lede { font-size: 14px; margin-bottom: 18px; }
  .jlhp-ways { margin-bottom: 22px; }
  .jlhp-actions { flex-direction: column; align-items: stretch; }
  .jlhp-cta { justify-content: center; }
  .jlhp-x { top: 10px; right: 10px; background: rgb(251 247 238 / .92); }
  .jlhp-x:hover { background: var(--jlhp-cream); }
  .jlhp[open] { animation-name: jlhp-up; }
  .jlhp.is-closing { animation-name: jlhp-down; }
  @keyframes jlhp-up { from { translate: 0 100%; } }
  @keyframes jlhp-down { to { translate: 0 100%; } }
}

@media (prefers-reduced-motion: reduce) {
  .jlhp[open], .jlhp[open]::backdrop, .jlhp.is-closing, .jlhp.is-closing::backdrop { animation: jlhp-fade .2s ease both; }
  .jlhp.is-closing { animation-direction: reverse; }
}
