/* Site footer: primary nav links (also used for search engine sitelinks) */
.sapio-site-footer {
  margin: 0 -15px;
  padding: 20px 15px 24px;
  background-color: #323437;
  color: #fff;
  text-align: center;
}

.sapio-site-footer__label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

.sapio-primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 0;
}

.sapio-primary-nav li + li::before {
  content: "|";
  margin: 0 14px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: normal;
}

.sapio-primary-nav a {
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
}

.sapio-primary-nav a:hover {
  color: #a8d3ff;
  text-decoration: underline;
}

/* Shared mobile / tablet layout fixes */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
}

body {
  max-width: 100%;
  /* Beat Hestia + inline overflow-x:hidden (that forces a nested Y scrollbar). */
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.wrapper,
.main {
  max-width: 100%;
}

img,
video,
iframe {
  max-width: 100%;
}

.main img,
.pagebuilder-section img,
.section-text img,
.blog-post .single-post-wrap img {
  max-width: 100%;
  height: auto;
}

/* Related posts: keep thumbnails aligned, cropped, and inside each card */
.related-posts .card.card-blog {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 30px;
}

.related-posts .card-image {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  line-height: 0;
  margin: 0 !important;
  border-radius: 6px 6px 0 0;
  box-shadow: none;
  transform: none !important;
}

.related-posts .card-image a {
  display: block;
  height: 100%;
  line-height: 0;
}

.related-posts .card-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0 !important;
  border-radius: 0;
  object-fit: cover;
  object-position: center center;
  transform: none !important;
}

.related-posts .card-image a:hover img {
  transform: none !important;
}

/* Smart Slider "force full width" uses 100vw and causes horizontal scroll */
ss3-force-full-width {
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  transform: none !important;
  left: auto !important;
}

/* Homepage hero slider only: break out of the 15px content padding */
body.home .n2_clear:has(ss3-force-full-width) {
  margin-left: -15px;
  margin-right: -15px;
  width: calc(100% + 30px);
  max-width: none;
}

body.home ss3-force-full-width,
body.home #n2-ss-2,
body.home #n2-ss-2-align,
body.home .n2-section-smartslider {
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  transform: none !important;
}

body.home #n2-ss-2 .n2-ss-slide-background-image img {
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header / footer span the page; main content keeps its side padding */
.header,
.navbar,
footer.footer {
  width: 100%;
  max-width: none;
}

#inquiry,
div[style*="background-color: #a8d3ff"] {
  width: auto;
  max-width: none;
  margin-bottom: 0 !important;
}

/* Schedule / FAQ: full-width blue band, content stays container-width */
.section-text:has(.sapio-page-band) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.section-text .sapio-page-band {
  margin-top: -70px !important;
  margin-bottom: 0 !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  width: 100vw !important;
  max-width: 100vw;
  padding: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
  display: flow-root;
}

.section-text .sapio-page-content {
  width: 100%;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding: 50px 15px 0;
  box-sizing: border-box;
}

/* FAQ / Schedule: responsive page hero title */
.page.blog-post #primary.page-header.header-small {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
}

.page.blog-post #primary.page-header.header-small .header-filter {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page.blog-post #primary.page-header.header-small .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 120px 15px 72px !important;
  min-height: 0;
}

.page.blog-post #primary.page-header.header-small .container .row {
  width: 100%;
  margin: 0;
}

.page.blog-post #primary.page-header.header-small .hestia-title {
  margin: 0 !important;
  line-height: 1.2;
}

.section-text .sapio-page-band #inquiry {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: none;
}

.sapio-calendar-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.section-text .sapio-page-content:has(.sapio-calendar-wrap) {
  padding-bottom: 48px;
}

.navbar .container {
  width: 100%;
  max-width: 1170px;
}

.navbar-brand img {
  max-height: 52px !important;
  width: auto !important;
  height: auto !important;
  max-width: 160px;
}

.navbar.hestia_left .title-logo-wrapper {
  min-width: 0 !important;
}

a.a[href*="lin.ee"] {
  box-sizing: border-box;
  max-width: calc(100% - 16px);
  white-space: normal;
  line-height: 1.35;
}

#calendar {
  width: 100% !important;
  max-width: 100%;
  height: min(85vh, 800px);
}

.sapio-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sapio-table-wrap table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.sapio-table-wrap th,
.sapio-table-wrap td {
  word-break: break-word;
}

.sapio-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
  gap: 28px !important;
}

.sapio-class-card {
  width: 100% !important;
  max-width: 280px;
  box-sizing: border-box;
}

.sapio-class-card [style*="white-space: nowrap"] {
  white-space: normal !important;
}

div[style*="margin-bottom: -50px"] {
  margin-bottom: 0 !important;
}

body.home .pagebuilder-section {
  padding-bottom: 0;
}

.sapio-news-list-wrap .sapio-news-featured {
  margin-left: -10px;
  margin-right: -10px;
  width: calc(100% + 20px);
  max-width: none;
  border-radius: 0;
}

.sapio-news-featured {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #fff2e0;
  border-left: 5px solid #ff7f00;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 6px;
  list-style: none;
}

.sapio-news-badge {
  flex: 0 0 auto;
  background-color: #e2600a;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  padding: 3px 10px;
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
}

.sapio-news-featured-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sapio-news-featured .wp-block-latest-posts__post-title {
  display: block;
  color: #c85000;
  font-weight: bold;
  line-height: 1.35;
  text-decoration: none;
  white-space: normal;
}

.sapio-news-featured .wp-block-latest-posts__post-date {
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  color: #666;
}

.sapio-info-card {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sapio-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.sapio-info-label {
  flex: 0 0 6.5em;
  max-width: 100%;
  font-weight: bold;
  color: #b25f00;
}

.sapio-info-value {
  flex: 1 1 12em;
  min-width: 0;
}

#inquiry,
.section-text,
.pagebuilder-section,
.blog-post {
  overflow-wrap: anywhere;
}

@media (max-width: 1023px) {
  .sapio-class-grid {
    grid-template-columns: 1fr !important;
    justify-items: center;
  }

  .sapio-class-card {
    width: min(100%, 320px) !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .sapio-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .sapio-class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1023px) {
  .page.blog-post #primary.page-header.header-small {
    min-height: 240px;
  }

  .page.blog-post #primary.page-header.header-small .container {
    padding: 96px 15px 44px !important;
  }

  .page.blog-post #primary.page-header.header-small .hestia-title {
    font-size: clamp(28px, 5vw, 36px) !important;
  }

  .section-text .sapio-page-band {
    margin-top: -48px !important;
  }

  .section-text .sapio-page-content {
    padding-top: 40px;
  }
}

@media (max-width: 767px) {
  .page.blog-post #primary.page-header.header-small {
    min-height: 200px;
  }

  .page.blog-post #primary.page-header.header-small .container {
    padding: 84px 15px 32px !important;
  }

  .page.blog-post #primary.page-header.header-small .hestia-title {
    font-size: clamp(24px, 7.5vw, 32px) !important;
  }

  .section-text .sapio-page-band {
    margin-top: -32px !important;
  }

  .section-text .sapio-page-content {
    padding-top: 32px;
  }

  a.a[href*="lin.ee"] {
    display: inline-block !important;
    box-sizing: border-box;
    width: min(100%, 340px);
    padding: 22px 28px !important;
    font-size: 22px !important;
    line-height: 1.35;
    text-align: center;
  }

  .pagebuilder-section img[style*="height: 280px"] {
    height: auto !important;
    max-height: 220px;
  }

  .pagebuilder-section img[style*="width: 250px"] {
    width: min(100%, 250px) !important;
  }

  .section-text .sapio-page-band {
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    width: 100vw !important;
    max-width: 100vw;
  }

  #calendar {
    height: 620px;
  }

  .navbar-fixed-top + .main,
  .navbar-fixed-top + #primary {
    padding-top: 0;
  }
}

@media (max-width: 420px) {
  .page.blog-post #primary.page-header.header-small {
    min-height: 180px;
  }

  .page.blog-post #primary.page-header.header-small .container {
    padding: 76px 12px 24px !important;
  }

  .section-text .sapio-page-band {
    margin-top: -24px !important;
  }

  .section-text .sapio-page-content {
    padding-top: 24px;
  }

  a.a[href*="lin.ee"] {
    width: min(100%, 320px);
    padding: 20px 22px !important;
    font-size: 20px !important;
  }

  #calendar {
    height: 540px;
  }

  .navbar-brand img {
    max-width: 132px;
  }
}
