/* Shared mobile treatment for the static App Router lower pages.
   The reference palette and spacing come from home-sp.css. */
@media (max-width: 1023px) {
html[data-page] {
  --pages-ink: #001833;
  --pages-blue: #007cff;
  --pages-pale: #e6f2ff;
  --pages-copy: #4b5f73;
  scroll-padding-top: 80px;
}

html[data-page] body {
  overflow-x: hidden;
  background: #fff;
}

html[data-page] a:focus-visible,
html[data-page] button:focus-visible,
html[data-page] input:focus-visible,
html[data-page] textarea:focus-visible {
  outline: 3px solid var(--pages-blue);
  outline-offset: 3px;
}

/* Shared navigation and footer */
html[data-page] header {
  background: rgb(255 255 255 / 94%) !important;
  box-shadow: 0 1px 0 rgb(0 49 102 / 10%);
  backdrop-filter: blur(12px);
}

html[data-page] header > div {
  min-height: 72px;
  padding: 12px 20px;
}

html[data-page] header a[href="/"] {
  color: var(--pages-ink);
  font-size: 22px;
}

html[data-page] header button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8e7f7;
  border-radius: 14px;
  color: var(--pages-ink);
}

html[data-page] footer {
  border-color: #123962;
  background: linear-gradient(155deg, #001833, #003166 74%, #004a99);
}

html[data-page] footer > div {
  padding: 56px 24px 28px;
}

html[data-page] footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

/* Breadcrumb, opening area, and section rhythm */
html[data-page] main > div:first-child {
  padding-top: 72px;
}

html[data-page] main > div:first-child > div:first-child {
  padding-right: 22px;
  padding-left: 22px;
}

html[data-page] main nav[aria-label="breadcrumb"],
html[data-page] main > div:first-child > div:first-child > nav {
  padding: 17px 0;
}

html[data-page] main nav ol {
  flex-wrap: wrap;
  gap: 5px 8px;
  font-size: 11px;
  line-height: 1.6;
}

html[data-page] main section,
html[data-page="news-article"] main article {
  padding-top: 76px;
  padding-bottom: 78px;
}

html[data-page] main section > div,
html[data-page="news-article"] main article > div {
  padding-right: 22px;
  padding-left: 22px;
}

html[data-page] main > div:first-child > section:first-of-type {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #001833 0, #003166 225px, #f5faff 226px, #fff 410px);
}

html[data-page] main > div:first-child > section:first-of-type::before {
  position: absolute;
  top: 2px;
  right: -126px;
  width: 340px;
  height: 340px;
  border: 1px solid rgb(128 191 255 / 20%);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgb(128 191 255 / 5%), 0 0 0 108px rgb(128 191 255 / 3%);
  content: "";
  pointer-events: none;
}

html[data-page] main > div:first-child > section:first-of-type > div {
  position: relative;
}

html[data-page] main section > div > div:first-child:has(> h1),
html[data-page] main section > div > div:first-child:has(> h2) {
  margin-bottom: 42px;
  text-align: left;
}

html[data-page] main > div:first-child > section:first-of-type > div > div:first-child:has(> h1),
html[data-page] main > div:first-child > section:first-of-type > div > div:first-child:has(> h2) {
  margin-bottom: 86px;
}

html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h1,
html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h2 {
  color: #fff;
  font-size: clamp(34px, 10vw, 43px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h1::after,
html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h2::after {
  display: block;
  width: 52px;
  height: 3px;
  margin-top: 18px;
  background: #67cfff;
  content: "";
}

html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > p {
  margin-top: 16px;
  color: #bddfff;
  font-size: 12px;
  letter-spacing: 0.16em;
}

html[data-page] main section:not(:first-of-type) > div > div:first-child > h2 {
  color: var(--pages-ink);
  font-size: 32px;
  line-height: 1.2;
}

html[data-page] main section:not(:first-of-type) > div > div:first-child > p {
  margin-top: 10px;
  color: var(--pages-blue);
  font-size: 12px;
  letter-spacing: 0.1em;
}

html[data-page] main p,
html[data-page] main li {
  line-height: 1.85;
}

html[data-page] main img {
  max-width: 100%;
  height: auto;
}

html[data-page] main .grid {
  grid-template-columns: minmax(0, 1fr);
}

html[data-page] main .grid > * {
  min-width: 0;
}

html[data-page] main a.rounded-full,
html[data-page] main button.rounded-full {
  min-height: 52px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

/* Company: let the mission breathe, then show facts as stacked records. */
html[data-page="company"] main section:first-of-type .font-handwriting {
  font-size: 16px;
  line-height: 1.9;
}

html[data-page="company"] main section:first-of-type .text-2xl {
  color: var(--pages-ink);
  font-size: 25px;
  line-height: 1.55;
  text-align: left;
}

html[data-page="company"] main section:first-of-type .max-w-3xl {
  text-align: left;
}

html[data-page="company"] main section .grid {
  gap: 18px;
}

html[data-page="company"] main section .grid > div {
  border: 1px solid #dceafb;
  border-radius: 18px;
}

html[data-page="company"] main table,
html[data-page="company"] main tbody,
html[data-page="company"] main tr,
html[data-page="company"] main th,
html[data-page="company"] main td {
  display: block;
  width: 100%;
}

html[data-page="company"] main tr {
  padding: 17px 20px;
  border-bottom: 1px solid #e7eff8;
}

html[data-page="company"] main tr:last-child { border-bottom: 0; }
html[data-page="company"] main th { padding: 0 0 5px; color: #007cff; font-size: 12px; }
html[data-page="company"] main td { padding: 0; color: var(--pages-ink); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }

/* Case cards and detail tabs */
html[data-page^="case"] main .pm-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 34px;
}

html[data-page^="case"] main .pm-tab {
  display: grid;
  min-height: 48px;
  padding: 9px 7px;
  place-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 12px;
}

html[data-page^="case"] main .pm-tab-active {
  background: var(--pages-ink);
  border-color: var(--pages-ink);
}

html[data-page^="case"] main .pm-h2 {
  margin: 55px 0 20px;
  padding-left: 14px;
  border-left-color: var(--pages-blue);
  color: var(--pages-ink);
  font-size: 22px;
  line-height: 1.45;
}

html[data-page^="case"] main .grid > a,
html[data-page^="case"] main .grid > div,
html[data-page^="case"] main .grid > article {
  border: 1px solid #dceafb;
  border-radius: 18px;
  box-shadow: 0 9px 30px rgb(0 49 102 / 7%);
}

html[data-page^="case"] main .grid > a { min-height: 44px; }
html[data-page^="case"] main .grid img { display: block; width: 100%; height: auto; }
html[data-page^="case"] main .pm-stats { gap: 12px; }
html[data-page^="case"] main .pm-faq summary { min-height: 52px; }
html[data-page^="case"] main .pm-faq p { font-size: 14px; }

/* News index: date/category over a legible title. */
html[data-page="news"] main section > div > .max-w-3xl > a {
  position: relative;
  display: flex;
  min-height: 106px;
  padding: 20px 34px 20px 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  border-bottom: 1px solid #e2edf8;
  background: #fff;
}

html[data-page="news"] main section > div > .max-w-3xl > a:first-child { border-radius: 16px 16px 0 0; }
html[data-page="news"] main section > div > .max-w-3xl > a:last-child { border-radius: 0 0 16px 16px; }
html[data-page="news"] main section > div > .max-w-3xl > a::after { position: absolute; right: 15px; top: 50%; color: var(--pages-blue); content: "↗"; transform: translateY(-50%); }
html[data-page="news"] main section > div > .max-w-3xl > a h3 { font-size: 15px; font-weight: 700; line-height: 1.55; }

/* Article body: editorial header, full width media, action links. */
html[data-page="news-article"] main article {
  background: linear-gradient(180deg, #001833 0, #003166 140px, #fff 141px);
}

html[data-page="news-article"] main article > div { max-width: 100%; }
html[data-page="news-article"] main article > div > div { max-width: 100%; }
html[data-page="news-article"] main article .mb-6.flex { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 19px; color: #d7ebff; }
html[data-page="news-article"] main article .mb-6.flex time { color: #d7ebff; }
html[data-page="news-article"] main article .mb-6.flex span {
  background: #d7ebff;
  color: #003166;
  font-weight: 700;
}
html[data-page="news-article"] main article h1 {
  margin-top: 68px;
  margin-bottom: 34px;
  color: var(--pages-ink);
  font-size: 27px;
  line-height: 1.45;
  letter-spacing: -0.025em;
}
html[data-page="news-article"] main article .prose { color: var(--pages-copy); font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
html[data-page="news-article"] main article .prose h2,
html[data-page="news-article"] main article .prose h3 { color: var(--pages-ink); line-height: 1.5; }
html[data-page="news-article"] main article .prose img { display: block; width: 100%; height: auto; border-radius: 12px; }
html[data-page="news-article"] main article .prose a[href$=".pdf"] {
  display: inline-flex;
  min-height: 48px;
  padding: 11px 20px;
  align-items: center;
  border: 1px solid var(--pages-blue);
  border-radius: 999px;
  color: #0057bd;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
html[data-page="news-article"] main article .prose a[href$=".pdf"]::after { margin-left: 12px; content: "↗"; }
html[data-page="news-article"] main article .prose a[href^="https://docs.google.com/forms/"] { min-height: 52px; }

#pages-sp-apply { display: none; }
html[data-page="news-article"] #pages-sp-apply {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: block;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgb(0 24 51 / 96%);
  box-shadow: 0 -9px 25px rgb(0 24 51 / 18%);
}
html[data-page="news-article"] #pages-sp-apply a {
  display: grid;
  min-height: 54px;
  place-items: center;
  border-radius: 999px;
  background: var(--pages-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
html[data-page="news-article"] body:has(#pages-sp-apply) { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* Contact */
html[data-page="contact"] main form { display: grid; gap: 22px; }
html[data-page="contact"] main form > div { margin: 0; }
html[data-page="contact"] main form .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}
html[data-page="contact"] main form .grid > * {
  width: 100%;
  opacity: 1;
  transform: none;
  visibility: visible;
}
html[data-page="contact"] main form input,
html[data-page="contact"] main form textarea,
html[data-page="contact"] main form select {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.5;
}
html[data-page="contact"] main form textarea { min-height: 160px; }
html[data-page="contact"] main form label { margin-bottom: 8px; color: var(--pages-ink); font-size: 14px; font-weight: 700; }
html[data-page="contact"] main form button[type="submit"] { width: 100%; min-height: 56px; font-size: 16px; font-weight: 700; }
html[data-page="contact"] main section > div > .max-w-2xl.rounded-2xl { padding: 25px 20px; border: 1px solid #dceafb; box-shadow: 0 12px 38px rgb(0 49 102 / 8%); }

@media (max-width: 389px) {
  html[data-page] main section > div,
  html[data-page="news-article"] main article > div { padding-right: 18px; padding-left: 18px; }
  html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h1,
  html[data-page] main > div:first-child > section:first-of-type > div > div:first-child > h2 { font-size: 33px; }
}
}

/* Keep the former h2 size from paimen-hotfix.css on the four promoted heroes. */
@media (max-width: 640px) {
  html:is([data-page="company"], [data-page="case"], [data-page="news"], [data-page="contact"])
  main > div:first-child > section:first-of-type > div > div:first-child > h1 {
    font-size: 2rem !important;
  }
}
