/* ==========================================================================
   OFICINA — Registro Temporal de uma Intervenção Artística
   Estilo: Preto e Branco, Super Minimalista, Humanizado, Mobile-first
   ========================================================================== */

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

:root {
  --bg: #000000;
  --surface: #0e0e0e;
  --surface-hover: #181818;
  --border: #222222;
  --border-light: #333333;
  --text-main: #f0f0f0;
  --text-muted: #888888;
  --text-faint: #444444;
  --white: #ffffff;
  
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  color: var(--text-main);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: 680px;
  padding: 2.5rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 4.5rem 2rem 7rem;
    gap: 4.5rem;
  }
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.5rem 0; /* touch area */
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--white);
}

.header-date {
  color: var(--text-faint);
  text-transform: lowercase;
}

/* 1. Título */
.title-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
}

.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  font-weight: 300;
}

/* 2. Audio Player (Minimalista & Touch-friendly) */
.player {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color 0.2s ease;
}

.player:hover {
  border-color: var(--border-light);
}

.player-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-button {
  background-color: var(--white);
  color: var(--bg);
  border: none;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.play-button:hover {
  opacity: 0.9;
  transform: scale(1.04);
}

.play-button:active {
  transform: scale(0.96);
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.track-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-display {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.3rem;
}

.time-sep {
  color: var(--text-faint);
}

/* Scrubber / Progress Bar */
.progress-wrap {
  width: 100%;
  padding: 0.5rem 0; /* large touch target for mobile */
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.progress-bar {
  width: 100%;
  height: 3px;
  background-color: var(--border);
  position: relative;
  border-radius: 2px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--white);
  border-radius: 2px;
  pointer-events: none;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background-color: var(--white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.8;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.progress-wrap:hover .progress-thumb,
.progress-wrap:focus-visible .progress-thumb {
  transform: translate(-50%, -50%) scale(1.3);
  opacity: 1;
}

/* 3. Espaço para Texto */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.text-content {
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.85;
  color: var(--text-main);
  font-weight: 300;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  outline: none;
  border-left: 1px solid transparent;
  transition: border-color 0.2s ease, padding 0.2s ease;
}

/* Subtle visual cue when editing */
.text-content:focus {
  border-left: 1px solid var(--text-muted);
  padding-left: 1rem;
}

.text-content p {
  text-indent: 0;
}

.text-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.save-hint {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.7rem;
}

/* Responsiveness tweaks */
@media (max-width: 480px) {
  .container {
    padding: 1.75rem 1.25rem 4rem;
    gap: 2.75rem;
  }

  .player {
    padding: 1rem 1rem 1.25rem;
  }

  .play-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}
