/* ==========================================================================
   GRAZIANO WORKOUT — ROUTINE DETAIL / FICHA TÉCNICA
   Technical Sheet & Exercise Matrix — Editorial Style
   ========================================================================== */

/* Overlay Container */
.routine-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-smooth), visibility var(--t-smooth);
}

.routine-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Technical Sheet Document */
.routine-sheet {
  width: 100%;
  max-width: var(--container-sheet);
  background: var(--black);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform var(--t-smooth);
}

@media (min-width: 768px) {
  .routine-sheet {
    margin: var(--space-xl) auto;
    min-height: auto;
    border: 1px solid var(--line);
  }
}

.routine-modal-overlay.active .routine-sheet {
  transform: translateY(0);
}

/* Sticky Action Bar */
.sheet-action-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem clamp(0.75rem, 3vw, var(--space-lg));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.sheet-action-left, .sheet-action-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-sheet-close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 0.4rem clamp(0.5rem, 1.8vw, 0.7rem);
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  letter-spacing: 0.04em;
  min-height: 38px;
}

.btn-sheet-close:hover {
  color: var(--text-primary);
  border-color: var(--line-active);
}

.btn-sheet-close:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
  color: var(--text-primary);
  border-color: var(--line-active);
}

/* Sheet Main Content */
.sheet-content {
  padding: clamp(1rem, 3vw, var(--space-xl)) clamp(0.75rem, 3vw, var(--space-lg));
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, var(--space-2xl));
}

@media (min-width: 768px) {
  .sheet-content {
    padding: var(--space-2xl);
  }
}

/* Sheet Header Block */
.sheet-header-block {
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(1rem, 3vw, var(--space-xl));
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
}

.sheet-meta-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-character-title {
  font-size: clamp(1.65rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: break-word;
}

.sheet-routine-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* Technical Specification Matrix */
.sheet-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: var(--line);
  border: 1px solid var(--line);
  margin-top: var(--space-sm);
}

@media (min-width: 640px) {
  .sheet-spec-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.spec-cell {
  background-color: var(--surface);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-cell--full {
  grid-column: 1 / -1;
}

.spec-cell-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.spec-cell-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Section Titles */
.sheet-section-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.sheet-section-title::before {
  content: "■";
  color: var(--text-muted);
  font-size: 0.6rem;
}

.sheet-stimulus-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Protocol / Warmup Box */
.sheet-warmup-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-lg);
}

.warmup-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.warmup-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.warmup-item::before {
  content: "→";
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Technical Exercise Table */
.exercise-table-container {
  border: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  position: relative;
}

.exercise-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.exercise-table th {
  background-color: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-dim);
}

.exercise-table th:last-child {
  border-right: none;
}

.exercise-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line-dim);
  border-right: 1px solid var(--line-dim);
  vertical-align: top;
}

.exercise-table td:last-child {
  border-right: none;
}

.exercise-table tr:last-child td {
  border-bottom: none;
}

.exercise-table tr:hover td {
  background-color: var(--surface-hover);
}

.col-order {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 45px;
  color: var(--text-muted);
}

.col-name {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 170px;
}

.col-sets, .col-reps, .col-rest, .col-tut {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
}

.col-notes {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  min-width: 200px;
}

/* Safety & Notes Box */
.sheet-safety-box {
  border: 1px solid var(--accent-red-border);
  background-color: var(--surface);
  padding: var(--space-lg);
}

.safety-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.safety-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.safety-item::before {
  content: "▲";
  color: var(--accent-red);
  font-size: 0.65rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Equipment Section */
.sheet-equipment-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-md) var(--space-lg);
}

.equipment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.equipment-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.3rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.equipment-tag-bullet {
  color: var(--text-muted);
  font-size: 0.55rem;
}

/* Training Pillars */
.sheet-pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .sheet-pillars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pillar-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: border-color var(--t-fast);
}

.pillar-card:hover {
  border-color: var(--line-active);
}

.pillar-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line-dim);
  padding-bottom: 0.4rem;
  margin-bottom: 0.3rem;
}

.pillar-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

.pillar-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.pillar-detail {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Nutrition Strategy & Recipes */
.sheet-nutrition-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.nutrition-strategy-block {
  border-left: 2px solid var(--line);
  padding-left: var(--space-md);
}

.nutrition-strategy-label,
.recipe-sublabel {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.nutrition-strategy-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.recipe-card {
  border: 1px solid var(--line-dim);
  background: var(--surface-2);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--line-dim);
  padding-bottom: 0.4rem;
}

.recipe-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.recipe-ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.recipe-ingredient-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.15rem 0.4rem;
  color: var(--text-secondary);
}

.recipe-purpose-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Lifestyle Notes */
.sheet-lifestyle-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-lg);
}

.lifestyle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lifestyle-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.lifestyle-item::before {
  content: "◆";
  color: var(--text-muted);
  font-size: 0.6rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Multi-Day Split */
.sheet-days-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.routine-day-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.routine-day-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
  border-left: 2px solid var(--line);
  padding-left: var(--space-sm);
  margin-bottom: 0.2rem;
}

.routine-day-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.routine-day-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Schedule Box */
.sheet-schedule-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-md) var(--space-lg);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.schedule-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 1px solid var(--line-dim);
  padding-left: var(--space-sm);
}

.schedule-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Related Routines */
.sheet-related-section {
  border-top: 1px solid var(--line);
  padding-top: var(--space-xl);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.related-card:hover {
  border-color: var(--line-active);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.related-character {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.related-routine {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Print styles have been factored out into dedicated css/print.css */

