/*
Theme Name: License Lookup
Description: A private license lookup with manually managed holder profiles, institute and category directories, and support for existing scans.
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 7.4
Author: ZH Consultancy
License: GNU General Public License v2 or later
Text Domain: license-lookup
*/
@font-face {
  font-family: "Lookup Jost";
  src: url("assets/jost.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #142d59;
  --navy-dark: #191e41;
  --ink: #202933;
  --muted: #55616d;
  --line: #a9b5bf;
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: #dce6e9;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
.lookup-scene {
  height: calc(100vh - var(--lookup-toolbar-height, 0px));
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: clamp(1rem, 3vmin, 3rem);
  --lookup-background: url("assets/airliner-clouds.webp");
  background: #e6f1fb var(--lookup-background) center center / cover no-repeat;
}
@supports (height: 100dvh) {
  .lookup-scene { height: calc(100dvh - var(--lookup-toolbar-height, 0px)); }
}
.lookup-card {
  width: min(100%, 32rem);
  background: white;
  border: 1px solid rgba(18, 47, 76, .23);
  border-radius: .32rem;
  max-height: 100%;
  overflow: auto;
  box-shadow: 0 1.2rem 3.4rem rgba(25,48,74,.17), 0 2px 6px rgba(25,48,74,.12);
}
.lookup-masthead {
  display: flex;
  align-items: center;
  padding: 1.15rem 1.55rem;
  color: #fff;
  background: linear-gradient(110deg, #10264b, #183865);
  border-bottom: 2px solid #aec6d8;
}
.lookup-emblem {
  flex: 0 0 auto;
  width: clamp(3.1rem, 11vw, 4.3rem);
  margin-right: clamp(.75rem, 2vw, 1rem);
  height: auto;
  color: white;
}
.lookup-custom-logo { width: auto; max-width: 4.3rem; max-height: 3.5rem; object-fit: contain; }
.lookup-heading { flex: 1; min-width: 0; text-align: right; }
.lookup-heading h1 {
  margin: 0;
  color: #fff;
  font: 450 clamp(1.14rem, 3.65vw, 1.47rem)/1.15 "Lookup Jost", sans-serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lookup-heading p {
  margin: .32rem 0 0;
  color: #f6e2ad;
  font: 450 clamp(.79rem, 2.65vw, .93rem)/1.3 "Lookup Jost", sans-serif;
}
.lookup-form { padding: 1.25rem 1.75rem 1.4rem; }
.lookup-intro { font-size: .96rem; line-height: 1.5; margin: 0 0 1.1rem; }
.lookup-field + .lookup-field { margin-top: .95rem; }
.lookup-field label { display: block; font-size: .95rem; line-height: 1.4; font-weight: 600; margin-bottom: .42rem; }
.lookup-field input {
  display: block;
  width: 100%;
  min-height: 2.9rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--ink);
  background: white;
  font-size: 1rem;
  line-height: 1.4;
}
.lookup-field input::placeholder { color: #667480; opacity: 1; }
.lookup-hint { margin: .4rem 0 0; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.lookup-field input:focus-visible, .lookup-submit:focus-visible, .lookup-close:focus-visible {
  outline: 3px solid #4a7da6;
  outline-offset: 2px;
}
.lookup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem 1rem;
  border-top: 1px solid #dce2e6;
  margin-top: 1.6rem;
  padding-top: 1.12rem;
}
.lookup-submit {
  appearance: none;
  min-height: 2.8rem;
  padding: .58rem 1.45rem;
  border: 1px solid var(--navy-dark);
  border-radius: .55rem;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.lookup-submit:hover { background: var(--navy-dark); }
.lookup-submit:disabled { opacity: .7; cursor: progress; }
.lookup-message { margin: .95rem 0 0; line-height: 1.45; color: #803430; }
.lookup-message:empty { margin: 0; }
.lookup-challenge-image {
  display: block;
  width: 8.75rem;
  height: 2.8rem;
  margin: .25rem 0 .5rem;
  border: 1px solid #c0d1c2;
  border-radius: .3rem;
  background: #eff5ee;
}
.lookup-message[data-valid] { color: #285238; }
.lookup-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lookup-dialog:not([open]) { display: none; }
.lookup-dialog[open] { display: grid; place-items: center; }
.lookup-dialog::backdrop { background: rgba(14, 27, 44, .91); }
.lookup-dialog img {
  display: block;
  max-width: calc(100% - 2.5rem);
  max-height: calc(100% - 7.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 .6rem 3rem #08121c80;
}
.lookup-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid #d1d9e2;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font: 400 1.8rem/1 Arial,sans-serif;
  cursor: pointer;
}
html:has(.lookup-dialog[open]) { overflow: hidden; }
.lookup-content { width: min(100% - 2rem, 52rem); margin: 3rem auto; padding: 2rem; background: white; line-height: 1.6; }
.lookup-content img { max-width: 100%; height: auto; }
.lookup-content a { color: var(--navy); }
body.admin-bar { --lookup-toolbar-height: 32px; }
@media (max-width: 782px) {
  body.admin-bar { --lookup-toolbar-height: 46px; }
}
@media (max-aspect-ratio: 1/1) {
  .lookup-scene {
    position: relative;
    isolation: isolate;
    background-position: center bottom;
    background-size: auto 400%;
  }
  .lookup-scene::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 31%;
    background: var(--lookup-background) right top / cover no-repeat;
    -webkit-mask-image: linear-gradient(#000 77%, transparent);
    mask-image: linear-gradient(#000 77%, transparent);
    pointer-events: none;
  }
}
@media (max-width: 36rem) {
  .lookup-masthead { padding: 1rem; }
  .lookup-dialog img { max-width: calc(100% - 1rem); }
  .lookup-form { padding: 1.4rem 1.3rem 1.5rem; }

}
@media (max-width: 23rem) {
  .lookup-actions { justify-content: stretch; }
  .lookup-submit { flex: 1 0 100%; }
}

/* Desktop proportions follow the approved License Details artwork. */
.lookup-scene [hidden] { display: none !important; }
.lookup-scene.showing-record {
  --card-width: min(61.6vw, 64.4rem);
  min-height: calc(100vh - var(--lookup-toolbar-height, 0px));
  min-height: calc(100dvh - var(--lookup-toolbar-height, 0px));
  height: auto;
  grid-template: minmax(2rem, 1fr) auto minmax(2rem, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 0 1rem;
  background: #e6f1fb var(--lookup-background) center center / cover no-repeat;
}
.lookup-scene.showing-record::before { content: none; }
.license-result {
  grid-area: 2 / 1;
  font-family: Arial, "Helvetica Neue", sans-serif;
  width: var(--card-width);
  max-width: 100%;
  color: #102347;
  background: #fff;
  border: 1px solid #b2c0d0;
  border-radius: clamp(9px, .8vw, 14px);
  overflow: hidden;
  container-type: inline-size;
}
.result-masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.55em 2.95%; color: white; background: #102747;
  font-size: clamp(11px, 1.15cqw, 14px);
}
.result-brand { display: flex; align-items: center; font-size: clamp(24px,4.15cqw,44px); line-height: 1; font-weight: 700; }
.result-brand svg, .result-logo { width: 1.52em; height: 1em; object-fit: contain; }
.result-brand span { margin-left: .34em; padding-left: .36em; border-left: 1px solid #c1cad5; }
.result-heading { text-align: right; line-height: 1.25; }
.result-heading strong { display: block; font-size: clamp(15px,2.32cqw,25px); }
.result-heading span { display: block; margin-top: .18em; color: #ffdf81; font-size: clamp(12px,2.03cqw,21px); font-weight: 600; }
.result-content { padding: 2.55% 2.95% 2.8%; }
.result-content h2 { margin: 0 0 3.6%; font-size: clamp(25px,3.82cqw,40px); letter-spacing: -.035em; line-height: 1.14; }
.result-identity { display: grid; grid-template-columns: 29.5% minmax(0,1fr); gap: 4.4%; align-items: start; }
.result-portrait { width: 100%; aspect-ratio: 35/45; object-fit: cover; object-position: center 30%; background: #e4eaf0; border: 1px solid #a5b4c6; border-radius: 3px; }
.result-fields { margin: -.9% 0 0; }
.result-fields > div { display: grid; grid-template-columns: 36% minmax(0,1fr); gap: 2%; align-items: center; min-height: 5.31cqw; padding: .43em 0; border-bottom: 1px solid #cbd3df; font-size: clamp(16px,2.38cqw,25px); }
.result-fields > div:first-child { padding-top: .15em; min-height: 4.75cqw; }
.result-fields dt { font-size: .79em; font-weight: 700; color: #545d70; text-transform: uppercase; }
.result-fields dd { margin: 0; font-weight: 700; line-height: 1.23; letter-spacing: -.035em; overflow-wrap: anywhere; }
.result-status { display: flex; align-items: flex-start; gap: 2.35%; margin-top: 4%; padding: 2.15% 2.7%; background: #e3f8e5; border-radius: 9px; color: #167316; }
.result-status svg { width: 4.55cqw; flex: none; margin-top: .1em; }
.result-status strong { font-size: clamp(24px,3.75cqw,40px); line-height: 1.05; }
.result-status p { margin: .32em 0 0; font-size: clamp(15px,2.12cqw,22px); line-height: 1.35; color: #142940; }
.result-return { grid-area: 3 / 1; place-self: start; margin: .25rem 0 0 max(0px, calc((100% - var(--card-width)) / 2)); min-height: 1.75rem; border: 0; border-radius: 4px; background: #fffffff0; padding: .25rem .65rem; font-size: .86rem; color: #183759; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
@media (max-width: 62rem) {
  .lookup-scene.showing-record { --card-width: min(86vw, 48rem); }
}
@media (max-width: 42rem) {
  .lookup-scene.showing-record { --card-width: 100%; padding-inline: .8rem; background-position: right center; }
  .result-masthead { padding: .9rem; gap: .65rem; }
  .result-brand { font-size: 21px; }
  .result-content { padding: 1rem; }
  .result-content h2 { margin-bottom: 1rem; }
  .result-identity { grid-template-columns: minmax(0,1fr); gap: .8rem; }
  .result-portrait { width: 6.25rem; }
  .result-fields { margin: 0; }
  .result-fields > div, .result-fields > div:first-child { min-height: 2.65rem; padding: .52rem 0; grid-template-columns: 38% minmax(0,1fr); }
  .result-status { margin-top: 1rem; padding: .85rem; gap: .7rem; }
  .result-status svg { width: 1.8rem; }
}
