/* =====================================================================
   Galeria de Provedores — Santa Casa de Marília
   Inspirada no projeto do designer (parede de museu, molduras e luz).
   Todas as classes usam o prefixo "gp-" para não conflitar com o tema do site.
   ===================================================================== */

.gp-museu,
.gp-dialog,
.gp-dialog-retrato {
    --gp-ink: #f1ede4;
    --gp-muted: #b9beb5;
    --gp-bronze: #cfb98f;
    --gp-line: rgba(210, 207, 186, .16);
    --gp-serif: 'Cormorant Garamond', 'Palatino Linotype', Palatino, Georgia, serif;
    --gp-sans: 'Roboto', 'Quicksand', 'Segoe UI', Arial, sans-serif;
    --gp-frame: clamp(240px, 22vw, 310px);
    --gp-dist: clamp(380px, 40vw, 620px);
}

/* ---------- Seção / parede ---------- */
.gp-museu {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--gp-ink);
    font-family: var(--gp-sans);
    background: radial-gradient(ellipse at 50% 30%, #3c4440 0, #252f2e 38%, #1a2324 72%);
    padding: 56px 0 0;
}
.gp-museu::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url('parede.svg') repeat;
    opacity: .3;
    mix-blend-mode: soft-light;
    pointer-events: none;
}
.gp-museu *,
.gp-dialog *,
.gp-dialog-retrato * { box-sizing: border-box; }
.gp-museu h2, .gp-museu h3, .gp-museu p,
.gp-dialog h2, .gp-dialog h3, .gp-dialog p,
.gp-dialog-retrato h2, .gp-dialog-retrato p {
    margin: 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: inherit;
}
.gp-museu button,
.gp-dialog button,
.gp-dialog-retrato button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: inherit;
    -webkit-tap-highlight-color: transparent;
}
.gp-museu button:focus-visible,
.gp-dialog button:focus-visible,
.gp-dialog-retrato button:focus-visible,
.gp-parede:focus-visible {
    outline: 2px solid #e2c99f;
    outline-offset: 6px;
}
.gp-museu svg,
.gp-dialog svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.gp-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Abertura ---------- */
.gp-intro { text-align: center; padding: 0 24px 8px; }
.gp-eyebrow {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    font-size: .72rem !important;
    letter-spacing: .24em !important;
    color: #d6c39f !important;
    margin-bottom: 14px !important;
    text-transform: uppercase !important;
}
.gp-eyebrow > span { width: 26px; height: 1px; background: #bda27a88; }
.gp-museu .gp-titulo {
    font-family: var(--gp-serif);
    font-size: clamp(2.5rem, 4.4vw, 3.9rem);
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--gp-ink);
    margin-bottom: 12px;
}
.gp-titulo em { font-style: italic; color: #e4d3b2; font-weight: 500; }
.gp-intro-texto { color: #c4c9bf !important; font-size: .95rem !important; line-height: 1.6 !important; }

/* ---------- Galeria (carrossel) ---------- */
.gp-parede {
    position: relative;
    width: 100%;
    height: 560px;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    perspective: 1600px;
    outline-offset: -8px !important;
    contain: layout;
}
.gp-parede.gp-arrastando { cursor: grabbing; }
.gp-trilho { position: absolute; height: 2px; top: 12px; left: 8%; right: 8%; background: linear-gradient(90deg, transparent, #a5a58a33, transparent); }
.gp-paineis { position: absolute; inset: 49px 5% 52px; display: flex; justify-content: space-around; opacity: .36; pointer-events: none; }
.gp-paineis span { width: 27%; border: 1px solid #9ea89518; box-shadow: inset 1px 1px 0 #0003, 1px 1px 0 #0003; }
.gp-exposicao { position: absolute; inset: 0; transform-style: preserve-3d; }

.gp-quadro {
    position: absolute;
    left: 50%;
    top: 56px;
    width: var(--gp-frame);
    margin: 0;
    transform: translateX(-50%);
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transition: transform 850ms cubic-bezier(.22, .72, .18, 1), opacity 650ms, filter 650ms;
    opacity: 0;
    visibility: hidden;
    filter: brightness(.7);
    pointer-events: none;
}
.gp-quadro[data-pos="0"] { transform: translateX(calc(-50% + var(--gp-drag, 0px))); z-index: 4; opacity: 1; visibility: visible; filter: none; pointer-events: auto; cursor: zoom-in; }
.gp-quadro[data-pos="-1"] { transform: translateX(calc(-50% - var(--gp-dist) + var(--gp-drag, 0px))) perspective(1000px) rotateY(22deg) scale(.78); opacity: .5; visibility: visible; z-index: 2; pointer-events: auto; cursor: pointer; }
.gp-quadro[data-pos="1"] { transform: translateX(calc(-50% + var(--gp-dist) + var(--gp-drag, 0px))) perspective(1000px) rotateY(-22deg) scale(.78); opacity: .5; visibility: visible; z-index: 2; pointer-events: auto; cursor: pointer; }
.gp-quadro[data-pos="-2"] { transform: translateX(calc(-50% - var(--gp-dist) * 2 + var(--gp-drag, 0px))) scale(.6); opacity: 0; visibility: visible; }
.gp-quadro[data-pos="2"] { transform: translateX(calc(-50% + var(--gp-dist) * 2 + var(--gp-drag, 0px))) scale(.6); opacity: 0; visibility: visible; }
.gp-parede.gp-arrastando .gp-quadro { transition: none; }

/* Luminária */
.gp-luz { position: absolute; width: 110px; height: 7px; top: -25px; left: 50%; transform: translateX(-50%); border-radius: 8px; background: linear-gradient(#b1a086, #74634b 53%, #342d24); box-shadow: 0 3px 8px #0008, 0 5px 14px #e1cb8c44; pointer-events: none; }
.gp-luz::before { content: ''; position: absolute; width: 2px; height: 12px; background: #7a735e; left: 50%; top: -11px; box-shadow: 2px 0 3px #0007; }
.gp-luz::after { content: ''; position: absolute; left: 50%; top: 6px; width: calc(var(--gp-frame) * 1.6); height: 480px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 0%, #fae5b41c, transparent 68%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); z-index: -1; }

/* Moldura, passe-partout e janela da foto */
.gp-moldura {
    position: relative;
    width: 100%;
    padding: 19px;
    background: linear-gradient(130deg, #8c7961 0, #3c332b 3%, #554535 5%, #271e18 11%, #5a4835 19%, #3b2d21 23%, #372d23 78%, #1b1713 92%, #86725b 99%);
    border: 1px solid #aa967766;
    box-shadow: 0 20px 25px -7px #0008, 15px 20px 32px -20px #000a, -3px -3px 12px #d9ccab09, inset 1px 1px 1px #f2d6a755, inset -1px -1px 1px #000;
    isolation: isolate;
}
.gp-moldura::before { content: ''; position: absolute; inset: 5px; border: 1px solid #c4aa794a; box-shadow: 0 0 0 2px #17110f55, inset 0 0 0 2px #17110f55; pointer-events: none; }
.gp-moldura::after { content: ''; position: absolute; inset: 13px; border: 1px solid #c7ab7266; box-shadow: 1px 1px 1px #0007; pointer-events: none; }
.gp-passepartout { padding: 10px; background: #d8d3c4; box-shadow: 0 0 0 1px #1a150f, 0 0 0 3px #9a836455, inset 1px 1px 3px #0003; }
.gp-janela { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #d4d0c5; box-shadow: 0 0 0 1px #9b968566; }
.gp-janela::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 2px 5px #0004; background: linear-gradient(125deg, #fff1 0%, transparent 45%); }
.gp-museu .gp-janela img { width: 100%; height: 100%; max-width: none; object-fit: var(--gp-fit, contain); object-position: 50% 50%; display: block; pointer-events: none; }

/* Legenda */
.gp-quadro figcaption { text-align: center; margin-top: 24px; width: calc(100% + 180px); margin-left: -90px; transition: opacity 500ms; }
.gp-museu .gp-nome { font-family: var(--gp-serif); font-size: clamp(1.55rem, 2.1vw, 2rem); font-weight: 500; line-height: 1.15; margin: 0 auto 10px; max-width: 430px; color: #f1ede3; text-wrap: balance; }
.gp-museu .gp-periodo { display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--gp-bronze); font-size: .875rem; letter-spacing: .04em; }
.gp-cargo { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.gp-periodo i { display: block; height: 11px; width: 1px; background: #8d8268; }
.gp-quadro:not([data-pos="0"]) figcaption { opacity: .55; }
.gp-quadro:not([data-pos="0"]) .gp-cargo,
.gp-quadro:not([data-pos="0"]) .gp-periodo i { display: none; }

.gp-vinheta { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(90deg, #151e2066 0, transparent 17%, transparent 83%, #151e2066); }
.gp-base-parede { position: absolute; bottom: 17px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, #8f977f33 24%, #8f977f33 76%, transparent); box-shadow: 0 2px 2px #0005, 0 18px 50px #0004; pointer-events: none; }
.gp-museu .gp-ampliar { position: absolute; right: 48px; bottom: 34px; z-index: 8; display: flex; align-items: center; gap: 8px; color: #b4bcb0; font-size: .8rem; padding: 8px; }
.gp-museu .gp-ampliar:hover { color: #fff; }
.gp-ampliar svg { width: 15px; height: 15px; }

/* ---------- Navegação ---------- */
.gp-nav { position: relative; z-index: 6; max-width: 1200px; margin: 0 auto; padding: 0 30px 26px; }
.gp-nav-topo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 42px; margin-bottom: 12px; }
.gp-museu .gp-dica { display: flex; align-items: center; gap: 11px; color: #b3bab1; font-size: .875rem; }
.gp-dica svg { width: 23px; height: 21px; stroke-width: 1.1; }
.gp-museu .gp-progresso { display: flex; align-items: center; gap: 14px; font-size: .875rem; font-variant-numeric: tabular-nums; color: #aaafa0; }
.gp-progresso > span:first-child { color: #ece1c9; font-size: 1rem; }
.gp-progresso-div { display: block; width: 28px; height: 1px; background: #a29b8155; }
.gp-direcao { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.gp-museu .gp-direcao button { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; padding: 9px 0; color: #d7d5c7; min-width: 62px; }
.gp-museu .gp-direcao button:hover { color: #fff; }
.gp-direcao svg { width: 16px; height: 16px; }
.gp-direcao > span { width: 1px; height: 14px; background: #a9ac9644; }

.gp-linha { position: relative; display: flex; align-items: flex-start; width: 100%; padding-top: 9px; }
.gp-linha::before { content: ''; position: absolute; top: 14px; left: 0; right: 0; height: 1px; background: #9aa1894d; }
.gp-museu .gp-linha button { position: relative; flex: 1; min-width: 0; text-align: center; padding: 0 0 9px; color: #acb3a5; font-size: .875rem; font-variant-numeric: tabular-nums; line-height: 1.8; }
.gp-museu .gp-linha button:first-child { text-align: left; }
.gp-museu .gp-linha button:last-child { text-align: right; }
.gp-ponto { display: block; width: 9px; height: 9px; margin: 0 auto 10px; position: relative; background: #667263; border: 2px solid #26312c; border-radius: 50%; transition: all .3s; }
.gp-linha button:first-child .gp-ponto { margin-left: 0; }
.gp-linha button:last-child .gp-ponto { margin-right: 0; }
.gp-museu .gp-linha button[aria-current="true"] { color: #eed4a4; }
.gp-linha button[aria-current="true"] .gp-ponto { background: #d3b57b; box-shadow: 0 0 0 1px #b8a378; }
.gp-museu .gp-linha button:hover { color: #fff; }
.gp-linha button:hover .gp-ponto { background: #f0d6a5; }

.gp-nav-base { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; }
.gp-legenda { font-size: .66rem; letter-spacing: .16em; color: #a6b0a1; text-transform: uppercase; }
.gp-museu .gp-btn-acervo { display: inline-flex; align-items: center; gap: 9px; font-size: .875rem; color: #d2d7c8; padding: 6px 0; }
.gp-museu .gp-btn-acervo:hover { color: #fff; }
.gp-btn-acervo svg { width: 13px; height: 13px; stroke-width: 1; }

/* ---------- Texto institucional (rodapé da parede) ---------- */
.gp-sobre { position: relative; z-index: 6; border-top: 1px solid var(--gp-line); background: #0e171566; }
.gp-sobre-inner { max-width: 1200px; margin: 0 auto; padding: 34px 30px 38px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.gp-museu .gp-sobre h3 { font-family: var(--gp-serif); font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 500; line-height: 1.15; color: var(--gp-ink); }
.gp-museu .gp-sobre p { color: #c3cabd; font-size: .95rem; line-height: 1.8; }
.gp-museu .gp-sobre p + p { margin-top: 10px; }

/* ---------- Diálogos ---------- */
.gp-dialog,
.gp-dialog-retrato { color: var(--gp-ink); font-family: var(--gp-sans); }
.gp-dialog::backdrop,
.gp-dialog-retrato::backdrop { background: #080f10d9; backdrop-filter: blur(10px); }
.gp-dialog { position: fixed; background: #202b29; border: 1px solid #7d856154; box-shadow: 0 30px 100px #000a; width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 48px 42px 30px; scrollbar-width: thin; scrollbar-color: #6b7363 transparent; }
.gp-dialog::-webkit-scrollbar,
.gp-dialog-retrato::-webkit-scrollbar { width: 8px; }
.gp-dialog::-webkit-scrollbar-track,
.gp-dialog-retrato::-webkit-scrollbar-track { background: transparent; }
.gp-dialog::-webkit-scrollbar-thumb,
.gp-dialog-retrato::-webkit-scrollbar-thumb { background: #6b7363; border-radius: 8px; }
.gp-dialog .gp-eyebrow { justify-content: flex-start; margin-bottom: 16px !important; }
.gp-dialog h2 { font-family: var(--gp-serif); font-size: 2.4rem; font-weight: 500; line-height: 1.1; color: var(--gp-ink); margin-bottom: 8px; }
.gp-dialog .gp-dialog-intro { font-size: .9rem; color: #c6cec0; margin-bottom: 20px; }
.gp-fechar { position: absolute; top: 10px; right: 14px; width: 44px; height: 44px; font-size: 1.75rem !important; line-height: 1 !important; color: var(--gp-ink) !important; z-index: 2; }
.gp-fechar:hover { color: #e4c289 !important; }
.gp-acervo-lista { display: flex; flex-direction: column; }
.gp-dialog .gp-acervo-item { display: grid; grid-template-columns: 49px 1fr auto; gap: 18px; align-items: center; width: 100%; padding: 14px 6px; border-bottom: 1px solid var(--gp-line); text-align: left; }
.gp-dialog .gp-acervo-item:last-child { border-bottom: 0; }
.gp-dialog .gp-acervo-item:hover { background: #ffffff08; }
.gp-acervo-item img { width: 49px; height: 61px; object-fit: cover; object-position: 50% 20%; background: #d8d5ce; display: block; }
.gp-acervo-nome { font-family: var(--gp-serif); font-size: 1.3rem; font-weight: 500; line-height: 1.2; }
.gp-acervo-item[aria-current="true"] .gp-acervo-nome { color: #dfc796; }
.gp-acervo-anos { font-size: .875rem; color: #bac2b3; white-space: nowrap; }

.gp-dialog-retrato { padding: 0; background: #141c1c; border: 1px solid #9b88606b; max-width: calc(100vw - 32px); max-height: calc(100vh - 30px); overflow: auto; width: fit-content; box-shadow: 0 30px 100px #000b; }
.gp-dialog-retrato .gp-fechar { background: #141c1cd9; border: 1px solid #e0d1a82b; }
.gp-dialog-retrato > img { display: block; width: auto; max-width: 100%; height: calc(100vh - 170px); min-height: 200px; object-fit: contain; margin: auto; }
.gp-retrato-legenda { text-align: center; padding: 16px 28px 18px; }
.gp-dialog-retrato h2 { font-family: var(--gp-serif); font-size: 1.6rem; font-weight: 500; color: var(--gp-ink); margin-bottom: 6px; }
.gp-dialog-retrato p { color: var(--gp-bronze); font-size: .875rem; }
html.gp-modal-aberto { overflow: hidden; }

.gp-vazio { padding: 40px 24px 70px; text-align: center; color: #c4c9bf; }

/* ---------- Responsivo ---------- */
@media (min-width: 1500px) {
    .gp-parede { height: 590px; }
    .gp-quadro { top: 62px; }
}
@media (max-width: 991px) {
    .gp-museu, .gp-dialog, .gp-dialog-retrato { --gp-frame: 280px; --gp-dist: 390px; }
    .gp-parede { height: 520px; }
    .gp-quadro { top: 50px; }
    .gp-nav { padding: 0 24px 24px; }
    .gp-museu .gp-ampliar { right: 20px; bottom: 26px; }
    .gp-ampliar span { display: none; }
    .gp-sobre-inner { grid-template-columns: 1fr; gap: 14px; text-align: center; }
}
@media (max-width: 600px) {
    .gp-museu, .gp-dialog, .gp-dialog-retrato { --gp-frame: 236px; --gp-dist: 262px; }
    .gp-museu { padding-top: 40px; }
    .gp-eyebrow { font-size: .62rem !important; gap: 10px; }
    .gp-museu .gp-titulo { font-size: 2.4rem; }
    .gp-intro-texto { font-size: .85rem !important; max-width: 290px; margin: 0 auto !important; }
    .gp-parede { height: 470px; }
    .gp-quadro { top: 48px; }
    .gp-moldura { padding: 16px; }
    .gp-moldura::after { inset: 11px; }
    .gp-passepartout { padding: 9px; }
    .gp-luz { width: 90px; height: 6px; top: -23px; }
    .gp-luz::after { height: 370px; }
    .gp-quadro figcaption { width: calc(100% + 70px); margin-left: -35px; margin-top: 22px; }
    .gp-museu .gp-nome { font-size: 1.6rem; max-width: 300px; }
    .gp-museu .gp-periodo { font-size: .8rem; gap: 9px; }
    .gp-quadro[data-pos="-1"], .gp-quadro[data-pos="1"] { opacity: .35; }
    .gp-paineis { inset: 44px -35% 38px; }
    .gp-base-parede { bottom: 8px; }
    .gp-museu .gp-ampliar { right: 10px; bottom: 16px; min-width: 44px; min-height: 44px; justify-content: center; }
    .gp-nav { padding: 4px 18px 22px; }
    .gp-nav-topo { grid-template-columns: 1fr auto; column-gap: 14px; margin-bottom: 14px; }
    .gp-museu .gp-dica { font-size: .8rem; min-width: 0; }
    .gp-progresso { display: none !important; }
    .gp-direcao { gap: 12px; }
    .gp-museu .gp-direcao button { min-height: 44px; min-width: 0; font-size: .8rem; }
    .gp-linha { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #a6946c55 transparent; padding-bottom: 7px; }
    .gp-linha::before { right: auto; width: max(100%, 420px); }
    .gp-museu .gp-linha button { flex: 1 0 46px; min-width: 46px; min-height: 44px; text-align: center !important; font-size: .8125rem; }
    .gp-linha button .gp-ponto { margin-left: auto !important; margin-right: auto !important; }
    .gp-nav-base { justify-content: center; }
    .gp-legenda { display: none; }
    .gp-sobre-inner { padding: 26px 20px 30px; }
    .gp-dialog { padding: 46px 22px 26px; }
    .gp-dialog h2 { font-size: 2rem; }
    .gp-dialog .gp-acervo-item { grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; }
    .gp-acervo-item img { width: 40px; height: 50px; grid-row: span 2; }
    .gp-acervo-nome { font-size: 1.1rem; align-self: end; }
    .gp-acervo-anos { grid-column: 2; align-self: start; font-size: .75rem; }
    .gp-dialog-retrato > img { height: auto; max-height: calc(100vh - 160px); width: 100%; min-height: 0; }
}
@media (max-width: 360px) {
    .gp-museu, .gp-dialog, .gp-dialog-retrato { --gp-frame: 220px; --gp-dist: 232px; }
    .gp-parede { height: 450px; }
}
@media (prefers-reduced-motion: reduce) {
    .gp-quadro, .gp-ponto, .gp-quadro figcaption { transition: none !important; }
}
