/* Vector Aviation Maintenance
   Values here (colours, sizes, spacing) were measured off the original site so
   the rebuild lands on the same design, not an approximation of it. */

/* Variable font, latin subset only: one 43 KB file covers 400/500/700.
   swap so text paints immediately in Arial and reflows when the font lands. */
@font-face {
  font-family: "Open Sans";
  src: url("/static/fonts/opensans-latin-var.woff2?v=441af0def989") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold: #fbad18;
  --teal: #013c4a;
  --blue: #236788;   /* the logo's blue */
  --grey: #666;

  --font: "Open Sans", Arial, Helvetica, sans-serif;

  --header-h: 84px;
  --header-h-scrolled: 74px;
  --container: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The header is fixed, so an anchor jump would otherwise land underneath it. */
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font: 400 14px/1.7 var(--font);
  color: var(--grey);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--gold); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Honeypot. display:none is the one thing that stops some bots filling it, so
   move it out of view instead. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- header --------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
  padding: 0 34px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .1);
  transition: height .4s ease, box-shadow .4s ease;
}

/* Set by site.js once the page scrolls; matches the original's shrink. */
.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  box-shadow: 0 0 7px rgba(0, 0, 0, .1);
}

.site-header__logo { display: flex; }

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header__link {
  /* The shop's main call to action, so it leads the header: a step larger
     and heavier than the phone number beside it. */
  font-size: 20px;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.site-header__link:hover { color: var(--gold); }

.site-header__logo img {
  width: 258px;
  height: 50px;
  transition: width .4s ease, height .4s ease;
}

.site-header.is-scrolled .site-header__logo img {
  width: 227px;
  height: 44px;
}

/* The original put a hamburger here that opened a menu containing one link
   back to the page you were already on. This is the useful thing to put in
   that space instead. */
.site-header__phone {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.site-header__phone:hover { color: var(--gold); }

/* --- hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
  padding: 60px 20px;
  text-align: center;
  overflow: hidden;
}

/* The photo lives on its own layer rather than on .hero so the fixed
   attachment is not affected by the overlay or by overflow on the section. */
.hero__bg {
  position: absolute;
  inset: 0;
  background-position: 50% 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;

  /* Two declarations, in this order, on purpose: a browser that does not
     understand image-set() drops the second and keeps the JPEG. AVIF is a
     quarter of the size at a quality difference you cannot see here. */
  background-image: url("/static/img/hero.jpg?v=69e25de6b67c");
  background-image: image-set(
    url("/static/img/hero.avif?v=0146dd685bd3") type("image/avif"),
    url("/static/img/hero.jpg?v=69e25de6b67c") type("image/jpeg"));
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .29);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero__title {
  margin: 0;
  padding-bottom: 10px;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 1.4px 1.4px 2.8px rgba(0, 0, 0, .8);
}

.hero__sub {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;   /* the original crams this to 0.8; 1.1 is as tight as it goes without clipping descenders when it wraps */
  color: #fff;
  text-shadow: 1.4px 1.4px 2.8px rgba(0, 0, 0, .8);
}

.hero__inner p:last-child { margin: 20px 0 0; }

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 6px 20px;
  border: 2px solid var(--gold);
  border-radius: 3px;
  background: transparent;
  color: var(--gold);
  font: 500 20px/1.7 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--gold);
  color: #fff;
}

.btn[disabled] { opacity: .5; cursor: default; }

/* --- contact -------------------------------------------------------------- */

.contact {
  padding: 81px 0;   /* 54px section + 27px row on the original */
  background: var(--teal);
  color: #fff;
  text-align: center;
}

.contact__heading {
  margin: 0 0 30px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.contact__icon {
  display: block;
  width: 90px;
  height: 94px;
  margin: 0 auto 24px;
}

.contact__phone {
  margin: 0 0 30px;
  font-size: 28px;
  line-height: 1.3;
}

.contact__phone a {
  color: #fff;
  text-decoration: none;
  transition: color .2s ease;
}
.contact__phone a:hover { color: var(--gold); }

/* --- form ----------------------------------------------------------------- */

.contact-form { text-align: left; }

.contact-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 33px;
}

.field--full { grid-column: 1 / -1; }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 1px;
  /* Same colour as the section: the gold rule is the only thing drawing the
     box, which is what gives the original form its flat look. */
  background: var(--teal);
  color: #fff;
  font: 400 14px/1.7 var(--font);
}

.contact-form textarea {
  height: 150px;
  resize: vertical;
}

.contact-form ::placeholder {
  color: #fff;
  opacity: .9;
  font-weight: 700;
}

.contact-form [aria-invalid="true"] { border-color: #ff8a7a; }

.field__error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #ffb3a7;
}

.contact-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 33px;
}

.notice {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: 3px;
  font-size: 15px;
  text-align: left;
}

.notice--ok {
  border: 1px solid var(--gold);
  color: #fff;
  background: rgba(251, 173, 24, .12);
}

.notice--error {
  border: 1px solid #ff8a7a;
  color: #ffd7d0;
  background: rgba(255, 138, 122, .12);
}

/* --- footer --------------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  /* Centred, not space-between: the footer held a social link on the right
     until that page was taken down, and one child in a space-between row
     just sits hard left. */
  justify-content: center;
  gap: 20px;
  padding: 20px 34px;
  background: var(--teal);
  border-top: 1px solid rgba(255, 255, 255, .1);
  /* The original uses the body grey (#666) here, which lands at about 2.2:1
     against the teal — legible on the designer's monitor and nowhere else.
     This keeps the same recessive look at a contrast you can actually read. */
  color: rgba(255, 255, 255, .55);
  font-size: 14px;
}

.site-footer__copy { margin: 0; }

/* --- 404 ------------------------------------------------------------------ */

.error-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 60px);
  margin-top: var(--header-h);
  padding: 60px 0;
  background: var(--teal);
  color: #fff;
  text-align: center;
}

.error-panel__code {
  margin: 0;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}

.error-panel__msg {
  margin: 12px 0 24px;
  font-size: 24px;
  color: #fff;
}

/* --- marketplace ---------------------------------------------------------- */

/* The header is fixed, so every page without a hero has to reserve its height
   itself. The home page does this on .hero instead. */
.page-plain {
  padding-top: var(--header-h);
  /* Short pages — an empty listing, the login box — would otherwise leave the
     footer floating in the middle of the viewport. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-plain main { flex: 1 0 auto; }
.page-admin { padding-top: 0; }

.admin-foot {
  padding: 16px 26px;
  border-top: 1px solid #e6e6e6;
  color: var(--grey);
  font-size: 13px;
}

.listing,
.part { padding: 54px 0 81px; }

.listing__heading,
.part__title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--teal);
}

.listing__intro,
.listing__empty {
  max-width: 60ch;
  margin: 0 0 36px;
  color: var(--grey);
}

.listing__empty a { color: var(--blue); }

.cards {
  display: grid;
  /* auto-fill rather than auto-fit: with two items on a wide screen, auto-fit
     would stretch them across the full width and they would read as banners
     rather than as cards. */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.card:hover,
.card:focus-within {
  border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__photo {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: #f4f4f4;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 18px;
}

/* Pushes the price to the bottom so a one-line and a two-line title still
   line their prices up across a row. */
.card__price { margin-top: auto; }

.card__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--teal);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--grey);
}

.card__condition {
  padding: 1px 9px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
}

/* Filled rather than outlined, so the two pills on a card read as different
   attributes without needing a visible label for each. */
.card__location {
  padding: 1px 9px;
  border-radius: 999px;
  background: #eef4f5;
  color: var(--teal);
}

.card__price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
}

/* --- one part ------------------------------------------------------------- */

.part__back { margin: 0 0 24px; }
.part__back a {
  color: var(--blue);
  text-decoration: none;
  font-size: 15px;
}
.part__back a:hover { text-decoration: underline; }

.part__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.part__photos {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.part__photo {
  width: 100%;
  height: auto;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  background: #f4f4f4;
}

.part__spec {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0 0 18px;
  font-size: 15px;
}

.part__spec dt { color: var(--grey); }

.part__spec dd {
  margin: 0;
  font-weight: 600;
  color: var(--teal);
}

.part__price {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
}

.part__desc {
  margin-bottom: 34px;
  line-height: 1.75;
  color: #333;
}

.part__enquire {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--teal);
}

.part__enquire-sub {
  margin: 0 0 20px;
  color: var(--grey);
}
.part__enquire-sub a { color: var(--blue); }

/* The contact form's own styling assumes the teal section it normally sits in.
   On a light page the same markup needs the inverse. */
.page-plain .contact-form__grid { gap: 20px; }

.page-plain .contact-form input[type="text"],
.page-plain .contact-form input[type="email"],
.page-plain .contact-form textarea {
  border-color: #ccc;
  background: #fff;
  color: #222;
}

.page-plain .contact-form ::placeholder { color: #999; }

.page-plain .contact-form input:focus-visible,
.page-plain .contact-form textarea:focus-visible { border-color: var(--blue); }

.page-plain .btn {
  border-color: var(--blue);
  color: var(--blue);
}
.page-plain .btn:hover,
.page-plain .btn:focus-visible {
  background: var(--blue);
  color: #fff;
}

.page-plain .notice--ok {
  background: #eef6f0;
  color: #1c5c33;
}

/* --- admin ---------------------------------------------------------------- */

/* Not fixed, unlike the public header: an admin page is a working surface and
   the bar scrolling away is one less thing covering the table. */
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 26px;
  background: var(--teal);
  color: #fff;
}

.admin-bar__home {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.admin-bar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-bar__right a,
.admin-bar .linkbtn {
  color: #fff;
  font-size: 14px;
}

.admin {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.admin h1 {
  margin: 0 0 20px;
  font-size: 26px;
  color: var(--teal);
}

.admin__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.admin__head h1 { margin: 0; }

.admin__note,
.admin__empty {
  margin: 22px 0 0;
  color: var(--grey);
  font-size: 14px;
}
.admin__empty a { color: var(--blue); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6e6e6;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grey);
}

.admin-table td a { color: var(--blue); font-weight: 600; }

.admin-table__sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--grey);
}

.admin-table tr.is-sold td { opacity: .55; }

.admin-table__thumb { width: 72px; }
.admin-table__thumb img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  background: #f4f4f4;
}
.admin-table__nophoto { color: #bbb; }

.admin-table__actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.admin-table__actions form { display: inline; margin-left: 14px; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.tag--live { background: #e6f2ea; color: #1c5c33; }
.tag--sold { background: #eee; color: #666; }
.tag--draft { background: #fdf1dd; color: #8a5a12; }

/* A button that has to read as a link: these are POSTs, because they change
   something, and a GET link would be followed by anything that prefetches. */
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}
.linkbtn:hover { color: var(--gold); }
.linkbtn--danger { color: #a3282d; }

.admin-form,
.admin-photos { max-width: 620px; }

.admin-form .field,
.admin-login .field { margin-bottom: 20px; }

.admin-form label,
.admin-login label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}

.admin-form select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font: 400 15px/1.6 var(--font);
  color: #222;
  /* Not width:100%: a four-item dropdown stretched the width of the form
     reads as a text field that will not accept typing. */
  min-width: 220px;
  background: #fff;
}

.admin-form input[type="text"],
.admin-form textarea,
.admin-login input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font: 400 15px/1.6 var(--font);
  color: #222;
  background: #fff;
}

.admin-form textarea { resize: vertical; }

.field__hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--grey);
}

.admin-photos {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid #e6e6e6;
}

.admin-photos h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--teal);
}

.admin-photos__list {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.admin-photos__list li { text-align: center; }

.admin-photos__list img {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  margin-bottom: 6px;
  background: #f4f4f4;
}

.admin-login {
  display: flex;
  justify-content: center;
  padding: 80px 20px;
}

.admin-login__panel {
  width: 100%;
  max-width: 360px;
}

.admin-login__heading {
  margin: 0 0 20px;
  font-size: 24px;
  color: var(--teal);
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 782px) {
  .contact-form__grid { grid-template-columns: 1fr; }

  .hero__title { font-size: 30px; }
  .hero__sub { font-size: 20px; }

  .contact__heading { font-size: 26px; }
  .contact__phone { font-size: 24px; }
  .contact { padding: 54px 0; }

  .site-header { padding: 0 20px; }
  .site-header__logo img { width: 191px; height: 37px; }
  .site-header.is-scrolled .site-header__logo img { width: 176px; height: 34px; }
  .site-header__phone { font-size: 15px; }
  .site-header__nav { gap: 16px; }
  .site-header__link { font-size: 16px; }

  .part__grid { grid-template-columns: 1fr; gap: 30px; }
  .listing__heading, .part__title { font-size: 26px; }
  .listing, .part { padding: 36px 0 60px; }

  /* The action column cannot stay on one line at this width, and a table that
     scrolls sideways is worse than one that wraps. */
  .admin-table__actions { white-space: normal; }
  .admin-table__actions form { display: block; margin: 0 0 4px; }
  .admin__head { flex-direction: column; align-items: flex-start; gap: 12px; }

  .site-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 20px;
  }
}

@media (max-width: 620px) {
  /* Below this the logo, the nav link and the number cannot all sit on one
     line. The number goes first: it is repeated in the contact section and on
     every part page, whereas the link is the only route to the listings. */
  .site-header__phone { display: none; }
  .site-header__logo img { width: 191px; height: 37px; }
}

@media (max-width: 420px) {
  .site-header { padding: 0 14px; }
  .site-header__logo img { width: 160px; height: 31px; }
  .cards { grid-template-columns: 1fr; gap: 20px; }
}

/* background-attachment:fixed is broken on iOS Safari — it sizes the image to
   the document rather than the viewport, so the photo appears wildly zoomed.
   Touch devices get the static version, which is what the original does too. */
@media (hover: none) {
  .hero__bg { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
