/*
 * Jose Cazorla Website
 * Design: Rocío Zanón de la Fuente
 * Development: Roberto Díaz Martín Junquera
 * © 2026
 */

/* ---------------------------------------------------------
   Responsive rules
   Desktop navigation stays visible until 900px.
   This avoids the oversized tablet menu seen around 1000px.
---------------------------------------------------------- */

@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr);
    gap: 46px;
  }

  .hero-visual {
    width: min(100%, 430px);
    min-height: 0;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .service-card {
    min-height: 300px;
  }

  .coming-card {
    grid-template-columns: 1fr 1fr;
  }

  /* Keep About closer to Rocío's proportions on small desktop/tablet. */
  .about-grid {
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    gap: 46px;
  }

  .about-photo-shell {
    width: min(100%, 430px);
  }
}

/* Hamburger navigation only starts once the desktop header is genuinely tight. */
@media (max-width: 900px) {
  :root {
    --header-h: 80px;
  }

  /* Disable backdrop-filter here so the fixed menu is anchored to the viewport,
     not to the sticky header in Chromium/Edge. */
  .site-header,
  .site-header.is-scrolled {
    height: var(--header-h);
    background: rgba(251, 250, 247, .98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .main-nav {
    position: fixed;
    z-index: 240;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    /* 100vh is the compatibility fallback; modern browsers use dvh below. */
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    justify-self: stretch;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(28px, 5vh, 52px) var(--gutter) 36px;
    background: #f7f6f3;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity .24s ease,
      transform .34s var(--ease),
      visibility 0s linear .34s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
  }

  .nav-list {
    width: min(100%, 720px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 26px;
  }

  .nav-list li {
    opacity: 0;
    transform: translateY(16px);
    border-bottom: 1px solid var(--line);
    transition: opacity .32s ease, transform .4s var(--ease);
  }

  .main-nav.is-open .nav-list li {
    opacity: 1;
    transform: none;
  }

  .main-nav.is-open .nav-list li:nth-child(1) { transition-delay: .03s; }
  .main-nav.is-open .nav-list li:nth-child(2) { transition-delay: .06s; }
  .main-nav.is-open .nav-list li:nth-child(3) { transition-delay: .09s; }
  .main-nav.is-open .nav-list li:nth-child(4) { transition-delay: .12s; }
  .main-nav.is-open .nav-list li:nth-child(5) { transition-delay: .15s; }
  .main-nav.is-open .nav-list li:nth-child(6) { transition-delay: .18s; }
  .main-nav.is-open .nav-list li:nth-child(7) { transition-delay: .21s; }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: 58px;
    padding: 10px 2px;
    border-radius: 0;
    font-size: clamp(1.35rem, 5vw, 2.5rem);
    font-weight: 470;
    letter-spacing: -.035em;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    transform: translateX(8px);
  }

  .nav-link[aria-current="page"]::after {
    content: "•";
    margin-left: auto;
    color: var(--accent-2);
    font-size: 1.35rem;
  }

  .nav-indicator {
    display: none;
  }

  .main-nav > .language-switcher {
    display: flex;
    align-self: flex-start;
    margin-top: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s .18s ease, transform .36s .18s var(--ease);
  }

  .main-nav.is-open > .language-switcher {
    opacity: 1;
    transform: none;
  }

  .header-actions > .language-switcher {
    display: none;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    position: relative;
    z-index: 260;
  }
}

@media (max-width: 820px) {
  :root {
    --gutter: 22px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(4rem, 16vw, 7rem);
  }

  .hero-copy-body {
    max-width: none;
  }

  .hero-visual {
    width: min(100%, 500px);
    min-height: 0;
    justify-self: center;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quote-panel {
    grid-template-columns: 1fr;
  }

  .about-topline {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo-shell {
    position: relative;
    top: auto;
    width: min(100%, 470px);
    justify-self: start;
  }

  .about-ending {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .about-quote-card {
    max-width: 470px;
    padding: 22px 20px 20px;
    border-radius: 20px;
  }

  .about-ending-copy p {
    font-size: .98rem;
    line-height: 1.62;
  }

  .about-signature {
    justify-items: start;
    min-height: 0;
  }

  .signature-image {
    justify-self: start;
    width: min(100%, 300px);
    max-height: 88px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-intro {
    position: relative;
    top: auto;
  }

  .coming-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .coming-visual {
    min-height: 330px;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: .72rem;
  }

  .main-nav {
    padding-top: 24px;
  }

  .nav-link {
    min-height: 52px;
    font-size: clamp(1.28rem, 8vw, 2rem);
  }

  .hero-title {
    font-size: clamp(3.6rem, 19vw, 5.6rem);
  }

  .hero-copy-body {
    padding-left: 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    width: min(100%, 420px);
    min-height: 0;
  }

  .hero-photo-shell {
    border-radius: 70px 14px 70px 14px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 255px;
  }

  .quote-panel {
    padding: 34px 26px;
  }

  .about-photo-shell {
    width: min(100%, 420px);
  }

  .contact-form-card {
    padding: 26px 22px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .coming-card {
    padding: 34px 24px;
  }

  .coming-title {
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }
}
