/* ==========================================================================
   AeroPlanet — design system & site styles
   ========================================================================== */

:root {
  --navy: #0b3d63;
  --navy-dark: #082c48;
  --sky: #1c6ea4;
  --accent: #e0792e;
  --accent-dark: #c2621f;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #182634;
  --muted: #5c6b7a;
  --border: #e3e8ee;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 40, 70, 0.08);
  --shadow-hover: 0 10px 24px rgba(15, 40, 70, 0.14);
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow { max-width: 760px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef3f8; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 10px; }

/* ---------------- Header ---------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
}
.brand-logo { height: 68px; width: auto; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav > a { color: var(--text); padding: 6px 0; }
.main-nav > a:hover { color: var(--sky); }
.nav-cta {
  background: var(--navy);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--sky); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 6px 0;
}
.nav-dropdown-toggle:hover { color: var(--sky); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  min-width: 240px;
  padding: 8px;
  margin-top: 8px;
}
.nav-dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--sky); }
.nav-dropdown.is-open .nav-dropdown-menu { display: block; }

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(135deg, var(--navy), var(--sky));
  color: #fff;
  padding: 64px 0 72px;
}
.hero-inner { text-align: center; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  max-width: 780px;
  margin: 0 auto 0.4em;
}
.hero-sub {
  font-size: 1.1rem;
  color: #dceaf6;
  max-width: 620px;
  margin: 0 auto 2em;
}
.hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 10px;
  border-radius: 14px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: var(--shadow-hover);
}
.hero-search-select,
.hero-search-input {
  border: none;
  outline: none;
  font: inherit;
  padding: 10px 12px;
  color: var(--text);
  background: transparent;
}
.hero-search-select { border-right: 1px solid var(--border); flex: 0 0 auto; }
.hero-search-input { flex: 1 1 220px; min-width: 0; }

/* ---------------- Category grid ---------------- */
.categories-section, .featured-section { padding: 56px 0; }
.section-title { font-size: 1.6rem; margin-bottom: 28px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.category-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.category-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.category-card-icon {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: #fff;
}
.category-card-body { padding: 18px 20px 20px; }
.category-card-body h3 { font-size: 1.1rem; margin-bottom: 6px; }
.category-card-body p { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.category-card-count {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sky);
  background: #eaf3fa;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------------- Listing cards / grid ---------------- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.listing-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.listing-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.listing-card-img { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-featured { background: var(--accent); color: #fff; }
.badge-community { background: var(--sky); color: #fff; }
.listing-card-img.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3f8;
  color: var(--muted);
  font-size: 0.85rem;
}
.listing-card-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.listing-card-subtype {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sky);
  margin-bottom: 6px;
}
.listing-card-body h3 { font-size: 1.05rem; margin-bottom: 6px; }
.listing-card-price { font-weight: 700; font-size: 1.05rem; color: var(--navy); margin-bottom: 4px; }
.listing-card-meta { color: var(--muted); font-size: 0.86rem; margin-bottom: 4px; }
.listing-card-location { color: var(--muted); font-size: 0.86rem; margin-bottom: 0; margin-top: auto; }

/* ---------------- Industry news (live feed) ---------------- */
.news-section { padding: 8px 0 24px; }
.section-subtitle { color: var(--muted); font-size: 0.88rem; }

/* ---------------- Home page: main content + news sidebars ---------------- */
.home-main-section { padding-bottom: 56px; }
.home-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  grid-template-areas: "news-left main news-right";
  gap: 28px;
  align-items: start;
}
.home-main-col { grid-area: main; }
.home-main-col .categories-section { margin-bottom: 44px; }
.home-layout .news-sidebar:first-child { grid-area: news-left; }
.home-layout .news-sidebar:last-child { grid-area: news-right; }
.news-sidebar { position: sticky; top: 90px; }
.news-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 14px;
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.news-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.news-card-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}
.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.news-card-source {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sky);
}
.news-card h3 { font-size: 1rem; margin: 0; }
.news-card-date { font-size: 0.8rem; color: var(--muted); }
.news-loading, .news-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------- Live jobs (category page) ---------------- */
.live-jobs-section { margin-bottom: 36px; }
.live-jobs-section .listing-grid { margin-top: 20px; }
.sample-postings-title { margin-top: 8px; }

/* ---------------- CTA banner ---------------- */
.cta-banner { background: var(--navy-dark); color: #fff; padding: 48px 0; }
.cta-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.cta-banner-inner h2 { margin-bottom: 6px; }
.cta-banner-inner p { color: #cfe0ee; margin: 0; }

/* ---------------- Category page ---------------- */
.category-hero { color: #fff; padding: 48px 0 40px; }
.category-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.category-hero-desc { color: #eaf2fa; max-width: 640px; margin: 0; }
.breadcrumb { color: rgba(255,255,255,0.85); font-size: 0.85rem; margin-bottom: 12px; }
.breadcrumb a { text-decoration: underline; }
.static-hero .breadcrumb, .listing-detail .breadcrumb { color: var(--muted); }
.static-hero .breadcrumb a, .listing-detail .breadcrumb a { color: var(--sky); }

.category-body { padding: 40px 0 64px; }
.filter-bar { margin-bottom: 28px; }
.filter-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 14px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.chip:hover { border-color: var(--sky); color: var(--sky); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------------- Listing detail ---------------- */
.listing-detail { padding: 32px 0 64px; }
.listing-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  align-items: start;
}
.listing-detail-img { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.listing-detail h1 { font-size: 1.7rem; }
.listing-detail-location { color: var(--muted); margin-bottom: 18px; }
.spec-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
.spec-row { display: flex; justify-content: space-between; padding: 10px 16px; font-size: 0.92rem; }
.spec-row:nth-child(odd) { background: #fbfcfe; }
.spec-key { color: var(--muted); }
.spec-value { font-weight: 600; }
.listing-detail-description { color: var(--text); }
.sample-disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 12px;
  font-style: italic;
}
.listing-detail-sidebar { position: sticky; top: 90px; }
.price-card, .contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.price-card-price { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.price-card-subtype { color: var(--muted); font-size: 0.88rem; margin: 0; }
.contact-card h3 { font-size: 1rem; margin-bottom: 10px; }
.contact-card p { margin-bottom: 4px; font-size: 0.92rem; color: var(--muted); }

.related-section { margin-top: 56px; }

/* ---------------- User-submitted photo gallery (api/listing.php) -------- */
.user-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.user-photo-main {
  display: block;
  flex: 1 1 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
}
.user-photo-thumb {
  display: block;
  flex: 0 0 calc(25% - 6px);
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
}
.user-photo-main img, .user-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-photo-none {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  background: #eef3f8;
  color: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* ---------------- Static pages / forms ---------------- */
.static-hero { background: var(--navy); color: #fff; padding: 44px 0; }
.static-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.static-body { padding: 44px 0 64px; }
.static-body p { color: var(--text); font-size: 1.02rem; }

.contact-form { display: flex; flex-direction: column; gap: 16px; margin: 28px 0; }
.contact-form label { font-weight: 600; font-size: 0.92rem; display: flex; flex-direction: column; gap: 6px; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 400;
}
.contact-form button { align-self: flex-start; }
.form-note { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.field-hint { color: var(--muted); font-size: 0.82rem; margin-top: -8px; }
.field-hint-warn { color: #9c2b2b; font-weight: 600; }
.contact-form input[type="file"] {
  border: 1px dashed var(--border);
  padding: 14px;
  background: #fbfcfe;
}
.form-error {
  background: #fdecec;
  border: 1px solid #f3b9b9;
  color: #9c2b2b;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.form-error a { text-decoration: underline; }
/* Honeypot: positioned off-screen rather than display:none, since some
   spam bots specifically skip fields hidden that way. Invisible and
   unreachable by keyboard/screen-reader users either way. */
.hp-field {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-details p { font-size: 0.98rem; }

.form-success {
  background: #eaf7f1;
  border: 1px solid #a9dcc4;
  color: #14603f;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.form-hint { color: var(--muted); font-size: 0.85rem; margin-top: -10px; }

/* ---------------- Auth (log in / register / password reset) ------------ */
.auth-nav { display: flex; align-items: center; gap: 14px; }
.auth-nav a { font-weight: 600; }
.auth-nav .auth-nav-name { color: var(--muted); font-weight: 500; }
.auth-page { padding: 44px 0 72px; }
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-card-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }
.auth-card .contact-form { margin: 0 0 4px; gap: 14px; }
.auth-card-footer { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 18px; }
.auth-remember { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.auth-remember input { width: auto; }

/* ---------------- Favorite button ---------------- */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  padding: 4px;
}
.fav-btn:hover { color: var(--accent); }
.fav-btn.is-active { color: var(--accent); }
.listing-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.listing-detail-title-row h1 { margin-bottom: 0; }
.listing-card-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.owner-controls {
  background: #eef3f8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text);
}

/* ---------------- Account dashboard ---------------- */
.account-page { padding: 40px 0 72px; }
.account-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.account-tabs { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.account-tabs a {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.account-tabs a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.account-list { display: flex; flex-direction: column; gap: 14px; }
.account-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.account-row-main h3 { font-size: 1rem; margin-bottom: 4px; }
.account-row-meta { color: var(--muted); font-size: 0.85rem; }
.account-row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.account-row-actions a, .account-row-actions button.link-btn {
  font-weight: 600;
  font-size: 0.88rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sky);
  padding: 0;
}
.account-row-actions .link-btn-danger { color: #9c2b2b; }
.status-pill { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 4px 10px; border-radius: 999px; }
.status-pending { background: #fdf3e3; color: #9a6a12; }
.status-approved { background: #eaf7f1; color: #14603f; }
.status-rejected { background: #fdecec; color: #9c2b2b; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--navy-dark); color: #cfe0ee; padding: 48px 0 20px; margin-top: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-logo { height: 96px; width: auto; margin-bottom: 14px; background: #fff; padding: 10px 16px; border-radius: 8px; }
.footer-brand p { color: #a9c2d6; font-size: 0.9rem; }
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }
.footer-col a { display: block; color: #a9c2d6; font-size: 0.9rem; margin-bottom: 8px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding-top: 18px; font-size: 0.82rem; color: #7c99b0; }
.footer-social { margin-top: 14px; display: flex; gap: 10px; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #a9c2d6;
  transition: background 0.15s ease, color 0.15s ease;
}
.social-link:hover { background: var(--sky); color: #fff; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .listing-detail-grid { grid-template-columns: 1fr; }
  .listing-detail-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .user-photo-thumb { flex: 0 0 calc(33.333% - 6px); }
  .home-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "news-left" "news-right";
  }
  .news-sidebar { position: static; }
  .news-list { flex-direction: row; flex-wrap: wrap; }
  .news-list .news-card { flex: 1 1 260px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    gap: 4px;
  }
  .main-nav.is-open { display: flex; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; margin-top: 4px; display: none; }
  .nav-dropdown.is-open .nav-dropdown-menu { display: block; }
  .nav-cta { display: inline-block; width: fit-content; }
  .hero-search { flex-direction: column; }
  .hero-search-select { border-right: none; border-bottom: 1px solid var(--border); }
  .cta-banner-inner { flex-direction: column; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-logo { height: 52px; }
}
