/* MTEC · estilos exclusivos da página de projetos: filtros e janela (modal) dos cases */

  /* ---------- Filtros ---------- */
  .filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 28px;
  }

  .filters { display: flex; flex-wrap: wrap; gap: 10px; }

  .chip {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg-muted);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 9px 18px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .chip:hover { color: var(--fg); border-color: var(--fg-muted); }

  .chip:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 3px; }

  .chip[aria-pressed="true"] {
    background: var(--fg);
    border-color: var(--fg);
    color: #0d0d0f;
    font-weight: 600;
  }

  .count {
    margin: 0;
    font-size: 0.82rem;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
  }

  .thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

  .tag {
    position: absolute;
    left: 14px;
    bottom: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 4px 10px;
  }

  /* ---------- Modal de case ---------- */
  html.modal-open { overflow: hidden; }

  dialog.case-modal {
    padding: 0;
    width: min(980px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    font-family: var(--font-display);
  }

  dialog.case-modal::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); }

  @media (prefers-reduced-motion: no-preference) {
    dialog.case-modal[open] { animation: caseIn 0.24s ease; }
    @keyframes caseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  }

  .modal-bar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }

  .modal-bar-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
  }

  .modal-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .modal-close svg { width: 14px; height: 14px; }

  .modal-close:hover { border-color: var(--fg-muted); background: color-mix(in srgb, var(--fg) 5%, transparent); }

  .modal-close:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 3px; }

  .modal-body { padding: 32px 32px 36px; }

  .m-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

  .m-tag {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 4px 10px;
  }

  .m-type { font-size: 0.88rem; color: var(--fg-muted); }

  .m-title {
    margin: 0 0 14px;
    font-size: clamp(1.9rem, 4.6vw, 2.8rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
  }

  .m-lede { margin: 0; max-width: 56ch; color: var(--fg-muted); font-size: 1rem; line-height: 1.6; }

  .m-show { position: relative; margin: 32px 0 52px; }

  .m-browser { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--bg-elevated); }

  .m-browser-bar { display: flex; align-items: center; gap: 7px; height: 30px; padding-inline: 12px; border-bottom: 1px solid var(--border); }

  .m-browser-bar i { width: 8px; height: 8px; border: 1px solid var(--border-strong); border-radius: 50%; }

  .m-browser img, .m-phone img, .m-shot img { display: block; width: 100%; height: auto; }

  .m-phone {
    position: absolute;
    right: 4%;
    bottom: -30px;
    width: clamp(90px, 16%, 160px);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
  }

  .m-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

  .m-fact { padding: 18px 20px 18px 0; }

  .m-fact + .m-fact { padding-left: 20px; border-left: 1px solid var(--border); }

  .m-fact dt { margin: 0 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }

  .m-fact dd { margin: 0; font-size: 0.92rem; line-height: 1.45; }

  .m-block { display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding-top: 36px; }

  .m-block h3 { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); padding-top: 4px; }

  .m-prose { max-width: 62ch; }

  .m-prose p { margin: 0 0 14px; font-size: 1rem; line-height: 1.65; }

  .m-prose p:last-child { margin-bottom: 0; }

  .m-list { list-style: none; margin: 20px 0 0; padding: 0; }

  .m-list li { padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.92rem; line-height: 1.5; color: var(--fg-muted); }

  .m-list li:last-child { border-bottom: 1px solid var(--border); }

  .m-list strong { color: var(--fg); font-weight: 600; }

  .m-shots { display: grid; gap: 22px; padding-top: 40px; }

  .m-shot { margin: 0; }

  .m-shot .m-frame { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--bg-elevated); }

  .m-shot figcaption { margin-top: 10px; font-size: 0.82rem; color: var(--fg-muted); }

  .m-cover { margin-top: 32px; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--bg-elevated); }

  .m-cover img { display: block; width: 100%; height: auto; }

  .m-soon { margin-top: 28px; padding: 20px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--fg-muted); font-size: 0.92rem; line-height: 1.5; }

  .m-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); }

  .m-cta p { margin: 0; font-size: 1.05rem; font-weight: 600; }

  @media (max-width: 900px) {
    .m-facts { grid-template-columns: repeat(2, 1fr); }
    .m-fact:nth-child(3) { padding-left: 0; border-left: none; }
    .m-fact:nth-child(n+3) { border-top: 1px solid var(--border); }
    .m-block { grid-template-columns: 1fr; gap: 12px; }
  }

  @media (max-width: 600px) {
    dialog.case-modal { width: 100%; height: 100dvh; max-height: 100dvh; border: none; border-radius: 0; }
    .modal-bar { padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
    .modal-body { padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
    .m-facts { grid-template-columns: 1fr; }
    .m-fact, .m-fact + .m-fact { padding: 14px 0; border-left: none; }
    .m-fact + .m-fact { border-top: 1px solid var(--border); }
    .m-phone { right: 3%; bottom: -24px; }
    .m-show { margin-bottom: 44px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-panel, .scrim, .card, .chip, .card-arrow, .btn-outline, .btn-outline svg, .cta, nav.main-nav a { transition: none; }
    a.card:hover, a.card:focus-visible { transform: none; }
  }

/* Cards escondidos pelo filtro: sem isso, o display do .card ignora o atributo hidden */
.card[hidden] { display: none; }
