/* ============================================================
   Fly Papua — Melanesia flight & hotel directory
   Original responsive theme. Mobile-first.
   Theme adapted from the supplied reference: blueviolet #8a2be2
   brand color, soft gold/cream gradient band, white page with
   light-gray #d8d8da bordered rounded boxes, #3c3c3c ink.
   ============================================================ */

:root {
  --purple:      #8a2be2;
  --purple-d:    #6c18bc;
  --purple-deep: #4a0e88;
  --purple-tint: #f4e9fe;
  --gold-1:      #e9cc8d;
  --gold-2:      #f6e7c9;
  --gold-grad:   linear-gradient(115deg, #e9cc8d 0%, #f1deb4 55%, #f6e7c9 100%);
  --ink:         #3c3c3c;
  --muted:       #808080;
  --line:        #d8d8da;
  --soft:        #f8f8f8;
  --bg:          #ffffff;
  --card:        #ffffff;
  --radius:      12px;
  --shadow:      0 6px 22px rgba(60, 60, 60, .10);

  /* classic YUI "sam" menubar palette (as before) */
  --bar-border:  #808080;
  --bar-sep:     #cccccc;
  --bar-grad:    linear-gradient(to bottom, #fdfdfd 0%, #f1f1f1 45%, #dedede 55%, #cfcfcf 100%);
  --sel-border:  #7D98B8;
  --sel-grad:    linear-gradient(to bottom, #e3eefc 0%, #d2e4fb 45%, #b6d1f2 55%, #a3c5ef 100%);
  --item-hover:  #B3D4FF;
  --title-gray:  #a4a4a4;
  --home-orange: #ff991A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

main { flex: 1 0 auto; padding-block: 1.25rem 2.5rem; }

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-d); }

img, svg { max-width: 100%; }

/* ---------- Header (white masthead + gold strip) ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.site-head::after {
  content: ""; display: block; height: 4px;
  background: var(--gold-grad);
}

.head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 62px; position: relative;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--purple); font-size: 1.15rem; color: #fff;
  box-shadow: 0 3px 10px rgba(138, 43, 226, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.08rem; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .18em; }

.nav-toggle {
  display: none; position: relative; z-index: 60;
  background: none; border: 0; cursor: pointer; padding: .5rem;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; margin: 5px 0;
  background: #3c3c3c; border-radius: 2px; transition: .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Menubar — glossy sam-skin bar (as before) ---------- */

.site-nav {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--bar-border);
  border-radius: 0 0 10px 10px;          /* rounded bottom corners, like original */
  background: var(--bar-grad);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 93%;
  line-height: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  overflow: visible;
}

.site-nav > a, .nav-link {
  display: inline-block; padding: 0 .8rem;
  color: #000; font-weight: 400; font-size: 100%;
  background: none; border: 0; cursor: default; font-family: inherit;
  white-space: nowrap; text-decoration: none;
}
.site-nav > a { cursor: pointer; }
.site-nav > a + a, .site-nav .nav-drop + .nav-drop, .site-nav a + .nav-drop { border-left: 1px solid var(--bar-sep); }

/* blue hover like the sam-skin selected bar item */
.site-nav > a:hover, .nav-link:hover,
.nav-drop:hover > .nav-link, .nav-drop:focus-within > .nav-link,
.site-nav > a.active {
  background: var(--sel-grad);
  border-color: var(--sel-border);
  box-shadow: inset 0 0 0 1px var(--sel-border);
  color: #000;
}

/* Home item — orange, as on the original bar */
.site-nav > a.home-item {
  background: var(--home-orange);
  color: #fff; font-weight: 700;
}
.site-nav > a.home-item:hover {
  background: #f08a00; color: #fff;
  box-shadow: inset 0 0 0 1px #b26a00;
}

.nav-drop { position: relative; }

/* ---------- Dropdowns — white panels, #808080 border (as before) ---------- */

.mega {
  position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  background: #fff; color: #000;
  border: 1px solid var(--bar-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.12), 0 8px 22px rgba(0,0,0,.15);
  min-width: 200px; opacity: 0; visibility: hidden; transition: .18s ease;
  padding: 3px 0; font-size: 93%; line-height: 1.5;
}
.mega::before {
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
.nav-drop:hover .mega, .nav-drop:focus-within .mega, .nav-drop.open .mega {
  opacity: 1; visibility: visible;
}
.mega-in {
  display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0 1rem; padding: 3px 0;
  max-height: min(62vh, 560px); overflow: auto;
}
.mega-slim .mega-in { grid-template-columns: 1fr 1fr; }

/* group titles: gray bold, hairline above each group */
.menu-group h4 {
  font-size: 100%; font-weight: 700; text-transform: none; letter-spacing: 0;
  color: var(--title-gray);
  padding: 3px 10px 0 10px; margin: 0;
  border-top: 1px solid var(--bar-sep);
}
.menu-group:first-child h4 { border-top: 0; }
.menu-group ul { list-style: none; padding: 3px 0; }
.menu-group li a {
  display: block; padding: 0 20px; font-size: .92rem; color: #000;
  border-radius: 0; white-space: nowrap; cursor: default;
}
.menu-group li a:hover { background: var(--item-hover); color: #000; }
.menu-group li a i {
  font-style: normal; color: var(--muted); font-size: .78rem; margin-left: .35rem;
}

/* ---------- Hero (gold/cream band) ---------- */

.hero {
  position: relative; overflow: hidden;
  background: var(--gold-grad);
  color: #3a2c10;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(4.5rem, 9vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "✈"; position: absolute; right: -2%; top: 14%;
  font-size: clamp(10rem, 28vw, 22rem); opacity: .10;
  transform: rotate(12deg); pointer-events: none;
  color: #8a6d2f;
}
.hero h1 { font-size: clamp(1.55rem, 4.2vw, 2.6rem); line-height: 1.2; max-width: 21ch; color: #33280e; }
.hero p { margin-top: .6rem; max-width: 58ch; color: #6b5a33; font-size: clamp(.92rem, 2vw, 1.05rem); }

/* ---------- Search card ---------- */

.search-card {
  position: relative; z-index: 2; margin-top: -3.2rem;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 1.15rem;
}
.search-tabs { display: flex; gap: .4rem; margin-bottom: .9rem; flex-wrap: wrap; }
.tab-btn {
  padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--muted);
}
.tab-btn:hover { border-color: var(--purple); color: var(--purple); }
.tab-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }

.search-form { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.field label {
  display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: .25rem; font-weight: 700;
}
.field input, .field select {
  width: 100%; padding: .6rem .7rem; font: inherit; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(138, 43, 226, .18);
}
.btn-go {
  padding: .72rem 1.2rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--purple); color: #fff; font: inherit; font-weight: 700; font-size: .98rem;
  box-shadow: 0 4px 14px rgba(138, 43, 226, .35);
  transition: background .15s;
}
.btn-go:hover { background: var(--purple-d); }

/* ---------- Sections ---------- */

.section { margin-top: 2.4rem; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  border-bottom: 2px solid var(--purple); padding-bottom: .45rem;
}
.section-head h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--ink); }
.section-head .more { font-size: .88rem; font-weight: 600; white-space: nowrap; }

.dir-toggle { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.dir-toggle button {
  border: 0; background: none; padding: .38rem .95rem; border-radius: 999px;
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--muted);
}
.dir-toggle button.active { background: var(--purple); color: #fff; }

/* ---------- Deal cards ---------- */

.grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }

.deal {
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--card); border-radius: var(--radius); padding: 1rem;
  box-shadow: 0 2px 8px rgba(60,60,60,.06);
  border: 1.5px solid var(--line); color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.deal:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--purple); color: var(--ink);
}
.deal-top { display: flex; justify-content: space-between; align-items: center; }
.deal-code {
  font-weight: 800; letter-spacing: .05em; color: var(--purple);
  background: var(--purple-tint); padding: .18rem .5rem; border-radius: 7px; font-size: .8rem;
}
.deal-flag { font-size: 1.25rem; }
.deal-name { font-size: 1.05rem; font-weight: 700; margin-top: .35rem; }
.deal-sub { font-size: .8rem; color: var(--muted); }
.deal-fare {
  margin-top: .7rem; display: flex; align-items: baseline; gap: .5rem;
  border-top: 1px dashed var(--line); padding-top: .6rem;
}
.deal-fare span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.deal-fare strong { color: var(--purple); font-size: 1.3rem; }

/* ---------- City page ---------- */

.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: var(--purple); }

.city-hero {
  background: linear-gradient(120deg, var(--purple-deep) 0%, var(--purple) 70%, #a55af0 100%);
  color: #fff; border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: 0 10px 30px rgba(138, 43, 226, .30);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.city-hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); display: flex; align-items: center; gap: .6rem; }
.city-hero .meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.chip {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.32);
  padding: .22rem .65rem; border-radius: 999px; font-size: .8rem;
}
.city-code {
  font-size: 2.4rem; font-weight: 800; letter-spacing: .06em;
  background: rgba(255,255,255,.14); border-radius: var(--radius);
  padding: .35rem 1rem; border: 1px dashed rgba(255,255,255,.45);
}

.route-table { width: 100%; border-collapse: collapse; background: #fff; }
.route-table th, .route-table td { padding: .6rem .75rem; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--line); }
.route-table th { background: var(--purple-tint); color: var(--purple-deep); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.route-table tr:last-child td { border-bottom: 0; }
.route-table tfoot td { font-size: .74rem; color: var(--muted); }

.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(60,60,60,.06); }

/* ---------- Hotels ---------- */

.hotel {
  display: flex; gap: .9rem; background: #fff; border-radius: var(--radius);
  padding: .9rem; border: 1.5px solid var(--line);
  box-shadow: 0 2px 8px rgba(60,60,60,.06);
  transition: border-color .15s, transform .15s;
  color: var(--ink); align-items: center;
}
.hotel:hover { border-color: var(--purple); transform: translateY(-2px); color: var(--ink); }
.hotel-thumb {
  flex: 0 0 52px; height: 52px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--purple-tint);
}
.hotel h3 { font-size: .98rem; }
.hotel .loc { font-size: .8rem; color: var(--muted); }
.hotel .stars { color: #d99a26; font-size: .82rem; letter-spacing: .08em; }
.hotel .rate { margin-left: auto; text-align: right; white-space: nowrap; }
.hotel .rate small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.hotel .rate b { color: var(--purple); font-size: 1.1rem; }

/* ---------- Notices / misc ---------- */

.note { font-size: .78rem; color: var(--muted); margin-top: .8rem; }

/* Bookable action pill (stands out from neutral links) */
a.book-link, .book-link {
  background: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #fff !important;
  font-weight: 700;
}
a.book-link:hover {
  background: var(--purple-d) !important;
  border-color: var(--purple-d) !important;
  color: #fff !important;
}

/* ---------- Partner sites rows ---------- */

.partner-list { display: grid; gap: .55rem; grid-template-columns: 1fr; }

.partner-row {
  display: flex; align-items: center; gap: .85rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: .65rem .9rem; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.partner-row:hover {
  border-color: var(--purple); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(138, 43, 226, .15); color: var(--ink);
}
.partner-chip {
  position: relative; flex: 0 0 40px; width: 40px; height: 40px;
  border-radius: 10px; display: grid; place-items: center;
  overflow: hidden;
}
.partner-chip i {
  font-style: normal; font-weight: 800; font-size: 1.05rem; color: #fff;
}
.partner-chip img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff; padding: 7px;
}
.partner-info { min-width: 0; }
.partner-info b { display: block; font-size: .98rem; }
.partner-info small { color: var(--muted); font-size: .8rem; display: block; overflow: hidden; text-overflow: ellipsis; }
.partner-cta {
  margin-left: auto; font-weight: 700; font-size: .88rem; white-space: nowrap;
  color: var(--purple);
}
.partner-row:hover .partner-cta { color: var(--purple-d); }

@media (min-width: 640px) {
  .partner-list { grid-template-columns: 1fr 1fr; }
}

/* ---------- Duffel local-booking card ---------- */

.duffel-card {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  background: linear-gradient(120deg, #f7effe, #efe2fd);
  border: 1.5px solid #d9bdf7; border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 4px 16px rgba(138, 43, 226, .12);
}
.duffel-chip {
  position: relative; flex: 0 0 46px; width: 46px; height: 46px;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--purple); color: #fff; font-size: 1.3rem; font-weight: 800;
  overflow: hidden;
}
.duffel-chip img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff; padding: 8px;
}
.duffel-copy { flex: 1 1 260px; min-width: 0; }
.duffel-copy h3 { font-size: 1.08rem; color: var(--purple-deep); }
.duffel-copy p { font-size: .9rem; color: #5b4a6e; margin-top: .2rem; }
.duffel-status { margin-top: .35rem; }
.duffel-status small { color: var(--muted); }
.duffel-status code {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: .05rem .3rem; font-size: .78rem;
}
.duffel-cta { flex: 0 0 auto; }

.live-badge {
  display: inline-block; vertical-align: middle;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: #0a7d32; background: #e2f6e9;
  border: 1px solid #b5e3c6; border-radius: 999px;
  padding: .1rem .5rem; margin-left: .3rem;
}
.live-badge.tp {
  color: #1d4ed8; background: #e7effd; border-color: #b9cdf5;
}
.pill-link {
  display: inline-block; margin: .2rem .25rem .2rem 0; padding: .35rem .8rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink);
}
.pill-link:hover { border-color: var(--purple); color: var(--purple); }

.notfound {
  text-align: center; padding: 3rem 1rem; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.notfound h1 { font-size: 2rem; color: var(--purple-deep); }

/* ---------- Footer (deep purple, gold hover) ---------- */

.site-foot { margin-top: 2.5rem; background: linear-gradient(120deg, var(--purple-deep), var(--purple)); color: #ecdcfb; font-size: .86rem; }
.foot-grid {
  display: grid; gap: 1.5rem; padding: 2.2rem 0 1.2rem;
  grid-template-columns: 1fr;
}
.foot-col h4 { color: #fff; font-size: .85rem; margin-bottom: .55rem; text-transform: uppercase; letter-spacing: .05em; }
.foot-col ul { list-style: none; }
.foot-col li { margin: .18rem 0; }
.foot-col a { color: #ecdcfb; }
.foot-col a:hover { color: #f1deb4; }
.foot-about p { margin-top: .5rem; }
.fine { color: #c9b0ea; font-size: .74rem; }
.foot-bar {
  border-top: 1px solid rgba(255,255,255,.18);
  padding: .85rem 0; text-align: center; font-size: .8rem; color: #d9c4f2;
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .search-form { grid-template-columns: 1fr 1fr; }
  .search-form .btn-go { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 820px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .search-form { grid-template-columns: 2fr 2fr 1.4fr 1.4fr; }
  .search-form .btn-go { grid-column: auto; }
}

@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .foot-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Mobile nav — off-canvas drawer under 900px */
@media (max-width: 899px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: fixed; inset: 66px 0 0 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border: 0; border-top: 1px solid var(--bar-border);
    border-radius: 0; box-shadow: none;
    font-size: 100%; padding: 0 0 2rem;
    overflow-y: auto; transform: translateX(100%);
    transition: transform .28s ease; z-index: 55;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav > a, .nav-link {
    padding: .8rem 1rem; border-bottom: 1px solid var(--bar-sep);
    border-radius: 0; text-align: left; font-size: 1rem; color: #000;
  }
  .site-nav > a + a, .site-nav .nav-drop + .nav-drop, .site-nav a + .nav-drop { border-left: 0; }
  .site-nav > a.home-item { padding: .8rem 1rem; }
  .nav-drop > .nav-link { display: flex; justify-content: space-between; }

  .nav-drop .mega {
    position: static; transform: none; opacity: 1; visibility: hidden;
    box-shadow: none; background: #fafafa; color: #000;
    max-height: 0; overflow: hidden; padding: 0; transition: max-height .3s ease;
    min-width: 0; border: 0; border-bottom: 1px solid var(--bar-sep);
  }
  .nav-drop.open .mega { visibility: visible; max-height: 2000px; }
  .mega-in { grid-template-columns: 1fr; max-height: none; overflow: visible; padding: .25rem 0; }
  .mega-slim .mega-in { grid-template-columns: 1fr; }
  .menu-group h4 { color: var(--title-gray); border-top: 1px solid var(--bar-sep); padding-left: 1rem; }
  .menu-group:first-child h4 { border-top: 0; }
  .menu-group li a { color: #000; white-space: normal; }
  .menu-group li a:hover { background: var(--item-hover); color: #000; }
  .menu-group li a i { color: var(--muted); }
}
