/*
 * home.css — styles for the home page sections (intro, services, tagline,
 * "Nuestro trabajo", projects, CTA, Kit Digital band) and the hero slider.
 */

/* ---------------------------------------------------------------------- */
/* Shared section title                                                   */
/* ---------------------------------------------------------------------- */

.section-title {
  font-size: 36px;
  line-height: 1.3;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 50px;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-button);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  padding: 12px 24px;
  border-radius: 30px;
  border: 2px solid transparent;
  transition: background-color var(--transition-fast),
    color var(--transition-fast), border-color var(--transition-fast);
}

/* White outline, used on photo cards (Planos / Obras). */
.btn--outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--color-brand-red);
  border-color: var(--color-white);
  color: var(--color-white);
}

/* Solid white pill on a red background, used in the CTA band. */
.btn--solid {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-brand-red);
}

.btn--solid:hover,
.btn--solid:focus-visible {
  background: var(--color-brand-red);
  border-color: var(--color-white);
  color: var(--color-white);
}

/* ---------------------------------------------------------------------- */
/* Hero slider                                                             */
/* ---------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  /* Wide desktop ratio only from 1025px up; the live site switches to a
     much taller ratio at both tablet (1024) and mobile widths (measured
     1024x878 and 390x334 — nearly identical ~7:6 ratio at both), not
     just below the 767px mobile breakpoint. */
  aspect-ratio: 1920 / 800;
  background: var(--color-text);
}

@media (max-width: 1024px) {
  .hero {
    aspect-ratio: 7 / 6;
  }
}

.slider {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* easeOutQuad */
}

.slider__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-white);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.slider__arrow:hover,
.slider__arrow:focus-visible {
  opacity: 1;
}

.slider__arrow--prev {
  left: 12px;
}

.slider__arrow--next {
  right: 12px;
}

.slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.slider__dot {
  /* The shared `button` reset (base.css) clears border/background/font
     but not padding or native appearance. The UA default button padding
     (1px 6px) is wider than this 9px box, so with box-sizing:border-box
     the content width clamps to 0 and the border-box grows to fit the
     padding (12x9) instead of staying square — an oval, not a circle.
     Reset both explicitly so the box is exactly 9x9 at every width. */
  appearance: none;
  padding: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.slider__dot.is-active {
  background: var(--color-white);
  transform: scale(1.2);
}

/* Per-slide caption ("Soluciones", "Fiabilidad", ...). Desktop: plain
   white text, bottom-left. Mobile: same position, but on a dark
   translucent box for readability at the smaller size. */
.slider__caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  color: var(--color-white);
  font-size: 22px;
  line-height: 1;
  /* text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);*/
  color: #131313;
  font-family: "Open Sans", sans-serif;
  font-size: 225%;
  padding: 6px 15px 6px 15px;
}

.dark .slider__caption {
    background: RGBA(0, 0, 0, 0.5);
    opacity: 1;
    padding: 6px 15px 6px 15px;
    box-shadow: none;
    border: 0px solid RGBA(255, 255, 255, 0);
    border-radius: 3px;
    color: #fff;
}

@media (max-width: 767px) {
  /* .hero aspect-ratio is already 7/6 from the max-width:1024px rule
     above (which also covers this narrower range). */

  .slider__caption {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.55);
    text-shadow: none;
  }
}

/* ---------------------------------------------------------------------- */
/* Intro / who we are                                                      */
/* ---------------------------------------------------------------------- */

.intro {
  /* The original uses percentage padding here (15% of the section's own
     width), so it scales smoothly with the viewport instead of jumping
     at fixed breakpoints. */
  padding: 15% 0;
}

.intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 60px;
}

.intro__title {
  font-size: 45px;
  line-height: 1.11;
  margin-bottom: 25px;
}

.intro__subtitle {
  font-size: 1rem;
  line-height: 1.47;
  color: var(--color-text-soft);
}

.intro__body p {
  font-size: 1rem;
  line-height: 1.47;
}

.intro__body p + p {
  margin-top: 20px;
}

.intro__body strong {
  font-weight: 700;
  color: var(--color-text);
}

@media (max-width: 1024px) {
  .intro {
    padding: 90px 0;
  }
}

@media (max-width: 767px) {
  .intro {
    padding: 75px 0;
  }

  .intro__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ---------------------------------------------------------------------- */
/* Servicios que ofrecemos                                                 */
/* ---------------------------------------------------------------------- */

.services {
  padding: 80px 0;
  background: var(--color-bg-light);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 50px 40px;
}

.service-card__img {
  width: 100%;
  /* Matches the live site's rendered image proportions (measured: 532x377). */
  aspect-ratio: 532 / 377;
  object-fit: cover;
  margin-top: 15px;
  margin-bottom: 15px;
}

/* The first card's image is a white-background line drawing (a
   blueprint), which needs a thin border to read as a distinct image on
   the section's light grey background — matching the live site. */
.service-card__img--bordered {
  border: 1px solid rgba(11, 11, 11, 0.15);
}

.service-card__title {
  font-size: 24px;
  line-height: 1.3;
}

.service-card p {
  font-size: 1rem;
  line-height: 1.47;
}

@media (max-width: 1024px) {
  /* The live site opens up more space below the "Servicios que
     ofrecemos" heading at tablet/mobile widths than the shared
     .section-title's 50px (measured ~110px at 1024, ~95px at 390) --
     scoped to services only since the Proyectos heading (which shares
     .section-title) already matches without this override. */
  .services .section-title {
    margin-bottom: 100px;
  }
}

@media (max-width: 767px) {
  .services {
    padding: 50px 0;
  }

  .services__grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  /* Bold at mobile only — verified against the live site (the
     "Proyectos realizados" heading, sharing the same .section-title
     class, stays regular weight at the same width). */
  .services .section-title {
    font-weight: 600;
  }
}

/* ---------------------------------------------------------------------- */
/* Tagline                                                                  */
/* ---------------------------------------------------------------------- */

.tagline {
  /* Matches the live site's element (correcting an earlier mix-up with
     the "Nuestro trabajo" section's id): margin 5% (of viewport width,
     scales fluidly) plus a 150px/120px top/bottom padding at desktop. */
  margin: 5% 0;
  padding: 150px 0 120px;
  background: var(--color-white);
}

.tagline__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
}

.tagline__title {
  font-size: 44px;
  line-height: 1.36;
}

.tagline p {
  font-size: 1rem;
  line-height: 1.47;
}

@media (max-width: 1024px) {
  .tagline {
    padding: 90px 0;
  }
}

@media (max-width: 767px) {
  .tagline {
    padding: 75px 0;
  }

  .tagline__grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  /* The live site keeps the heading at the same 44px/60px size on
     mobile (verified: measured identical at 390px and 1440px) instead
     of shrinking it. */
}

/* ---------------------------------------------------------------------- */
/* Nuestro trabajo                                                         */
/* ---------------------------------------------------------------------- */

.work {
  /* Percentage padding (10% of the section's own width, so it scales
     fluidly instead of jumping at breakpoints) — matches the live
     site's element (correcting an earlier mix-up with the tagline
     section's id, which really uses fixed 150px/120px + 5% margin). */
  padding: 10% 0;
  /* Solid light grey — the photo lives only behind the card grid on the
     right (.work__cards-photo below), not behind the whole section. */
  background: var(--color-bg-light);
}

.work__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px;
}

/* .work__intro stretches to the row's full height (grid default
   align-items:stretch, matching the cards panel on its right); center
   its own heading+paragraph within that height instead of leaving them
   pinned to the top. The live site does the same thing on its column
   wrapper (`display:flex; align-items:center`) -- verified the
   heading/intro's own centre-Y lands exactly on the panel's centre-Y
   there, and nowhere close to it without this rule. */
.work__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work__title {
  font-size: 36px;
  line-height: 1.3;
  text-align: right;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.work__intro p {
  font-size: 1rem;
  line-height: 1.47;
  text-align: right;
}

/* Background photo behind the card grid, with the grid itself sitting
   in a semi-transparent light panel on top of it (matches the live
   site: a boxed panel over a background image, not a full-bleed
   watermark behind the whole section). */
.work__cards-photo {
  background-image: url("../img/home/work-panel-background.jpg");
  background-size: cover;
  background-position: center;
  /* Matches the live site's inset between the photo edge and the row
     panels (measured ~7-8px at 1440). */
  padding: 8px;
  border: 1px solid rgba(11, 11, 11, 0.25);
}

/* One panel per 2-card row (matches the live DOM: 4 separate stacked
   sections, not one panel wrapping all 7 cards). They sit flush
   against each other with no gap — verified on the live site the next
   row's top edge lands exactly on the previous row's bottom edge — so
   together they still read as a single continuous panel, but each
   row's own height is driven only by its own content instead of the
   tallest-of-all-seven. */
.work__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 60px;
  background: rgba(247, 247, 247, 0.88);
  padding: 20px 20px;
}

.work__row--single {
  grid-template-columns: 1fr;
}

.work-card h3 {
  font-size: 30px;
  font-weight: 300;
  line-height: 1.3;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.work-card p {
  font-size: 1rem;
  line-height: 1.47;
}

@media (max-width: 1024px) {
  /* The original stacks the "Nuestro trabajo" heading/intro above the
     card grid at tablet width, while the 2-column card grid itself
     stays 2 columns until the 767px mobile breakpoint. The heading and
     intro paragraph stay right-aligned throughout — verified at both
     1024px and 390px (an earlier center-align "fix" here was wrong).
     (.work padding is percentage-based already — see base rule.) */
  .work__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* The live site adds real breathing room around the stacked
     heading+intro block at tablet width (measured: 10% padding on
     every side, computed against the column's own width, i.e.
     ~102px at 1024px) -- this is what reads as "more vertical
     spacing above/below" once the block stacks above the cards
     panel instead of sitting beside it. Overridden with mobile's
     own fixed values below (the live site doesn't use the same 10%
     rule at 767px and under). */
  .work__intro {
    padding: 10%;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  /* At tablet width the live site's cards panel spans edge-to-edge
     (measured: 0 to the viewport's full width), breaking out of the
     .container's side padding that every other section keeps -- unlike
     at 767px and under, where the panel instead stays narrower than
     the photo strip behind it (see the mobile rule below), so this is
     scoped to tablet only. */
  .work__cards-photo {
    margin-inline: calc(-1 * var(--container-padding));
  }
}

@media (max-width: 767px) {
  /* The live site switches the heading/intro block to a fixed
     (non-percentage) padding at mobile width -- measured 60px top,
     30px right/left, 30px bottom -- overriding the tablet rule above. */
  .work__intro {
    padding: 60px 30px 30px;
  }

  /* The live site keeps the grid narrower than the photo at mobile
     too, flush to the left, with a strip of photo showing on the
     right (verified: panel ~330px wide inside a 390px-wide photo
     column). Same grey tint as desktop, not a whiter one. */
  .work__cards-photo {
    padding: 10px 40px 10px 10px;
  }

  .work__row {
    grid-template-columns: 1fr;
    row-gap: 20px;
    padding: 20px;
  }
}

/* ---------------------------------------------------------------------- */
/* Proyectos realizados                                                    */
/* ---------------------------------------------------------------------- */

.projects {
  /* Matches the live site's heading-area top spacing (100px) and cards
     row bottom padding (120px). */
  padding: 100px 0 120px;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.project-card {
  position: relative;
  display: flex;
  /* Matches the live site's measured card heights per breakpoint (they
     don't share one fixed aspect-ratio). */
  height: 469px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Dark grey wash over the whole photo by default (matches the live
   site); a red tint takes over on hover/focus as an affordance. */
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(58, 58, 58, 0.6);
  transition: background-color var(--transition-fast);
}

.project-card:hover::before,
.project-card:focus-within::before {
  background: rgba(222, 0, 0, 0.75);
}

.project-card__overlay {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  width: 100%;
  padding: 40px;
  color: var(--color-white);
}

.project-card__overlay h3 {
  font-size: 30px;
  line-height: 1.3;
  color: var(--color-white);
  margin-bottom: 10px;
}

.project-card__overlay p {
  font-size: 1rem;
  line-height: 1.47;
  color: var(--color-white);
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .projects {
    padding: 90px 0;
  }

  .project-card {
    height: 494px;
  }
}

@media (max-width: 767px) {
  .projects {
    padding: 75px 0;
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .project-card {
    height: 434px;
  }

  .project-card__overlay {
    padding: 25px;
  }
}

/* ---------------------------------------------------------------------- */
/* CTA                                                                      */
/* ---------------------------------------------------------------------- */

.cta {
  padding: 120px 0;
  background: var(--color-brand-red);
  text-align: center;
}

.cta__eyebrow {
  color: var(--color-white);
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.cta__title {
  color: var(--color-white);
  font-size: 34px;
  line-height: 1.2;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .cta {
    padding: 90px 0;
  }

  /* The live site's real gap between the CTA title and the button is
     ~96px, not 30px (measured identically at 1440 and 1024 -- the
     30px figure from an earlier round was wrong at every width, not
     just here). Only correcting it at tablet/mobile, where closing
     the page-height gap is in scope; leaving the 1440 desktop value
     as-is to avoid pushing that already slightly-tall layout further
     over its own target (see home-migration.md T12 notes). */
  .cta__title {
    margin-bottom: 96px;
  }
}

@media (max-width: 767px) {
  .cta {
    padding: 75px 0;
  }

  /* The live site keeps the CTA heading at 34px/40.8px on mobile too
     (measured identical at 390px, 1024px and 1440px). */

  /* The title-to-button gap grows further at mobile (measured
     ~177px at 390, vs ~96px at 1024/1440). */
  .cta__title {
    margin-bottom: 177px;
  }
}

/* ---------------------------------------------------------------------- */
/* Kit Digital band                                                        */
/* ---------------------------------------------------------------------- */

.kit-digital {
  padding: 50px 0;
}

.kit-digital__inner {
  text-align: center;
}

.kit-digital p {
  font-size: 1rem;
  line-height: 1.47;
  /* Matches the live site's column width, which is ~53% of its
     container at every measured breakpoint (208/390, 546/1024,
     608/1440 — the 620px cap only bites at the widest size). */
  width: 53%;
  max-width: 620px;
  /* The live site leaves ~47px total between the paragraph and the
     logos image (measured 1440/1024/390) -- not the 27px this had
     before. Kept as one margin-bottom (rather than adding a separate
     margin-top on the image) since adjacent block margins collapse
     to their max, not their sum, and 27+20 would otherwise still
     render as only 27px. */
  margin: 0 auto 47px;
}

.kit-digital__logos {
  /* Matches the live site's rendered width (measured: 636px at 1440,
     narrower than the image's own 1024px natural width would suggest). */
  width: 636px;
  max-width: 100%;
  margin: 0 auto;
  height: auto;
}

@media (max-width: 1024px) {
  .kit-digital {
    /* The live site uses 70px top/bottom padding here at every width
       (measured identically at 1440/1024/390), not the 50px this was
       previously estimated at. Only correcting it at tablet/mobile
       (where the gap this closes is largest) to avoid pushing the
       already slightly-tall 1440 layout further over its target. */
    padding: 70px 0;
  }

  .kit-digital__logos {
    width: 571px;
  }
}

@media (max-width: 767px) {
  .kit-digital__logos {
    width: 217px;
  }
}
