/* Practice — Explorer: tabbed reading pane styles */

.explorer-body {
  overflow: hidden;
  height: 100vh;
}

.explorer-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 1;
}

/* ---------- Chrome bar ---------- */
.explorer-chrome {
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #080808 0%, #000000 100%);
  border-bottom: 1px solid var(--ink-line);
  flex-shrink: 0;
}

/* ---------- Tab bar ---------- */
.chrome-tabs {
  display: flex;
  align-items: stretch;
  padding: 6px 10px 0 68px;   /* left clears grain-dot nav */
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-line) transparent;
  min-height: 38px;
}
.chrome-tabs::-webkit-scrollbar { height: 6px; }
.chrome-tabs::-webkit-scrollbar-thumb {
  background: var(--ink-line);
  border-radius: 3px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  max-width: 240px;
  padding: 8px 6px 8px 12px;
  background: rgba(236, 231, 220, 0.02);
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
  user-select: none;
}
.tab:hover {
  background: rgba(236, 231, 220, 0.05);
  color: var(--ink);
}
.tab.is-active {
  background: var(--bg);
  border-color: var(--ink-line);
  color: var(--ink);
  position: relative;
}
.tab.is-active::after {
  /* Hide the bottom border where the tab meets the chrome controls */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--bg);
}

/* ---------- Drag-to-reorder visual feedback ---------- */
.tab[draggable="true"] { cursor: grab; }
.tab.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
/* Drop indicator: a thin red line on the leading edge of the target tab */
.tab.is-drop-before { box-shadow: -2px 0 0 0 var(--red); }
.tab.is-drop-after  { box-shadow:  2px 0 0 0 var(--red); }

.tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: lowercase;
}

.tab-close {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--ink-faint);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 180ms ease, background 180ms ease;
}
.tab-close:hover {
  color: var(--red);
  background: rgba(178, 34, 34, 0.14);
}
.tab-close svg { width: 12px; height: 12px; stroke-width: 2; }

.tab-add {
  width: 34px;
  height: 32px;
  margin-left: 4px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px dashed var(--ink-line);
  border-radius: 6px;
  color: var(--ink-faint);
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.tab-add:hover {
  color: var(--ink);
  border-color: var(--red);
  background: rgba(178, 34, 34, 0.08);
}
.tab-add svg { width: 14px; height: 14px; stroke-width: 1.8; }

/* ---------- Chrome controls row ---------- */
.chrome-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 68px;
  border-top: 1px solid var(--ink-line);
}

.chrome-nav {
  display: flex;
  gap: 2px;
}

.chrome-nav button,
.chrome-extras button,
.chrome-extras .chrome-settings,
.chrome-address button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 6px;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
  text-decoration: none;
}
.chrome-nav button:hover,
.chrome-extras button:hover,
.chrome-extras .chrome-settings:hover,
.chrome-address button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ink-line);
}
.chrome-nav button:active,
.chrome-extras button:active,
.chrome-address button:active {
  background: rgba(178, 34, 34, 0.1);
  border-color: var(--red);
}
.chrome-nav button svg,
.chrome-extras button svg,
.chrome-extras .chrome-settings svg,
.chrome-address button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

/* Address bar */
.chrome-address {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  background: rgba(236, 231, 220, 0.04);
  padding: 0 6px 0 12px;
  height: 34px;
  transition: border-color 200ms ease, background 200ms ease;
}
.chrome-address:focus-within {
  border-color: var(--red);
  background: rgba(236, 231, 220, 0.06);
}
.chrome-address-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
}
.chrome-address input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  height: 30px;
  min-width: 0;
  padding: 0;
}
.chrome-address input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.chrome-extras {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chrome-status {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 820px) {
  .chrome-tabs { padding-left: 44px; }
  .chrome-controls {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .chrome-extras .chrome-status { display: none; }
}

/* ---------- Nav-dot positioning in explorer ----------
   Math: chrome-tabs row is min-height 38px starting at y=0. Tabs inside
   have padding-top: 6px + their own padding 8px + 11px font, so tab
   center is ~22px from the top. We want the dot center at y=22 too.
   With .nv's intrinsic 10px padding, .nv top:5 puts the dot's top at
   y=15, so its center (dot is 14px tall here) lands at y=22 — flush
   with the tab row's vertical centerline. */
.explorer-body .nv {
  top: 5px;
  left: 18px;
}
.explorer-body .nv-dot {
  width: 14px;
  height: 14px;
}
/* The grain SVG inside the dot is `width:100%; height:100%` of the
   .nv-dot box. With explicit aspect-ratio + preserveAspectRatio it
   should always render centered, but Chromebook Chrome was clipping
   the right/bottom — force the dot to clip its overflow so any
   sub-pixel render slop stays inside the circle silhouette. */
.explorer-body .nv-dot { overflow: hidden; }

/* ---------- Frame area ---------- */
.explorer-frame-wrap {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

.explorer-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  display: block;
}
.explorer-frame[hidden] { display: none; }

.explorer-splash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  pointer-events: none;
  transition: opacity 400ms var(--ease-zen);
  z-index: 1;
}
.explorer-splash.is-hidden { opacity: 0; }
.splash-inner { max-width: 520px; text-align: center; }
.splash-eyebrow {
  display: block;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}
.splash-inner h1 {
  margin: 0 0 14px;
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(32px, 4.5vw, 54px);
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--ink);
}
.splash-inner h1 em { font-style: italic; color: var(--red); }
.splash-inner p {
  margin: 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
