/* =========================================================
   The Works Enterprises — florist wire-order pad
   (after The John Henry Co. CA0151, as used by
    The Works Floral & Gift)

   --form = printed-form ink   --ink = the green hand
   Light = "the original"   Dark = "the carbon copy"
   ========================================================= */

/* Heritage uncial wordmark.
   IrishUncialfabeta (Manfred Klein, donationware — free incl. commercial)
   is the live face: a close stand-in for the original Glendower lettering.
   Uncial Antiqua (SIL OFL) is kept as a deeper fallback.
   Swap to real Glendower later by adding its @font-face — it's first in --uncial. */
@font-face {
  font-family: "IrishUncialfabeta";
  src: url("/assets/fonts/IrishUncialfabeta-Bold.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Uncial Antiqua";
  src: url("/assets/fonts/uncial-antiqua.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --paper:      #f6f1e3;
  --paper-bg:   #e7ddc6;
  --form:       #2a2723;            /* printed black */
  --form-soft:  rgba(42, 39, 35, .45);
  --ink:        #1d5c3a;            /* green ink */
  --ink-soft:   #3a7d57;
  --stamp:      #b1402f;
  --brand:      #9a6a2c;            /* antique bronze/copper (light) */
  --shadow:     rgba(40, 30, 10, .24);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper:      #0e1512;
  --paper-bg:   #060a08;
  --form:       #c2cdc6;            /* printed lines on the carbon */
  --form-soft:  rgba(194, 205, 198, .40);
  --ink:        #74e3a4;            /* phosphor ink */
  --ink-soft:   #4cbf86;
  --stamp:      #e0795f;
  --brand:      #d2a44e;            /* brass (dark) */
  --shadow:     rgba(0, 0, 0, .6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --paper:      #0e1512;
    --paper-bg:   #060a08;
    --form:       #c2cdc6;
    --form-soft:  rgba(194, 205, 198, .40);
    --ink:        #74e3a4;
    --ink-soft:   #4cbf86;
    --stamp:      #e0795f;
    --brand:      #d2a44e;
    --shadow:     rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root {
  --label: Georgia, "Times New Roman", serif;          /* printed labels */
  --hand:  "Snell Roundhand", "Apple Chancery", "Segoe Script",
           Georgia, serif;                              /* the ink hand */
  /* heritage uncial wordmark — licensed faces first (use if installed
     locally or self-hosted later), then the free self-hosted stand-in */
  --uncial: "Glendower", "IrishUncialfabeta", "Ossian", "Gandalf", "Iona",
            "Stonecross", "RM Celtic", "Kells SD", "Uncial Antiqua", Georgia, serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad-max: 620px;                                     /* tall, narrow pad */
}

/* ---- base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper-bg);
  color: var(--form);
  font-family: var(--label);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: clamp(14px, 4vw, 48px) 14px;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: rgba(127, 127, 127, .25); }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--paper); border: 1px solid var(--form);
  color: var(--form); padding: 10px 12px; z-index: 50;
}
.skip-link:focus { left: 12px; }

/* ---- the hand (ink fill-ins) ---- */
.hand {
  font-family: var(--hand);
  color: var(--ink);
  font-style: italic;
}
.ditto { color: var(--form-soft); font-style: normal; }

/* ---- theme toggle ---- */
.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink);
  background: var(--paper); border: 1px solid var(--form-soft);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- the pad sheet ---- */
.pad {
  max-width: var(--pad-max);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--form-soft);
  box-shadow: 0 18px 50px var(--shadow);
  padding: clamp(20px, 5vw, 40px);
}

/* shared form label */
.ph-label {
  font-family: var(--label);
  font-weight: 700;
  font-size: .98rem;
  color: var(--form);
}

/* small printed checkbox */
.box {
  display: inline-block;
  width: 11px; height: 11px;
  border: 1.4px solid var(--form);
  vertical-align: -1px;
}

/* short underline rule */
.ph-rule {
  display: inline-block;
  flex: 0 0 90px;
  border-bottom: 1px solid var(--form);
  height: 1em;
}
.ph-rule--short { flex-basis: 60px; }
.ph-rule--grow { flex: 1 1 auto; }

/* =========================================================
   PRE-PRINTED HEADER (the florist's custom imprint)
   ========================================================= */
.ph-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
}
.ph-head__mark { width: 58px; height: 58px; flex: 0 0 auto; color: var(--brand); }
.ph-head__brand { display: grid; line-height: .92; color: var(--brand); }
.ph-head__the {
  font-family: var(--uncial);
  font-size: 22px;
  text-transform: lowercase;
  margin-left: 2px;
}
.ph-head__name {
  font-family: var(--uncial);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(34px, 9vw, 50px);
  letter-spacing: .015em;
}
.ph-head__ent {
  font-family: var(--uncial);
  font-weight: 400;
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(14px, 3.6vw, 18px);
  letter-spacing: .06em;
  margin-top: 2px;
}
.ph-head__meta {
  margin-left: auto;
  display: grid;
  text-align: right;
  gap: 2px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--form-soft);
}

/* =========================================================
   TOP TABLE: DATE | A.M. | P.M. | CHARGE | C.O.D. | PAID
   ========================================================= */
.ph-top {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--form);
  table-layout: fixed;
  margin-bottom: 6px;
}
.ph-top th,
.ph-top td {
  border: 1px solid var(--form);
  text-align: center;
  padding: 4px 3px;
  font-size: 12px;
}
.ph-top th {
  font-family: var(--label);
  font-weight: 700;
  letter-spacing: .02em;
}
.ph-top td { height: 30px; }
.ph-top .c-date { width: 30%; }
.ph-top td.c-date { text-align: left; padding-left: 8px; }
.ph-top td.c-date .hand { font-size: 17px; }
.ph-top td .box { width: 12px; height: 12px; }

/* =========================================================
   RULED FIELDS  (Send to / Inquiries)
   label floats left, content rides the first rule
   ========================================================= */
.ph-field { margin: 16px 0; }
.ph-field > .ph-label { float: left; margin-right: .6em; line-height: 1.95rem; }
.ph-lines { overflow: hidden; }
.ph-lines p {
  margin: 0;
  min-height: 1.95rem;
  line-height: 1.95rem;
  border-bottom: 1px solid var(--form-soft);
}
.ph-hand { font-size: 1.18rem; }
.ph-hand--soft { color: var(--ink-soft); font-size: 1.02rem; }
.email { border-bottom: 0; text-decoration: none; }
.email:hover { color: var(--ink-soft); }

/* =========================================================
   DESCRIPTION BOX  → The Name story
   ========================================================= */
.ph-desc {
  position: relative;
  border: 1.5px solid var(--form);
  padding: 30px 16px 18px;
  margin: 14px 0;
  min-height: 250px;
}
.ph-desc__label { position: absolute; top: 7px; left: 14px; }
.ph-desc__phone { position: absolute; top: 7px; right: 14px; }
/* two narrow price columns on the right edge, like the original —
   start below the Phone label so the rule doesn't cut through it */
.ph-desc__col {
  position: absolute; top: 30px; bottom: 0;
  border-left: 1px solid var(--form);
}
.ph-desc__col--1 { right: 92px; }
.ph-desc__col--2 { right: 46px; }
.ph-desc__body {
  padding-right: 108px;
  font-size: 1.16rem;
  line-height: 1.7;
}
.ph-desc__body p { margin: 0 0 .55em; }
.ph-desc__body p:last-child { margin-bottom: 0; }
.ph-desc__body strong { font-style: normal; font-weight: 700; }

/* =========================================================
   SPECIALTY WORKS  (was "Card") → subsidiary slots
   ========================================================= */
.ph-field--ledger > .ph-label { line-height: 2.1rem; }
.ph-ledger { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ph-ledger__line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 2.1rem;
  line-height: 2.1rem;
  border-bottom: 1px solid var(--form-soft);
}
.ph-ledger__no {
  flex: 0 0 1.4em;
  font-family: var(--label);
  color: var(--form-soft);
  font-variant-numeric: tabular-nums;
}
.ph-ledger__name { flex: 1 1 auto; font-size: 1.16rem; }
.ph-ledger__line.is-filled .ph-ledger__name a {
  border-bottom: 1px solid var(--ink-soft); text-decoration: none;
}

/* rubber-stamp status */
.stamp {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 9px; border: 1.5px solid currentColor; border-radius: 3px;
  transform: rotate(-3deg);
}
.stamp--pending { color: var(--form-soft); }
.stamp--active  { color: var(--stamp); font-weight: 700; }

/* =========================================================
   INQUIRIES  (was "Charge to")
   ========================================================= */
.ph-field--charge .ph-hand { font-size: 1.22rem; }
.ph-charge__sub {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   WIRE row — authentic, unused
   ========================================================= */
.ph-wire {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1.5px solid var(--form);
}
.ph-wire__label { display: inline-block; margin-bottom: 6px; letter-spacing: .1em; }
.ph-wire__opts {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--label); font-size: .92rem;
}
.ph-wire__opts li { display: flex; align-items: center; gap: 6px; }
.ph-wire__opts li:last-child { flex: 1 1 160px; min-width: 160px; }
.ph-wire__note {
  margin: 8px 0 0;
  font-size: 1.02rem;
  color: var(--ink-soft);
}

/* =========================================================
   FOOTER imprint
   ========================================================= */
.ph-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--form-soft);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 520px) {
  .ph-head { flex-wrap: wrap; }
  .ph-head__meta { margin-left: 0; text-align: left; width: 100%; }
  .ph-top th, .ph-top td { font-size: 10px; }
  /* drop the price columns; let the story use full width */
  .ph-desc__col { display: none; }
  .ph-desc__body { padding-right: 0; }
  .ph-desc__phone { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp { transform: none; }
}
