/* =============================================
   IELPO S.R.L.S — Custom CSS (Tailwind-first)
   Solo: @font-face, animazioni, componenti complessi
   ============================================= */

/* --- Helvetica locale --- */
@font-face {
  font-family: 'Helvetica';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local('Helvetica Light'), url('../helvetica/helvetica-light-587ebe5a59211.woff') format('woff');
}

@font-face {
  font-family: 'Helvetica';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Helvetica'), url('../helvetica/Helvetica.woff') format('woff');
}

@font-face {
  font-family: 'Helvetica';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Helvetica Oblique'), url('../helvetica/Helvetica-Oblique.woff') format('woff');
}

@font-face {
  font-family: 'Helvetica';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Helvetica Bold'), url('../helvetica/Helvetica-Bold.woff') format('woff');
}

@font-face {
  font-family: 'Helvetica';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: local('Helvetica Bold Oblique'), url('../helvetica/Helvetica-BoldOblique.woff') format('woff');
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Helvetica', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- Hero overlay --- */
.hero-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(28, 33, 48, .88) 0%, rgba(28, 33, 48, .58) 50%, rgba(28, 33, 48, .35) 100%);
}

/* --- Hero scroll line --- */
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .55), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }

  50% {
    opacity: .35;
    transform: scaleY(.55);
  }
}

/* --- Fade-up animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}

.fade-up.in {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: .1s;
}

.delay-2 {
  transition-delay: .2s;
}

.delay-3 {
  transition-delay: .3s;
}

.delay-4 {
  transition-delay: .4s;
}

/* --- Service card hover text reveal --- */
.service-reveal {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .45s ease, opacity .45s ease;
}

.service-card:hover .service-reveal {
  max-height: 120px;
  opacity: 1;
}

.service-card-arrow {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}

.service-card:hover .service-card-arrow {
  opacity: 1;
  transform: translateY(0);
}

/* --- Masonry item caption --- */
.masonry-cap {
  opacity: 0;
  transition: opacity .3s ease;
}

.masonry-item:hover .masonry-cap {
  opacity: 1;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, .97);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  user-select: none;
}

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: none;
  padding: 16px 18px;
  cursor: pointer;
  transition: background .2s;
  font-size: 1.1rem;
  line-height: 1;
}

.lb-btn:hover {
  background: #C0461A;
}

.lb-prev {
  left: 20px;
}

.lb-next {
  right: 20px;
}

/* --- Mobile nav drawer --- */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 90vw);
  height: 100dvh;
  background: #1C2130;
  z-index: 1100;
  padding: 88px 32px 40px;
  display: flex;
  flex-direction: column;
  transition: right .35s ease;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

/* --- Scroll-to-top --- */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: #C0461A;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  border-radius: 3px;
  opacity: 0;
  transform: translateY(16px);
  transition: all .3s ease;
  box-shadow: 0 4px 16px rgba(192, 70, 26, .4);
  z-index: 500;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  background: #1C2130;
}

/* --- Header transition --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background .3s ease, box-shadow .3s ease;
}

.site-header.scrolled {
  background: #1C2130;
  box-shadow: 0 2px 24px rgba(0,0,0,.25);
}
.site-header.light {
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

/* Logo swap — default: white logo (home transparent + home scrolled) */
.logo-white { display: block; }
.logo-dark  { display: none; }

/* Light pages (non-home): always dark logo */
.site-header.light .logo-white { display: none; }
.site-header.light .logo-dark  { display: block; }

/* Nav links — light pages: dark/black */
.site-header.light .nav-link { color: #2D2D2D !important; }
.site-header.light .nav-link:hover,
.site-header.light .nav-link.active { color: #C0461A !important; }
/* Home scrolled: links stay white (Tailwind text-white/85 default applies) */

/* Phone number — light pages: dark */
.site-header.light .header-phone { color: #2D2D2D !important; }

/* Mobile toggle bars — light: dark; home scrolled: white */
.site-header.light .toggle-bar { background: #1C2130 !important; }
.site-header.scrolled:not(.light) .toggle-bar { background: #fff !important; }

/* --- Footer link underline animation --- */
.footer-link::before {
  content: '';
  width: 14px;
  height: 1px;
  background: #C0461A;
  display: inline-block;
  opacity: 0;
  margin-right: 0;
  transition: opacity .2s, margin-right .2s;
  vertical-align: middle;
}

.footer-link:hover::before {
  opacity: 1;
  margin-right: 6px;
}

/* --- Portfolio item overlay --- */
.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 33, 48, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
}

.portfolio-item:hover .portfolio-overlay {
  background: rgba(28, 33, 48, .45);
}

.portfolio-overlay-icon {
  opacity: 0;
  transition: opacity .3s;
  color: #fff;
  font-size: 1.5rem;
}

.portfolio-item:hover .portfolio-overlay-icon {
  opacity: 1;
}

/* --- Blog card image zoom --- */
.blog-img {
  transition: transform .55s ease;
}

.blog-card:hover .blog-img {
  transform: scale(1.05);
}

/* --- Why card border --- */
.why-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #C0461A;
  transform: scaleX(0);
  transition: transform .3s;
}

.why-card:hover::before {
  transform: scaleX(1);
}

/* --- Mobile overlay --- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* --- Form select appearance --- */
select.form-control {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* --- Article body typography --- */
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1C2130;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: .75rem;
  color: #1C2130;
}

.article-body p {
  color: #6B7280;
  margin-bottom: 1.125rem;
  line-height: 1.8;
  font-size: .97rem;
}

.article-body ul {
  margin: 0 0 1.125rem 1.25rem;
  list-style: disc;
}

.article-body ul li {
  color: #6B7280;
  font-size: .97rem;
  line-height: 1.7;
  margin-bottom: .375rem;
}

.article-body .highlight {
  background: #FEF3ED;
  border-left: 4px solid #C0461A;
  padding: 18px 22px;
  margin: 1.75rem 0;
  border-radius: 0 3px 3px 0;
}

.article-body .highlight p {
  color: #1C2130;
  margin: 0;
  font-weight: 500;
}