@font-face {
  font-family: "Geist";
  src: url("/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Tokens do site erdigitalstudio.com.br (work/Site_ER/styles.css). */
:root {
  --canvas: #080808;
  --surface: #141414;
  --surface-raised: #1b1b1b;
  --primary: #f5f3ee;
  --text: #f4f4f2;
  --muted: #b6b6b1;
  --border: #303030;
  --border-hover: #505050;
  --danger: #ff8a7a;
  --max-width: 1200px;
  --radius: 24px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.container {
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
}

/* Cabeçalho */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgb(8 8 8 / 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 40px;
  height: auto;
  flex: none;
}

.brand-name {
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-name em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

/* Botões */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: var(--canvas);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.button:hover {
  background: transparent;
  color: var(--primary);
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}

.button.ghost:hover {
  border-color: var(--primary);
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.button[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Capa da galeria */
.hero {
  padding: clamp(48px, 9vw, 104px) 0 clamp(32px, 5vw, 56px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
}

.hero-meta p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Grade: ordem cronológica da esquerda para a direita */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 45%), 1fr));
  gap: clamp(6px, 1vw, 12px);
  margin: 0 0 80px;
  padding: 0;
  list-style: none;
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 0.5s var(--ease),
    transform 0.6s var(--ease);
}

.thumb img.loaded {
  opacity: 1;
  transform: scale(1);
}

.thumb:hover img.loaded {
  transform: scale(1.03);
}

/* Estados */
.status {
  margin: 0 0 80px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.status h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.status p {
  margin: 0;
  color: var(--muted);
}

.status.error h2 {
  color: var(--danger);
}

.skeleton {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-raised) 50%, var(--surface) 60%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

/* Visualizador em tela cheia */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(4 4 4 / 0.97);
  color: var(--text);
}

.viewer::backdrop {
  background: rgb(0 0 0 / 0.85);
}

.viewer-inner {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.viewer-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.viewer-tools {
  display: flex;
  gap: 8px;
}

.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 16px;
  touch-action: pan-y pinch-zoom;
}

.viewer-stage img {
  /* Altura explícita: % de altura não resolve dentro da linha 1fr do grid e a foto vertical estourava a tela. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 86px);
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  background: rgb(20 20 20 / 0.8);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.icon-button:hover {
  border-color: var(--primary);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.nav.prev {
  left: 20px;
}

.nav.next {
  right: 20px;
}

.nav:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Páginas de mensagem (acesso negado, indisponível) */
.home {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  padding: 48px 0;
}

.panel {
  width: min(100%, 640px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.panel .logo {
  width: 120px;
  margin: 0 auto 28px;
}

.panel h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.panel > p {
  margin: 0 0 28px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.field label {
  font-weight: 500;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--text);
}

.field input:focus {
  border-color: var(--primary);
  outline: none;
}

.result {
  display: none;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  text-align: left;
}

.result.visible {
  display: block;
}

.result.error {
  color: var(--danger);
}

.result a {
  display: block;
  margin: 6px 0 14px;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Os botões da ação não herdam o bloco do link acima. */
.result .result-actions a {
  display: inline-flex;
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.footer-inner a {
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Links do cabeçalho e botão discreto da equipe */
.back-link {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

.back-link:hover {
  color: var(--text);
}

/* Discreto de propósito: é só atalho; quem protege /admin é o login do Portal no servidor. */
.team-link {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border-radius: 999px;
  color: var(--muted);
  opacity: 0.35;
  transition: opacity 0.25s var(--ease);
}

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

.team-link svg {
  width: 14px;
  height: 14px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

/* Portfólio */
.lead {
  max-width: 560px;
}

.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin: 0 0 80px;
  padding: 0;
  list-style: none;
}

.album.skeleton {
  aspect-ratio: 4 / 4.6;
}

.album a {
  display: block;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.25s var(--ease);
}

.album a:hover {
  border-color: var(--border-hover);
}

.album-cover {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-raised);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition:
    opacity 0.5s var(--ease),
    transform 0.6s var(--ease);
}

.album-cover img.loaded {
  opacity: 1;
}

.album a:hover .album-cover img.loaded {
  transform: scale(1.03);
}

.album-body {
  padding: 18px 20px 22px;
}

.album-body h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.album-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Área da equipe */
.admin {
  display: grid;
  gap: 32px;
  padding: 40px 0 80px;
}

.admin-card {
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
}

.admin-card > p {
  margin: 0 0 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.form-grid .field {
  gap: 8px;
}

.span-2 {
  grid-column: 1 / -1;
}

.field input[type="date"] {
  color-scheme: dark;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  align-self: end;
  padding: 12px 0;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--primary);
}

.check small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.list-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.list-head p {
  margin: 0;
}

.album-rows {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.album-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.album-rows .empty {
  padding: 16px 0;
}

.row-info {
  min-width: 0;
  flex: 1 1 260px;
}

.row-info p {
  margin: 4px 0 0;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.row-title strong {
  overflow-wrap: anywhere;
}

.badge {
  padding: 2px 10px;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.badge.on {
  border-color: var(--primary);
  color: var(--primary);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.button.danger:hover {
  background: var(--danger);
  color: var(--canvas);
}

.button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.edit-dialog {
  width: min(100% - 32px, 720px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.edit-dialog::backdrop {
  background: rgb(0 0 0 / 0.7);
}

.edit-dialog h2 {
  margin: 0;
  font-size: 1.3rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.cover-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cover-field legend {
  padding: 0;
  font-weight: 500;
}

.cover-field p {
  margin: 4px 0 10px;
}

.cover-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.cover-option {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-raised);
  cursor: pointer;
}

.cover-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-option[aria-checked="true"] {
  border-color: var(--primary);
}

.cover-option[aria-checked="true"]::after {
  content: "Capa";
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--canvas);
  font-size: 0.72rem;
  font-weight: 600;
}

.row-cover {
  flex: none;
  width: 56px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-raised);
}

.row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-actions {
    width: 100%;
  }

  .row-actions .button {
    flex: 1 1 auto;
  }

  .hero-actions {
    align-items: stretch;
    width: 100%;
  }

  .nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
