/* ============================================================
   MISE EN PAGE — Cook Mode
   Mobile landscape. Reads from recipe JSON. No illustrations.
   ============================================================ */

.cook-body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
}

/* === LAYOUT SHELL === */
.cook-layout {
  display: grid;
  grid-template-rows: 72px 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--charcoal);
}

/* === HEADER === */
.cook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(245, 241, 234, 0.10);
  flex-shrink: 0;
}

.cook-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cook-header__brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--white);
  opacity: 0.6;
}

.cook-header__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.06em;
}

.cook-header__sep {
  color: var(--white);
  opacity: 0.4;
  font-size: 24px;
}

.cook-header__controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cook-header__wake {
  font-family: var(--font-light);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.4s;
}
.cook-header__wake.active { opacity: 0.7; }

.cook-header__exit {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 6px 0;
}
.cook-header__exit:hover { opacity: 0.85; }

/* === MAIN AREA === */
.cook-main {
  display: flex;
  overflow: hidden;
  height: 100%;
}

/* === SIDEBAR — sticky left column for lane labels === */
.cook-sidebar {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(245, 241, 234, 0.07);
  overflow: hidden;
}

.cook-sidebar__axis-spacer {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cook-lane-labels {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cook-lane-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px 0 6px;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.75;
  border-bottom: 1px solid rgba(245, 241, 234, 0.05);
  text-align: right;
  line-height: 1.3;
}

/* === TIMELINE WRAPPER — horizontal scroll === */
.cook-timeline-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.cook-timeline-wrapper::-webkit-scrollbar { height: 2px; }
.cook-timeline-wrapper::-webkit-scrollbar-track { background: transparent; }
.cook-timeline-wrapper::-webkit-scrollbar-thumb {
  background: rgba(196, 122, 58, 0.25);
  border-radius: 1px;
}

.cook-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* === TIME AXIS === */
.cook-axis {
  flex-shrink: 0;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cook-tick {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.cook-tick__label {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--white);
  opacity: 0.7;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.cook-tick__mark { width: 1px; }
.cook-tick--major .cook-tick__mark {
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
}
.cook-tick--minor .cook-tick__mark {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
}

/* === LANES === */
.cook-lanes {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cook-lane {
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(245, 241, 234, 0.05);
}

/* Dotted lane centre line */
.cook-lane__line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    rgba(245, 241, 234, 0.16) 0px,
    rgba(245, 241, 234, 0.16) 2px,
    transparent 2px,
    transparent 8px
  );
}

/* === BLOCKS === */
.cook-block {
  position: absolute;
  top: 5px;
  border: 1px solid rgba(245, 241, 234, 0.14);
  background: rgba(245, 241, 234, 0.02);
  display: flex;
  flex-direction: column;
  padding: 8px 12px 6px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background   0.2s ease,
    opacity      0.35s ease;
  touch-action: manipulation;
  overflow: hidden;
  border-radius: 1px;
}

.cook-block:active {
  background: rgba(245, 241, 234, 0.06);
}

.cook-block__label {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.cook-block__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin: 6px 0;
  flex-shrink: 0;
}

.cook-block__ingredients {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  color: var(--white);
  line-height: 1.35;
  overflow: hidden;
  flex-shrink: 0;
}

.cook-block__outcome {
  font-family: var(--font-light);
  font-size: 20px;
  font-weight: 300;
  color: var(--white);
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  opacity: 0.85;
}

/* === BLOCK STATES === */
.cook-block--completed {
  opacity: 0.18;
  border-color: transparent;
  pointer-events: none;
}

.cook-block--next {
  border-color: var(--copper);
  background: rgba(196, 122, 58, 0.07);
}

.cook-block--next .cook-block__label {
  color: var(--white);
}

.cook-block--available {
  border-color: rgba(245, 241, 234, 0.25);
}

/* === PROGRESS BAR === */
.cook-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(245, 241, 234, 0.06);
  z-index: 50;
}

.cook-progress__bar {
  height: 100%;
  background: var(--copper);
  transition: width 0.5s ease;
  width: 0%;
}

/* === COMPLETION OVERLAY === */
.cook-done {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 49, 53, 0.94);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.cook-done.visible { display: flex; }

.cook-done__title {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 700;
  font-style: italic;
  color: var(--white);
}

.cook-done__sub {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.7;
}

.cook-done__rule {
  width: 32px;
  height: 1px;
  background: var(--copper);
  opacity: 0.5;
}

.cook-done__back {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.cook-done__back:hover { opacity: 1; }

/* === PORTRAIT PROMPT === */
.cook-portrait-prompt {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--charcoal);
  z-index: 300;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 36px;
  text-align: center;
}

.cook-portrait-prompt__icon {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(196, 122, 58, 0.4);
  border-radius: 6px;
  position: relative;
  transform: rotate(0deg);
  transition: transform 0.5s ease;
  flex-shrink: 0;
}

.cook-portrait-prompt p {
  font-family: var(--font-serif);
  font-size: 40px;
  font-style: italic;
  color: var(--white);
  opacity: 0.8;
  line-height: 1.55;
  max-width: 22ch;
}

.cook-portrait-prompt span {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.6;
}

@media (orientation: portrait) {
  .cook-portrait-prompt { display: flex; }
  .cook-layout { display: none; }
  .cook-progress { display: none; }
}
