/* ================================================================
   VIRTUOSO CELLO — RESPONSIVE CSS v2.1
   Correções de responsividade mobile, alinhamento e overflow
================================================================ */

/* ----------------------------------------------------------------
   CONTAINERS & CONTAINMENT RULES (MOBILE DEFAULT / BREAKPOINTS)
---------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Global Container Standard */
  .container,
  .container--narrow,
  .container--wide,
  .section-container,
  .content-wrapper {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: 20px;
    box-sizing: border-box;
  }

  /* General Button Behavior on Mobile */
  .btn {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    text-align: center;
    box-sizing: border-box;
  }

  /* Text & Title Wrap Rules */
  h1, h2, h3, h4, h5, h6,
  .section-title,
  .hero-title,
  .contact-info-title,
  .page-hero-title {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .hero-title {
    font-size: clamp(2rem, 7.5vw, 3.2rem);
    line-height: 1.15;
  }

  .page-hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.75rem);
    line-height: 1.2;
  }

  .section-title {
    font-size: clamp(1.5rem, 5.5vw, 2.4rem);
    line-height: 1.25;
  }

  p {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Decorative Elements Overflow Containment */
  .authority-bar::before,
  .services-section::before,
  .repertoire-cta::before,
  .site-footer::before,
  .contact-section::before,
  .title-line {
    max-width: 100%;
  }

  .hero-fhole {
    display: none !important;
  }

  /* Header / Mobile Drawer */
  .nav-desktop { display: none; }
  .btn-header-cta { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav-mobile { display: flex; }

  /* Hero */
  .hero {
    min-height: 100svh;
    padding-top: var(--header-h-mobile);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .hero-bg img {
    object-position: 70% center;
  }

  .hero-overlay {
    background:
      linear-gradient(to right, rgba(11,11,11,0.92) 0%, rgba(11,11,11,0.80) 100%),
      linear-gradient(to top, rgba(11,11,11,0.85) 0%, transparent 50%);
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    padding-block: 2.5rem 4.5rem;
    box-sizing: border-box;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.875rem;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
  }

  /* Scroll progress line */
  .scroll-progress-line {
    height: 1px;
  }

  /* Section connector */
  .section-connector {
    padding-block: 1rem;
    max-width: 100%;
    overflow: hidden;
  }

  /* Authority Bar */
  .authority-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
  }

  .authority-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.875rem;
  }

  .authority-item::after { display: none !important; }

  /* About Section */
  .about-grid,
  .bio-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
  }

  .about-image-wrap,
  .bio-photo {
    width: 100%;
    max-width: 360px;
    margin-inline: auto;
    box-sizing: border-box;
  }

  .about-badge {
    display: none;
  }

  .about-content,
  .bio-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .about-content .section-title,
  .bio-content .section-title {
    text-align: center;
  }

  .about-content .eyebrow,
  .bio-content .eyebrow {
    text-align: center;
    display: block;
  }

  .about-content .title-line,
  .bio-content .title-line {
    display: block;
    margin-inline: auto;
  }

  .about-content > .btn,
  .bio-content > .btn {
    align-self: center;
    width: 100%;
    max-width: 100%;
  }

  /* Audiovisual */
  .av-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  /* Services / Apresentações / Moments Grids */
  .services-grid,
  .event-types-grid,
  .moments-grid,
  .diferenciais-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 1.5rem;
  }

  .service-card,
  .event-type-card,
  .moment-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Repertoire Page (repertorio.html) Overrides */
  .rep-category-header {
    padding: 1.25rem 1rem;
  }

  .rep-category-body {
    padding: 0 1rem 1.25rem;
  }

  .rep-songs {
    grid-template-columns: minmax(0, 1fr);
  }

  .rep-song {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .rep-song-name {
    min-width: 0;
    overflow-wrap: break-word;
  }

  .rep-song-composer {
    white-space: normal;
    overflow-wrap: break-word;
  }

  .repertoire-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .repertoire-pill {
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
  }


  /* How It Works */
  .howto-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
  }

  .howto-grid::before { display: none; }

  .howto-step {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 0;
    width: 100%;
    min-width: 0;
  }

  .howto-step-number {
    flex-shrink: 0;
    margin-bottom: 0;
    width: 3.25rem;
    height: 3.25rem;
  }

  .howto-step-content {
    flex: 1;
    min-width: 0;
  }

  /* Repertoire Section */
  .repertoire-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
  }

  .repertoire-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Repertoire CTA & Button Fix ("CONTE QUAL MÚSICA FAZ PARTE DA SUA HISTÓRIA") */
  .repertoire-cta {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    overflow: hidden;
  }

  .repertoire-cta-quote {
    font-size: clamp(1rem, 4vw, 1.2rem);
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .repertoire-cta .btn,
  .repertoire-cta-button,
  .repertoire-cta a.btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 58px;
    padding: 16px 20px;
    margin-inline: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    text-align: center;
    line-height: 1.25;
    font-size: clamp(0.75rem, 3.5vw, 0.875rem);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
  }

  .gallery-item,
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(3),
  .gallery-item:nth-child(4),
  .gallery-item:nth-child(5),
  .gallery-item:nth-child(6),
  .gallery-item:nth-child(7),
  .gallery-item:nth-child(8),
  .gallery-item:nth-child(9) {
    grid-column: span 1;
    height: 240px;
    width: 100%;
    max-width: 100%;
  }

  /* FAQ Section */
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
  }

  .faq-intro {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .faq-intro .section-title-group {
    text-align: center;
  }

  .faq-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .faq-question-text {
    font-size: clamp(0.95rem, 4vw, 1.1rem);
    overflow-wrap: break-word;
  }

  /* Contact Section & Contact Page Fixes */
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
    width: 100%;
  }

  .contact-info,
  .contact-info p,
  .contact-section p,
  .contact-intro,
  .contact-intro p {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;
  }

  .contact-info-title,
  .contact-intro-title {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem);
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
  }

  .contact-info p,
  .contact-section p {
    font-size: clamp(0.875rem, 3.8vw, 1rem);
    line-height: 1.6;
  }

  /* Contact Cards (Telefone/WhatsApp, Email, Horário) */
  .contact-details {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .contact-detail,
  .contact-card {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: flex-start;
    gap: 16px;
    padding: 1rem;
    box-sizing: border-box;
  }

  .contact-detail-content,
  .contact-card__content {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact-detail-label {
    font-size: clamp(0.65rem, 2.8vw, 0.75rem);
  }

  .contact-detail-value {
    font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact-detail-value a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Big Green WhatsApp Button ("SOLICITAR PELO WHATSAPP") */
  .contact-info .btn-whatsapp,
  .btn-whatsapp {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 52px;
    padding: 14px 18px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: clamp(0.75rem, 3.5vw, 0.875rem);
    line-height: 1.3;
  }

  /* Budget Form Card & Inputs */
  .contact-form,
  .form-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
    padding: 1.5rem 1.25rem;
    box-sizing: border-box;
  }

  .form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
  }

  .form-group,
  .form-group--full {
    grid-column: span 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .form-label {
    font-size: clamp(0.7rem, 2.8vw, 0.8rem);
  }

  .form-input,
  .form-select,
  .form-textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  }

  .form-textarea {
    resize: vertical;
  }

  .contact-form .btn,
  .form-actions .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 54px;
    padding: 14px 18px;
    white-space: normal;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 3.5vw, 0.95rem);
    line-height: 1.3;
  }

  .form-note {
    font-size: clamp(0.7rem, 2.8vw, 0.8rem);
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .form-consent {
    padding: 0.875rem;
    width: 100%;
    box-sizing: border-box;
  }

  /* Page Hero & Breadcrumb */
  .page-hero {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .page-hero-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .page-hero-breadcrumb {
    flex-wrap: wrap;
    word-break: break-word;
  }

  /* Formation & Timeline */
  .formation-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .formation-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .timeline {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .timeline-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    width: 100%;
  }

  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Floating WhatsApp Button & Back to Top */
  .whatsapp-float {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    z-index: var(--z-modal);
  }

  .whatsapp-float-tooltip {
    display: none !important;
  }

  .whatsapp-float-btn {
    width: 48px;
    height: 48px;
  }

  .whatsapp-float-btn svg {
    width: 24px;
    height: 24px;
  }

  .back-to-top {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(4.5rem, calc(16px + env(safe-area-inset-bottom) + 52px));
    width: 40px;
    height: 40px;
  }

  /* Lightbox */
  .lightbox-prev { left: -0.5rem; }
  .lightbox-next { right: -0.5rem; }

  .lightbox-nav {
    width: 32px;
    height: 32px;
  }

  .lightbox-nav svg {
    width: 16px;
    height: 16px;
  }

  /* Gallery Page Grid */
  .gallery-page-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
  }

  .gallery-page-grid .gallery-item {
    height: 220px;
    width: 100%;
  }

  /* Toast */
  .toast {
    width: calc(100% - 2rem);
    max-width: 400px;
    white-space: normal;
    text-align: center;
    font-size: 0.8rem;
    box-sizing: border-box;
  }
}

/* ----------------------------------------------------------------
   VERY SMALL PHONES (max-width: 380px)
---------------------------------------------------------------- */
@media (max-width: 380px) {
  .container,
  .container--narrow,
  .container--wide,
  .section-container,
  .content-wrapper {
    padding-inline: 16px;
  }

  .contact-form,
  .form-card {
    padding: 1.25rem 0.875rem;
  }

  .btn {
    padding-inline: 14px;
    font-size: 0.75rem;
  }

  .repertoire-cta .btn,
  .repertoire-cta-button {
    padding: 14px 14px;
    min-height: 54px;
    font-size: 0.75rem;
  }

  .site-logo img {
    height: 36px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .authority-value {
    font-size: 1.5rem;
  }

  .authority-label {
    font-size: 0.65rem;
  }
}

/* ----------------------------------------------------------------
   TABLET (768px+)
---------------------------------------------------------------- */
@media (min-width: 768px) {

  .nav-desktop { display: flex; }
  .nav-mobile-toggle { display: none; }
  .btn-header-cta { display: block; }

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

  .howto-grid::before {
    display: none;
  }

  .howto-step {
    align-items: center;
  }

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

  .repertoire-grid > *:last-child {
    grid-column: auto;
  }

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

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

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

  .bio-grid {
    grid-template-columns: 1fr 1.3fr;
  }
}

/* ----------------------------------------------------------------
   DESKTOP (1024px+) — PRESERVES ALL DESKTOP DESIGN VISUALLY
---------------------------------------------------------------- */
@media (min-width: 1024px) {

  .howto-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .howto-grid::before { display: block; }

  .howto-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem;
  }

  .howto-step-number {
    margin-bottom: 1.5rem;
  }

  .repertoire-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .repertoire-grid > *:last-child {
    grid-column: auto;
  }

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

  .faq-grid {
    grid-template-columns: 1fr 1.5fr;
  }

  .faq-intro {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }

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

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

  .form-group--full { grid-column: span 2; }

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

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

  .authority-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ----------------------------------------------------------------
   LARGE DESKTOP (1366px+)
---------------------------------------------------------------- */
@media (min-width: 1366px) {
  :root {
    --header-h: 88px;
  }

  .site-logo img { height: 58px; }

  .site-header.scrolled .site-logo img { height: 46px; }

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

/* ----------------------------------------------------------------
   WIDE DESKTOP (1440px+)
---------------------------------------------------------------- */
@media (min-width: 1440px) {
  .av-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------------
   ULTRA WIDE (1920px+)
---------------------------------------------------------------- */
@media (min-width: 1920px) {
  :root {
    --container-max: 1400px;
  }
}

/* ----------------------------------------------------------------
   TOUCH DEVICES (Hover adjustment)
---------------------------------------------------------------- */
@media (hover: none) {
  .gallery-item:hover img { transform: none; filter: contrast(1.05) saturate(0.85); }
  .service-card:hover { transform: none; }
  .service-card:hover .service-card-image img { transform: none; }
  .about-photo:hover img { transform: none; }
  .av-card:hover { transform: none; }
  .formation-card:hover { transform: none; }
}

/* ----------------------------------------------------------------
   HIGH CONTRAST MODE
---------------------------------------------------------------- */
@media (forced-colors: active) {
  .btn-primary {
    border: 2px solid ButtonText;
  }

  .site-header.scrolled {
    border-bottom: 1px solid ButtonText;
  }

  .scroll-progress-line {
    background: Highlight;
  }
}
