/**
 * Mobile-first app experience (phones & small tablets)
 */

@media (max-width: 767px) {
  :root {
    --app-radius: 14px;
    --app-pad: 0.75rem;
    --touch-min: 44px;
    --tab-bar-h: 3.65rem;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-size: 16px;
    line-height: 1.5;
    padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .container {
    padding-left: var(--app-pad);
    padding-right: var(--app-pad);
  }

  /* —— Compact app header —— */
  .top-bar {
    padding: 0.25rem 0;
  }

  .top-bar__inner {
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .top-bar__email {
    display: none;
  }

  .site-header__inner {
    justify-content: space-between;
    padding: 0.4rem 0;
  }

  .site-header__meta,
  .site-header__cta {
    display: none;
  }

  .site-logo {
    height: 36px;
    max-width: 160px;
  }

  /* Main nav → bottom tab bar handles primary nav */
  .main-nav {
    display: none;
  }

  /* Trending chips — horizontal app strip */
  .quick-links-bar__inner {
    gap: 0.4rem;
  }

  .quick-links-bar__title {
    font-size: 0.72rem;
  }

  .quick-chip {
    min-height: var(--touch-min);
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  /* Marquee — compact */
  .marquee-item {
    flex-direction: column;
    align-items: stretch;
    padding: 0.35rem 0;
  }

  .marquee-label {
    width: 100%;
    text-align: center;
    border-radius: 0;
  }

  .marquee-item .jobs-marquee-viewport {
    width: 100%;
  }

  /* Hero — app banner */
  .hero-section {
    padding: 1.35rem 0 1.15rem;
    margin: 0;
    border-radius: 0 0 22px 22px;
  }

  .hero-content__title {
    font-size: 1.32rem;
  }

  .hero-content__lead {
    font-size: 0.88rem;
    margin-bottom: 1rem;
  }

  .hero-stat-card {
    padding: 0.75rem 0.4rem;
    border-radius: 12px;
  }

  .hero-stat-card__value {
    font-size: 1.2rem;
  }

  .main-content {
    padding: 0.75rem 0 1rem;
  }

  .content-wrapper {
    gap: 0.75rem;
  }

  /* Sections → full-width cards */
  .jobs-section,
  .table-section,
  .category-section,
  .update-card {
    border-radius: var(--app-radius);
    margin-left: 0;
    margin-right: 0;
    box-shadow: 0 2px 12px rgb(15 23 42 / 0.06);
  }

  .section-header {
    padding: 0.85rem var(--app-pad);
    gap: 0.75rem;
  }

  .section-header h2 {
    font-size: 1.05rem;
  }

  .section-header .btn,
  .section-header .btn-whatsapp {
    width: 100%;
    min-height: var(--touch-min);
    font-size: 0.88rem;
  }

  /* Job list — app cards */
  .job-list {
    padding: 0.35rem 0 0.5rem;
  }

  .job-item {
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 var(--app-pad) 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--app-radius);
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    box-shadow: 0 1px 4px rgb(15 23 42 / 0.05);
  }

  .job-item:active {
    transform: scale(0.99);
    background: var(--bg-card);
  }

  .job-item:last-child {
    margin-bottom: 0.75rem;
  }

  .job-month-heading {
    margin: 0.75rem var(--app-pad) 0.35rem;
    border-radius: var(--app-radius);
  }

  .job-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: auto;
    text-align: left;
    padding: 0.5rem 0.65rem;
    background: var(--bg-card);
    border-radius: 10px;
    align-self: stretch;
  }

  .job-date .day {
    font-size: 1.35rem;
  }

  .job-title {
    font-size: 1rem;
    line-height: 1.45;
  }

  .job-meta {
    font-size: 0.8rem;
    gap: 0.35rem 0.65rem;
  }

  .job-actions {
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
  }

  .job-actions .btn {
    flex: 1;
    min-height: var(--touch-min);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
  }

  .btn {
    min-height: var(--touch-min);
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }

  /* Sidebar — horizontal scroll widgets */
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.65rem;
    padding: 0 0 0.25rem;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-widget {
    flex: 0 0 min(85vw, 280px);
    border-radius: var(--app-radius);
  }

  /* Category grid — 2 col app tiles */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .category-card {
    padding: 0.85rem 0.5rem;
    border-radius: var(--app-radius);
    min-height: var(--touch-min);
  }

  .category-card:active {
    transform: scale(0.98);
  }

  /* Tables already card-style — tighten */
  .jobs-table tbody tr {
    margin-left: var(--app-pad);
    margin-right: var(--app-pad);
    border-radius: var(--app-radius);
  }

  .jobs-month-row td {
    margin: 0 var(--app-pad);
  }

  /* Pagination — larger taps */
  .pagination a,
  .pagination span {
    min-width: var(--touch-min);
    height: var(--touch-min);
    font-size: 0.9rem;
  }

  /* Newsletter */
  .newsletter-section {
    padding: 1.25rem var(--app-pad);
    margin-top: 1rem;
  }

  .newsletter-form input,
  .newsletter-form button {
    min-height: var(--touch-min);
    font-size: 1rem;
  }

  /* Footer — compact above tab bar */
  .site-footer {
    padding-bottom: 0.5rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .footer-column a {
    min-height: 36px;
    font-size: 0.85rem;
  }

  /* Job detail page */
  .job-page .content-wrapper {
    gap: 0.65rem;
  }

  .job-card {
    border-radius: var(--app-radius);
    margin-bottom: 0.5rem;
  }

  .job-card--hero {
    padding: 1rem;
  }

  .job-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .job-stat-card {
    border-radius: 12px;
    padding: 0.75rem;
  }

  .job-links-card__buttons .btn,
  .job-links-card__buttons .job-link-missing {
    flex: 1 1 100%;
    min-height: var(--touch-min);
  }

  .job-cta__buttons .btn {
    min-height: var(--touch-min);
  }
}

/* —— Fixed bottom tab bar (app navigation) —— */
.app-tab-bar {
  display: none;
}

@media (max-width: 767px) {
  .app-tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    height: var(--tab-bar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgb(15 23 42 / 0.1);
    justify-content: space-around;
    align-items: stretch;
  }

  .app-tab-bar__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    text-decoration: none;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .app-tab-bar__link:active {
    background: var(--bg-card);
  }

  .app-tab-bar__link.is-active {
    color: var(--primary);
  }

  .app-tab-bar__icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .app-tab-bar__link--wa {
    color: #128c7e;
  }

  .app-tab-bar__link--wa.is-active {
    color: #25d366;
  }

  .app-tab-bar__link--wa .app-tab-bar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-tab-bar__link--wa .wa-icon {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}
