/**
 * Your Name From Space — tool styles
 *
 * Loaded only on /tools/your-name-on-earth/. Inherits the site's dark theme
 * variables from the global stylesheet (via :root). Mobile-first
 * (90% of traffic), with a max width of ~720px so the letter strip
 * stays readable on a desktop without ballooning to silly sizes.
 */

/* ============================================================
   PAGE CHROME
============================================================ */

.tool-page {
  padding: 1rem 0 4rem;
}

.tool-page .container {
  max-width: 880px;
}

.tool-header {
  text-align: center;
  margin: 1.5rem 0 2rem;
}

.tool-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #6ec1ff 0%, #c5a3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tool-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 0.75rem;
  font-style: normal;
}

.tool-subtitle em {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.tool-tagline {
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  max-width: 600px;
  margin: 0 auto 1rem;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.tool-meta .meta-label {
  color: rgba(255, 255, 255, 0.45);
  margin-right: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ============================================================
   RESULT WRAPPERS
   Split into "visual" (above the form) and "detail" (below it) so
   the input box always sits right under the image strip — within
   thumb reach and within the same eye-line.
============================================================ */

.ynfs-result-visual {
  margin-bottom: 0.85rem; /* tight gap so form sits just below the strip */
}

.ynfs-result-detail {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   INPUT FORM
============================================================ */

.ynfs-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 0 auto 0.85rem;
  max-width: 520px;
}

.ynfs-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.ynfs-input-row {
  display: flex;
  gap: 0.6rem;
}

#ynfs-input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#ynfs-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.08em;
}

#ynfs-input:focus {
  border-color: #6ec1ff;
  box-shadow: 0 0 0 3px rgba(110, 193, 255, 0.2);
}

#ynfs-input.is-invalid {
  border-color: #ff7676;
  box-shadow: 0 0 0 3px rgba(255, 118, 118, 0.18);
}

.ynfs-go {
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6ec1ff 0%, #c5a3ff 100%);
  color: #0b0d17;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.ynfs-go:hover {
  box-shadow: 0 4px 18px rgba(110, 193, 255, 0.35);
}

.ynfs-go:active {
  transform: translateY(1px);
}

.ynfs-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0.6rem 0 0;
  text-align: center;
}

.ynfs-hint.is-error {
  color: #ff9a9a;
}

/* ============================================================
   LETTER STRIP
============================================================ */

.ynfs-strip-wrap {
  margin: 0 -1rem 0.75rem; /* allow horizontal scroll edge to reach container edge on mobile */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.ynfs-strip {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-start;
  min-width: min-content;
  padding: 0.25rem;
}

.ynfs-tile {
  position: relative;
  flex: 0 0 auto;
  width: clamp(120px, 34vw, 190px);
  height: clamp(120px, 34vw, 190px);
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  scroll-snap-align: center;
}

.ynfs-tile.is-india {
  border-color: rgba(255, 153, 51, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 153, 51, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.ynfs-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ynfs-tile-letter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: clamp(0.9rem, 2.6vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.ynfs-tile-flag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.7rem;
  background: rgba(255, 153, 51, 0.95);
  color: #0b0d17;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* Single image refresh control. Kept separate from share/download actions
   so the input stays directly beneath the visual result on phones. */
.ynfs-image-controls {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0 0.85rem;
}

.ynfs-refresh-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 193, 255, 0.35);
  background: rgba(110, 193, 255, 0.14);
  color: #dff2ff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.ynfs-refresh-all:hover,
.ynfs-refresh-all:focus-visible {
  background: rgba(110, 193, 255, 0.22);
  border-color: rgba(110, 193, 255, 0.6);
  outline: none;
}

.ynfs-refresh-all:active {
  transform: translateY(1px);
}

/* ============================================================
   ACTION BUTTONS
============================================================ */

.ynfs-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  max-width: 520px;
  margin: 0 auto 1.4rem;
}

.ynfs-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.5rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  min-height: 38px;
  white-space: nowrap;
}

.ynfs-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.ynfs-action:active {
  transform: translateY(1px);
}

.ynfs-action.is-success {
  background: rgba(110, 255, 160, 0.15);
  border-color: rgba(110, 255, 160, 0.4);
}

@media (min-width: 720px) {
  .ynfs-strip-wrap {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .ynfs-strip {
    justify-content: center;
    gap: 0.85rem;
  }

  .ynfs-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .ynfs-action {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }
}

/* ============================================================
   PLACE STORIES
============================================================ */

.ynfs-stories {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.ynfs-story {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.ynfs-story.is-india {
  border-color: rgba(255, 153, 51, 0.35);
  background: linear-gradient(135deg, rgba(255, 153, 51, 0.05), rgba(255, 255, 255, 0.02));
}

.ynfs-story-letter {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6ec1ff 0%, #c5a3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  line-height: 1;
  margin-top: 0.15rem;
}

.ynfs-story.is-india .ynfs-story-letter {
  background: linear-gradient(135deg, #ff9933 0%, #ffd633 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.ynfs-story-body h3 {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  color: #fff;
}

.ynfs-story-body h3 .ynfs-india-tag {
  display: inline-block;
  font-size: 0.65rem;
  background: rgba(255, 153, 51, 0.95);
  color: #0b0d17;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.ynfs-story-body p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.ynfs-story-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.35rem !important;
}

.ynfs-story-meta a {
  color: rgba(110, 193, 255, 0.8);
  text-decoration: none;
}

.ynfs-story-meta a:hover {
  text-decoration: underline;
}

.ynfs-credit {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  margin: 1.5rem 0 0;
}

/* ============================================================
   EDUCATIONAL SECTION (below tool)
============================================================ */

.tool-info {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-info h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
  color: #fff;
}

.tool-info h3 {
  font-size: 1.02rem;
  margin: 1.4rem 0 0.35rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.tool-info p,
.tool-info li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.tool-info a {
  color: #6ec1ff;
}

.tool-info ul,
.tool-info ol {
  padding-left: 1.25rem;
}

.tool-info li {
  margin-bottom: 0.5rem;
}

.tool-info code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: rgba(110, 193, 255, 0.95);
}

.tool-steps li {
  margin-bottom: 0.7rem;
}

/* ============================================================
   COMPARISON TABLE — vs NASA Landsat tool
============================================================ */

.tool-compare-wrap {
  margin: 1rem -0.25rem 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tool-compare {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tool-compare th,
.tool-compare td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: top;
  line-height: 1.45;
}

.tool-compare thead th {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tool-compare tbody th {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  width: 32%;
}

.tool-compare tbody td {
  color: rgba(255, 255, 255, 0.72);
}

.tool-compare tbody td:last-child {
  color: rgba(255, 255, 255, 0.92);
}

.tool-compare tr:hover td,
.tool-compare tr:hover th {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   NO-SCRIPT FALLBACK
============================================================ */

.ynfs-noscript {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin: 1rem 0;
  color: rgba(255, 255, 255, 0.7);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   MOTION PREFERENCES
============================================================ */

@media (prefers-reduced-motion: reduce) {
  .ynfs-tile,
  .ynfs-action,
  .ynfs-go,
  #ynfs-input {
    transition: none;
  }
}
