/* Printed A4 stationery */
.a4 {
  position: relative;
  width: 210mm;
  height: 297mm !important;
  min-height: 297mm !important;
  max-height: 297mm !important;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}
.lh-brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.lh-head {
  position: relative;
  z-index: 3;
  padding: 8mm 16mm 7mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.lh-head-meta {
  font-size: 8.5pt;
  line-height: 1.45;
  text-align: right;
  max-width: 62mm;
  opacity: .92;
}
.a4.rtl .lh-head-meta { text-align: left; }
.lh-body {
  position: relative;
  z-index: 2;
  padding: 9mm 18mm 26mm;
  font-size: 12.5pt;
  line-height: 1.55;
}
.a4[data-lang="ar"] .lh-body { font-size: 13.5pt; line-height: 1.8; }
.lh-foot {
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  min-height: 14mm;
  padding: 4mm 16mm 5mm;
  font-size: 8.5pt;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.lh-watermark {
  position: absolute; inset: 72mm 26mm 36mm;
  display: grid; place-items: center;
  opacity: .07; pointer-events: none; z-index: 1;
}
.lh-watermark img, .lh-watermark .initials-logo { max-width: 92mm; max-height: 92mm; }
.lh-logo { width: 18mm; height: 18mm; overflow: hidden; display: grid; place-items: center; }
.lh-logo img { width: 100%; height: 100%; object-fit: contain; }
.co-en { font-weight: 800; font-size: 15pt; line-height: 1.15; letter-spacing: .01em; }
.co-ar { font-family: "Cairo","IBM Plex Sans Arabic",sans-serif; font-weight: 700; font-size: 11pt; }
.subject { font-weight: 800; font-size: 13pt; margin: 8px 0 12px; text-decoration: underline; }
.nm, .co { font-weight: 800; }
.sig-block { margin-top: 10mm; }
.refrow { display: flex; justify-content: space-between; gap: 12px; color: #334; font-size: 11pt; margin-bottom: 8px; }
.a4[data-lang="ar"] .refrow { flex-direction: row-reverse; }
.lh-siderail {
  display: none;
  position: absolute;
  z-index: 4;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* 01 Flash / electrical — orange head, teal foot */
[data-head="01"] .lh-head { background: #f36b1c; color: #fff; }
[data-head="01"] .co-en, [data-head="01"] .co-ar, [data-head="01"] .lh-head-meta { color: #fff; }
[data-head="01"] .lh-foot { background: #1aa39c; color: #fff; }

/* 02 Centered monument */
[data-head="02"] .lh-head { flex-direction: column; text-align: center; padding-top: 14mm; background: #fff; }
[data-head="02"] .lh-brand { flex-direction: column; }
[data-head="02"] .lh-head-meta { text-align: center; max-width: none; color: #667; display: none; }
[data-head="02"] .co-en { font-size: 18pt; color: #163a66; letter-spacing: .08em; }
[data-head="02"] .lh-logo { width: 28mm; height: 28mm; }
[data-head="02"] .lh-foot { background: #fff; color: #163a66; justify-content: flex-start; padding-left: 16mm; }
[data-head="02"] .lh-watermark { opacity: .09; }

/* 03 Navy + gold executive */
[data-head="03"] .lh-head { background: #0c2d5a; border-bottom: 5px solid #c9a227; }
[data-head="03"] .co-en, [data-head="03"] .co-ar, [data-head="03"] .lh-head-meta { color: #fff; }
[data-head="03"] .lh-foot { background: #0c2d5a; color: #fff; box-shadow: inset 0 5px 0 #c9a227; padding-top: 6mm; }

/* 04 Blue wave org */
[data-head="04"] .lh-head { background: linear-gradient(180deg,#0b4f9a 0 72%, #08386e 72% 100%); }
[data-head="04"] .lh-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12mm; height: 14mm;
  background: #0b4f9a; clip-path: ellipse(58% 100% at 50% 0%);
}
[data-head="04"] .co-en, [data-head="04"] .co-ar, [data-head="04"] .lh-head-meta { color: #fff; }
[data-head="04"] .lh-foot {
  background: #0b4f9a; color: #fff;
  clip-path: ellipse(80% 120% at 50% 100%);
  padding-top: 9mm; min-height: 20mm;
}
[data-head="04"] .lh-watermark { opacity: .1; }

/* 05 Geometric modern */
[data-head="05"] .lh-head {
  background:
    linear-gradient(135deg, rgba(11,79,154,.92), rgba(11,79,154,.55)),
    linear-gradient(45deg,#f4d35e 0 28%, #ee964b 28% 48%, #43aa8b 48% 72%, #0b4f9a 72%);
  min-height: 32mm;
}
[data-head="05"] .co-en, [data-head="05"] .co-ar, [data-head="05"] .lh-head-meta { color: #fff; }
[data-head="05"] .lh-foot { background: #0b4f9a; color: #fff; }

/* 06 Green leaf wave */
[data-head="06"] .lh-head { background: #fff; border-top: 7px solid #2d6a4f; }
[data-head="06"] .co-en { color: #2d6a4f; }
[data-head="06"] .lh-foot {
  background: #2d6a4f; color: #fff;
  clip-path: polygon(0 45%, 18% 0, 55% 35%, 100% 0, 100% 100%, 0 100%);
  padding-top: 9mm; min-height: 20mm;
}

/* 07 Red rail director */
[data-head="07"] { padding-left: 9mm; }
[data-head="07"]::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7mm;
  background: linear-gradient(#c1121f, #c1121f 86%, #7a0b14);
  z-index: 4;
}
[data-head="07"] .lh-head { background: #fff; border-bottom: 2px solid #c1121f; }
[data-head="07"] .co-en { color: #c1121f; }
[data-head="07"] .lh-foot { background: #fff; color: #333; border-top: 2px solid #c1121f; left: 9mm; }

/* 08 Organic dual bars + wave */
[data-head="08"] .lh-head { background: #fff; border-top: 8px solid #f36b1c; box-shadow: inset 0 14px 0 #2d6a4f; padding-top: 12mm; }
[data-head="08"] .co-en { color: #2d6a4f; }
[data-head="08"] .lh-foot {
  background: #2d6a4f; color: #fff;
  clip-path: polygon(0 40%, 22% 0, 70% 50%, 100% 10%, 100% 100%, 0 100%);
  min-height: 20mm; padding-top: 8mm;
}

/* 09 Purple vertical title */
[data-head="09"] .lh-siderail {
  display: flex; align-items: center; justify-content: center;
  left: 0; top: 0; bottom: 0; width: 14mm;
  background: #5b2c6f; color: #fff; font-size: 9pt;
}
[data-head="09"] { padding-left: 14mm; }
[data-head="09"] .lh-head { background: #6d3a86; }
[data-head="09"] .co-en, [data-head="09"] .co-ar, [data-head="09"] .lh-head-meta { color: #fff; }
[data-head="09"] .lh-foot { background: #5b2c6f; color: #fff; left: 14mm; }

/* 10 Church / curve red-black */
[data-head="10"] .lh-head { background: #111; border-bottom: 4px solid #c1121f; }
[data-head="10"] .co-en, [data-head="10"] .co-ar, [data-head="10"] .lh-head-meta { color: #fff; }
[data-head="10"] .lh-foot {
  background: linear-gradient(90deg,#111 0 55%, #c1121f 55% 100%);
  color: #fff;
  clip-path: polygon(0 38%, 48% 0, 100% 48%, 100% 100%, 0 100%);
  min-height: 20mm; padding-top: 8mm;
}

/* 11 Security gold sweep */
[data-head="11"] .lh-head { background: #fff; border-bottom: 1px solid #ddd; }
[data-head="11"] .co-en { color: #1b1b1b; letter-spacing: .12em; }
[data-head="11"] .lh-foot {
  background: linear-gradient(90deg,#111 0 42%, #e0b429 42% 100%);
  color: #fff;
  clip-path: polygon(0 50%, 40% 0, 100% 40%, 100% 100%, 0 100%);
  min-height: 20mm; padding-top: 8mm;
}

/* 12 Brand red corner footer */
[data-head="12"] .lh-head { background: #fff; border-bottom: 1px solid #eee; }
[data-head="12"] .co-en { color: #222; }
[data-head="12"] .lh-foot {
  background: #c1121f; color: #fff; justify-content: flex-end;
  clip-path: polygon(28% 100%, 48% 0, 100% 0, 100% 100%);
  min-height: 22mm; padding-right: 18mm;
}

/* 13 School navy bars */
[data-head="13"] .lh-head { background: #0b3a6e; }
[data-head="13"] .co-en, [data-head="13"] .co-ar, [data-head="13"] .lh-head-meta { color: #fff; }
[data-head="13"] .lh-foot { background: #0b3a6e; color: #fff; }

/* 14 Farming green swoosh */
[data-head="14"] .lh-head { background: #fff; }
[data-head="14"] .lh-head::after {
  content: ""; position: absolute; right: 0; top: 0; width: 70mm; height: 28mm;
  background: #3f7d20;
  clip-path: ellipse(80% 100% at 100% 0%);
}
[data-head="14"] .co-en { color: #3f7d20; }
[data-head="14"] .lh-foot { background: #3f7d20; color: #fff; }

/* 15 Blueprint */
[data-head="15"] .lh-head { background: #0a3d62; }
[data-head="15"] .co-en, [data-head="15"] .co-ar, [data-head="15"] .lh-head-meta { color: #fff; }
[data-head="15"] .lh-body { background-image: linear-gradient(#e8f0f8 1px, transparent 1px); background-size: 100% 8mm; }
[data-head="15"] .lh-foot { background: #0a3d62; color: #fff; }

/* 16 Sand classic */
[data-head="16"] .lh-head { background: #f4e6d4; border-bottom: 5px solid #9c4a1a; }
[data-head="16"] .co-en { color: #9c4a1a; }
[data-head="16"] .lh-foot { background: #9c4a1a; color: #fff; }

/* 17 Split navy gold */
[data-head="17"] .lh-head { background: linear-gradient(90deg,#0c2d5a 0 68%, #c9a227 68% 100%); }
[data-head="17"] .co-en, [data-head="17"] .co-ar, [data-head="17"] .lh-head-meta { color: #fff; }
[data-head="17"] .lh-foot { background: #0c2d5a; color: #fff; }

/* 18 Gold rules */
[data-head="18"] .lh-head { background: #fff; border-bottom: 2px solid #c9a227; }
[data-head="18"] .co-en { color: #3a2a12; font-family: "Libre Baskerville", serif; }
[data-head="18"] .lh-foot { background: #fff; color: #3a2a12; border-top: 2px solid #c9a227; }

/* 19 Geometry red */
[data-head="19"] .lh-head { background: #d90429; }
[data-head="19"] .co-en, [data-head="19"] .co-ar, [data-head="19"] .lh-head-meta { color: #fff; }
[data-head="19"]::before { content:""; position:absolute; top:0; right:0; width:42mm; height:24mm; background:#9b1028; clip-path:polygon(35% 0,100% 0,100% 100%); z-index:2; }
[data-head="19"] .lh-foot { background: #d90429; color: #fff; }

/* 20 Seafoam */
[data-head="20"] .lh-head { background: #e8f5ef; border-bottom: 4px solid #2d6a4f; }
[data-head="20"] .co-en { color: #2d6a4f; }
[data-head="20"] .lh-foot { background: #2d6a4f; color: #fff; }

/* 21 Copper plate */
[data-head="21"] .lh-head { background: #3a2414; border-bottom: 3px solid #d4a373; }
[data-head="21"] .co-en, [data-head="21"] .co-ar, [data-head="21"] .lh-head-meta { color: #f3d5b5; }
[data-head="21"] .lh-foot { background: #3a2414; color: #f3d5b5; }

/* 22 Sky angle */
[data-head="22"] .lh-head { background: #1565c0; clip-path: polygon(0 0,100% 0,100% 76%,0 100%); padding-bottom: 12mm; }
[data-head="22"] .co-en, [data-head="22"] .co-ar, [data-head="22"] .lh-head-meta { color: #fff; }
[data-head="22"] .lh-foot { background: #0d47a1; color: #fff; }

/* 23 Legal charcoal */
[data-head="23"] .lh-head { background: #1a1a1a; }
[data-head="23"] .co-en, [data-head="23"] .co-ar, [data-head="23"] .lh-head-meta { color: #fff; }
[data-head="23"] .lh-foot { background: #1a1a1a; color: #ddd; }

/* 24 Frame */
[data-head="24"] { box-shadow: inset 0 0 0 6px #5b2c6f; }
[data-head="24"] .lh-head { background: #f8f1fb; }
[data-head="24"] .co-en { color: #5b2c6f; }
[data-head="24"] .lh-foot { background: #5b2c6f; color: #fff; }

/* 25 Olive dossier */
[data-head="25"] .lh-head { background: #eef0e4; border-left: 10px solid #606c38; }
[data-head="25"] .co-en { color: #606c38; }
[data-head="25"] .lh-foot { background: #606c38; color: #fff; }

/* 26 Berry */
[data-head="26"] .lh-head { background: #c9184a; }
[data-head="26"] .co-en, [data-head="26"] .co-ar, [data-head="26"] .lh-head-meta { color: #fff; }
[data-head="26"] .lh-foot { background: #c9184a; color: #fff; }

/* 27 Blocks */
[data-head="27"] .lh-head { background: #33415c; }
[data-head="27"] .lh-head::after { content:""; position:absolute; right:0; top:0; bottom:0; width:16mm; background:#1d2638; }
[data-head="27"] .co-en, [data-head="27"] .co-ar, [data-head="27"] .lh-head-meta { color: #fff; }
[data-head="27"] .lh-foot { background: #1d2638; color: #fff; }

/* 28 Mustard navy */
[data-head="28"] .lh-head { background: #0b1f3a; }
[data-head="28"] .lh-head::after { content:""; position:absolute; left:0; right:0; bottom:0; height:6px; background:#e0b429; }
[data-head="28"] .co-en, [data-head="28"] .co-ar, [data-head="28"] .lh-head-meta { color: #fff; }
[data-head="28"] .lh-foot { background: #e0b429; color: #0b1f3a; font-weight: 700; }

/* 29 Ribbon wave foot */
[data-head="29"] .lh-head { background: #4a4e69; }
[data-head="29"] .co-en, [data-head="29"] .co-ar, [data-head="29"] .lh-head-meta { color: #fff; }
[data-head="29"] .lh-foot { background: #4a4e69; color: #fff; clip-path: polygon(0 0,100% 38%,100% 100%,0 100%); padding-top: 8mm; min-height: 18mm; }

/* 30 Aqua */
[data-head="30"] .lh-head { background: linear-gradient(180deg,#e6fffb 0 68%, #00a6a6 68% 100%); padding-bottom: 10mm; }
[data-head="30"] .co-en { color: #046b6b; }
[data-head="30"] .lh-foot { background: #00a6a6; color: #fff; }

/* 31 Maroon gold */
[data-head="31"] .lh-head { background: #4a0d26; border-bottom: 4px solid #e6c978; }
[data-head="31"] .co-en, [data-head="31"] .co-ar, [data-head="31"] .lh-head-meta { color: #f3e0b5; }
[data-head="31"] .lh-foot { background: #4a0d26; color: #f3e0b5; }

/* 32 Tech lime */
[data-head="32"] .lh-head { background: #111; border-left: 8px solid #b6ff3b; }
[data-head="32"] .co-en, [data-head="32"] .co-ar, [data-head="32"] .lh-head-meta { color: #fff; }
[data-head="32"] .lh-foot { background: #111; color: #b6ff3b; }

/* 33 Sandstone */
[data-head="33"] .lh-head { background: #efe2d0; border-bottom: 8px solid #7f5539; }
[data-head="33"] .co-en { color: #7f5539; font-family: "Libre Baskerville", serif; }
[data-head="33"] .lh-foot { background: #7f5539; color: #fff; }

/* 34 Crest teal */
[data-head="34"] .lh-head { background: #005f73; }
[data-head="34"] .co-en, [data-head="34"] .co-ar, [data-head="34"] .lh-head-meta { color: #fff; }
[data-head="34"] .lh-foot { background: #003d4a; color: #fff; }

/* 35 Coral */
[data-head="35"] .lh-head { background: #ff7f51; }
[data-head="35"] .co-en { color: #3b1408; }
[data-head="35"] .lh-foot { background: #3b1408; color: #fff; }

/* 36 Chevron */
[data-head="36"] .lh-head { background: #023e8a; clip-path: polygon(0 0,100% 0,100% 68%,50% 100%,0 68%); padding-bottom: 14mm; }
[data-head="36"] .co-en, [data-head="36"] .co-ar, [data-head="36"] .lh-head-meta { color: #fff; }
[data-head="36"] .lh-foot { background: #023e8a; color: #fff; }

/* 37 Ivory */
[data-head="37"] .lh-head { background: #f7f3ea; border-bottom: 1px solid #1d3557; }
[data-head="37"] .co-en { color: #1d3557; font-family: "Libre Baskerville", serif; }
[data-head="37"] .lh-foot { background: #1d3557; color: #f7f3ea; }

/* 38 Wine */
[data-head="38"] .lh-head { background: #5f0f40; }
[data-head="38"] .co-en, [data-head="38"] .co-ar, [data-head="38"] .lh-head-meta { color: #fff; }
[data-head="38"] .lh-foot { background: #5f0f40; color: #fff; border-top: 3px solid #e6c978; }

/* 39 Minimal */
[data-head="39"] .lh-head { background: #fff; border-bottom: 1px solid #0f172a; }
[data-head="39"] .co-en { color: #0f172a; }
[data-head="39"] .lh-foot { background: #fff; color: #0f172a; border-top: 1px solid #0f172a; }

/* 40 Official UAE */
[data-head="40"] .lh-head { background: #fff; border-top: 9px solid #00732f; box-shadow: inset 0 13px 0 #111, inset 0 17px 0 #c1121f; padding-top: 13mm; }
[data-head="40"] .co-en { color: #00732f; }
[data-head="40"] .lh-foot { background: #00732f; color: #fff; }

/* SVG waves — closer to ChatGPT stationery mockups */
[data-head="04"] .lh-foot,
[data-head="06"] .lh-foot,
[data-head="08"] .lh-foot {
  clip-path: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  min-height: 22mm;
  color: #fff;
}
[data-head="04"] .lh-foot {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='none'><path fill='%230b4f9a' d='M0,40 C180,110 360,0 600,50 C840,100 1020,10 1200,55 L1200,140 L0,140 Z'/></svg>");
}
[data-head="06"] .lh-foot {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='none'><path fill='%232d6a4f' d='M0,70 C200,10 420,120 700,50 C920,0 1080,90 1200,40 L1200,140 L0,140 Z'/></svg>");
}
[data-head="08"] .lh-foot {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='none'><path fill='%232d6a4f' d='M0,55 C250,120 480,0 760,60 C980,105 1100,20 1200,48 L1200,140 L0,140 Z'/></svg>");
}
