/* K13 Live Sites: screenshot cards with a green info bar, two reverse-scrolling
   columns on larger screens, and an in-page browser window for each site. */
.k13-sites {
  --sites-green: #20493C;
  --sites-cream: #FEFAF2;
  --sites-gap: 1.5em;
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}
.k13-sites *,
.k13-site-modal * {
  box-sizing: border-box;
}
.k13-sites__head {
  margin-bottom: 3em;
}
.k13-sites__eyebrow {
  margin: 0 0 .75em;
  font-size: 1em;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--sites-green);
  opacity: .7;
}
.k13-sites__title {
  margin: 0;
  font-size: 4em;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--sites-green);
}

/* Plain grid: phones, reduced motion, no JS, or animation turned off. */
.k13-sites__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sites-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.k13-sites__item {
  margin: 0;
  padding: 0;
}

/* Card */
.k13-sites__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 2px solid var(--sites-green);
  border-radius: 1em;
  background-color: var(--sites-green);
  overflow: hidden;
}
.k13-sites__shot {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #10241e;
  cursor: pointer;
}
.k13-sites__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .8s cubic-bezier(.22, 1, .36, 1);
}
.k13-sites__card:hover .k13-sites__img {
  transform: scale(1.03);
}
.k13-sites__shot.is--blank {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2c5d4d, var(--sites-green) 70%);
}
.k13-sites__blank-logo {
  width: 40%;
  max-height: 45%;
  object-fit: contain;
}
.k13-sites__blank-name {
  font-size: 3.5em;
  letter-spacing: .08em;
  color: var(--sites-cream);
}

/* Green bar */
.k13-sites__bar {
  display: flex;
  align-items: center;
  gap: 1.5em;
  padding: 1.5em 1.75em;
  color: var(--sites-cream);
  background-color: var(--sites-green);
}
.k13-sites__logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  width: 8.5em;
  height: 3.5em;
}
.k13-sites__logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: left center;
}
.k13-sites__name {
  font-size: 1.35em;
  letter-spacing: .06em;
  line-height: 1.1;
}
.k13-sites__divider {
  flex: 0 0 1px;
  align-self: stretch;
  background-color: currentColor;
  opacity: .35;
}
.k13-sites__line {
  flex: 1 1 auto;
  margin: 0;
  font-size: 1.1em;
  line-height: 1.35;
}
.k13-sites__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .85em 1.35em;
  border: 1px solid currentColor;
  border-radius: .6em;
  color: var(--sites-cream);
  font-size: 1em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.k13-sites__btn:hover,
.k13-sites__btn:focus-visible {
  background-color: var(--sites-cream);
  color: var(--sites-green);
}
.k13-sites__btn-icon {
  width: 1em;
  height: 1em;
}

/* Reverse-scrolling columns (set up by js/widgets/live-sites.js). */
.k13-sites__stage.is--split {
  position: relative;
}
.k13-sites__stage.is--split .k13-sites__sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: calc(var(--svh, 1vh) * 100);
}
.k13-sites__grid.is--split {
  display: flex;
  width: 100%;
  height: var(--sites-window, auto);
  overflow: hidden;
}
.k13-sites__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sites-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}

@media screen and (max-width: 991px) {
  .k13-sites__title {
    font-size: 3em;
  }
  .k13-sites__bar {
    flex-wrap: wrap;
    gap: 1em 1.25em;
    padding: 1.25em;
  }
  .k13-sites__divider {
    display: none;
  }
  .k13-sites__line {
    flex: 1 1 12em;
  }
  .k13-sites__btn {
    width: 100%;
    justify-content: center;
  }
}
@media screen and (max-width: 767px) {
  .k13-sites__grid {
    grid-template-columns: 1fr;
  }
  .k13-sites__title {
    font-size: 2.25em;
  }
  .k13-sites__logo {
    width: 7em;
    height: 3em;
  }
}

/* Centred heading. */
.k13-sites__head {
  text-align: center;
}
.k13-sites__title {
  max-width: 14em;
  margin-left: auto;
  margin-right: auto;
}

/* Every green bar is the same height whatever the logo or line length. */
.k13-sites__card {
  height: 100%;
}
.k13-sites__shot {
  flex: 1 1 auto;
  min-height: 0;
}
.k13-sites__bar {
  flex: 0 0 auto;
  height: var(--sites-bar, 7.5em);
}
.k13-sites__line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Elementor's ".elementor img { height: auto }" would leave a gap under the screenshot. */
.k13-sites .k13-sites__shot .k13-sites__img {
  height: 100%;
}

/* Pinned columns: each pair fills most of the screen, showing more of each site vertically. */
.k13-sites__grid.is--split .k13-sites__shot {
  aspect-ratio: auto;
  height: calc(var(--svh, 1vh) * 76 - var(--sites-bar, 7.5em));
}
.k13-sites__stage.is--split .k13-sites__sticky {
  padding-top: 3.5em;
  box-sizing: border-box;
}

/* Tablet + phone: less space above the heading (Markup #115 / #119) and
   stacking cards (Markup #111 / #120, set up by live-sites.js). */
@media screen and (max-width: 991px) {
  .k13-sites {
    --sites-bar: 9.5em;
    padding-top: 3em;
  }
  .k13-sites__head {
    margin-bottom: 1.5em;
  }
  .k13-sites__grid.is--stack {
    display: flex;
    flex-direction: column;
    gap: 1.25em;
  }
  .k13-sites__grid.is--stack .k13-sites__item {
    position: sticky;
    top: calc(5.5em + var(--stack-i, 0) * 0.45em);
  }
  .k13-sites__grid.is--stack .k13-sites__card {
    transform-origin: 50% 0;
    will-change: transform, filter;
    box-shadow: 0 -10px 30px -18px rgba(16, 36, 30, 0.45);
  }
}
@media screen and (max-width: 767px) {
  .k13-sites {
    --sites-bar: auto;
    padding-top: 2.25em;
  }
  .k13-sites__head {
    margin-bottom: 1.25em;
  }
  .k13-sites__bar {
    height: auto;
    min-height: 10.5em;
    align-content: center;
  }
  .k13-sites__grid.is--stack .k13-sites__item {
    top: calc(4.75em + var(--stack-i, 0) * 0.35em);
  }
}

/* In-page browser window */
.k13-site-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5vh 2.5vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.k13-site-modal.is--open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease;
}
.k13-site-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 22, 18, .78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.k13-site-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  border-radius: 1em;
  overflow: hidden;
  background-color: #10241e;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transform: translateY(1.5em) scale(.98);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.k13-site-modal.is--open .k13-site-modal__panel {
  transform: none;
}
.k13-site-modal__bar {
  display: flex;
  align-items: center;
  gap: .75em;
  padding: .7em .8em .7em 1.1em;
  background-color: #20493C;
  color: #FEFAF2;
  font-size: 14px;
}
.k13-site-modal__dot {
  flex: 0 0 .6em;
  height: .6em;
  border-radius: 50%;
  background-color: #8fd3a8;
}
.k13-site-modal__logo {
  flex: 0 0 auto;
  display: block;
  width: auto;
  height: 1.9em;
  margin-right: .25em;
}
.k13-site-modal__url {
  flex: 1 1 auto;
  min-width: 0;
  padding: .55em .9em;
  border-radius: .5em;
  background-color: rgba(0, 0, 0, .25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k13-site-modal__action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .55em 1em;
  border: 1px solid rgba(254, 250, 242, .5);
  border-radius: .5em;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.k13-site-modal__action:hover,
.k13-site-modal__action:focus-visible {
  background-color: #FEFAF2;
  color: #20493C;
}
.k13-site-modal__action.is--close {
  background-color: #FEFAF2;
  color: #20493C;
}
.k13-site-modal__frame {
  position: relative;
  flex: 1 1 auto;
  background-color: #fff;
}
.k13-site-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background-color: #fff;
}
.k13-site-modal__status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  padding: 2em;
  text-align: center;
  background-color: #10241e;
  color: #FEFAF2;
  font-size: 15px;
  transition: opacity .3s ease;
}
.k13-site-modal__status[hidden] {
  display: none;
}
.k13-site-modal__spinner {
  width: 2em;
  height: 2em;
  border: 2px solid rgba(254, 250, 242, .25);
  border-top-color: #FEFAF2;
  border-radius: 50%;
  animation: k13-site-spin .8s linear infinite;
}
@keyframes k13-site-spin {
  to { transform: rotate(360deg); }
}
@media screen and (max-width: 767px) {
  .k13-site-modal {
    padding: 0;
  }
  .k13-site-modal__panel {
    border-radius: 0;
  }
  .k13-site-modal__action.is--newtab span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k13-sites__img,
  .k13-site-modal,
  .k13-site-modal__panel {
    transition: none;
  }
}

/* Bigger, equal cards: wider stage, screenshot never shrinks, bar fills the rest. */
.k13-sites .k13-container {
  max-width: 1720px;
  width: 100%;
  padding-left: 2.5vw;
  padding-right: 2.5vw;
}
.k13-sites {
  --sites-gap: 2em;
}
.k13-sites__item,
.k13-sites__card {
  width: 100%;
}
.k13-sites__shot {
  flex: 0 0 auto;
  width: 100%;
}
.k13-sites__bar {
  flex: 1 1 auto;
  min-height: 7.5em;
  padding: 1.75em 2.25em;
}
.k13-sites__logo {
  width: 10em;
  height: 4em;
}
.k13-sites__line {
  font-size: 1.25em;
}
.k13-sites__btn {
  font-size: 1.1em;
  padding: 1em 1.6em;
}
