/* ============================================================================
   TEMPLATES CSS — 12 Professional A4 Letterpad Designs
   A4 canvas = 794px × 1123px at 96dpi
   ============================================================================ */

/* ── BASE LETTERPAD STRUCTURE ────────────────────────────────────────────── */

/*
 * The A4 page is a strict flex-column: header → body → footer.
 * The outer wrapper (.lp-doc) fills the page and acts as the flex container.
 * Template 6 (sidebar) overrides this with a grid, handled separately.
 */

.lp-doc {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Header: never grows, never shrinks — fixed zone */
.lp-header {
  flex-shrink: 0;
}

/* Body: grows with content, never clips */
.lp-body {
  flex: 1 0 auto;
}

/* Footer: always after body content */
.lp-footer {
  flex-shrink: 0;
}

/* ── SHARED ELEMENT RESETS ────────────────────────────────────────────────── */

/* Kill browser default margins inside the A4 page */
.lp-header h1,
.lp-header h2,
.lp-header h3,
.lp-header p,
.lp-footer p {
  margin: 0;
}

/* Logo sizing — consistent across all templates */
.lp-header .logo {
  max-width: 110px;
  max-height: 60px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Company name */
.lp-header .company-name {
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Tagline */
.lp-header .tagline {
  margin: 0;
  opacity: 0.75;
  line-height: 1.4;
}

/* Contact block */
.lp-header .contact-info {
  font-size: 11.5px;
  line-height: 1.75;
}
.lp-header .contact-info div { margin: 0; }

/* Footer text */
.lp-footer .footer-text {
  font-size: 11px;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 1 — CORPORATE MINIMAL
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-1 .lp-header {
  padding: 36px 50px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 3px solid var(--primary, #2563eb);
}
.tpl-1 .header-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.tpl-1 .header-right { margin-left: auto; text-align: right; }
.tpl-1 .company-name { font-size: 21px; font-weight: 800; color: #0f172a; }
.tpl-1 .tagline { font-size: 10.5px; color: #64748b; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; }
.tpl-1 .contact-info { color: #475569; }

.tpl-1 .lp-footer {
  padding: 14px 50px;
  border-top: 1px solid #e4e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tpl-1 .footer-text { color: #94a3b8; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 2 — MODERN GRADIENT
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-2 .lp-header {
  background: linear-gradient(135deg, var(--primary, #2563eb) 0%, #4f46e5 100%);
  padding: 34px 50px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
}
.tpl-2 .company-name { font-size: 24px; font-weight: 800; color: #fff; }
.tpl-2 .tagline { color: rgba(255,255,255,0.75); font-size: 11.5px; margin-top: 3px; }
.tpl-2 .contact-info { color: rgba(255,255,255,0.8); margin-top: 6px; }
.tpl-2 .header-text { flex: 1; min-width: 0; }
.tpl-2 .logo { border-radius: 8px; }

.tpl-2 .lp-footer {
  padding: 13px 50px;
  background: #f8fafc;
  border-top: 3px solid var(--primary, #2563eb);
}
.tpl-2 .footer-text { color: #64748b; text-align: center; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 3 — CLASSIC FORMAL
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-3 .lp-header {
  padding: 34px 50px 22px;
  text-align: center;
  border-bottom: 3px double var(--primary, #2563eb);
}
.tpl-3 .logo { margin: 0 auto 10px; }
.tpl-3 .company-name { font-size: 23px; font-weight: 800; color: #0f172a; font-family: Georgia, serif; }
.tpl-3 .tagline { font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: #64748b; margin-top: 4px; }
.tpl-3 .contact-info { margin-top: 9px; color: #475569; }
.tpl-3 .contact-info span { margin: 0 8px; }

.tpl-3 .lp-footer {
  padding: 13px 50px;
  text-align: center;
  border-top: 3px double var(--primary, #2563eb);
}
.tpl-3 .footer-text { color: #64748b; font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 4 — CREATIVE DESIGNER
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-4 .lp-header { padding: 0; }
.tpl-4 .header-top-strip { background: var(--primary, #2563eb); height: 8px; }
.tpl-4 .header-main {
  padding: 26px 50px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #e4e8f0;
}
.tpl-4 .header-accent {
  width: 4px; height: 56px;
  background: var(--primary, #2563eb);
  border-radius: 2px;
  flex-shrink: 0;
}
.tpl-4 .company-name { font-size: 21px; font-weight: 800; color: #0f172a; }
.tpl-4 .tagline { font-size: 10.5px; color: #64748b; margin-top: 3px; }
.tpl-4 .contact-info { color: #475569; margin-top: 7px; }
.tpl-4 .header-right { margin-left: auto; text-align: right; }

.tpl-4 .lp-footer { padding: 12px 50px; background: var(--primary, #2563eb); }
.tpl-4 .footer-text { color: rgba(255,255,255,0.85); text-align: center; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 5 — BOLD HEADER
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-5 .lp-header {
  padding: 36px 50px 28px;
  border-left: 6px solid var(--primary, #2563eb);
}
.tpl-5 .header-row { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.tpl-5 .company-name { font-size: 28px; font-weight: 900; color: var(--primary, #2563eb); letter-spacing: -0.03em; }
.tpl-5 .tagline { font-size: 11px; color: #64748b; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.tpl-5 .contact-info-row { display: flex; gap: 20px; font-size: 11px; color: #64748b; }
.tpl-5 .hr-accent { height: 2px; background: linear-gradient(90deg, var(--primary, #2563eb), transparent); margin-top: 18px; }

.tpl-5 .lp-footer {
  padding: 13px 50px 13px 56px;
  border-top: 2px solid var(--primary, #2563eb);
  border-left: 6px solid var(--primary, #2563eb);
}
.tpl-5 .footer-text { color: #64748b; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 6 — SIDEBAR LAYOUT
   Grid: fixed sidebar | flex-column main area.
   The .lp-doc override below replaces the default flex-col with a grid.
   ══════════════════════════════════════════════════════════════════════════ */

/* Override: sidebar template uses grid instead of flex-col */
.tpl-6.lp-doc {
  display: grid;
  grid-template-columns: 180px 1fr;
  grid-template-rows: 1fr;   /* single row fills the page height */
  height: 100%;
}

/* Sidebar = lp-header zone (repurposed) */
.tpl-6 .lp-header {
  background: var(--primary, #2563eb);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  grid-row: 1;
  /* override shared flex-shrink: 0 so sidebar fills full height */
  flex-shrink: unset;
  height: 100%;
  box-sizing: border-box;
}

.tpl-6 .sidebar-logo { max-width: 80px; margin: 0 auto; border-radius: 8px; }
.tpl-6 .sidebar-company { text-align: center; }
.tpl-6 .company-name { font-size: 14px; font-weight: 800; color: #fff; text-align: center; }
.tpl-6 .tagline { font-size: 10px; color: rgba(255,255,255,0.6); text-align: center; margin-top: 4px; }
.tpl-6 .sidebar-divider { height: 1px; background: rgba(255,255,255,0.2); }
.tpl-6 .sidebar-contact { color: rgba(255,255,255,0.8); font-size: 10px; line-height: 1.8; }
.tpl-6 .sidebar-contact div { margin: 0; }

/* Main content column = lp-body zone */
.tpl-6 .lp-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tpl-6 .main-header {
  padding: 28px 36px 18px;
  border-bottom: 2px solid var(--primary, #2563eb);
  flex-shrink: 0;
}

/* letter-body inside main column */
.tpl-6 .letter-body { padding: 28px 36px; }

/* lp-footer for sidebar = bottom of main area */
.tpl-6 .lp-footer {
  padding: 13px 36px;
  border-top: 1px solid #e4e8f0;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 7 — CENTER LUXURY
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-7 .lp-header {
  padding: 40px 60px 26px;
  text-align: center;
  border-bottom: 1px solid #c0c8d8;
  position: relative;
}
.tpl-7 .lp-header::before {
  content: '';
  position: absolute;
  top: 10px; left: 50px; right: 50px;
  height: 1px;
  background: #c0c8d8;
}
.tpl-7 .logo { margin: 0 auto 12px; }
.tpl-7 .company-name { font-size: 24px; font-weight: 700; color: #0f172a; font-family: Georgia, serif; letter-spacing: 0.04em; }
.tpl-7 .tagline { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #94a3b8; margin-top: 5px; }
.tpl-7 .contact-info { margin-top: 11px; color: #64748b; }
.tpl-7 .contact-info span { margin: 0 10px; }

.tpl-7 .lp-footer { padding: 14px 60px; text-align: center; border-top: 1px solid #c0c8d8; }
.tpl-7 .footer-text { color: #94a3b8; font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 8 — LEGAL STYLE
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-8 .lp-header {
  padding: 30px 50px;
  border-top: 5px solid #1e293b;
  border-bottom: 2px solid #1e293b;
}
.tpl-8 .header-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.tpl-8 .company-name { font-size: 19px; font-weight: 800; color: #0f172a; font-family: Georgia, serif; }
.tpl-8 .tagline { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #64748b; margin-top: 4px; }
.tpl-8 .contact-block { text-align: right; color: #475569; line-height: 1.8; }
.tpl-8 .gst-bar {
  margin-top: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 3px;
  display: inline-block;
}

.tpl-8 .lp-footer { padding: 12px 50px; border-top: 2px solid #1e293b; display: flex; justify-content: space-between; }
.tpl-8 .footer-text { color: #475569; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 9 — TECH STARTUP
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-9 .lp-header {
  background: #0f172a;
  padding: 30px 50px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.tpl-9 .company-name { font-size: 21px; font-weight: 800; color: #fff; }
.tpl-9 .tagline { font-size: 10.5px; color: rgba(255,255,255,0.45); margin-top: 3px; }
.tpl-9 .contact-info { color: rgba(255,255,255,0.55); margin-top: 7px; }
.tpl-9 .header-text { flex: 1; min-width: 0; }

/* accent line sits between header and body — part of the header zone */
.tpl-9 .accent-line {
  height: 3px;
  background: linear-gradient(90deg, var(--primary, #2563eb), #8b5cf6, transparent);
  flex-shrink: 0;
}

.tpl-9 .lp-footer {
  padding: 12px 50px;
  background: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tpl-9 .footer-text { color: rgba(255,255,255,0.4); font-size: 10px; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 10 — ELEGANT SERIF
   Minimal serif with thin gold rule
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-10 .lp-header {
  padding: 40px 60px 28px;
}

.tpl-10 .header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.tpl-10 .company-name { font-size: 24px; font-weight: 700; color: #1a1a2e; font-family: Georgia, serif; letter-spacing: 0.02em; }
.tpl-10 .tagline { font-size: 10px; color: #94a3b8; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 5px; }

.tpl-10 .gold-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--primary, #2563eb), rgba(37,99,235,0.2));
  margin-bottom: 12px;
}

.tpl-10 .contact-info { font-size: 11px; color: #64748b; display: flex; gap: 24px; }

.tpl-10 .lp-footer {
  padding: 16px 60px;
  border-top: 1px solid #e4e8f0;
}
.tpl-10 .footer-text { color: #94a3b8; font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 11 — MINIMALIST LINE
   Ultra minimal with a single hairline
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-11 .lp-header {
  padding: 48px 60px 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #0f172a;
}

.tpl-11 .company-name { font-size: 28px; font-weight: 800; color: #0f172a; letter-spacing: -0.03em; }
.tpl-11 .tagline { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.tpl-11 .contact-right { text-align: right; font-size: 11px; color: #64748b; line-height: 1.8; }

.tpl-11 .logo { margin-bottom: 8px; }

.tpl-11 .lp-footer {
  padding: 14px 60px;
  border-top: 1px solid #0f172a;
  display: flex;
  justify-content: space-between;
}
.tpl-11 .footer-text { color: #94a3b8; }

/* ══════════════════════════════════════════════════════════════════════════
   TEMPLATE 12 — PREMIUM GOLD
   Luxury dark header with gold accents
   ══════════════════════════════════════════════════════════════════════════ */
.tpl-12 .lp-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 36px 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.tpl-12 .lp-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4af37, #ffd700, #d4af37);
}

.tpl-12 .company-name { font-size: 22px; font-weight: 800; color: #ffd700; font-family: Georgia, serif; }
.tpl-12 .tagline { font-size: 11px; color: rgba(255,215,0,0.5); margin-top: 2px; letter-spacing: 0.08em; }
.tpl-12 .contact-info { color: rgba(255,255,255,0.6); font-size: 11px; margin-top: 8px; }
.tpl-12 .header-text { flex: 1; }

.tpl-12 .lp-footer {
  padding: 14px 50px;
  background: #1a1a2e;
  border-top: 2px solid #d4af37;
}
.tpl-12 .footer-text { color: rgba(255,215,0,0.6); text-align: center; }

/* ── TEMPLATE THUMBNAIL PREVIEWS (in sidebar) ─────────────────────────── */
.thumb-tpl-1 { background: #fff; border-top: 4px solid #2563eb; }
.thumb-tpl-2 { background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%); }
.thumb-tpl-3 { background: #fff; border-top: 3px double #2563eb; border-bottom: 3px double #2563eb; }
.thumb-tpl-4 { background: #fff; border-top: 6px solid #2563eb; }
.thumb-tpl-5 { background: #fff; border-left: 6px solid #2563eb; }
.thumb-tpl-6 { background: linear-gradient(90deg, #2563eb 30%, #f8fafc 30%); }
.thumb-tpl-7 { background: #fff; border: 1px solid #c0c8d8; }
.thumb-tpl-8 { background: #fff; border-top: 5px solid #1e293b; }
.thumb-tpl-9 { background: linear-gradient(180deg, #0f172a 35%, #f8fafc 35%); }
.thumb-tpl-10 { background: #fff; }
.thumb-tpl-11 { background: #fff; border-bottom: 2px solid #0f172a; }
.thumb-tpl-12 { background: linear-gradient(180deg, #1a1a2e 35%, #fff 35%); }
