/* The Herbal Library: herb page cards (The Herbarium, membership, practitioner, consults).
   Written for the herb pages; herb-app.css is built from the app, so these live here.
   Layout: one column on phones; the Herbarium and consult cards split into
   two columns from 640px. Builds on the database tokens (--ink, --moss, --rule,
   --display, --body, --type, --clin). */
:root {
  --sage: #AEB89E;          /* the cotton envelope */
  --sage-ink: #3B4535;      /* text and buttons on sage */
  --sage-paper: #F3F2EA;    /* the Herbarium band and stamp paper */
  --postmark: rgba(46, 56, 45, 0.62);
  --pro-paper: #E4EADA;    /* the practitioner cards */
  --pro-rule: #CBD4BD;
  --pro-deep: #2E382F;
  --stamp-ink: #2F3A2C;    /* the engraved stamp */
}

/* shared pieces */
.mh-eyebrow { display: block; font-family: var(--type); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.mh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 6px; }
.mh-unlock .mh-actions { margin-top: 0; padding-top: 15px; }
.mh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 3px; border: 1px solid var(--moss); background: var(--moss); color: #fff; font-family: var(--body); font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none; transition: background-color 0.15s ease, border-color 0.15s ease; }
.mh-btn:hover { background: var(--moss-ink); border-color: var(--moss-ink); color: #fff; }
.mh-link { font-family: var(--body); font-size: 15.5px; color: var(--moss-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.mh-btn:focus-visible, .mh-link:focus-visible { outline: 2px solid var(--moss-ink); outline-offset: 3px; }
.mh-tier { display: inline-flex; align-items: center; gap: 6px; font-family: var(--clin); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--moss); border-radius: 3px; padding: 4px 9px; }
.mh-tier svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* membership and practitioner unlock cards: the offer, with a small cutout at the top right (the plant on
   members' cards, a tincture bottle on practitioners' light sage cards). The text wraps around it; on phones the buttons sit below. */
.mh-unlock { position: relative; margin-top: 14px; border: 1px solid var(--rule); border-radius: 3px; background: var(--sheet); overflow: hidden; }
.mh-panel { padding: 18px 16px 20px; }
.mh-panel::after { content: ""; display: block; clear: both; }
.mh-panel .mh-art { float: right; display: block; width: 86px; height: 110px; max-width: none; margin: -6px -6px 6px 12px; object-fit: contain; object-position: 50% 50%; }
.mh-panel h4 { margin: 11px 0 0; font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.15; color: var(--ink); text-wrap: balance; }
.mh-panel p { margin: 9px 0 0; max-width: 56ch; color: var(--ink-2); }
.mh-panel .mh-fine { font-size: 14px; color: var(--ink-3); }

/* practitioners: light sage, with a tincture bottle; the chip and button in the darker moss */
.mh-unlock--pro { border-color: var(--pro-rule); background: var(--pro-paper); }
.mh-unlock--pro .mh-panel .mh-art { width: 68px; height: 184px; margin: -10px -2px 2px 14px; object-position: 50% 100%; }
.mh-unlock--pro .mh-tier { background: var(--moss-ink); color: #fff; }
.mh-unlock--pro .mh-btn { background: var(--moss-ink); border-color: var(--moss-ink); color: #fff; }
.mh-unlock--pro .mh-btn:hover { background: var(--pro-deep); border-color: var(--pro-deep); color: #fff; }

/* The Herbarium */
.mh-zine { display: grid; margin-top: 30px; border: 1px solid #DDE0D4; border-radius: 3px; overflow: hidden; background: var(--sage-paper); }
.mh-zine__art { display: grid; place-items: center; padding: 30px 22px 18px; }
.mh-env { position: relative; width: min(100%, 360px); aspect-ratio: 7.25 / 5.25; background: var(--sage); border-radius: 2px; transform: rotate(-2.5deg); box-shadow: 0 1px 1px rgba(28, 37, 27, 0.1), 0 16px 30px -16px rgba(28, 37, 27, 0.5); }
.mh-env::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 90% at 25% 15%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 62%), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.014) 0 1px, transparent 1px 4px); }
.mh-env__from { position: absolute; left: 7%; top: 10%; font-family: var(--type); font-size: clamp(8px, 2.4vw, 10px); line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage-ink); }
.mh-env__to { position: absolute; left: 32%; right: 9%; top: 60%; display: grid; gap: 10px; }
.mh-env__to span { display: block; height: 17px; border-bottom: 1px solid rgba(59, 69, 53, 0.38); font-family: var(--display); font-style: italic; font-size: clamp(13px, 4vw, 17px); line-height: 1; color: var(--sage-ink); }
.mh-env__tag { position: absolute; left: 7%; bottom: 10%; font-family: var(--type); font-size: clamp(7px, 2.1vw, 9px); letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage-ink); border: 1px solid rgba(59, 69, 53, 0.5); padding: 2px 5px; }
.mh-stamp { position: absolute; right: 6.5%; top: 8%; width: 25%; aspect-ratio: 4 / 5.3; padding: 6px 6px 18px; background: var(--sage-paper); transform: rotate(0.6deg); }
.mh-stamp::before { content: ""; position: absolute; inset: 4px 4px 16px; border: 1px solid var(--stamp-ink); pointer-events: none; z-index: 1; }
/* engraved look: the plate goes one-colour, trimmed and faded at the edges so scan shadows drop out */
.mh-stamp .pic { display: block; width: 100%; height: 100%; overflow: hidden; }
.mh-stamp .pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; transform: scale(1.2); filter: url(#mh-engrave);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%), linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.mh-stamp b { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-family: var(--type); font-weight: 400; font-size: clamp(7px, 2.2vw, 9px); line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp-ink); white-space: nowrap; overflow: hidden; }
/* longer names take two lines in the stamp's margin */
.mh-stamp.long { padding-bottom: 25px; }
.mh-stamp.long::before { inset: 4px 4px 23px; }
.mh-stamp.long b { bottom: 3px; white-space: normal; line-height: 1.15; letter-spacing: 0.05em; font-size: clamp(6px, 1.85vw, 8px); padding: 0 4px; }
.mh-stamp::after { content: ""; position: absolute; inset: -3px; pointer-events: none;
  background:
    radial-gradient(circle, var(--sage) 2.4px, transparent 2.9px) 0 0 / 7px 7px repeat-x,
    radial-gradient(circle, var(--sage) 2.4px, transparent 2.9px) 0 100% / 7px 7px repeat-x,
    radial-gradient(circle, var(--sage) 2.4px, transparent 2.9px) 0 0 / 7px 7px repeat-y,
    radial-gradient(circle, var(--sage) 2.4px, transparent 2.9px) 100% 0 / 7px 7px repeat-y; }
.mh-postmark { position: absolute; right: 30%; top: 28%; width: 58%; height: auto; overflow: visible; pointer-events: none; }
.mh-postmark * { fill: none; stroke: var(--postmark); stroke-width: 1.3; }
.mh-postmark text { fill: var(--postmark); stroke: none; font-family: var(--type); }
.mh-zine__body { display: grid; gap: 10px; padding: 8px 20px 24px; }
.mh-zine__h { margin: 0; font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1; color: var(--ink); }
.mh-zine__body p { margin: 0; max-width: 52ch; color: var(--ink-2); }
.mh-zine__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; }
.mh-zine__meta span { color: var(--ink-3); }
.mh-zine__meta .mh-close { color: var(--sage-ink); font-weight: 500; }
.mh-zine .mh-btn { background: var(--sage-ink); border-color: var(--sage-ink); }
.mh-zine .mh-btn:hover { background: #2C3427; border-color: #2C3427; }
.mh-zine .mh-link { color: var(--sage-ink); }

/* consult */
.mh-consult { display: grid; margin-top: 30px; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; background: var(--sheet); }
.mh-consult__photo { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; }
.mh-consult__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 55% 40%; }
.mh-consult__body { display: grid; gap: 10px; padding: 18px 18px 22px; }
.mh-consult__h { margin: 0; font-family: var(--display); font-weight: 400; font-size: 29px; line-height: 1.1; color: var(--ink); text-wrap: balance; }
.mh-consult__body p { margin: 0; max-width: 52ch; color: var(--ink-2); }
.mh-consult__meta { font-size: 14.5px; color: var(--ink-3) !important; }

@media (max-width: 520px) { .mh-unlock .mh-actions { clear: both; } .mh-actions .mh-btn { width: 100%; } }
@media (min-width: 640px) {
  .mh-panel { padding: 22px 22px 24px; }
  .mh-panel .mh-art { width: 104px; height: 132px; margin: -8px -6px 8px 18px; }
  .mh-unlock--pro .mh-panel .mh-art { width: 76px; height: 204px; margin: -14px 4px 0 22px; }
  .mh-zine { grid-template-columns: 1fr 1fr; align-items: center; }
  .mh-zine__art { padding: 34px 10px 34px 26px; }
  .mh-zine__body { padding: 30px 30px 30px 18px; }
  .mh-consult { grid-template-columns: 5fr 6fr; }
  .mh-consult__photo { aspect-ratio: auto; min-height: 100%; }
  .mh-consult__body { padding: 26px 28px; align-content: center; }
}
@media (prefers-reduced-motion: reduce) { .mh-btn { transition: none; } }
