/*
Theme Name: EpharmaSoul
Theme URI: https://epharmasoul.com
Author: EpharmaSoul
Description: Custom theme for EpharmaSoul - powering pharma flow. Converted from the static HTML redesign, with working registration and contact forms.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: epharmasoul
*/

/* EpharmaSoul — design system
   Colours are taken from the logo: royal blue + leaf green on a cool white. */
:root {
  --ink: #0c1e45;
  --blue: #0a3aa8;
  --blue-d: #082c80;
  --green: #4ea617;
  --green-d: #3a8210;
  --mist: #f2f6fb;
  --tint: #eaf4e2;
  --line: #dce4f0;
  --muted: #4b5977;
  --white: #fff;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --wrap: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--muted);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-d); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family:inherit;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 62ch; }

.container { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 60px) 0; }
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--muted); max-width: 42ch; }

/* ---------- Buttons ---------- */
.btn-ep {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font: 600 1rem/1 var(--font-body);
  border: 2px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn-ep:hover { transform: translateY(-2px); }
.btn-ep.primary { background: var(--blue); color: #fff; }
.btn-ep.primary:hover { background: var(--blue-d); color: #fff; }
.btn-ep.ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ep.ghost:hover { background: var(--ink); color: #fff; }
.btn-ep.green { background: var(--green); color: #07210a; }
.btn-ep.green:hover { background: #5fbd22; color: #07210a; }
.btn-ep.light { background: #fff; color: var(--ink); }
.btn-ep.light:hover { background: var(--tint); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 78px; }
.logo img { height: 30px; width: auto; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 44px; height: 44px; font-size: 1.5rem; color: var(--ink); cursor: pointer;
}
.nav { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav > li { position: relative; }
.nav a.nav-link, .nav button.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: 0; background: none; cursor: pointer;
  font: 600 1rem var(--font-body); color: var(--ink);
  position: relative;
}
.nav a.nav-link::after, .nav button.nav-link::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 2px; height: 3px;
  background: var(--green); border-radius: 3px; transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.nav a.nav-link:hover::after, .nav a.nav-link.active::after,
.nav button.nav-link:hover::after, .nav button.nav-link.active::after { transform: scaleX(1); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 18px 40px -12px rgba(12,30,69,.25);
  list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.nav > li:hover > .menu, .nav > li:focus-within > .menu, .menu.open { opacity: 1; visibility: visible; transform: none; }
.menu a { display: block; padding: 11px 14px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.menu a small { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
.menu a:hover { background: var(--mist); }

/* ---------- Home hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--mist), #fff 85%);
}
.hero::before { /* echo of the swoosh in the logo banner */
  content: ""; position: absolute; right: -8%; top: -30%; width: 62%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(10,58,168,.16), rgba(78,166,23,.12) 55%, transparent 70%);
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center;
  padding: clamp(38px, 2vw, 80px) 0 clamp(54px, 3vw, 90px);
}
.hero h1 { margin-bottom: .45em; max-width: 13ch; }
.hero .lede { margin-bottom: 2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art { position: relative; }
.hero-art::before {
  content: ""; position: absolute; inset: 7% -5% -6% 9%;
  background: linear-gradient(150deg, var(--blue), var(--green));
  border-radius: 190px 18px 18px 18px; transform: rotate(3deg); opacity: .95;
}
.hero-art img {
  position: relative; width: 100%; aspect-ratio: 5 / 5.4; object-fit: cover; object-position: 38% 30%;
  border-radius: 190px 18px 18px 18px; box-shadow: 0 30px 60px -28px rgba(12,30,69,.55);
}
.scan-card {
  position: absolute; left: -34px; bottom: 34px; display: flex; gap: 14px; align-items: center;
  background: #fff; padding: 14px 18px 14px 14px; border-radius: 16px;
  box-shadow: 0 20px 44px -14px rgba(12,30,69,.4);
}
.scan-card svg { width: 54px; height: 54px; flex: none; }
.scan-card b { display: block; color: var(--ink); font: 700 1rem var(--font-display); }
.scan-card span { font-size: .88rem; color: var(--green-d); font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* ---------- Supply chain strip ---------- */
.chain-head { max-width: 720px; margin-bottom: 56px; }
.chain { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; list-style: none; margin: 0; padding: 0; }
.chain::before, .chain::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 3px; border-radius: 3px;
}
.chain::before { background: var(--line); }
.chain::after { background: linear-gradient(90deg, var(--blue), var(--green)); transform-origin: left; transform: scaleX(var(--draw, 1)); transition: transform 1.6s cubic-bezier(.6,.1,.2,1); }
.js .chain { --draw: 0; }
.js .chain.in { --draw: 1; }
.chain li { position: relative; padding-top: 48px; z-index: 1; }
.chain li::before {
  content: ""; position: absolute; top: 0; left: 0; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 8px solid var(--blue);
}
.chain li:nth-child(2)::before { border-color: #2b6f8c; }
.chain li:nth-child(3)::before { border-color: #3d8a56; }
.chain li:nth-child(4)::before { border-color: var(--green); }
.chain h3 { margin-bottom: .35em; }
.chain p { font-size: 1rem; }

/* ---------- Features ---------- */
.features { background: var(--mist); }
.features-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 7vw, 96px); align-items: start; }
.features-side { position: sticky; top: 120px; }
.features-side img { margin-top: 36px; border-radius: 4px 90px 4px 4px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.feature { display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding: 28px 0; border-top: 1px solid var(--line); }
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature i { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: #fff; color: var(--blue); font-size: 1.4rem; box-shadow: inset 0 0 0 1px var(--line); }
.feature:nth-child(even) i { color: var(--green-d); }
.feature h3 { margin-bottom: .25em; }
.feature p { margin: 0; }

/* ---------- Join ---------- */
.join { background: var(--ink); color: #c4cfe6; }
.join h2 { color: #fff; }
.join .lede { color: #c4cfe6; }
.join-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 56px; border-top: 1px solid rgba(255,255,255,.18); }
.join-link { display: flex; flex-direction: column; gap: 10px; padding: 32px 32px 36px 0; color: #c4cfe6; border-right: 1px solid rgba(255,255,255,.18); transition: background .25s; }
.join-link + .join-link { padding-left: 32px; }
.join-link:last-child { border-right: 0; }
.join-link h3 { color: #fff; display: flex; justify-content: space-between; align-items: center; margin: 0; }
.join-link i { color: var(--green); font-size: 1.5rem; transition: transform .25s; }
.join-link:hover { color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.05), transparent); }
.join-link:hover i { transform: translateX(6px); }
.join-link p { margin: 0; }

/* ---------- About teaser / About page ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 96px); align-items: center; }
.split img { border-radius: 90px 4px 4px 4px; width: 100%; aspect-ratio: 5/4.4; object-fit: cover; }
.split.flip img { border-radius: 4px 4px 90px 4px; }

.cta-band { background: var(--tint); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-inner h2 { margin: 0; max-width: 18ch; }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: linear-gradient(180deg, var(--mist), #fff); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; right: -6%; top: -60%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(78,166,23,.16), transparent 68%); }
.page-head .container { position: relative; padding: clamp(30px, 6vw, 30px) 0 clamp(36px, 5vw, 30px); z-index: 1; }
.page-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin-bottom: .3em; }
.page-head p { font-size: 1.15rem; margin: 0; }
.crumbs { display: flex; gap: 8px; font-size: .92rem; margin-bottom: 18px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }

/* ---------- Services page ---------- */
.service-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.flow-figure { position: sticky; top: 110px; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: 0 24px 50px -30px rgba(12,30,69,.35); }
.flow-figure img { width: 100%; border-radius: 12px; }
.flow-figure figcaption { padding: 14px 8px 4px; font-size: .95rem; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li { padding: 24px 0; border-top: 1px solid var(--line); }
.service-list li:last-child { border-bottom: 1px solid var(--line); }
.service-list h3 { font-size: 1.2rem; margin-bottom: .3em; }
.service-list p { margin: 0; }

/* ---------- About page ---------- */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 64px; border-top: 1px solid var(--line); }
.promises div { padding: 28px 28px 0 0; }
.promises div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.promises i { color: var(--green-d); font-size: 1.6rem; }
.promises h3 { margin: 10px 0 .3em; }
.promises p { margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-items { display: grid; gap: 28px; margin: 32px 0; }
.contact-item { display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start; }
.contact-item i { width: 52px; height: 52px; display: grid; place-items: center; background: var(--mist); color: var(--blue); border-radius: 14px; font-size: 1.3rem; }
.contact-item h3 { font-size: 1.1rem; margin: 2px 0 2px; }
.contact-item p { margin: 0; }
.map-frame { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.map-frame iframe { display: block; width: 100%; height: 240px; border: 0; }

/* ---------- Forms (shared) ---------- */
.form-section { background: var(--mist); padding: clamp(36px, 5vw, 64px) 0 clamp(64px, 8vw, 110px); }
.form-wrap { width: min(920px, 100% - 48px); margin-inline: auto; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 60px -40px rgba(12,30,69,.45); overflow: hidden; }
.form-header { display: flex; gap: 18px; align-items: center; padding: 28px 36px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, #fff, var(--mist)); }
.form-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 1.5rem; flex: none; }
.form-header h1, .form-header h2 { font-size: 1.6rem; margin: 0 0 2px; letter-spacing: -0.02em; }
.form-header p { margin: 0; font-size: .98rem; }
.form-body { padding: 32px 36px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.field > label, .field label.lbl { font-weight: 600; font-size: .93rem; color: var(--ink); }
.required { color: #c0392b; }
.hint { font-size: .85rem; margin: 0; color: var(--muted); }
.input-wrap, .textarea-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 14px; color: #7f8db0; font-size: 1.05rem; pointer-events: none; display: flex; }
.input-wrap .input-icon { top: 50%; transform: translateY(-50%); }
.form-card input:not([type=file]):not([type=checkbox]), .form-card select, .form-card textarea {
  width: 100%; font: 500 1rem var(--font-body); color: var(--ink);
  padding: 13px 14px 13px 42px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s;
}
.form-card select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%234b5977' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center; padding-right: 40px; }
.form-card textarea { min-height: 96px; resize: vertical; }
.form-card ::placeholder { color: #93a0bf; font-weight: 400; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10,58,168,.12); }
.form-card input:user-invalid, .form-card textarea:user-invalid, .form-card select:user-invalid { border-color: #c0392b; }
.upload-container { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 124px; border: 2px dashed #b9c6e2; border-radius: 14px; background: var(--mist); cursor: pointer; text-align: center; transition: .2s; padding: 16px; }
.upload-container:hover, .upload-container:focus-within { border-color: var(--blue); background: #eaf0fb; }
.upload-container .input-icon { position: static; font-size: 1.6rem; color: var(--blue); }
.upload-container p { margin: 0; font-size: .95rem; }
.upload-container input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.preview-box { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 124px; border: 1.5px solid var(--line); border-radius: 14px; color: var(--muted); overflow: hidden; background: #fff; }
.preview-box .input-icon { position: static; }
.preview-box img { max-height: 110px; object-fit: contain; }
.form-footer, .buttons { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px 36px 32px; }
.form-card .btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 999px; font: 600 1rem var(--font-body); border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: .2s; line-height: 1.2; }
.form-card .btn:hover { border-color: var(--ink); }
.form-card .btn-primary, .form-card .btn-save { background: var(--blue); border-color: var(--blue); color: #fff; }
.form-card .btn-primary:hover, .form-card .btn-save:hover { background: var(--blue-d); border-color: var(--blue-d); }
.form-status { margin: 0 36px 28px; padding: 14px 18px; border-radius: 12px; background: var(--tint); color: #1d4d08; font-weight: 600; display: none; }
.form-status.show { display: block; }
.contact-form-card .form-body { padding-top: 32px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #b3c0dd; padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 48px; padding-bottom: 56px; }
.wordmark { font-size: 31px; color:#fff; letter-spacing: -0.03em;}
.wordmark span { color: #7ccf3e; }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1em; letter-spacing: 0; }
.footer p { margin-bottom: .5em; }
.footer a { color: #b3c0dd; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-contact li { display: flex; gap: 12px; }
.footer-contact i { color: #7ccf3e; margin-top: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding: 22px 0; font-size: .92rem; }

#topBtn { position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1.3rem; display: none; place-items: center; cursor: pointer; box-shadow: 0 10px 24px -8px rgba(10,58,168,.6); z-index: 40; }
#topBtn.show { display: grid; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #fff; padding: 12px 24px 24px; border-bottom: 1px solid var(--line); box-shadow: 0 24px 30px -20px rgba(12,30,69,.3); }
  .nav.open { display: flex; }
  .nav a.nav-link, .nav button.nav-link { padding: 14px 0; justify-content: space-between; width: 100%; }
  .nav a.nav-link::after, .nav button.nav-link::after { left: 0; right: auto; width: 36px; }
  .menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 12px; display: none; }
  .menu.open { display: block; }
  .nav > li:hover > .menu { display: none; }
  .nav > li:hover > .menu.open { display: block; }
  .hero-grid, .features-grid, .split, .service-layout, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { max-width: 520px; margin: 0 auto 20px; width: 100%; }
  .scan-card { left: 8px; }
  .features-side, .flow-figure { position: static; }
  .chain { grid-template-columns: 1fr; gap: 0; }
  .chain::before, .chain::after { left: 14px; right: auto; top: 14px; bottom: 14px; width: 3px; height: auto; }
  .chain::after { transform-origin: top; transform: scaleY(var(--draw, 1)); }
  .chain li { padding: 0 0 36px 56px; }
  .join-grid { grid-template-columns: 1fr; }
  .join-link, .join-link + .join-link { padding: 26px 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.18); }
  .promises { grid-template-columns: 1fr; }
  .promises div, .promises div + div { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container, .form-wrap { width: calc(100% - 32px); }
  .form-grid, .three-col { grid-template-columns: 1fr; }
  .form-header, .form-body, .form-footer, .buttons { padding-left: 20px; padding-right: 20px; }
  .form-status { margin-inline: 20px; }
  .hero-art img { border-radius: 110px 14px 14px 14px; }
  .hero-art::before { border-radius: 110px 14px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .chain { --draw: 1; }
}

/* ---------- WordPress additions ---------- */
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal; }
.screen-reader-text:focus { background: #fff; clip: auto; clip-path: none; color: var(--ink); display: block; height: auto; left: 8px; top: 8px; padding: 12px 18px; width: auto; z-index: 100000; }
.ep-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status.show { display: block; margin-top: 24px; }
.form-status.error { background: #fdecea; color: #8a1c13; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.entry { max-width: 780px; }
.entry img { max-width: 100%; height: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: .9rem; color: var(--muted); }
