/* Travelpayouts widgets — fleet-wide opt-in styles. Loaded via <link> in article head.
   Design tokens match shared/static/hutts-signup-cta.css for visual consistency. */

:root {
  --tp-blue: #2563eb;
  --tp-blue-hover: #1d4ed8;
  --tp-text: #111827;
  --tp-text-muted: #4b5563;
  --tp-text-subtle: #6b7280;
  --tp-label: #374151;
  --tp-border-input: #d1d5db;
  --tp-border-card: #e5e7eb;
  --tp-bg-card-grad-from: #fafafa;
  --tp-bg-card-grad-to: #f3f4f6;
  --tp-radius-card: 12px;
  --tp-radius-button: 8px;
  --tp-radius-input: 6px;
  --tp-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* =========================================================================
   1. HERO SEARCH WIDGET (above article body)
   ========================================================================= */
.tp-search-widget {
  margin: 1.25rem 0 1.75rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, var(--tp-bg-card-grad-from) 0%, var(--tp-bg-card-grad-to) 100%);
  border: 1px solid var(--tp-border-card);
  border-radius: var(--tp-radius-card);
  box-shadow: var(--tp-shadow-card);
}

.tp-search-widget-heading {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tp-text);
  line-height: 1.3;
}

.tp-search-form { display: block; }

.tp-search-row {
  display: grid;
  /* desktop: 4 fields + button on a single row */
  grid-template-columns: 1fr 1fr 1.05fr 1.05fr auto;
  gap: 0.6rem;
  align-items: end;
}

.tp-field {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  min-width: 0;  /* allow shrinking inside grid */
}

.tp-field > span {
  margin-bottom: 0.22rem;
  color: var(--tp-label);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.tp-field > span small {
  font-weight: 400;
  color: var(--tp-text-subtle);
  font-size: 0.7rem;
}

.tp-field input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--tp-border-input);
  border-radius: var(--tp-radius-input);
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  color: var(--tp-text);
}

.tp-field input::placeholder { color: #9ca3af; }

.tp-field input:focus,
.tp-field input:focus-visible {
  outline: 2px solid var(--tp-blue);
  outline-offset: 1px;
  border-color: var(--tp-blue);
}

.tp-search-button {
  padding: 0.55rem 1.1rem;
  background: var(--tp-blue);
  color: #fff;
  border: 0;
  border-radius: var(--tp-radius-button);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tp-search-button:hover,
.tp-search-button:focus { background: var(--tp-blue-hover); transform: translateY(-1px); }
.tp-search-button:focus-visible { outline: 2px solid var(--tp-blue); outline-offset: 2px; }

.tp-search-disclosure {
  font-size: 0.72rem;
  color: var(--tp-text-subtle);
  margin: 0.7rem 0 0;
  line-height: 1.4;
}

/* Tablet: 2x2 grid + full-width button */
@media (max-width: 800px) {
  .tp-search-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .tp-search-button {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.15rem;
  }
}

/* Mobile: tighten everything; keep 2x2 grid for compactness */
@media (max-width: 640px) {
  .tp-search-widget {
    margin: 1rem 0 1.25rem;
    padding: 0.85rem 0.95rem;
    border-radius: 10px;
  }
  .tp-search-widget-heading {
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
  }
  .tp-search-row { gap: 0.45rem; }
  .tp-field > span { font-size: 0.72rem; margin-bottom: 0.18rem; }
  .tp-field input { padding: 0.5rem 0.5rem; font-size: 0.9rem; }
  .tp-search-button { padding: 0.6rem 0.9rem; font-size: 0.9rem; }
  .tp-search-disclosure { font-size: 0.68rem; margin-top: 0.55rem; }
}

/* Very small viewports (<400px) — collapse to single column to avoid cramped 2x2 */
@media (max-width: 400px) {
  .tp-search-row { grid-template-columns: 1fr; }
}

/* =========================================================================
   2. IN-ARTICLE DEAL CTA (injected into body)
   ========================================================================= */
.tp-deal-cta {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, var(--tp-bg-card-grad-from) 0%, var(--tp-bg-card-grad-to) 100%);
  border: 1px solid var(--tp-border-card);
  border-left: 4px solid var(--tp-blue);
  border-radius: var(--tp-radius-card);
  box-shadow: var(--tp-shadow-card);
}

.tp-deal-cta-heading {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  margin: 0 0 0.4rem !important;
  color: var(--tp-text) !important;
  line-height: 1.3 !important;
}

.tp-deal-cta-lead {
  margin: 0 0 0.85rem !important;
  color: var(--tp-text-muted) !important;
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
}

.tp-deal-cta-cta {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--tp-blue);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: var(--tp-radius-button);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tp-deal-cta-cta:hover,
.tp-deal-cta-cta:focus {
  background: var(--tp-blue-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.tp-deal-cta-cta:focus-visible {
  outline: 2px solid var(--tp-blue);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .tp-deal-cta {
    padding: 0.85rem 1rem;
    margin: 1.25rem 0;
    border-radius: 10px;
  }
  .tp-deal-cta-heading { font-size: 1rem !important; }
  .tp-deal-cta-lead { font-size: 0.9rem !important; }
}

/* =========================================================================
   3. FOOTER BANNER (between </main> and <footer>)
   ========================================================================= */
.tp-footer-banner {
  margin: 2rem 0 0;
  padding: 1.25rem 0;
  background: var(--tp-blue);
  color: #fff;
}

.tp-footer-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.tp-footer-banner-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
  line-height: 1.3;
}

.tp-footer-banner-lead {
  margin: 0.2rem 0 0;
  opacity: 0.92;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.4;
}

.tp-footer-banner-cta {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: #fff;
  color: var(--tp-blue) !important;
  text-decoration: none !important;
  border-radius: var(--tp-radius-button);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tp-footer-banner-cta:hover,
.tp-footer-banner-cta:focus {
  background: #f0f7ff;
  color: var(--tp-blue) !important;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .tp-footer-banner {
    margin: 1.5rem 0 0;
    padding: 1rem 0;
  }
  .tp-footer-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
  .tp-footer-banner-heading { font-size: 1rem; }
  .tp-footer-banner-lead { font-size: 0.88rem; }
  .tp-footer-banner-cta {
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
  }
}

/* =========================================================================
   4. INLINE AUTOLINKED AIRLINE LINKS — match body link style
   ========================================================================= */
.article-body a[href*="aviasales.com/airlines/"] {
  /* leave default link color; only ensure underline + cursor */
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.15em;
}
