/* ==========================================================================
   Haskel School – shared stylesheet
   Linked from every page with <link rel="stylesheet" href="styles.css">

   1. Base
   2. Navigation
   3. Buttons and forms
   4. Home page (hero slideshow, flip cards)
   5. Our Story timeline
   6. Responsive (tablet and phone)
   ========================================================================== */


/* 1. Base ------------------------------------------------------------------ */

body {
  margin: 0;
  background: #ffffff;
}

a {
  color: #7D05F4;
}

a:hover {
  color: #080A12;
}

.hk-foot a {
  color: #E6ECF3;
  text-decoration: none;
}

.hk-foot a:hover {
  color: #82FE06;
}


/* 2. Navigation ------------------------------------------------------------ */

.hk-nav a {
  color: #8738D5;
  text-decoration: none;
}

.hk-nav a:hover {
  color: #080A12;
}

.hk-dd {
  position: relative;
}

.hk-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  padding-top: 10px;
  z-index: 20;
}

.hk-menu-in {
  min-width: 190px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(8, 10, 18, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.hk-dd:hover .hk-menu,
.hk-dd:focus-within .hk-menu {
  display: block;
}

.hk-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
}

.hk-menu a:hover {
  background: #F8FBFF;
}

/* Menu button: created by site.js, only shown on small screens (see section 6) */
.hk-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #7D05F4;
  border-radius: 12px;
  background: #ffffff;
  color: #7D05F4;
  cursor: pointer;
}

.hk-burger:hover {
  background: #F8FBFF;
}

.hk-burger svg {
  display: block;
}

.hk-burger .hk-x,
.hk-burger[aria-expanded="true"] .hk-bars {
  display: none;
}

.hk-burger[aria-expanded="true"] .hk-x {
  display: inline;
}


/* 3. Buttons and forms ----------------------------------------------------- */

.hk-btn:hover {
  filter: brightness(0.95);
}

.hk-input::placeholder {
  color: #6B7684;
}


/* 4. Home page ------------------------------------------------------------- */

.hk-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  animation: hkSlide 30s infinite;
}

@keyframes hkSlide {
  0% {
    opacity: 0;
    transform: scale(1);
  }

  3% {
    opacity: 1;
  }

  17% {
    opacity: 1;
  }

  20% {
    opacity: 0;
    transform: scale(1.08);
  }

  100% {
    opacity: 0;
  }
}

.hk-duo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  animation: hkDuo 10s infinite;
}

@keyframes hkDuo {

  0%,
  45% {
    opacity: 1;
  }

  50%,
  95% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Flip cards: the back face shows on hover, keyboard focus, or a tap on touch screens */
.hk-flip {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 460px;
  outline-offset: 4px;
  cursor: default;
}

.hk-face {
  position: absolute;
  inset: 0;
  padding: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity .45s ease;
}

.hk-back {
  opacity: 0;
}

.hk-flip:hover .hk-back,
.hk-flip:focus .hk-back,
.hk-flip:focus-within .hk-back {
  opacity: 1;
}

.hk-flip:hover .hk-front,
.hk-flip:focus .hk-front,
.hk-flip:focus-within .hk-front {
  opacity: 0;
}

.hk-play:hover .hk-play-btn {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {

  .hk-slide,
  .hk-duo {
    animation: none;
  }

  .hk-slide:first-of-type {
    opacity: 1;
  }

  .hk-duo+.hk-duo {
    opacity: 0;
  }

  .hk-face {
    transition: none;
  }
}


/* 5. Our Story timeline --------------------------------------------------- */

.hk-tl {
  position: relative;
}

.hk-tl::before {
  content: "";
  position: absolute;
  left: 118px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 2px;
  background: #E9DBFC;
}

.hk-tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px 48px 1fr;
  align-items: start;
  margin-bottom: 22px;
}

.hk-tl-item:last-child {
  margin-bottom: 0;
}

.hk-tl-year {
  text-align: right;
  padding-top: 18px;
}

.hk-tl-dot {
  justify-self: center;
  margin-top: 22px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7D05F4;
  border: 4px solid #F8FBFF;
  box-shadow: 0 0 0 3px #E9DBFC;
  position: relative;
  z-index: 1;
  margin-left: 2px;
}

@media (max-width: 640px) {
  .hk-tl::before {
    left: 10px;
  }

  .hk-tl-item {
    grid-template-columns: 24px 1fr;
  }

  .hk-tl-year {
    grid-column: 2;
    text-align: left;
    padding: 0 0 8px;
  }

  .hk-tl-dot {
    grid-column: 1;
    grid-row: 1;
    margin-top: 4px;
    margin-left: 0;
  }

  .hk-tl-card {
    grid-column: 2;
  }
}


/* 6. Responsive ------------------------------------------------------------

   Most of the page layout is written as inline style="" attributes, which
   ordinary CSS cannot override. The rules below therefore use !important and
   match on the inline values (for example [style*="padding: 48px;"]). Once
   those inline styles are moved into classes, these can become plain rules.
   -------------------------------------------------------------------------- */

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

body {
  overflow-wrap: break-word;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

/* Tablet and below: collapse the main menu behind the menu button */
@media (max-width: 960px) {
  .hk-burger {
    display: inline-flex;
  }

  /* Only collapse when site.js has added the button (html.hk-js), so the
     menu is never hidden without a way to open it. */
  .hk-js .hk-nav {
    display: none !important;
  }

  .hk-js .hk-nav.is-open {
    display: flex !important;
  }

  .hk-nav {
    flex: 1 1 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding-bottom: 12px;
  }

  .hk-nav > a,
  .hk-dd > a {
    display: flex !important;
    align-items: center;
    min-height: 48px;
    padding: 0 4px !important;
    border-bottom: 1px solid #E7ECF3;
  }

  .hk-nav > a.hk-btn {
    justify-content: center;
    min-height: 50px;
    margin-top: 14px;
    padding: 0 30px !important;
    border-bottom: 0;
  }

  /* Sub-menus are always open in the stacked menu (there is no hover on touch) */
  .hk-dd {
    width: 100%;
  }

  .hk-dd > a svg {
    display: none;
  }

  .hk-menu {
    display: block;
    position: static;
    padding-top: 0;
  }

  .hk-menu-in {
    min-width: 0;
    padding: 0 0 8px 16px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hk-menu a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 12px;
  }

  /* Keep logo and menu button on one row */
  header img[alt^="Haskel"] {
    width: 200px !important;
    max-width: 60vw !important;
  }
}

/* Phones and small tablets */
@media (max-width: 768px) {

  /* Top bar: centre the phone and email links and make them easier to tap */
  [style*="padding: 10px 24px"][style*="justify-content: flex-end"] {
    justify-content: center !important;
    gap: 0 20px !important;
  }

  [style*="padding: 10px 24px"][style*="justify-content: flex-end"] a {
    padding: 6px 0;
  }

  /* Headings */
  h1 {
    font-size: clamp(34px, 10vw, 46px) !important;
    line-height: 1.12 !important;
  }

  h2 {
    font-size: clamp(26px, 7.5vw, 32px) !important;
    line-height: 1.2 !important;
  }

  blockquote {
    font-size: 24px !important;
    line-height: 1.4 !important;
  }

  .hk-flip h3 {
    font-size: 26px !important;
  }

  p[style*="max-width: 780px"] {
    font-size: 18px !important;
  }

  /* Hero banners */
  [style*="padding: 150px 24px 200px"] {
    padding: 72px 20px 120px !important;
  }

  [style*="padding: 96px 24px 140px"] {
    padding: 56px 20px 100px !important;
  }

  a[aria-label="Scroll down"] {
    margin-top: 40px !important;
  }

  /* Section spacing */
  section[style*="padding"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  section[style$="padding: 96px 24px"],
  section[style$="padding: 88px 24px"] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  section[style*="padding: 72px 24px 96px"] {
    padding-top: 48px !important;
    padding-bottom: 64px !important;
  }

  section[style*="padding: 72px 24px 24px"],
  section[style*="padding: 64px 24px 24px"] {
    padding-top: 48px !important;
  }

  section[style*="padding: 48px 24px 96px"] {
    padding-bottom: 64px !important;
  }

  /* Cards: less padding so the text isn't squeezed */
  div[style*="padding: 48px;"],
  div[style*="padding: 44px;"] {
    padding: 28px 22px !important;
  }

  [style*="padding: 26px 36px"] {
    padding: 22px 20px !important;
  }

  .hk-face {
    padding: 28px 22px;
  }

  /* Flip cards: stack the two faces so the card grows to fit the longer one,
     instead of clipping text in a fixed-height box */
  .hk-flip {
    display: grid;
    min-height: 0;
  }

  .hk-face {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
  }

  /* News: shorter featured photo */
  button[data-lb-list],
  button[data-lb-list] img {
    min-height: 260px !important;
  }

  /* Forms: 16px text stops iOS zooming in on focus; full-width submit buttons */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  form button[type="submit"] {
    width: 100%;
  }

  /* Footer */
  .hk-foot {
    padding: 48px 20px 32px !important;
  }

  .hk-foot > div:first-child {
    gap: 32px !important;
  }

  .hk-foot a {
    display: inline-block;
    padding: 5px 0;
  }
}

/* Narrow phones: a 320px minimum column is wider than the screen */
@media (max-width: 480px) {
  #stories,
  [style*="minmax(320px, 1fr)"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 600px) {
  #ami-pages {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
