/* Compact Astra footer layout for Švietėjas. */

/* Keep the footer at the bottom of short pages without fixing it to the viewport.
   JavaScript sets --sv-page-min-height from the page's real document offset,
   so the calculation also accounts for the optional promo bar and WP admin bar. */
#page.site {
  display: flex !important;
  flex-direction: column;
  min-height: var(--sv-page-min-height, 100vh);
}

#page.site > #content {
  flex: 1 0 auto;
  width: 100%;
}

#page.site > #colophon {
  flex: 0 0 auto;
  width: 100%;
}

/* The site does not expose a public WordPress search. Keep Astra's 404 title,
   but remove the search suggestion and search form below it. */
body.error404 .ast-404-layout-1 .page-content {
  display: none !important;
}

body.error404 .ast-404-layout-1 .sv-404-home-link {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 24px auto 0;
  padding: 13px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3a40a 0%, #ef8d08 100%);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 28px rgba(239, 141, 8, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body.error404 .ast-404-layout-1 .sv-404-home-link:hover,
body.error404 .ast-404-layout-1 .sv-404-home-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 17px 34px rgba(239, 141, 8, 0.31);
  filter: brightness(1.02);
}

body.error404 .ast-404-layout-1 .sv-404-home-link:focus-visible {
  outline: 3px solid rgba(15, 35, 69, 0.28);
  outline-offset: 4px;
}

@media (max-width: 544px) {
  body.error404 .ast-404-layout-1 .sv-404-home-link {
    width: min(100%, 300px);
    min-height: 50px;
    margin-top: 20px;
    padding-right: 22px;
    padding-left: 22px;
    font-size: 14px;
  }
}

.site-footer {
  --sv-footer-gap: clamp(24px, 2.4vw, 46px);
  --sv-footer-logo-size: 78px;
}

.site-primary-footer-wrap[data-section="section-primary-footer-builder"] {
  padding: 28px clamp(24px, 3vw, 48px) 24px !important;
  border-top-width: 1px !important;
}

.site-primary-footer-wrap[data-section="section-primary-footer-builder"]
  .site-primary-footer-inner-wrap {
  display: grid !important;
  grid-template-columns:
    minmax(390px, 1.65fr)
    minmax(175px, 0.72fr)
    minmax(145px, 0.58fr)
    minmax(170px, 0.7fr) !important;
  column-gap: var(--sv-footer-gap) !important;
  row-gap: 10px !important;
  align-items: start !important;
  max-width: 1480px !important;
}

/* Let the existing Astra widgets participate in one four-column grid. */
.site-primary-footer-inner-wrap > .site-footer-primary-section-1,
.site-primary-footer-inner-wrap > .site-footer-primary-section-2,
.site-footer-primary-section-1
  > .footer-widget-area[data-section="sidebar-widgets-footer-widget-1"] {
  display: contents !important;
}

.site-primary-footer-wrap .widget,
.site-primary-footer-wrap .widget:last-child,
.site-primary-footer-wrap .widget p,
.site-primary-footer-wrap .widget ul,
.site-primary-footer-wrap figure {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Brand: logo and description share the first grid cell. */
.site-primary-footer-wrap #block-8 {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  width: var(--sv-footer-logo-size);
}

.site-primary-footer-wrap #block-8 img {
  display: block;
  width: var(--sv-footer-logo-size) !important;
  max-width: var(--sv-footer-logo-size) !important;
  height: var(--sv-footer-logo-size) !important;
  object-fit: cover !important;
}

.site-primary-footer-wrap #text-1 {
  grid-column: 1;
  grid-row: 1;
  min-height: var(--sv-footer-logo-size);
  padding-left: calc(var(--sv-footer-logo-size) + 22px);
}

.site-primary-footer-wrap #text-2 {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.site-primary-footer-wrap
  .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"] {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.site-primary-footer-wrap
  .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
  grid-column: 4;
  grid-row: 1 / span 2;
}

/* Astra Customizer had added a 40 px top margin to Widget 3.
   Keep both navigation columns aligned from the same top edge. */
.site-primary-footer-wrap
  .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"],
.site-primary-footer-wrap
  .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
  align-self: start !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.site-primary-footer-wrap
  .ast-builder-layout-element[data-section="section-fb-social-icons-1"] {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  padding-left: calc(var(--sv-footer-logo-size) + 22px);
  margin-top: 8px;
}

.site-primary-footer-wrap .widget-title {
  margin: 0 0 9px !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
}

.site-primary-footer-wrap #text-1 .widget-title {
  font-size: 19px !important;
}

.site-primary-footer-wrap .textwidget,
.site-primary-footer-wrap .menu {
  font-size: 14px;
  line-height: 1.5;
}

.site-primary-footer-wrap #text-1 .textwidget {
  max-width: 560px;
  color: #475569;
}

.site-primary-footer-wrap #text-2 .textwidget p + p {
  margin-top: 8px !important;
}

.site-primary-footer-wrap .widget_nav_menu li {
  margin: 0 0 4px !important;
  line-height: 1.42;
}

.site-primary-footer-wrap .widget_nav_menu li:last-child {
  margin-bottom: 0 !important;
}

.site-primary-footer-wrap .widget_nav_menu a,
.site-primary-footer-wrap #text-2 a {
  transition: color 0.16s ease;
}

.site-primary-footer-wrap .footer-social-inner-wrap {
  gap: 7px !important;
}

.site-primary-footer-wrap .footer-social-item {
  width: 28px !important;
  height: 28px !important;
}

.site-primary-footer-wrap .footer-social-item svg {
  width: 15px !important;
  height: 15px !important;
}

/* Compact copyright row. */
.site-below-footer-wrap[data-section="section-below-footer-builder"] {
  padding: 11px clamp(24px, 3vw, 48px) !important;
  min-height: 44px !important;
}

.site-below-footer-wrap[data-section="section-below-footer-builder"]
  .site-below-footer-inner-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 24px !important;
  align-items: center !important;
  max-width: 1480px !important;
  min-height: 22px !important;
}

.site-below-footer-wrap .site-footer-section {
  margin-bottom: 0 !important;
}

.site-below-footer-wrap .ast-footer-copyright,
.site-below-footer-wrap .ast-footer-copyright p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

/* The cookie settings control is moved into the second copyright cell by JS. */
.site-below-footer-wrap .sv-cookie-settings-footer {
  margin: 0 !important;
  padding: 0 !important;
  text-align: right;
}

.site-below-footer-wrap .sv-cookie-settings-link {
  min-height: auto !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #8a5a00 !important;
  font: inherit !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

.site-below-footer-wrap .sv-cookie-settings-link:hover,
.site-below-footer-wrap .sv-cookie-settings-link:focus-visible {
  color: #d98f00 !important;
}

@media (max-width: 1040px) {
  .site-primary-footer-wrap[data-section="section-primary-footer-builder"]
    .site-primary-footer-inner-wrap {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.75fr) !important;
    column-gap: 42px !important;
    row-gap: 20px !important;
  }

  /* Two-column layout:
     left: brand, socials, contacts;
     right: menu, legal information. */
  .site-primary-footer-wrap #block-8,
  .site-primary-footer-wrap #text-1 {
    grid-column: 1;
    grid-row: 1;
  }

  .site-primary-footer-wrap
    .ast-builder-layout-element[data-section="section-fb-social-icons-1"] {
    grid-column: 1;
    grid-row: 2;
  }

  .site-primary-footer-wrap #text-2 {
    grid-column: 1;
    grid-row: 3;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"] {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
    grid-column: 2;
    grid-row: 3;
  }
}

@media (max-width: 640px) {
  .site-footer {
    --sv-footer-logo-size: 64px;
  }

  .site-primary-footer-wrap[data-section="section-primary-footer-builder"] {
    padding: 22px 18px 18px !important;
  }

  .site-primary-footer-wrap[data-section="section-primary-footer-builder"]
    .site-primary-footer-inner-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 18px !important;
    row-gap: 0 !important;
    align-items: start !important;
    text-align: center;
  }

  /* Divider between the brand area and the two navigation columns. */
  .site-primary-footer-wrap .site-primary-footer-inner-wrap::before,
  .site-primary-footer-wrap .site-primary-footer-inner-wrap::after {
    content: "";
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
    background: rgba(15, 23, 42, 0.1);
  }

  .site-primary-footer-wrap .site-primary-footer-inner-wrap::before {
    grid-row: 4;
    margin: 16px 0 15px;
  }

  /* Second divider: contacts now sit below menu + legal information. */
  .site-primary-footer-wrap .site-primary-footer-inner-wrap::after {
    grid-row: 6;
    margin: 15px 0 14px;
  }

  .site-primary-footer-wrap #block-8 {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    width: var(--sv-footer-logo-size);
  }

  .site-primary-footer-wrap #block-8 figure {
    margin: 0 auto !important;
  }

  .site-primary-footer-wrap #text-1 {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 0;
    margin-top: 8px !important;
    padding-left: 0;
    text-align: center;
  }

  .site-primary-footer-wrap #text-1 .widget-title {
    margin-bottom: 7px !important;
    font-size: 18px !important;
  }

  .site-primary-footer-wrap #text-1 .textwidget {
    max-width: 330px;
    margin: 0 auto;
    line-height: 1.48;
  }

  .site-primary-footer-wrap
    .ast-builder-layout-element[data-section="section-fb-social-icons-1"] {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    justify-content: center !important;
    min-height: 0 !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
  }

  .site-primary-footer-wrap .ast-footer-social-1-wrap {
    margin: 0 !important;
    padding: 0 !important;
  }

  .site-primary-footer-wrap .ast-footer-social-1-wrap,
  .site-primary-footer-wrap .footer-social-inner-wrap {
    justify-content: center !important;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"] {
    grid-column: 1;
    grid-row: 5;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
    grid-column: 2;
    grid-row: 5;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"],
  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
    min-width: 0;
    margin-top: 0 !important;
    text-align: center;
  }

  .site-primary-footer-wrap #text-2 {
    grid-column: 1 / -1;
    grid-row: 7;
    margin-top: 0 !important;
    padding-top: 0;
    border-top: 0;
    text-align: center;
  }

  .site-primary-footer-wrap #text-2 .widget-title {
    margin-bottom: 9px !important;
  }

  .site-primary-footer-wrap #text-2 .textwidget {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    align-items: start;
    max-width: 310px;
    margin: 0 auto;
  }

  .site-primary-footer-wrap #text-2 .textwidget p,
  .site-primary-footer-wrap #text-2 .textwidget p + p {
    margin: 0 !important;
  }

  .site-primary-footer-wrap .widget-title {
    margin-bottom: 8px !important;
    font-size: 16px !important;
  }

  .site-primary-footer-wrap .textwidget,
  .site-primary-footer-wrap .menu {
    font-size: 13.5px;
  }

  .site-primary-footer-wrap .widget_nav_menu li {
    margin-bottom: 5px !important;
    line-height: 1.4;
  }

  /* Leave a protected area for the fixed live-chat button. */
  .site-below-footer-wrap[data-section="section-below-footer-builder"] {
    padding: 11px 76px 11px 18px !important;
  }

  .site-below-footer-wrap[data-section="section-below-footer-builder"]
    .site-below-footer-inner-wrap {
    grid-template-columns: 1fr !important;
    gap: 2px !important;
    justify-items: start !important;
  }

  .site-below-footer-wrap .sv-cookie-settings-footer {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .site-primary-footer-wrap[data-section="section-primary-footer-builder"]
    .site-primary-footer-inner-wrap {
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
  }

  .site-primary-footer-wrap .site-primary-footer-inner-wrap::before {
    grid-column: 1;
    grid-row: 4;
  }

  .site-primary-footer-wrap .site-primary-footer-inner-wrap::after {
    grid-column: 1;
    grid-row: 7;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"] {
    grid-column: 1;
    grid-row: 5;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"] {
    grid-column: 1;
    grid-row: 6;
    margin-top: 18px !important;
  }

  .site-primary-footer-wrap #text-2 {
    grid-column: 1;
    grid-row: 8;
  }

  .site-primary-footer-wrap #text-2 .textwidget {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    max-width: 260px;
  }

  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-2"],
  .site-primary-footer-wrap
    .footer-widget-area[data-section="sidebar-widgets-footer-widget-3"],
  .site-primary-footer-wrap #text-2 {
    justify-self: stretch;
    width: 100%;
  }

  .site-below-footer-wrap[data-section="section-below-footer-builder"] {
    padding-right: 70px !important;
    padding-left: 14px !important;
  }
}
