/* Phase 472 — Travelpayouts flash-deals rail.
   Styles the server-rendered special-offers block (tgz_tp_render_special_offers)
   on the homepage so cached Agadir fares read as a real product card, not raw
   text. Tokens mirror the proven Home Cockpit palette (home.bundle.css). */

.tpzRoot{}

.tpBlock{
  margin:0 auto;
  padding:22px;
  border-radius:26px;
  background:linear-gradient(180deg,rgba(255,255,255,.97),rgba(247,244,238,.93));
  border:1px solid var(--hc-line,rgba(13,31,56,.12));
  box-shadow:0 16px 40px rgba(9,25,48,.10);
}
.tpBlock + .tpBlock{margin-top:16px}

.tpBlockHead{
  display:grid;
  grid-template-columns:minmax(0,.75fr) minmax(0,1.1fr);
  gap:14px;
  align-items:end;
  margin-bottom:16px;
}
.tpBlockBadge{
  justify-self:start;
  display:inline-flex;
  align-items:center;
  gap:7px;
  grid-column:1/-1;
  width:max-content;
  max-width:100%;
  padding:7px 12px;
  border-radius:999px;
  background:#fff2da;
  color:#a85f00;
  border:1px solid rgba(245,154,27,.28);
  font:850 11px/1.15 Inter,system-ui,sans-serif;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.tpBlockBadge::before{
  content:"";
  width:7px;height:7px;border-radius:50%;
  background:#f59a1b;
  box-shadow:0 0 0 4px rgba(245,154,27,.22);
}
.tpBlockHead h2{
  margin:0;
  font:900 clamp(1.6rem,2.4vw,2.3rem)/1.02 'Inter Tight',Inter,system-ui,sans-serif;
  letter-spacing:-.04em;
  color:var(--hc-ink,#0b1628);
}
.tpBlockLead{
  margin:0;
  color:var(--hc-muted,#647084);
  font:650 14px/1.52 Inter,system-ui,sans-serif;
}

.tpOffersGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.tpOfferCard{
  display:grid;
  grid-template-rows:auto auto auto;
  gap:7px;
  padding:16px;
  border-radius:20px;
  background:#fff;
  border:1px solid rgba(13,31,56,.10);
  box-shadow:0 8px 22px rgba(9,25,48,.06);
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
  position:relative;
  overflow:hidden;
}
.tpOfferCard::after{
  content:"";
  position:absolute;
  inset:auto -34px -34px auto;
  width:120px;height:120px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(245,154,27,.16),transparent 62%);
  pointer-events:none;
}
.tpOfferCard:hover{
  transform:translateY(-2px);
  border-color:rgba(245,154,27,.42);
  box-shadow:0 14px 30px rgba(9,25,48,.10);
}
.tpOfferPrice{
  font:900 1.7rem/1 'Inter Tight',Inter,system-ui,sans-serif;
  letter-spacing:-.03em;
  color:#0b213d;
}
.tpOfferTop{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.tpOfferDeal{
  flex:0 0 auto;
  padding:3px 9px;border-radius:999px;
  font:850 10.5px/1.2 Inter,system-ui,sans-serif;letter-spacing:.02em;text-transform:uppercase;
}
.tpOfferDeal--great{background:#e6f4f1;color:#0e6a70}
.tpOfferDeal--good{background:#fff2da;color:#a85f00}
.tpOfferDeal--fair{background:#eef2f6;color:#647084}
.tpOfferRoute{
  font:850 14px/1.25 Inter,system-ui,sans-serif;
  color:#10294b;
  display:flex;align-items:center;gap:6px;
}
.tpOfferRoute em{font-style:normal;color:var(--hc-orange,#f59a1b);font-weight:900}
.tpOfferMeta{
  margin:0;
  font:650 12px/1.4 Inter,system-ui,sans-serif;
  color:var(--hc-muted,#647084);
}
.tpOfferView{
  display:inline-flex;align-items:center;justify-content:center;
  margin-top:4px;min-height:44px;padding:0 14px;border-radius:11px;
  background:#0b213d;color:#fff;text-decoration:none;
  font:850 12.5px/1 Inter,system-ui,sans-serif;
  transition:transform .14s ease,background .14s ease;
}
.tpOfferView:hover{transform:translateY(-1px);background:#10294b}
.tpOfferCard--great{border-color:rgba(14,106,112,.32)}
.tpOfferCard--great::after{background:radial-gradient(circle,rgba(14,106,112,.16),transparent 62%)}

.tpNoData{
  margin:0;
  padding:18px 20px;
  border-radius:18px;
  background:#f8fafc;
  border:1px dashed rgba(13,31,56,.16);
  color:var(--hc-muted,#647084);
  font:650 14px/1.5 Inter,system-ui,sans-serif;
}

.tpDisclaimer{
  margin:16px 0 0;
  padding-top:14px;
  border-top:1px solid rgba(13,31,56,.10);
  color:var(--hc-muted,#647084);
  font:500 11.5px/1.5 Inter,system-ui,sans-serif;
}

/* The rail sits inside the home container, keep it within the page rhythm. */
.hcPlanSection + .tpBlock,
.tpBlock{margin-top:18px;margin-bottom:6px}

@media (max-width:880px){
  .tpBlockHead{grid-template-columns:1fr}
  .tpOffersGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:560px){
  .tpBlock{padding:18px;border-radius:22px}
  .tpOffersGrid{grid-template-columns:1fr;gap:10px}
  .tpOfferPrice{font-size:1.55rem}
}

/* Dark mode — native route night surface (matches Phase 388/389 grammar). */
html[data-theme="dark"] body .tpBlock{
  background:linear-gradient(180deg,rgba(15,43,57,.96),rgba(7,23,32,.98));
  border-color:rgba(151,230,214,.22);
  box-shadow:none;
  color:#edf7f5;
}
html[data-theme="dark"] body .tpBlockHead h2,
html[data-theme="dark"] body .tpOfferPrice,
html[data-theme="dark"] body .tpOfferRoute{color:#edf7f5}
html[data-theme="dark"] body .tpOfferRoute em{color:#24c8b8}
html[data-theme="dark"] body .tpOfferView{background:linear-gradient(135deg,#24c8b8,#0e6a70);color:#031719}
html[data-theme="dark"] body .tpOfferView:hover{filter:brightness(1.06)}
html[data-theme="dark"] body .tpOfferDeal--great{background:rgba(36,200,184,.18);color:#aef5de}
html[data-theme="dark"] body .tpOfferDeal--good{background:rgba(255,184,77,.16);color:#ffb84d}
html[data-theme="dark"] body .tpOfferDeal--fair{background:rgba(151,230,214,.1);color:#8fb4b8}
html[data-theme="dark"] body .tpOfferCard--great{border-color:rgba(36,200,184,.4)}
html[data-theme="dark"] body .tpOfferPrice,
html[data-theme="dark"] body .tpOfferRoute{color:#edf7f5}
html[data-theme="dark"] body .tpBlockLead,
html[data-theme="dark"] body .tpOfferMeta,
html[data-theme="dark"] body .tpDisclaimer{color:#aac3c4}
html[data-theme="dark"] body .tpOfferCard{
  background:rgba(10,29,40,.72);
  border-color:rgba(151,230,214,.18);
}
html[data-theme="dark"] body .tpOfferCard:hover{border-color:rgba(36,200,184,.5)}
html[data-theme="dark"] body .tpBlockBadge{
  background:rgba(36,200,184,.16);
  color:#aef5de;
  border-color:rgba(174,245,222,.3);
}
html[data-theme="dark"] body .tpBlockBadge::before{
  background:#24c8b8;
  box-shadow:0 0 0 4px rgba(36,200,184,.22);
}
html[data-theme="dark"] body .tpNoData{
  background:rgba(10,29,40,.6);
  border-color:rgba(151,230,214,.2);
}

/* RTL */
[dir="rtl"] .tpOfferCard::after{inset:auto auto -34px -34px}

/* =====================================================================
   Phase 2026-W2b — OWNER FEEDBACK: "/flights/agadir/ :: too much raw text
   almost no design", mobile-first.

   Two separate faults were behind that:
   1. This stylesheet was registered `when => home_like` only, so on every
      /flights* route the whole .tpBlock family rendered completely
      unstyled. Fixed in the asset registry (now also `when => flights`).
   2. The table and calendar renderers in inc/tp_render.php emit
      .tpOffersTable / .tpOffersRow / .tpPrice / .tpAirline / .tpRoute /
      .tpAction / .tpBookLink / .tpCalendarGrid / .tpCalendarRow /
      .tpCalendarHighlight — and NONE of those class names had a single
      rule anywhere in css/. Even on the homepage they were raw text.
      Everything below is new; no existing declaration is modified.

   Mobile-first: rows become stacked cards under 720px (a 4-column fare
   table cannot work at 375px), and the whole table also scrolls inside
   its own container so it can never widen the page body.
   ===================================================================== */

/* --- Fare table: real rows on desktop, stacked cards on phones. ------- */
.tpOffersTable{
  display:grid;
  gap:8px;
  margin:0;
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
.tpOffersRow{
  display:grid;
  grid-template-columns:minmax(88px,.7fr) minmax(0,.8fr) minmax(0,1.4fr) auto;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(13,31,56,.10);
  box-shadow:0 6px 18px rgba(9,25,48,.05);
}
.tpOffersRow.tpOffersHeader{
  padding:6px 14px;
  background:none;
  border:0;
  box-shadow:none;
  font:800 11px/1.2 Inter,system-ui,sans-serif;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--hc-muted,#647084);
}
.tpPrice{display:grid;gap:1px;min-width:0}
.tpPrice b{
  font:900 1.35rem/1 'Inter Tight',Inter,system-ui,sans-serif;
  letter-spacing:-.03em;
  color:#0b213d;
}
.tpPrice small{font:650 11.5px/1.3 Inter,system-ui,sans-serif;color:var(--hc-muted,#647084)}
.tpAirline{
  min-width:0;
  font:750 13.5px/1.35 Inter,system-ui,sans-serif;
  color:#10294b;
  overflow-wrap:anywhere;
}
.tpRoute{display:grid;gap:2px;min-width:0}
.tpRoute b{font:850 13.5px/1.25 Inter,system-ui,sans-serif;color:#10294b;letter-spacing:.01em}
.tpRoute small{font:650 12px/1.35 Inter,system-ui,sans-serif;color:var(--hc-muted,#647084)}
.tpAction{display:flex;justify-content:flex-end;min-width:0}
.tpBookLink{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:44px;padding:0 16px;border-radius:12px;
  background:#0b213d;color:#fff;text-decoration:none;white-space:nowrap;
  font:850 13px/1 Inter,system-ui,sans-serif;
  transition:background .14s ease,transform .14s ease;
}
.tpBookLink:hover{background:#10294b;transform:translateY(-1px)}

/* --- Low-fare calendar ------------------------------------------------ */
.tpCalendarHighlight{
  display:flex;flex-wrap:wrap;align-items:center;gap:10px;
  margin:0 0 12px;padding:12px 14px;border-radius:16px;
  background:#fff7ea;border:1px solid rgba(245,154,27,.28);
  font:650 14px/1.45 Inter,system-ui,sans-serif;color:#13294a;
}
.tpCalendarHighlight b{font:900 1.05rem/1.1 'Inter Tight',Inter,system-ui,sans-serif;color:#0b213d}
.tpCalendarHighlight .tpBookLink{margin-inline-start:auto}
.tpCalendarGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  max-width:100%;
}
.tpCalendarRow{
  display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  min-height:44px;padding:10px 14px;border-radius:13px;
  background:#fff;border:1px solid rgba(13,31,56,.10);
  font:650 13.5px/1.3 Inter,system-ui,sans-serif;color:#46555e;
}
.tpCalendarRow b{
  font:900 15px/1.1 'Inter Tight',Inter,system-ui,sans-serif;
  letter-spacing:-.02em;color:#0b213d;
}
.tpCalendarRow.tpCalendarHeader{
  grid-column:1/-1;min-height:0;padding:2px 14px;
  background:none;border:0;
  font:800 11px/1.2 Inter,system-ui,sans-serif;
  letter-spacing:.06em;text-transform:uppercase;color:var(--hc-muted,#647084);
}
.tpCalendarRow.isCheapest{
  border-color:rgba(14,106,112,.42);
  background:#e6f4f1;
}
.tpCalendarRow.isCheapest b{color:#0e6a70}

/* --- Section rhythm: the flights hubs stack many blocks in a row. ----- */
.tpBlockLead{max-width:70ch}

@media (max-width:900px){
  .tpOffersRow{grid-template-columns:minmax(80px,.8fr) minmax(0,1.6fr) auto}
  .tpOffersRow .tpAirline{grid-column:2;grid-row:2;font-size:12.5px}
  .tpOffersRow.tpOffersHeader{display:none}
}

/* Phones: a 4-column fare table is unreadable at 375px, so each row
   becomes its own card — price + status on top, route under it, the CTA
   full width at the bottom. Same DOM, same links, same sub_ids. */
@media (max-width:719px){
  .tpOffersRow,
  .tpOffersRow.tpOffersHeader{grid-template-columns:1fr}
  .tpOffersRow{gap:6px;padding:14px;border-radius:16px}
  .tpOffersRow.tpOffersHeader{display:none}
  .tpOffersRow .tpAirline{grid-column:auto;grid-row:auto}
  .tpAction{justify-content:stretch;margin-top:4px}
  .tpBookLink{width:100%}
  .tpCalendarGrid{grid-template-columns:1fr}
  .tpCalendarHighlight{font-size:13.5px}
  .tpCalendarHighlight .tpBookLink{margin-inline-start:0;width:100%}
  .tpBlockHead h2{font-size:clamp(1.35rem,6vw,1.75rem)}
  .tpBlockLead{font-size:13.5px}
}

/* Dark theme parity for every new element above. */
html[data-theme="dark"] body .tpOffersRow{
  background:rgba(10,29,40,.72);
  border-color:rgba(151,230,214,.18);
  box-shadow:none;
}
html[data-theme="dark"] body .tpOffersRow.tpOffersHeader{background:none;border:0}
html[data-theme="dark"] body .tpPrice b,
html[data-theme="dark"] body .tpAirline,
html[data-theme="dark"] body .tpRoute b,
html[data-theme="dark"] body .tpCalendarRow b{color:#edf7f5}
html[data-theme="dark"] body .tpPrice small,
html[data-theme="dark"] body .tpRoute small,
html[data-theme="dark"] body .tpOffersRow.tpOffersHeader,
html[data-theme="dark"] body .tpCalendarRow,
html[data-theme="dark"] body .tpCalendarRow.tpCalendarHeader{color:#aac3c4}
html[data-theme="dark"] body .tpBookLink{
  background:linear-gradient(135deg,#24c8b8,#0e6a70);
  color:#031719;
}
html[data-theme="dark"] body .tpBookLink:hover{filter:brightness(1.06);background:linear-gradient(135deg,#24c8b8,#0e6a70)}
html[data-theme="dark"] body .tpCalendarHighlight{
  background:rgba(255,184,77,.10);
  border-color:rgba(255,184,77,.30);
  color:#edf7f5;
}
html[data-theme="dark"] body .tpCalendarHighlight b{color:#ffd89c}
html[data-theme="dark"] body .tpCalendarRow{
  background:rgba(10,29,40,.72);
  border-color:rgba(151,230,214,.18);
}
html[data-theme="dark"] body .tpCalendarRow.isCheapest{
  background:rgba(36,200,184,.14);
  border-color:rgba(36,200,184,.42);
}
html[data-theme="dark"] body .tpCalendarRow.isCheapest b{color:#aef5de}

[dir="rtl"] .tpAction{justify-content:flex-start}

/* Mobile audit 2026-08-23: at 320px viewports the 18px block padding pushed
   the badge/heading past the viewport (~7px page overflow on small phones). */
@media (max-width:360px){ .tpBlock{padding:12px;border-radius:16px} }
