/*
  Whit Did Ye Say? Premium Mobile Nav
  Bottom tab bar + slide-out drawer + minimal mobile header
  Applies at max-width: 920px
  Desktop nav is unchanged above 920px
*/

/* ============================================
   FIX: Desktop logo/nav overlap
   Remove overflow:hidden from nav-container
   (the duplicate rule at the top of nav-style.css
   was clipping the logo text into the first nav link)
   ============================================ */
.nav-container {
  overflow: visible !important;
}

/* ============================================
   MOBILE HEADER: logo + hamburger only
   ============================================ */
@media (max-width: 920px) {

  /* Body padding: account for fixed header + fixed bottom bar */
  body {
    /* FIX 1: clearance tracks the safe area so content never hides behind the bar */
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Header stays minimal */
  .navbar,
  .navbar#navbar {
    height: 60px;
    min-height: 60px;
  }

  .nav-container {
    min-height: 60px !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  /* Logo: show icon only on mobile */
  .nav-logo span {
    display: none !important;
  }

  .nav-logo-img {
    width: 38px;
    height: 38px;
  }

  /* Hide the entire desktop nav-links on mobile */
  .nav-links,
  .navbar .nav-links,
  .navbar#navbar .nav-links {
    display: none !important;
  }

  /* Hamburger: right side, always visible */
  .nav-toggle,
  .navbar .nav-toggle,
  .navbar#navbar .nav-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 auto !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s;
  }

  .nav-toggle:hover,
  .navbar .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #F8FAFC;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    margin: 3px auto;
  }

  .nav-toggle.drawer-open span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
  }
  .nav-toggle.drawer-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-toggle.drawer-open span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
  }

  /* body.content-page: use the smaller header height */
  body.content-page {
    padding-top: 60px !important;
  }
}

/* ============================================
   BOTTOM TAB BAR
   Fixed to bottom of viewport on mobile
   ============================================ */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 920px) {
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(11, 15, 26, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 900;
    align-items: stretch;
    justify-content: space-around;
    padding: 0;
    /* Safe area for iPhone home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* FIX 1: ease the safe-area change instead of snapping */
    transition: padding-bottom 0.25s ease;
  }

  .mobile-tab-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 4px;
    padding: 8px 4px;
    color: #7D8CA0 !important;
    text-decoration: none !important;
    font-family: 'League Spartan', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.2s, background 0.2s;
    border-radius: 0;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(249, 115, 22, 0.15);
  }

  .mobile-tab-bar a:active {
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-tab-bar a:hover,
  .mobile-tab-bar a[aria-current="page"] {
    color: #F8FAFC !important;
  }

  .mobile-tab-bar a[aria-current="page"] .tab-icon {
    color: #f97316;
  }

  .mobile-tab-bar .tab-icon {
    font-size: 1.3rem;
    line-height: 1;
    display: block;
  }

  .mobile-tab-bar .tab-label {
    display: block;
    line-height: 1;
  }

  /* Get App tab: orange highlight */
  .mobile-tab-bar .tab-get-app {
    color: #f97316 !important;
  }

  .mobile-tab-bar .tab-get-app .tab-icon {
    color: #f97316;
  }

  .mobile-tab-bar .tab-get-app:active {
    background: rgba(249, 115, 22, 0.12);
  }
}

/* ============================================
   SLIDE-OUT DRAWER
   Slides in from the right
   ============================================ */
.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1099;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #111827;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-drawer.active {
  transform: translateX(0);
}

/* Drawer header: coo greeting */
.nav-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.nav-drawer-coo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(249, 115, 22, 0.08);
  padding: 2px;
}

.nav-drawer-greeting {
  flex: 1;
}

.nav-drawer-greeting-line1 {
  font-family: 'Lilita One', cursive;
  font-size: 1.05rem;
  color: #F8FAFC;
  line-height: 1.2;
  display: block;
}

.nav-drawer-greeting-line2 {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.8rem;
  color: #7D8CA0;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.nav-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #AAB6C5;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-drawer-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
}

/* Drawer body: scrollable */
.nav-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Drawer sections */
.nav-drawer-section {
  margin-bottom: 8px;
}

.nav-drawer-section-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4A5568;
  padding: 10px 10px 6px;
}

.nav-drawer-section a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  color: #AAB6C5 !important;
  text-decoration: none !important;
  font-family: 'League Spartan', sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(249, 115, 22, 0.1);
}

.nav-drawer-section a:hover,
.nav-drawer-section a:active {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC !important;
}

.nav-drawer-section a[aria-current="page"] {
  background: rgba(26, 95, 180, 0.15);
  color: #5B9BD5 !important;
}

.nav-drawer-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* Drawer divider */
.nav-drawer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 8px 10px;
}

/* Drawer footer: app CTA */
.nav-drawer-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.nav-drawer-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: #f97316;
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: 'League Spartan', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
  transition: background 0.2s, transform 0.15s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.nav-drawer-app-btn:hover,
.nav-drawer-app-btn:active {
  background: #fb923c;
  transform: translateY(-1px);
  color: #ffffff !important;
}

/* ============================================
   DESKTOP: hide mobile-only elements
   ============================================ */
@media (min-width: 921px) {
  .mobile-tab-bar {
    display: none !important;
  }

  .nav-drawer,
  .nav-drawer-backdrop {
    display: none !important;
  }
}

/* ============================================
   MOBILE FOOTER FIX
   Footer grid collapses to single column on mobile
   ============================================ */
@media (max-width: 920px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .footer-brand {
    max-width: 100% !important;
  }

  .footer-brand p {
    max-width: 100% !important;
  }

  .footer-store-links {
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Stack the 3 link columns in a 2-column grid on tablet, single on phone */
  .footer-grid > .footer-links {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 0 !important;
  }

  .site-footer {
    padding: 40px 20px 100px !important; /* extra bottom padding for tab bar */
  }

  .footer-bottom {
    margin-top: 28px !important;
    padding-bottom: 16px !important;
  }
}

/* ============================================
   KICKER / BREADCRUMB PILL FIX
   On mobile, drop the pill capsule and hide
   the "Last updated" date segment so the
   breadcrumb fits on one line without wrapping
   ============================================ */
@media (max-width: 920px) {
  .kicker,
  .post-date {
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 0 16px 0 !important;
    display: block !important;
    text-align: left !important;
    font-size: 0.72rem !important;
  }

  /* Hide the "Last updated" segment on mobile */
  .kicker-date {
    display: none !important;
  }
}

/* ============================================
   DRAWER ICON SIZING
   Brand PNG icons and SVG line icons in drawer
   ============================================ */
.nav-drawer-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.nav-drawer-icon-svg svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}

.nav-drawer-app-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* ============================================
   TAB BAR SVG ICON SIZING
   Inline SVGs inherit stroke colour from parent
   ============================================ */
.mobile-tab-bar .tab-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* ============================================
   TAB BAR FLOAT FIX
   Ensure tab bar is always pinned to viewport
   bottom, even on short-content pages
   ============================================ */
@media (max-width: 920px) {
  .mobile-tab-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 900 !important;
  }
}
