/* =========================================================================
   EMEKUS BITUMEN — MAIN STYLESHEET
   -------------------------------------------------------------------------
   Sections:
     1.  Base / reset
     2.  Accessibility
     3.  Header & navigation
     4.  Hero
     5.  Buttons
     6.  Sections
     7.  About Us (homepage)
     8.  Services grid
     9.  Gallery grid
     10. Blog (grid + JS-driven ticker on homepage)
     11. Videos (horizontal scroll row)
     12. Client ticker
     13. Homepage closing CTA
     14. Contact form + page
     15. Page hero
     16. Footer
     17. Lightbox
     18. Mobile navigation
     19. Mobile video fix
     20. Small-screen logo adjustments
   ========================================================================= */


/* =========================================================================
   1. BASE / RESET
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: #fff;
  font-size: 16px;
  overflow-x: hidden; /* prevent horizontal scroll from tickers */
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
ul { list-style: none; }
h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.35rem; }
.container { width: min(1200px, 92%); margin: 0 auto; }


/* =========================================================================
   2. ACCESSIBILITY
   ========================================================================= */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

/* NOTE: prefers-reduced-motion intentionally does NOT disable the blog
   ticker anymore — JS handles that gracefully. But we still honour the
   preference for other animations. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


/* =========================================================================
   3. HEADER & NAVIGATION
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary);
  flex-shrink: 0;
}
.logo-mark {
  width: 40px; height: 40px;
  background: var(--secondary);
  color: #fff;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800;
}
.logo-text span { color: var(--secondary); }
.logo-img { max-height: 48px; width: auto; display: block; object-fit: contain; }

.main-nav ul { display: flex; gap: 1.5rem; align-items: center; }
.main-nav a {
  font-weight: 500;
  padding: .5rem 0;
  position: relative;
  font-size: .95rem;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--secondary);
  transition: width .3s;
}
.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }
.main-nav a.active { color: var(--secondary); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}


/* =========================================================================
   4. HERO
   ========================================================================= */
.hero {
  position: relative;
  min-height: 85vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(13,27,42,.85), rgba(13,27,42,.7));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  padding: 4rem 1rem;
}
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--secondary);
}
.hero h1 {
  color: #fff;
  margin-bottom: 1rem;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
.hero-sub {
  max-width: 780px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  line-height: 1.75;
  opacity: .95;
}
.hero-sub p { margin-bottom: 1rem; }
.hero-sub p:last-child { margin-bottom: 0; }
.hero-sub strong { color: #fff; }


/* =========================================================================
   5. BUTTONS
   ========================================================================= */
.btn {
  display: inline-block;
  padding: .9rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 0;
  transition: all .3s;
}
.btn-primary { background: var(--secondary); color: #fff; }
.btn-primary:hover {
  background: #c1303c;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(230,57,70,.4);
}
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline:hover { background: #fff; color: var(--primary); }


/* =========================================================================
   6. SECTIONS
   ========================================================================= */
.section { padding: 5rem 0; }
.section-title { text-align: center; margin-bottom: 3.5rem; }
.section-title span {
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: .85rem;
}
.section-title h2 { margin-top: .5rem; }


/* =========================================================================
   7. ABOUT US (HOMEPAGE)
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}
.about-content {
  color: #555;
  line-height: 1.7;
  max-height: 340px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
}
.about-content h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.about-content h2:first-child { margin-top: 0; }
.about-content p { margin-bottom: .9rem; }
.about-content ul { margin: .5rem 0 1rem 1.25rem; list-style: disc; }
.about-content li { margin-bottom: .35rem; }
.about-content strong { color: var(--primary); }


/* =========================================================================
   8. SERVICES GRID
   ========================================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.service-card {
  background: #fff;
  border: 1px solid #ececec;
  border-top: 3px solid var(--primary);
  border-radius: 10px;
  overflow: hidden;
  transition: border-top-color .25s, transform .25s, box-shadow .25s;
}
.service-card:hover {
  border-top-color: var(--secondary);
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(0,0,0,.08);
}
.service-card img { height: 200px; width: 100%; object-fit: cover; }
.service-card .body { padding: 1.5rem; }
.service-card h3 { margin-bottom: .75rem; }
.service-card p { color: #555; margin-bottom: 1rem; font-size: .95rem; }

.read-more { color: var(--secondary); font-weight: 600; font-size: .9rem; }
.read-more:hover { color: var(--primary); }


/* =========================================================================
   9. GALLERY GRID
   ========================================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-grid-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.gallery-item:hover img { transform: scale(1.08); }

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity .3s;
  font-size: .9rem;
}
.gallery-item:hover .overlay { opacity: 1; }

@media (max-width: 1024px) { .gallery-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .gallery-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .gallery-grid-4 { grid-template-columns: 1fr; } }


/* =========================================================================
   10. BLOG
   -------------------------------------------------------------------------
   Two layouts:
     .blog-grid       — used on /blog page (grid of cards)
     .blog-ticker     — used on the homepage (JS-driven auto-scrolling)
     .blog-card       — card style inside the grid
     .blog-card-h     — horizontal card used inside the ticker

   The ticker animation is driven by JavaScript in main.js (section 7).
   CSS here provides only layout, edge fade, and swipe fallback.
   ========================================================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Shared card styling */
.blog-card,
.blog-card-h {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.blog-card:hover,
.blog-card-h:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,.07);
}
.blog-card .body,
.blog-card-h .body { padding: 1.5rem; }
.blog-card .meta,
.blog-card-h .meta { color: #888; font-size: .85rem; margin-bottom: .75rem; }
.blog-card h3,
.blog-card-h h3 { margin-bottom: .75rem; font-size: 1.15rem; }
.blog-card img,
.blog-card-h img { height: 220px; width: 100%; object-fit: cover; }


/* ---------- JS-driven auto-scrolling blog ticker (homepage) ---------- */
.blog-ticker {
  overflow: hidden;
  padding: .5rem 0 1.5rem;
  /* Soft fade at the edges */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  isolation: isolate;

  /* Fallback: if JS ever fails, users can still swipe horizontally */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.blog-ticker::-webkit-scrollbar { display: none; }

.blog-ticker-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  /* JS updates transform; these properties make it smooth */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* Card variant inside the ticker */
.blog-card-h {
  flex: 0 0 auto;
  width: 340px;
  max-width: 85vw;
}
.blog-card-h img { height: 200px; }
.blog-card-h .body { padding: 1.25rem; }
.blog-card-h .meta { font-size: .82rem; margin-bottom: .6rem; }
.blog-card-h h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: .6rem;
}
.blog-card-h p {
  font-size: .9rem;
  color: #555;
  margin-bottom: .9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile: narrower cards */
@media (max-width: 740px) {
  .blog-card-h { width: 80vw; max-width: 320px; }
}


/* =========================================================================
   11. VIDEOS
   -------------------------------------------------------------------------
   .video-row    — horizontal scroll row (homepage + /videos page)
   .video-wrap   — individual slide wrapper
   .video-nav    — arrow button row
   ========================================================================= */
.video-row {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: .5rem .25rem 1.25rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.video-row::-webkit-scrollbar { height: 8px; }
.video-row::-webkit-scrollbar-track { background: #eee; border-radius: 4px; }
.video-row::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
.video-row::-webkit-scrollbar-thumb:hover { background: var(--secondary, #e63946); }

.video-row .video-wrap {
  flex: 0 0 auto;
  width: 380px;
  max-width: 85vw;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  background: #000;
}
.video-row .video-wrap iframe {
  width: 100%; height: 100%; border: 0; display: block;
}

.video-row.single { justify-content: center; }
.video-row.single .video-wrap {
  width: min(900px, 100%);
  max-width: 900px;
}

.video-nav {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: 1rem;
}
.video-nav button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--secondary, #e63946);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: background .2s, transform .2s;
}
.video-nav button:hover { background: #c1303c; transform: translateY(-2px); }

.video-wrap {
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
}
.video-wrap iframe { width: 100%; height: 100%; border: 0; }


/* =========================================================================
   12. CLIENT TICKER
   ========================================================================= */
.ticker {
  overflow: hidden;
  padding: 2rem 0;
  background: #f8f9fa;
  isolation: isolate;
}
.ticker-track {
  display: flex;
  gap: 4rem;
  animation: scroll 40s linear infinite;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker img {
  height: 60px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .6;
  transition: all .3s;
}
.ticker img:hover { filter: none; opacity: 1; }

@keyframes scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Mobile: keep the client ticker running */
@media (max-width: 740px) {
  .ticker-track {
    animation-duration: 50s !important;
    animation-play-state: running !important;
  }
  .ticker:hover .ticker-track { animation-play-state: running; }
}


/* =========================================================================
   13. HOMEPAGE CLOSING CTA
   ========================================================================= */
section[style*="var(--primary)"] {
  padding: 5.5rem 0;
  position: relative;
  overflow: hidden;
}
section[style*="var(--primary)"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.06), transparent 55%);
  pointer-events: none;
}
section[style*="var(--primary)"] h2 { text-wrap: balance; }
section[style*="var(--primary)"] .btn-primary:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}


/* =========================================================================
   14. CONTACT FORM + PAGE
   ========================================================================= */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 500;
  font-size: .9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .2s;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus { outline: 0; border-color: var(--secondary); }

.hp-field { position: absolute; left: -9999px; opacity: 0; }

.alert { padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.5rem; font-size: .95rem; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}
.contact-info h3 { margin-bottom: 1.25rem; }
.contact-line {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: 1rem 0;
  font-size: .98rem;
}
.contact-line i { margin-top: .25rem; font-size: 1.1rem; }
.contact-line a { color: inherit; }
.contact-line a:hover { color: var(--secondary); }

.contact-map {
  margin-top: 1.75rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.contact-map iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

.math-captcha .math-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.math-captcha .math-question {
  font-size: 1rem;
  color: #333;
  background: #f8f9fa;
  padding: .5rem .85rem;
  border-radius: 8px;
  display: inline-block;
}
.math-captcha .math-question strong {
  color: var(--secondary, #e63946);
  font-size: 1.1rem;
}
.math-captcha input[type="number"] {
  width: 120px;
  padding: .6rem .75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}
.math-captcha input[type="number"]:focus {
  outline: 0;
  border-color: var(--secondary, #e63946);
}


/* =========================================================================
   15. PAGE HERO
   ========================================================================= */
.page-hero {
  background: linear-gradient(135deg, var(--primary), #1a2f4a);
  color: #fff;
  padding: 5rem 0 3rem;
  text-align: center;
}
.page-hero h1 { color: #fff; }
.page-hero p { opacity: .85; margin-top: .5rem; }


/* =========================================================================
   16. FOOTER
   ========================================================================= */
.site-footer {
  background: var(--primary);
  color: #ccc;
  padding: 4rem 0 0;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  padding-bottom: 3rem;
}
.footer-col h4 { color: #fff; margin-bottom: 1rem; font-size: 1.1rem; }
.footer-col p,
.footer-col li { margin-bottom: .5rem; font-size: .92rem; }
.footer-col a:hover { color: var(--secondary); }

.socials { display: flex; gap: .75rem; }
.socials a {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  transition: background .3s;
}
.socials a:hover { background: var(--secondary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: .88rem;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-bottom-inner p { margin: 0; font-size: .88rem; }
.footer-bottom .powered-by a {
  color: var(--secondary, #e63946);
  font-weight: 600;
}
.footer-bottom .powered-by a:hover {
  color: #fff;
  text-decoration: underline;
}
@media (max-width: 600px) {
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}


/* =========================================================================
   17. LIGHTBOX
   ========================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}


/* =========================================================================
   18. MOBILE NAVIGATION
   ========================================================================= */
@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
  }
  .main-nav.open { max-height: 500px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 1rem; }
  .main-nav a {
    display: block;
    padding: .75rem 1rem;
    border-radius: 8px;
  }
  .hero { min-height: 70vh; }
}


/* =========================================================================
   19. MOBILE VIDEO FIX
   ========================================================================= */
@media (max-width: 860px) {
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #fff;
  }
}

@media (max-width: 740px) {
  .video-row {
    scroll-snap-type: none;
    scroll-padding: 0;
  }
  .video-row .video-wrap {
    width: 85vw;
    border-radius: 10px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
  }
  .video-row .video-wrap iframe {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
}

.video-row .video-wrap:fullscreen,
.video-row .video-wrap:-webkit-full-screen {
  overflow: visible;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  transform: none;
  -webkit-transform: none;
}
.video-row .video-wrap:fullscreen iframe,
.video-row .video-wrap:-webkit-full-screen iframe {
  width: 100%;
  height: 100%;
  transform: none;
  -webkit-transform: none;
}


/* =========================================================================
   20. SMALL-SCREEN LOGO ADJUSTMENTS
   ========================================================================= */
@media (max-width: 640px) {
  .logo-text { font-size: 1.1rem; }
  .logo-img  { max-height: 38px; }
}