/*
 Theme Name:   Fiare
 Theme URI:    https://fiare.com
 Description:  GeneratePress child theme for Fiare.com
 Author:       Lauri Aaltonen
 Author URI:   https://fiare.com
 Template:     generatepress
 Version:      0.1
*/

.tm-10 {
	margin-top: 10px;
}

.margin-small {
	margin: 1em !important;
}

.bg-blue {
	background-color: var(--accent) !important;
}

.color-white {
	color: var(--base) !important;
}

/* Added some spacing between navbar text and underline on hover, focus, current etc. */
.gb-menu-item-mi56a65d:is(:hover,:focus-within),
.gb-menu-item-mi56a65d:is(.current-menu-item,.current-menu-item:hover,.current-menu-item:focus-within) {
    text-underline-offset: 0.3em;
}

/* Added a rule to decrease megamenus' default <hr> top nad bottom margin from 40px to 1em */
hr.wp-block-separator.has-alpha-channel-opacity {
    margin: 1em 0;
}

/* Added some width to the mobile slideout menu */
.main-navigation.offside {
    width: 300px !important;
}

.offside-js--is-right.slide-opened .slideout-overlay button.slideout-exit {
    right: calc(300px - 5px) !important;
}

/* Navbar CTA */
li#menu-item-24384, li#menu-item-25745 {
    text-decoration: none; /* Remove underline */
}

.nav-button-blue a {
    align-items: center;
    background-color: var(--accent);
    color: #ffffff !important;
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
	margin-left: 16px;
	margin-right: 16px;
	height: 30px;
}

@media (max-width: 1099px) {
	ul#menu-main-navigation-2>li {
		display: flex;
		justify-content: center;
		flex-wrap: wrap;
	}
	.nav-button-blue a {
        background-color: var(--base);
        color: var(--accent) !important;
        font-size: 16px;
        margin: auto auto 1em auto;
    }
	.nav-button-blue a:is(:hover, :focus) {
		background-color: var(--accent-2);
		color: var(--base) !important;
	}
}

.nav-button-blue a:is(:hover, :focus) {
    background-color: var(--accent-2); /* This is the same blue we have on sticky header, change needed? */
    color: rgb(255, 255, 255);
}

/*
  Continuous scrolling logo marquee.
  - Pure CSS animation, no JS required.
  - Includes edge fade and responsive speed scaling.
*/

.logo-marquee-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 1rem 0;
}

.logo-marquee {
  display: flex;
  align-items: center;
  width: 100%;
}

.logo-track {
  display: flex;
  gap: 4rem;
  animation: scroll 60s linear infinite;
  width: max-content;
}

.logo-marquee img {
  height: auto;
  max-height: 75px;
  width: auto;
  max-width: 125px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.9;
  transition: all 0.3s ease;
}

.logo-marquee img:hover {
  filter: grayscale(0%);
  opacity: 1;
  /*transform: scale(2);*/
  /*max-height: 50px;*/
}

/* Infinite scroll animation */
@keyframes scroll {
  from {
    transform: translateX(25%);
  }
  to {
    transform: translateX(-75%);
  }
}

/* Edge fade overlays */
.fade-gray, .fade {
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.fade-left {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.fade-right {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.fade-left-gray {
  left: 0;
  background: linear-gradient(to right, rgba(245, 245, 245, 1), rgba(245, 245, 245, 0));
}

.fade-right-gray {
  right: 0;
  background: linear-gradient(to left, rgba(245, 245, 245, 1), rgba(245, 245, 245, 0));
}

/* Responsive speed & sizing */
@media (max-width: 1024px) {
  .logo-track {
    animation-duration: 110s;
  }
}

@media (max-width: 640px) {
  .logo-track {
    animation-duration: 130s;
  }

  .logo-marquee img {
    height: 40px;
    width: 80px;
  }

  .fade-gray, .fade {
    width: 60px;
  }
}

/* --- GenerateBlocks Tabs: fade effect including initial load --- */
.frontpage .gb-tabs__item, 
.marketplace .gb-tabs__item, 
.vehicletrade .gb-tabs__item {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  inset: 0;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}

.frontpage .gb-tabs__item.gb-tabs__item-open, 
.marketplace .gb-tabs__item.gb-tabs__item-open, 
.vehicletrade .gb-tabs__item.gb-tabs__item-open {
  opacity: 1;
  visibility: visible;
  position: relative;
  transition-delay: 0.25s;
  animation: tabFadeIn 1.5s ease forwards;
}

@keyframes tabFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.frontpage .gb-tabs__items, 
.marketplace .gb-tabs__items, 
.vehicletrade .gb-tabs__items {
  position: relative;
}

/*
  INSIGHTS-page Custom layout for GeneratePress Query Loop.
  - First post acts as a hero with overlay card on image.
  - Subsequent posts use smaller images with right-aligned overlapping cards.
*/

/* --- Query Loop Grid --- */
.insights .gb-query-loop,
.insights .wp-block-query {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

/* --- HERO (first post) --- */
.insights .gb-loop-item:first-child {
  grid-column: 1 / -1;
  position: relative;
}

/* Hero with image */
.insights .gb-loop-item:first-child:has(img) img {
  width: 70%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}

.insights .gb-loop-item:first-child:has(img) .post-card {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 40%;
  z-index: 2;
}

/* Hero fallback (no image present) */
.insights .gb-loop-item:first-child:not(:has(img)) .post-card {
  position: static;
  margin-top: 0;
  width: 100%;
  box-shadow: none;
}

/* --- OTHER POSTS --- */
.insights .gb-loop-item:not(:first-child) {
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: flex-start;
  padding: 20px;
}

.insights .gb-loop-item:not(:first-child) img {
  width: 70%;
  height: 420px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Right-aligned overlapping card */
.insights .gb-loop-item:not(:first-child) .post-card {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  position: relative;
  width: 70%;
  margin-top: -16rem;
  margin-left: auto;
  z-index: 2;
}

.insights .post-card h2.gb-text {
  font-size: 1.5rem;
}

/* Clamp excerpt text */
.insights .post-card p.gb-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 7.2em;
}

/* Prevent layout break when no image exists */
.insights .gb-loop-item:not(:first-child):not(:has(img)) .post-card {
  margin-top: 0; /* cancel overlap */
  width: 100%;   /* stretch normally */
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
	.gb-element-540898b5 .gb-media-d3424f16 {
		display: unset !important;
	}

  .insights .gb-query-loop,
  .insights .wp-block-query {
    grid-template-columns: 1fr;
  }

  .insights .gb-loop-item:not(:first-child) {
    padding: 20px 0;
  }

  /* Hero with image */
  .insights .gb-loop-item:first-child:has(img) .post-card {
    position: static;
    width: 90%;
    margin: -3rem auto 0;
  }

  /* Hero without image */
  .insights .gb-loop-item:first-child:not(:has(img)) .post-card {
    position: static;
    width: 90%;
    margin: 0 auto;
  }

  .insights .gb-loop-item:not(:first-child) .post-card {
    width: 90%;
    margin: -2.5rem auto 0;
  }

  .insights .gb-loop-item:not(:first-child) img {
    height: 180px;
  }

	.insights .gb-element-432fde8b {
		flex-wrap: wrap;
	}
}

@media (max-width: 769px) {
	.gb-tabs__menu {
		flex-direction: column;
		align-items: center;
		margin: unset !important;
		/* box-shadow: none !important;
		border: none !important;*/
	}
}