/* Fixes for this static copy, loaded on every page after the theme styles. */

/* Theme areas for tags, comments and a sidebar are empty on every page, but
   their margins add up to about 160px above the footer. */
.blog-tags-bottom,
.section-add-comment,
.col-secondary {
  display: none;
}

/* News cards for the news pages (tools/content.mjs). Their first paragraph can
   be longer than the text of the older cards, which makes the card taller than
   its photo; the photo fills the card instead of leaving a gap below it. On
   phones the photo sits above the text and keeps its own height. */
.westport-news-card > .zb-el-container:has(> .zb-el-zionImage),
.westport-news-card .zb-el-zionImage,
.westport-news-card .zb-el-zionImage > div {
  height: 100%;
}

.westport-news-card .zb-el-zionImage img {
  height: 100%;
  object-fit: cover;
}

/* /portugal/: more room above the press slider. The carousel plugin pulls its
   strip up 22px. */
.westport-press-carousel .carousel-thumb {
  margin-top: 10px;
}

/* Photo galleries added to project pages that had none. Every photo gets the
   shape of the AC27 renders (1500x810), so mixed formats line up. */
.westport-gallery-row {
  padding-top: 25px;
  padding-bottom: 50px;
}

.westport-gallery-row .cqcarousel-item img {
  width: 100%;
  aspect-ratio: 1500 / 810;
  object-fit: cover;
}

/* News pages (tools/content.mjs): the designer's template (Noticias.ai) on the
   site's grid and fonts. The content lines up with the page title above it.
   The photo shapes are the frames of the design; tools/news-images.py cuts
   the photos to the same numbers. */
/* The footer draws its line about 40px above its own box, so the bottom
   padding keeps the button as far from that line as the news list is. */
.westport-article {
  padding-top: 60px;
  padding-bottom: 80px;
}

.westport-article__inner {
  display: block;
  padding: 0 15px;
}

.westport-article__title {
  margin: 0 0 30px;
  font-family: 'Oswald', sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  color: #3d3d3d;
}

/* As a block, the subtitle moves to the next line whole when it does not fit. */
.westport-article__subtitle {
  display: inline-block;
  color: #bca13d;
}

.westport-article__wide {
  display: block;
  margin-bottom: 40px;
}

.westport-article__wide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.757;
  object-fit: cover;
}

.westport-article__text {
  margin-bottom: 60px;
}

.westport-article__text p {
  margin: 0 0 1.65em;
  font-size: 16px;
  line-height: 1.65;
  color: #747474;
}

.westport-article__text p:last-child {
  margin-bottom: 0;
}

/* Two columns, each with one tall and one short photo, so both end level. */
.westport-article__gallery {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.westport-article__column {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

.westport-article__photo {
  display: block;
  cursor: zoom-in;
}

.westport-article__photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.westport-article__photo--tall img {
  aspect-ratio: 0.7208;
}

.westport-article__photo--short img {
  aspect-ratio: 0.8654;
}

.westport-article__back {
  margin: 60px 0 0;
  text-align: center;
}

@media (max-width: 767px) {
  /* The theme keeps the slider wrapper at least 420px tall, but on phones the
     slider itself is about 230px, which left an empty band below it. */
  .main:has(> .rev_slider_wrapper),
  .rev_slider {
    min-height: 0;
  }

  /* Page builder spacers: the build caps the large ones for phones. */
  .vc_empty_space[style*="--phone-height"] {
    height: var(--phone-height) !important;
  }

  /* WPBakery puts 35px under every block. */
  .wpb_content_element {
    margin-bottom: 20px;
  }

  /* WPBakery also adds 35px above columns in or right after a row with a
     background, such as the page header. Same selectors, so this one wins. */
  .vc_col-has-fill > .vc_column-inner,
  .vc_row-has-fill + .vc_row-full-width + .vc_row > .vc_column_container > .vc_column-inner,
  .vc_row-has-fill + .vc_row > .vc_column_container > .vc_column-inner,
  .vc_row-has-fill > .vc_column_container > .vc_column-inner {
    padding-top: 20px;
  }

  /* The theme sets 35px in a style tag that comes after this file. */
  p.project-details-descr {
    margin-bottom: 20px;
  }

  /* Project pages: on phones the card has no margin, which left the BACK
     button 16px under the drawing. */
  .project-details-item {
    margin-bottom: 24px;
  }

  .westport-gallery-row {
    padding-top: 16px;
    padding-bottom: 0;
  }

  .westport-press-carousel .carousel-thumb {
    margin-top: 0;
  }

  /* Theme spacing sized for desktop (7.1em, about 85px). */
  .section {
    margin-top: 40px;
    margin-bottom: 40px;
  }

  .section-content {
    margin-top: 30px;
  }

  /* Keep the last block's margin inside the page area. Otherwise it merges with
     the footer's margin, and carousel dots, which hang below their box, end up
     touching the footer line. */
  .content,
  .blog-details {
    display: flow-root;
  }

  .blog-details {
    margin-bottom: 40px;
  }

  /* News articles only: other pages also use .blog-details, with no top margin. */
  .single .blog-details {
    margin-top: 40px;
  }

  .post-header {
    margin-bottom: 30px;
  }

  .footer {
    margin-top: 40px;
  }

  /* The site's own CSS sets the logo, the white bar and the social icons 30px
     from the left edge. On phones that left little room for the homepage
     slider texts, and the bar touched the PREV arrow, so they sit 15px from
     the edge, like the menu button and the NEXT arrow on the right. The logo
     moves on every page, so it stays in the same place. */
  header .brand-panel,
  header .vertical-panel,
  header .vertical-panel-content {
    left: 15px;
  }

  /* Homepage: the slider fills the screen (FULL_SCREEN_SLIDERS), so the
     theme's PREV/NEXT arrows, 4vh above its bottom, would sit under the
     newsletter bar fixed at the bottom of phones (60px). */
  .home .arrow-left,
  .home .arrow-right {
    bottom: calc(60px + 4vh);
  }

  /* News pages: the wide photo is cut 16:9 for phones (a <picture> source),
     otherwise it would be a strip about 120px tall. */
  .westport-article {
    padding-top: 32px;
    padding-bottom: 48px;
  }

  .westport-article__title {
    margin-bottom: 20px;
    font-size: 28px;
  }

  .westport-article__wide {
    margin-bottom: 24px;
  }

  .westport-article__wide img {
    aspect-ratio: 16 / 9;
  }

  .westport-article__text {
    margin-bottom: 32px;
  }

  .westport-article__text p {
    margin-bottom: 1.25em;
  }

  .westport-article__gallery,
  .westport-article__column {
    gap: 12px;
  }

  .westport-article__back {
    margin-top: 32px;
  }
}

@media (min-width: 768px) {
  /* Homepage: the slider fills the screen (FULL_SCREEN_SLIDERS) and its texts
     sit around the middle, where the theme fixes the newsletter tab. On screens
     up to about 1500px wide the tab covered the end of their lines, so on the
     homepage it sits lower. */
  .home .contact-buttons {
    top: auto;
    bottom: 15vh;
  }

  /* Page builder spacers: the build caps the large ones for wider screens too. */
  .vc_empty_space[style*="--desktop-height"] {
    height: var(--desktop-height) !important;
  }

  /* Project pages: the theme puts 7.1em (about 114px) above and below the
     project card. */
  .project-details {
    margin-top: 50px;
  }

  .project-details-item {
    margin-bottom: 50px;
  }

  /* The theme puts 7.1em (about 99px) above the footer and 8.3em (about 100px)
     below the page area. */
  .footer {
    margin-top: 60px;
  }

  .blog-details {
    margin-bottom: 60px;
  }

  /* News articles: 10.2em (about 122px) between the top image and the title. */
  .single .blog-details {
    margin-top: 64px;
  }

  /* Theme sections, such as the world map on About us: 7.1em (about 114px). */
  .section {
    margin-top: 64px;
    margin-bottom: 64px;
  }

  .section-content {
    margin-top: 64px;
  }
}
