/* ==========================================================================
   Finnet theme — layout.css
   Page wrappers, sections, wraps, columns, responsive grid.

   Structure (as captured):
     #Wrapper > #Content > .content_wrapper > .sections_group > .entry-content
       > .mfn-builder-content
         > section.section.mcb-section[.mfn-default-section][.default-width|.full-width]
             > .mcb-background-overlay
             > .section_wrapper.mfn-wrapper-for-wraps.mcb-section-inner
                 > .wrap.mcb-wrap.one-third.laptop-one-third.tablet-one.mobile-one
                     > .mcb-wrap-inner.mfn-wrapper-for-wraps
                         > .mcb-wrap-background-overlay
                         > .column.mcb-column.one.column_xxx
                             > .mcb-column-inner
                         > .wrap.mcb-wrap.mfn-nested-wrap …   (nested wraps)
         > section.section.the_content.no_content > .section_wrapper > .the_content_wrapper
         > section.section.section-page-footer

   Grid (reference values):
     ≥1240      .section_wrapper max-width 1345px (tokens: --fn-grid-width)
     960–1239   940px
     768–959    708px
     ≤767       550px + 33px side padding inside .content_wrapper,
                700px for .container; wraps/columns stack to 100%
   Column sizing classes: one, one-second, one-third, two-third, one-fourth,
   three-fourth, one-fifth … five-sixth, with laptop-/tablet-/mobile- prefixes.
   NOTE: like the reference, laptop-* classes apply from 960 up to 1440px
   inclusive (not 1239) — the 1440px reference screenshots rely on this.

   Side padding is NOT a grid default: sections that have 5% side padding get
   it from their own per-section CSS (e.g. `.mcb-section-xxxx{padding-left:5%}`).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page wrappers
   -------------------------------------------------------------------------- */
#Wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;        /* body.layout-full-width */
  margin: 0;
  background-color: var(--fn-color-bg);
}

body.admin-bar {
  position: relative;
}

#Content {
  position: relative;
  z-index: 0;
  width: 100%;
  padding-top: var(--fn-content-padding-top);
  background-color: var(--fn-color-bg);
}

/* Pages whose first section touches the header (slider pages, and pages
   flagged "no content padding" in the import) */
.template-slider #Content,
#Content.no-padding {
  padding-top: 0;
}

.no-content-padding #Content,
.page.hide-title-area #Content {
  padding: 0;
}

.search-results #Content {
  padding-top: 80px;
}

.content_wrapper,
.sections_group,
.entry-content,
.mfn-builder-content {
  /* plain flow containers; kept as selectors for per-page CSS */
  position: relative;
}

@media only screen and (max-width: 767px) {
  .sections_group {
    margin: 0;
    width: 100%;
    clear: both;
  }
}

/* --------------------------------------------------------------------------
   2. Sections
   -------------------------------------------------------------------------- */
.section {
  position: relative;
  box-sizing: border-box;
}

.section,
.mcb-wrap,
.mcb-column {
  background-position: 0 0;
  background-repeat: no-repeat;
}

@media only screen and (max-width: 959px) {
  .section {
    background-attachment: scroll !important; /* per-section CSS may set fixed */
  }
}

.section > .mcb-background-overlay {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* .mfn-default-section / .default-width are markers (normal section, boxed
   wrapper); .full-width removes the inner max-width. */
.container,
.section_wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  height: 100%;
  max-width: var(--fn-grid-width);
  margin: 0 auto;
}

.container::after,
.section_wrapper::after {
  content: " ";
  display: block;
  clear: both;
  height: 0;
  width: 100%;
  visibility: hidden;
}

/* The mobile rule below uses !important (reference behaviour), so this one
   needs it too to win on full-width sections. */
.section.full-width > .section_wrapper {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media only screen and (min-width: 768px) {
  .section.full-width-ex-mobile > .section_wrapper {
    max-width: 100% !important;
  }
}

.full-width .mfn-parallax ~ .section_wrapper {
  width: 100%;
}

.equal-height-wrap .section_wrapper {
  align-items: stretch;
}

.full-screen .section_wrapper {
  min-height: 100vh;
  align-content: center;
}

/* Section/wrap background parallax image */
.section .mfn-parallax {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none !important;  /* beats img.scale-with-grid max-width */
  transition: opacity 0.2s;
}

#Intro.parallax,
.section[data-parallax="3d"] {
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.section[data-parallax="3d"] > .section_wrapper {
  flex-grow: 1;
}

.section[data-parallax="3d"] .mfn-parallax,
.wrap[data-parallax="3d"] .mfn-parallax {
  position: absolute;
  left: 50%;
  top: 0;
  min-width: 100%;
  min-height: 100%;
  max-width: unset !important;
  object-fit: cover;
  transition: opacity 0.2s;
}

.wrap[data-parallax="3d"] {
  position: relative;
  overflow: hidden;
}

.wrap[data-parallax="3d"] > .column,
.wrap[data-parallax="3d"] > .mcb-wrap-inner {
  position: relative;
}

.wrap[data-parallax="3d"] > .mcb-wrap-inner {
  background: unset !important;
}

/* Shape dividers (SVG edge decorations) */
.mfn-shape-divider {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.mfn-shape-divider[data-name="top"] {
  top: 0;
}

.mfn-shape-divider[data-name="top"][data-invert="1"] {
  transform: rotate(180deg);
}

.mfn-shape-divider[data-name="bottom"],
.mfn-shape-divider.mfn-shape-divider-bottom {
  bottom: 0;
  transform: rotate(180deg);
}

.mfn-shape-divider[data-name="bottom"][data-invert="1"] {
  transform: unset;
}

.mfn-shape-divider[data-bring-front="1"] {
  z-index: 2;
}

.mfn-shape-divider[data-flip="1"] svg {
  transform: rotateY(180deg);
}

.mfn-shape-divider svg {
  display: block;
  position: relative;
  width: 100%;
  height: 150px;
}

.mfn-shape-divider svg circle,
.mfn-shape-divider svg ellipse,
.mfn-shape-divider svg rect,
.mfn-shape-divider svg path:not(.transparent) {
  fill: var(--mfn-shape-divider);
}

.mfn-shape-divider svg .opacity-5 {
  opacity: 0.5;
}

/* Sections with background video */
.section.has-video {
  position: relative;
  overflow: hidden;
}

.section.has-video .section_video {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  height: 100%;
  min-width: 100%;
  overflow: hidden;
}

.section.has-video .section_video video {
  width: 100%;
  object-fit: cover;
}

.section.has-video .section_wrapper {
  position: relative;
}

/* Highlight halves (one side of the section coloured) */
.highlight-left,
.highlight-right {
  position: relative;
}

.highlight-left::after,
.highlight-right::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--fn-color-theme);
}

.highlight-left::after {
  left: 0;
}

.highlight-right::after {
  right: 0;
}

.highlight-left .section_wrapper,
.highlight-right .section_wrapper {
  z-index: 2;
}

/* --------------------------------------------------------------------------
   3. Wraps (rows)
   -------------------------------------------------------------------------- */
.mcb-wrap {
  position: relative;
  z-index: 1;
  float: left;
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
}

.mcb-wrap-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  align-self: stretch;
  width: 100%;
}

.wrap > .mcb-wrap-inner > .mcb-wrap-background-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

/* .mfn-nested-wrap: a wrap placed inside another wrap's inner; it is sized
   by the same width classes and needs no extra rules.
   .mfn-wrapper-for-wraps / .mfn-module-wrapper are builder markers. */

/* Desktop widths (≥1441 and 1240–1440 unless a laptop-* class says otherwise) */
.one-sixth.mcb-wrap    { width: 16.666%; }
.one-fifth.mcb-wrap    { width: 20%; }
.one-fourth.mcb-wrap   { width: 25%; }
.one-third.mcb-wrap    { width: 33.333%; }
.two-fifth.mcb-wrap    { width: 40%; }
.one-second.mcb-wrap   { width: 50%; }
.three-fifth.mcb-wrap  { width: 60%; }
.two-third.mcb-wrap    { width: 66.666%; }
.three-fourth.mcb-wrap { width: 75%; }
.four-fifth.mcb-wrap   { width: 80%; }
.five-sixth.mcb-wrap   { width: 83.333%; }
.one.mcb-wrap          { width: 100%; }

/* --------------------------------------------------------------------------
   4. Columns (items)
   -------------------------------------------------------------------------- */
.column,
.columns {
  float: left;
  margin: 0;
}

.mcb-column {
  position: relative;
}

.mcb-column-inner {
  position: relative;
  margin: var(--mfn-column-gap-top) var(--mfn-column-gap-right) var(--mfn-column-gap-bottom) var(--mfn-column-gap-left);
}

.one-sixth.column    { width: 16.666%; }
.one-fifth.column    { width: 20%; }
.one-fourth.column   { width: 25%; }
.one-third.column    { width: 33.333%; }
.two-fifth.column    { width: 40%; }
.one-second.column   { width: 50%; }
.three-fifth.column  { width: 60%; }
.two-third.column    { width: 66.666%; }
.three-fourth.column { width: 75%; }
.four-fifth.column   { width: 80%; }
.five-sixth.column   { width: 83.333%; }
.one.column          { width: 100%; }

/* Inline items shrink to content (burgers, icons, headings in headers).
   Must beat both the width classes and the mobile 100% rule. */
.mfn-item-inline.column {
  width: auto !important;
  flex: 0 0 auto !important;
  max-width: 100%;
}

/* .mfn-item-custom-width: the item's width comes from its per-item CSS
   (e.g. `.mcb-item-xxx{width:300px}` or `flex:0 0 250px`). No base rule. */

/* Column spacing modifiers on the section */
.no-margin-h .column .mcb-column-inner {
  margin-left: 0;
  margin-right: 0;
}

.section.no-margin-v .column .mcb-column-inner,
.section.no-margin .column .mcb-column-inner {
  margin-bottom: 0;
}

.column-margin-0px .mcb-column-inner  { margin-bottom: 0 !important; }
.column-margin-10px .mcb-column-inner { margin-bottom: 10px !important; }
.column-margin-20px .mcb-column-inner { margin-bottom: 20px !important; }
.column-margin-30px .mcb-column-inner { margin-bottom: 30px !important; }
.column-margin-40px .mcb-column-inner { margin-bottom: 40px !important; }
.column-margin-50px .mcb-column-inner { margin-bottom: 50px !important; }

.equal-height .mcb-wrap .mcb-column-inner {
  height: calc(100% - var(--mfn-column-gap-bottom));
}

.equal-height .column-margin-0px .mcb-column-inner,
.equal-height.no-margin-v .mcb-wrap .mcb-column-inner {
  height: 100%;
}

.equal-height .column .column_attr {
  height: 100%;
  box-sizing: border-box;
}

/* Text column: the inner box fills the column so alignment works */
.column_column {
  display: flex;
}

.mcb-item-column-inner {
  width: 100%;
  word-break: break-word;
}

.column_attr.align_left    { text-align: left; }
.column_attr.align_right   { text-align: right; }
.column_attr.align_center  { text-align: center; }
.column_attr.align_justify { text-align: justify; }

.column_attr.bg-cover,
.mcb-section.bg-cover,
.mcb-wrap.bg-cover {
  background-size: cover;
}

.column_attr.bg-contain,
.mcb-section.bg-contain,
.mcb-wrap.bg-contain {
  background-size: contain;
}

/* Divider column never adds bottom spacing */
.column.column_divider .mcb-item-divider-inner {
  margin-bottom: 0 !important;
  height: auto !important;
}

/* --------------------------------------------------------------------------
   5. Classic content area (the_content) and page footer section
   -------------------------------------------------------------------------- */
.the_content_wrapper {
  margin: 0 1%;
  width: 98%;
}

.has_content .the_content_wrapper {
  margin-bottom: 15px;
}

.the_content_wrapper pre {
  margin-bottom: 20px;
}

.the_content_wrapper .image_frame,
.the_content_wrapper .wp-caption {
  margin-bottom: 20px;
}

.extra_content .the_content_wrapper {
  margin: 0 1%;
}

.extra_content .category_description .the_content_wrapper,
.extra_content .has_content .the_content_wrapper {
  margin-bottom: 40px;
}

.section-page-footer .mcb-column-inner,
.page-pager .mcb-column-inner,
.post-pager .mcb-column-inner {
  margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   6. Images
   -------------------------------------------------------------------------- */
.content_wrapper img,
img.scale-with-grid {
  max-width: 100%;
  height: auto;
}

#Content .is-cropped img {
  height: inherit;
}

/* Lazy images: JS copies data-src → src. No visual change while loading so
   layout and screenshots stay identical; width/height attributes reserve
   the box. */
img.mfn-lazy {
  display: inline-block;
}

/* Image frame skeleton (hover effects/links/masks live in components.css) */
.column_image {
  line-height: 0;
}

.image_frame,
.wp-caption {
  display: block;
  overflow: hidden;
  margin: 0;
  max-width: 100%;
  line-height: 0;
  border: 0 solid var(--fn-color-image-border);
  box-sizing: border-box;
}

.image_item.image_frame {
  display: inline-block;
}

.image_frame.scale-with-grid {
  max-width: 100%;
}

.image_frame .image_wrapper,
.wp-caption img {
  box-sizing: border-box;
}

.image_frame .image_wrapper {
  position: relative;
  overflow: hidden;
}

.image_frame a,
.wp-caption a {
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.image_frame.no_border {
  border-width: 0;
}

.image_frame.stretch .image_wrapper img,
.image_item.stretch:not(.svg) {
  width: 100%;
}

.image_item.image_frame.svg,
.image_item.image_frame.svg img {
  width: 100%;
}

@media only screen and (max-width: 767px) {
  .image_frame {
    margin-top: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   7. Responsive grid
   -------------------------------------------------------------------------- */

/* Laptop: 960–1440 (inclusive, as in the reference) */
@media only screen and (min-width: 960px) and (max-width: 1440px) {
  .laptop-one-sixth.mcb-wrap    { width: 16.666%; }
  .laptop-one-fifth.mcb-wrap    { width: 20%; }
  .laptop-one-fourth.mcb-wrap   { width: 25%; }
  .laptop-one-third.mcb-wrap    { width: 33.333%; }
  .laptop-two-fifth.mcb-wrap    { width: 40%; }
  .laptop-one-second.mcb-wrap   { width: 50%; }
  .laptop-three-fifth.mcb-wrap  { width: 60%; }
  .laptop-two-third.mcb-wrap    { width: 66.666%; }
  .laptop-three-fourth.mcb-wrap { width: 75%; }
  .laptop-four-fifth.mcb-wrap   { width: 80%; }
  .laptop-five-sixth.mcb-wrap   { width: 83.333%; }
  .laptop-one.mcb-wrap          { width: 100%; }

  .laptop-one-sixth.column    { width: 16.666%; }
  .laptop-one-fifth.column    { width: 20%; }
  .laptop-one-fourth.column   { width: 25%; }
  .laptop-one-third.column    { width: 33.333%; }
  .laptop-two-fifth.column    { width: 40%; }
  .laptop-one-second.column   { width: 50%; }
  .laptop-three-fifth.column  { width: 60%; }
  .laptop-two-third.column    { width: 66.666%; }
  .laptop-three-fourth.column { width: 75%; }
  .laptop-four-fifth.column   { width: 80%; }
  .laptop-five-sixth.column   { width: 83.333%; }
  .laptop-one.column          { width: 100%; }
}

/* Laptop grid width: 960–1239 */
@media only screen and (min-width: 960px) and (max-width: 1239px) {
  .container,
  .section_wrapper {
    max-width: var(--fn-grid-width-laptop);
  }
}

/* Tablet: 768–959 */
@media only screen and (min-width: 768px) and (max-width: 959px) {
  .container,
  .section_wrapper {
    max-width: var(--fn-grid-width-tablet);
  }

  .mcb-wrap[data-tablet~="no-up"] {
    margin-top: 0 !important;
  }

  .tablet-one-sixth.mcb-wrap    { width: 16.666%; }
  .tablet-one-fifth.mcb-wrap    { width: 20%; }
  .tablet-one-fourth.mcb-wrap   { width: 25%; }
  .tablet-one-third.mcb-wrap    { width: 33.333%; }
  .tablet-two-fifth.mcb-wrap    { width: 40%; }
  .tablet-one-second.mcb-wrap   { width: 50%; }
  .tablet-three-fifth.mcb-wrap  { width: 60%; }
  .tablet-two-third.mcb-wrap    { width: 66.666%; }
  .tablet-three-fourth.mcb-wrap { width: 75%; }
  .tablet-four-fifth.mcb-wrap   { width: 80%; }
  .tablet-five-sixth.mcb-wrap   { width: 83.333%; }
  .tablet-one.mcb-wrap          { width: 100%; }

  .tablet-one-sixth.column    { width: 16.666%; }
  .tablet-one-fifth.column    { width: 20%; }
  .tablet-one-fourth.column   { width: 25%; }
  .tablet-one-third.column    { width: 33.333%; }
  .tablet-two-fifth.column    { width: 40%; }
  .tablet-one-second.column   { width: 50%; }
  .tablet-three-fifth.column  { width: 60%; }
  .tablet-two-third.column    { width: 66.666%; }
  .tablet-three-fourth.column { width: 75%; }
  .tablet-four-fifth.column   { width: 80%; }
  .tablet-five-sixth.column   { width: 83.333%; }
  .tablet-one.column          { width: 100%; }
}

/* Mobile: ≤767 — everything stacks */
@media only screen and (max-width: 767px) {
  .container .column,
  .section_wrapper .column,
  .section_wrapper .mcb-wrap {
    margin: 0;
    width: 100%;
    clear: both;
  }

  .mobile-one.mcb-wrap,
  .mobile-one.column {
    width: 100%;
  }

  .container {
    max-width: var(--fn-grid-width-mobile-container) !important;
  }

  /* Content sections: 550px wide with 33px gutters (theme option) */
  .content_wrapper .section_wrapper {
    max-width: var(--fn-grid-width-mobile) !important;
    padding-left: var(--fn-mobile-gutter);
    padding-right: var(--fn-mobile-gutter);
  }

  /* Nested section wrappers (e.g. shortcode output) do not double the gutter */
  .content_wrapper .section:not(.full-width) > .section_wrapper .section_wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .content_wrapper .mcb-column-inner {
    margin: 0 0 20px;
  }

  .content_wrapper .mfn-column-absolute .mcb-column-inner {
    margin: 0;
  }

  .mcb-wrap[data-mobile~="no-up"] {
    margin-top: 0 !important;
  }

  .mcb-section.wrap-reverse > .mcb-section-inner,
  .mcb-wrap.column-reverse > .mcb-wrap-inner {
    flex-direction: column-reverse;
  }

  .mcb-section.wrap-reverse-rows > .mcb-section-inner,
  .mcb-wrap.column-reverse-rows > .mcb-wrap-inner {
    flex-direction: row-reverse;
  }

  .equal-height .column-margin-0px .mcb-column-inner,
  .equal-height .mcb-wrap .mcb-column-inner,
  .equal-height.no-margin-v .mcb-wrap .mcb-column-inner {
    height: auto !important;
  }

  .highlight-left::after,
  .highlight-right::after {
    content: none;
  }

  .highlight-left .wrap:first-child,
  .highlight-right .wrap:last-child {
    background: var(--fn-color-theme);
  }

  .highlight-left .section_wrapper,
  .highlight-right .section_wrapper {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .highlight-left .section_wrapper .wrap,
  .highlight-right .section_wrapper .wrap {
    padding: 0 var(--fn-mobile-gutter);
  }
}

/* The (usually empty) classic-content section still occupies 15px, as before */
#Content section.the_content.no_content { height: 15px; }
