/* ============================================================================
   Ultra-Lightweight Mobile-First Stylesheet (Zero Bloat, Zero CLS, RTL-Ready)
   Palette: Emerald Green (#059669) & Crisp White + Dark Mode
   ============================================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
.icon-md { width: 22px; height: 22px; flex-shrink: 0; }
.brand-icon { width: 26px; height: 26px; flex-shrink: 0; }

/* Navigation Buttons & Dropdowns */
.nav-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn { width: 36px; justify-content: center; padding: 0; }
.nav-btn:hover, .icon-btn:hover { border-color: var(--brand); }

html:not(.dark) .icon-sun { display: none; }
html.dark .icon-moon { display: none; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  z-index: 60;
}
.dropdown-menu-end { inset-inline-start: auto; inset-inline-end: 0; min-width: 175px; }

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.dropdown-item:hover, .dropdown-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
html.dark .dropdown-item:hover, html.dark .dropdown-item.is-active {
  color: #6ee7b7;
}
.muted-code { font-size: 0.75rem; color: var(--muted); }

/* Breadcrumb */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--brand); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

/* Above-the-Fold Downloader Form */
.dl-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 10px;
}

.dl-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.dl-input {
  width: 100%;
  height: 52px;
  padding-inline-start: 16px;
  padding-inline-end: 96px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.dl-input:focus { border-color: var(--brand); }

.paste-btn {
  position: absolute;
  inset-inline-end: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.paste-btn:hover { border-color: var(--brand); color: var(--brand); }

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.submit-btn:hover { background: var(--brand-dark); }
.submit-btn:disabled { opacity: 0.65; cursor: wait; }
.inline-btn { width: auto; }

.hero-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 16px; }

/* Zero-CLS Reserved Result & Ad Containers */
.result-region {
  max-width: 720px;
  margin: 0 auto 16px;
  min-height: 24px;
  text-align: start;
}

.alert-error {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
  font-weight: 500;
}
html.dark .alert-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.skeleton-card,
.result-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 196px;
}

.skeleton-thumb {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
.skeleton-line {
  height: 16px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: var(--border);
}
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-btns { display: flex; gap: 8px; margin-top: 16px; }
.skeleton-pill { width: 110px; height: 38px; border-radius: 8px; background: var(--border); }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #064e3b;
}
.result-meta-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
}
html.dark .result-meta-badge { color: #6ee7b7; }
.result-title { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.35; }
.result-duration { margin: 0 0 12px; font-size: 0.86rem; color: var(--muted); }
.format-btn-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.format-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.format-dl-btn:hover { background: var(--brand-dark); }
.format-dl-btn.is-audio { background: #0f172a; }
html.dark .format-dl-btn.is-audio { background: #334155; }

.ad-slot {
  max-width: 728px;
  min-height: 96px;
  margin: 12px auto 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--surface);
}

/* Content Sections */
.content-section { padding: 40px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.content-section h2 { margin: 0 0 14px; font-size: 1.5rem; line-height: 1.25; letter-spacing:-0.01em; }
.section-intro { margin: 0 0 22px; color: var(--muted); max-width: 720px; }
.prose-p { margin: 0 0 14px; color: var(--muted); }

/* 3-Step Guide & Features Grids */
.steps-grid,
.features-grid,
.sibling-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.step-card,
.feature-card,
.sibling-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.feature-icon,
.sibling-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.step-card h3, .feature-card h3, .sibling-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step-card p, .feature-card p, .sibling-card p { margin: 0; font-size: 0.92rem; color: var(--muted); }

.sibling-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.sibling-card:hover { border-color: var(--brand); transform: translateY(-1px); }

/* Formats Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; text-align: start; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
html.dark .data-table th { color: #6ee7b7; }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ Accordion */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.faq-q {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  font-weight: 600;
  cursor: pointer;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-chevron { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s ease; color: var(--brand); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-a { padding: 0 18px 16px; color: var(--muted); font-size: 0.94rem; }
.faq-a p { margin: 0; }

/* Legal & 404 */
.legal-container { max-width: 780px; }
.legal-title { margin: 0 0 6px; font-size: 1.9rem; }
.legal-meta { margin: 0 0 24px; font-size: 0.86rem; color: var(--muted); }
.legal-block { margin-bottom: 24px; }
.badge-404 {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  margin: 0 0 10px;
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); padding: 36px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
.footer-desc { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; max-width: 320px; }
.footer-col h3 { margin: 0 0 10px; font-size: 0.95rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; color: var(--muted); font-size: 0.84rem; text-align: center; }

/* Responsive Breakpoints */
@media (min-width: 640px) {
  .dl-form { flex-direction: row; }
  .submit-btn { flex-shrink: 0; }
  .skeleton-card, .result-card { grid-template-columns: 240px 1fr; align-items: start; }
  .features-grid, .sibling-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 860px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .sibling-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
