/*
  Precision Acoustics theme. Plain CSS, mobile first, no build step, no libraries.
  Small screens are the base; wider layouts are added with min-width media queries.
*/

/* ------------------------------------------------------------ Fonts */

@font-face {
  font-family: "PT Sans";
  src: url("../fonts/PTSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PT Sans";
  src: url("../fonts/PTSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------- Tokens */

:root {
  --green: #23ad23;
  --green-footer: #44b644;
  --navy: #0b2c78;
  --navy-active: #110b78;
  --sky: #2788d7;
  --red: #cc2329;
  --ink: #2d2d2d;
  --muted: #7c7c7c;
  --nav-ink: #646464;
  --rule: #cbcbcb;
  --page: #fafafa;
  --white: #fff;
  --shadow: 0 0 6px 0 #b8b8b8;
  --heading-font: "PT Sans", Helvetica, Arial, sans-serif;
  --body-font: Helvetica, Arial, sans-serif;
  --holder: 60rem;
  --gutter: 1rem;
}

/* ------------------------------------------------------------- Base */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
          text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 1rem/1.5 var(--body-font);
  color: var(--ink);
  background: var(--page);
}

body.front {
  background: var(--page) url("../images/main-background.jpg") no-repeat center 137px / cover;
}

.main-wrapper {
  flex: 1 0 auto;
  padding: 1.5rem 0 2rem;
}

.holder {
  width: 100%;
  max-width: var(--holder);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--red);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--white);
}

.skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------ Typography */

h1,
h2,
h3,
h4 {
  margin: 0 0 0.75rem;
  font-weight: 400;
  line-height: 1.2;
}

.page-title,
h1 {
  font: 400 1.75rem/1.2 var(--heading-font);
  color: var(--ink);
  text-shadow: 0 1px 0 #ada8a8;
}

h2 {
  font: 700 1.35rem/1.2 var(--heading-font);
  color: var(--green);
}

h3 {
  font: 700 1.1rem/1.2 var(--body-font);
}

h4 {
  font: 700 1rem/1.2 var(--body-font);
  margin: 0.75rem 0;
}

p {
  margin: 0 0 1.25rem;
}

.content a,
.card-text a {
  text-decoration: underline;
}

/*
  Headings inside page text. The migration moved every heading in the old body text
  down one level (the page title is the h1), so these three styles reproduce what the
  old h1, h2 and h3 looked like.
*/
.content h2 {
  font: 400 1.5rem/1.2 var(--heading-font);
  color: var(--ink);
}

.content h3 {
  font: 700 1.25rem/1.2 var(--heading-font);
  color: var(--green);
}

.content h4 {
  font: 700 1rem/1.2 var(--body-font);
  color: var(--ink);
}

.content ul,
.content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.75rem;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.5rem 0;
}

.label-above {
  font: 400 1.4rem/1.2 var(--heading-font);
  color: var(--green);
  margin: 1.5rem 0 0.5rem;
  text-shadow: none;
}

/* ----------------------------------------------------------- Header */

.site-header {
  /* The gradient is 1px wide and 144px tall; stretch it to the header's height so no seam shows below it. */
  background: var(--white) url("../images/top-bg.png") repeat-x 0 0 / 1px 100%;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  display: block;
  width: 130px;
  height: 91px;
  background: url("../images/pa-logo.png") no-repeat 0 0 / contain;
  text-indent: -9999px;
  overflow: hidden;
}

.phone {
  order: 3;
  width: 100%;
  margin: 0;
  text-align: center;
  font: 400 1.35rem/1.2 var(--heading-font);
}

.nav-toggle {
  font: 700 1rem/1 var(--heading-font);
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
}

.site-nav {
  order: 4;
  width: 100%;
  display: none;
}

.site-nav.is-open {
  display: block;
}

.menu,
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  display: block;
  padding: 0.65rem 0.5rem;
  font: 700 1.05rem/1.2 var(--heading-font);
  color: var(--nav-ink);
  border-bottom: 2px solid transparent;
}

.menu > li {
  border-top: 1px solid #eee;
}

.menu > li > a:hover,
.menu > li > a:focus-visible,
.menu > li.is-active > a {
  color: var(--navy-active);
}

.menu > li.is-active > a {
  border-bottom-color: var(--green);
}

.menu > li > a:hover,
.menu > li > a:focus-visible {
  border-bottom-color: var(--red);
}

.submenu a {
  padding-left: 1.5rem;
  font-size: 0.95rem;
  font-weight: 400;
}

.submenu a:hover,
.submenu a:focus-visible {
  color: var(--green);
}

/* Phone menu: the toggle buttons that open and close each section (added by js/site.js). */
.submenu-toggle {
  display: none;
}

@media (max-width: 59.99em) {
  .site-nav.has-toggles .menu > li.has-children {
    position: relative;
  }

  .site-nav.has-toggles .submenu {
    display: none;
  }

  .site-nav.has-toggles .is-expanded > .submenu {
    display: block;
  }

  .site-nav.has-toggles .submenu-toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 2.75rem;
    padding: 0;
    color: var(--nav-ink);
    background: none;
    border: 0;
    cursor: pointer;
  }

  .submenu-toggle::before {
    content: "";
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    margin: 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
  }

  .is-expanded > .submenu-toggle::before {
    transform: rotate(-135deg) translate(-0.15rem, -0.15rem);
  }
}

/* ------------------------------------------------------------- Home */

.hero {
  max-width: 62.5rem;
  margin: 0 auto;
  padding: 1.25rem 0 0.5rem;
  background: url("../images/banner-bg.png") repeat;
}

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tiles a {
  display: block;
  height: 100%;
  background: var(--white);
  box-shadow: var(--shadow);
  color: #000;
}

.tiles a:hover img,
.tiles a:focus-visible img {
  opacity: 0.8;
}

.tiles img {
  display: block;
  width: 100%;
  transition: opacity 0.3s;
}

.tiles span {
  display: block;
  padding: 0.85rem 1.75rem 0.85rem 0.65rem;
  font: 700 1rem/1.2 var(--heading-font);
  background: url("../images/fb-arrow.png") no-repeat right 0.5rem center;
}

.tagline {
  margin: 1.3rem 0 0;
  padding: 0.5rem 0 0.95rem;
  font: 400 1.9rem/1.2 var(--heading-font);
  color: var(--green);
  text-align: center;
  text-shadow: 0 1px 0 #194f2b;
  border-bottom: 1px solid #c7c7c7;
}

/* ----------------------------------------------------------- Layout */

.layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.main {
  min-width: 0;
}

.sidebar h2 {
  font: 700 1.2rem/1.6 var(--heading-font);
  color: #2c2c2c;
  margin: 0 0 1rem;
  padding: 0 0 0.5rem 2rem;
  border-bottom: 1px solid var(--rule);
  background: no-repeat 0 0;
}

.block {
  margin-bottom: 1.5rem;
}

.block-contact h2 {
  background-image: url("../images/icon-contact.png");
}

.block-courses h2 {
  background-image: url("../images/icon-courses.png");
}

.block-contact p,
.block-courses p {
  color: var(--muted);
  font-size: 0.95rem;
}

.block-contact strong {
  display: inline-block;
  min-width: 4.5rem;
  color: #4b4b4b;
}

.block-contact .address strong {
  min-width: 0;
}

.upcoming {
  margin-bottom: 1.25rem;
}

.course-date {
  display: block;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.course-title {
  margin: 0 0 0.25rem;
  color: #2c2c2c;
  font-weight: 700;
}

/* ------------------------------------------------------ Breadcrumbs */

.breadcrumb ol {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.breadcrumb li + li::before {
  content: ">";
  padding: 0 0.5rem;
  color: var(--muted);
}

/* -------------------------------------------------- Cards (listings) */

.card-list {
  margin-top: 1rem;
}

.card {
  padding: 1rem 0.75rem 1.25rem;
  border-bottom: 1px solid #e9e9e9;
  transition: box-shadow 0.3s, background 0.6s;
}

.card:first-child {
  padding-top: 0;
}

.card:last-child {
  border-bottom: 0;
}

.card:hover,
.card:focus-within {
  background: var(--white);
  box-shadow: var(--shadow);
}

.card img {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  transition: opacity 0.3s;
}

.card a:hover img,
.card a:focus-visible img {
  opacity: 0.8;
}

.card-more {
  margin: 0;
  text-align: right;
}

/* ---------------------------------------------------------- Buttons */

.button,
input[type="submit"],
button.submit {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font: 400 1rem/1.2 var(--heading-font);
  color: var(--white);
  background: var(--navy);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover,
.button:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
  color: var(--white);
  background: var(--sky);
}

.button:active,
input[type="submit"]:active {
  background: var(--red);
}

/* --------------------------------------------------------- Products */

.product-image {
  margin: 0 0 1.5rem;
}

.product-image img {
  display: block;
  margin: 0 auto;
  box-shadow: 0 0 5px 0 #b8b8b8;
}

.product-columns {
  display: grid;
  gap: 1.5rem;
}

.product-related h2 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.15rem;
  color: #2c2c2c;
}

.product-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-related li {
  border-bottom: 1px dotted var(--rule);
}

.product-related li a {
  display: block;
  padding: 0.6rem 0.6rem;
}

.feature-image {
  margin: 1.5rem 0;
}

/* ----------------------------------------------------------- Videos */

.videos-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.video-thumb {
  position: relative;
  display: block;
  background: #000;
}

.video-thumb img {
  display: block;
  width: 100%;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.video-thumb:hover img,
.video-thumb:focus-visible img {
  opacity: 1;
}

.video-thumb::after {
  content: "\25B8";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.5rem;
  color: var(--white);
  text-shadow: 0 0 10px #000;
}

.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption {
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

/* --------------------------------------------- Courses and downloads */

.course-facts {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fact {
  padding: 0.75rem;
  background: url("../images/dates-price-bg.png") repeat;
  border-radius: 5px;
  border-top: 1px solid #f6f6f6;
  border-bottom: 1px solid #dedede;
}

.fact .label-above {
  margin-top: 0;
  font: 700 1.1rem/1.2 var(--body-font);
  color: #2d2d2d;
}

.fact p {
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.document-list {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
}

.course .document-list {
  font-weight: 700;
}

.document-list li {
  margin-top: 0.4rem;
  padding-left: 1.4rem;
  background: url("../images/icon-pdf.png") no-repeat 0 0.2em;
}

.document-list li:first-child {
  margin-top: 0;
}

.notice {
  padding: 0.75rem 1rem;
  background: #f1f7f1;
  border-left: 4px solid var(--green);
}

/* ----------------------------------------------------------- Tables */

table {
  width: 100%;
  margin-bottom: 1rem;
  text-align: left;
  border-collapse: collapse;
}

th {
  padding: 0.6rem;
  background: #cacaca;
}

td {
  padding: 0.6rem;
}

tr {
  background: #ededed;
  border-bottom: 1px solid var(--white);
}

tr:nth-child(odd) {
  background: #f3f3f3;
}

.product-features {
  overflow-x: auto;
}

/* ------------------------------------------------------------ Forms */

label {
  display: block;
  margin-bottom: 0.3rem;
  cursor: pointer;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem;
  font: 0.95rem/1.3 Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #c1c1c1;
}

textarea {
  max-width: 100%;
}

input:hover,
input:focus,
select:hover,
select:focus,
textarea:hover,
textarea:focus {
  border-color: #60a3d9;
  box-shadow: var(--shadow);
}

input[type="checkbox"],
input[type="radio"] {
  display: inline;
  width: auto;
}

input[type="submit"] {
  max-width: none;
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem;
}

/* Grav Form plugin markup (booking form) */

.form-field {
  margin-bottom: 1.1rem;
}

.form-field .form-label label {
  font-weight: 700;
}

.form-field .required {
  color: var(--red);
}

form fieldset {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0.2rem;
  border: 1px solid var(--rule);
}

form legend {
  padding: 0 0.4rem;
  font: 400 1.15rem/1.2 var(--heading-font);
  color: var(--navy);
}

.form-description {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Checkbox groups: box and label side by side, one option per line. Radios sit in their own wrapper. */
.form-field .checkboxes {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
}

.form-field .radio {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.form-field .checkboxes label,
.form-field .radio label {
  margin: 0;
  display: block !important; /* the plugin writes style="display: inline" on each label */
}

.form-field .form-input-wrapper {
  max-width: 100%;
}

.buttons {
  margin-top: 1.5rem;
}

.buttons .button {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.1rem;
}

@media (min-width: 40em) {
  .buttons .button {
    width: auto;
  }
}

.notices {
  padding: 0.7rem 1rem;
  margin-bottom: 1.2rem;
  border-left: 4px solid var(--sky);
  background: var(--white);
}

.notices.error {
  border-left-color: var(--red);
}

/* Form beside the page text (Contact): a grey box in the right column, as on the old site. */
.form-box {
  margin-top: 1rem;
  padding: 0.625rem;
  background: #f6f6f6;
  box-shadow: var(--shadow);
}

.form-box input,
.form-box select,
.form-box textarea {
  max-width: none;
}

.form-box .buttons {
  margin-top: 1rem;
}

.form-box .buttons .button {
  width: 100%;
}

@media (min-width: 48em) {
  .form-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 25rem;
    gap: 2.5rem;
    align-items: start;
  }

  .form-box {
    margin-top: 0;
  }
}

@media (min-width: 62em) {
  .form-split {
    margin-right: calc(var(--gutter) * -1);
  }
}

/* -------------------------------------------------------------- Map */

.map {
  width: 100%;
  height: 22rem;
  margin-top: 1.5rem;
  border: 5px solid var(--white);
  box-shadow: var(--shadow);
}

.map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

/* ----------------------------------------------------------- Footer */

.site-footer {
  flex-shrink: 0;
  padding: 1.5rem 0;
  background: var(--green-footer);
  color: var(--white);
  font-family: var(--heading-font);
}

.site-footer a {
  color: var(--white);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--red);
}

.footer-row p {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.footer-row p a {
  text-decoration: underline;
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* ------------------------------------------------- Wider than a phone */

@media (min-width: 40em) {
  :root {
    --gutter: 1.5rem;
  }

  .product-columns {
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: 2rem;
  }

  .course-facts {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }
}

@media (min-width: 48em) {
  :root {
    --gutter: 0.625rem;
  }

  .tiles {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }

  .tagline {
    font-size: 2.4rem;
    line-height: 1.5;
  }

  .hero {
    padding-top: 4.8rem;
  }

  .has-sidebar .layout {
    grid-template-columns: minmax(0, 1fr) 18.75rem;
    gap: 2.5rem;
  }

  .no-sidebar .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-title,
  h1 {
    font-size: 2rem;
  }
}

/* Wide enough for the legacy proportions: a 560px text column and a 300px sidebar that runs 10px past the tiles. */
@media (min-width: 62em) {
  .has-sidebar .layout {
    grid-template-columns: 35rem 18.75rem;
    justify-content: space-between;
    padding-right: 0;
  }
}

/* The full menu bar: at this width the menu sits beside the logo with dropdowns. */
@media (min-width: 60em) {
  .header-row {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .nav-toggle {
    display: none;
  }

  .phone {
    position: absolute;
    right: var(--gutter);
    top: 2rem;
    width: auto;
    order: 0;
  }

  .header-row {
    position: relative;
    min-height: 9rem;
    padding-top: 1.25rem;
  }

  .site-nav {
    display: block;
    width: auto;
    order: 0;
    margin-top: 3.4rem;
  }

  .menu {
    display: flex;
    gap: 0.25rem;
  }

  .menu > li {
    position: relative;
    border-top: 0;
  }

  .menu > li > a {
    padding: 0.5rem 0.65rem;
  }

  .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    width: 15em;
    background: var(--white);
    box-shadow: var(--shadow);
    border-bottom: 2px solid var(--red);
  }

  .menu > li:hover > .submenu,
  .menu > li:focus-within > .submenu {
    display: block;
  }

  .submenu li {
    border-bottom: 1px solid var(--rule);
  }

  .submenu li:last-child {
    border-bottom: 0;
  }

  .submenu a {
    padding: 0.55rem 0.85rem;
    border-bottom: 0;
  }

  .footer-row {
    display: flex;
    align-items: baseline;
    gap: 2rem;
  }

  .footer-row p {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
