/*
Theme Name: GrabLoco Landing
Theme URI: https://grabloco.com
Author: GrabLoco
Author URI: https://grabloco.com
Description: GrabLoco landing theme with cities grid + single-city layout.
Version: 1.0.0
Text Domain: grabloco-landing
*/

/* =========================================================
   Base / safety defaults
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* =========================================================
   SINGLE SOURCE OF TRUTH: Site container (1200px + gutters)
   ========================================================= */
:root {
  --gl-max: 1200px;
  --gl-gutter: 24px; /* matches Tailwind px-6 */
}

.gl-site-container {
  max-width: var(--gl-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gl-gutter);
  padding-right: var(--gl-gutter);
  box-sizing: border-box;
}

/* Mobile gutters */
@media (max-width: 768px) {
  :root {
    --gl-gutter: 16px;
  } /* like px-4 */
}

/* Safety: media inside container never overflows */
.gl-site-container img,
.gl-site-container video,
.gl-site-container iframe {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   FIXED HEADER — height driven by logo size (s/m/l/xl)
   - Header grows only when logo size requires it
   - Content always starts 40px below header
========================================================= */

/* default fallback */
:root {
  --gl-header-h: 135px; /* reasonable default */
  --gl-gap: 40px;
}

/* Logo scaling safety (still allow square logos) */
.gl-header-logo {
  max-height: calc(var(--gl-header-h) - 20px); /* keep room for padding/nav */
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Header uses the variable height */
#site-header {
  height: var(--gl-header-h);
  max-height: var(--gl-header-h);
  display: flex;
  align-items: center;
}

/* Main is pushed down by header height + gap */
main {
  display: block;
  padding-top: calc(var(--gl-header-h) + var(--gl-gap)) !important;
  padding-bottom: 0;
}

/* Anchor offset matches main push-down */
#explore,
#how,
#cities,
#pricing,
#faq,
#partners {
  scroll-margin-top: calc(var(--gl-header-h) + var(--gl-gap));
}

/* -----------------------------
   Per-size header heights
------------------------------ */

/* S */
#site-header:has(.gl-header-logo[data-size="s"]) {
  --gl-header-h: 120px;
}

/* M */
#site-header:has(.gl-header-logo[data-size="m"]) {
  --gl-header-h: 135px;
}

/* L */
#site-header:has(.gl-header-logo[data-size="l"]) {
  --gl-header-h: 155px;
}

/* XL */
#site-header:has(.gl-header-logo[data-size="xl"]) {
  --gl-header-h: 195px;
}

/* -----------------------------
   Mobile adjustments
------------------------------ */
@media (max-width: 768px) {
  :root {
    --gl-gap: 40px;
  }

  #site-header:has(.gl-header-logo[data-size="s"]) {
    --gl-header-h: 130px;
  }
  #site-header:has(.gl-header-logo[data-size="m"]) {
    --gl-header-h: 145px;
  }
  #site-header:has(.gl-header-logo[data-size="l"]) {
    --gl-header-h: 165px;
  }
  #site-header:has(.gl-header-logo[data-size="xl"]) {
    --gl-header-h: 210px;
  }
}

:root {
  --gl-gap: 40px;
}

#site-header.gl-header-size-s {
  height: 120px;
  max-height: 120px;
}
#site-header.gl-header-size-m {
  height: 135px;
  max-height: 135px;
}
#site-header.gl-header-size-l {
  height: 155px;
  max-height: 155px;
}
#site-header.gl-header-size-xl {
  height: 195px;
  max-height: 195px;
}

main {
  padding-top: calc(var(--gl-gap) + 135px) !important;
} /* overwritten below */
#site-header.gl-header-size-s ~ main {
  padding-top: calc(120px + var(--gl-gap)) !important;
}
#site-header.gl-header-size-m ~ main {
  padding-top: calc(135px + var(--gl-gap)) !important;
}
#site-header.gl-header-size-l ~ main {
  padding-top: calc(155px + var(--gl-gap)) !important;
}
#site-header.gl-header-size-xl ~ main {
  padding-top: calc(195px + var(--gl-gap)) !important;
}

/* =========================================================
   Global container helpers
========================================================= */
.gl-container {
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* Prevent overflow inside container */
.gl-container * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Media safety */
.gl-container img,
.gl-container video,
.gl-container iframe,
.gl-container embed,
.gl-container object {
  max-width: 100%;
  height: auto;
}

/* Tables often overflow */
.gl-container table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

/* Contain wide/full blocks inside your container */
.gl-container .alignwide,
.gl-container .alignfull {
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Optional: consistent vertical spacing between sections */
.gl-section {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

@media (max-width: 768px) {
  .gl-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

/* Simple heading helper */
.gl-h2 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.gl-heading-center {
  text-align: center;
  align-content: center;
}

.gl-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* =========================================================
   Easy Accordion constraint (site-wide)
========================================================= */
.sp-easy-accordion {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

.sp-easy-accordion,
.sp-easy-accordion * {
  max-width: 100%;
}

/* =========================================================
   Cities Grid (plugin markup)
========================================================= */
.gl-cities-grid-root {
  width: 100%;
}

.gl-cities-grid-container {
  max-width: var(--gl-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gl-gutter);
  padding-right: var(--gl-gutter);
  box-sizing: border-box;
}

.gl-cities-grid-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.gl-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 220px;
}

.gl-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.gl-input,
.gl-select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 14px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
}

.gl-input:focus,
.gl-select:focus {
  border-color: rgba(0, 183, 116, 0.7);
  box-shadow: 0 0 0 3px rgba(0, 183, 116, 0.15);
}

.gl-reset {
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.gl-reset:hover {
  background: rgba(15, 23, 42, 0.04);
}

.gl-cities-grid-status {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.7);
  margin-bottom: 0.75rem;
}

.gl-cities-grid-wrap {
  width: 100%;
}

/* Grid layout */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(var(--gl-cols, 5), minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .gl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .gl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .gl-grid {
    grid-template-columns: 1fr;
  }
}

/* City card */
.gl-card {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.gl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.gl-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(15, 23, 42, 0.04);
  overflow: hidden;
  border-radius: 12px;
}

.gl-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gl-card-title {
  padding: 0.85rem 0.95rem 0 0.95rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

/* Pills */
.gl-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 0.95rem 0.95rem 0.95rem;
}

.gl-card-pills-row1 {
  padding-bottom: 0.35rem;
}

.gl-card-pills-row2 {
  padding-top: 0;
}

.gl-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(15, 23, 42, 0.92);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.gl-pill-muted {
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.75);
}

/* Pager */
.gl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.gl-page-btn {
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.gl-page-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

.gl-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gl-page-meta {
  color: rgba(15, 23, 42, 0.7);
  font-weight: 600;
}

.gl-empty {
  padding: 1.25rem;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 18px;
  color: rgba(15, 23, 42, 0.75);
  background: rgba(15, 23, 42, 0.02);
}

/* Placeholder when no image exists */
.gl-card-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #0f172a, #00b774);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
}

/* =========================================================
   Single City page layout
========================================================= */
.gl-city-single {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.gl-city-hero {
  display: flow-root;
}

.gl-city-img {
  float: left;
  width: min(400px, 100%);
  max-width: 400px;
  margin: 0 24px 12px 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.gl-city-img img {
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* Pills on single city */
.gl-city-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
  padding: 0;
}

.gl-city-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(15, 23, 42, 0.92);
  user-select: none;
  pointer-events: none;
}

.gl-city-pill-muted {
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.75);
}

.gl-city-body > *:first-child {
  margin-top: 0;
}

/* If editor content is empty, allow bigger image */
.gl-city-single.gl-city-no-content .gl-city-img {
  float: none;
  max-width: 800px;
  width: min(800px, 100%);
  margin: 0 0 14px 0;
}

/* Mobile stacking */
@media (max-width: 768px) {
  .gl-city-img {
    float: none;
    max-width: 100%;
    width: 100%;
    margin: 0 0 12px 0;
  }
}

.gl-city-body p,
.gl-city-body li {
  line-height: 1.65;
}

.gl-clear {
  clear: both;
}

/* =========================================================
   FAQ (TH FAQ / ThemeHunk plugin)
========================================================= */
.thfaqf-faq-wrapper,
.thfaqf-faq-container,
.thfaqf-faq {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

.thfaqf-faq-item,
.thfaqf-faq-item-title,
.thfaqf-faq-item-content {
  max-width: 100%;
  box-sizing: border-box;
}

#faq {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* =========================================================
   Gutenberg image tweaks
========================================================= */
.wp-block-image img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 15px;
}

.rowlayout-card img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Simple icon helper */
.gl-icon {
  color: #10b981;
  margin-right: 8px;
}

/* =========================================================
   Legal / Policy Content Typography Reset (inside .gl-legal)
========================================================= */
.gl-legal {
  line-height: 1.65;
}

.gl-legal h1,
.gl-legal h2,
.gl-legal h3,
.gl-legal h4,
.gl-legal h5 {
  display: block;
  margin: 1.75em 0 0.75em;
  font-weight: 700;
  line-height: 1.25;
  color: inherit;
}

.gl-legal h1 {
  font-size: 2rem;
}
.gl-legal h2 {
  font-size: 1.65rem;
}
.gl-legal h3 {
  font-size: 1.35rem;
}
.gl-legal h4 {
  font-size: 1.15rem;
}
.gl-legal h5 {
  font-size: 1rem;
}

.gl-legal p {
  display: block;
  margin: 0 0 1em;
}

.gl-legal ul,
.gl-legal ol {
  display: block;
  margin: 0 0 1em 1.25em;
  padding: 0;
}

.gl-legal ul {
  list-style-type: disc;
}
.gl-legal ol {
  list-style-type: decimal;
}

.gl-legal li {
  display: list-item;
  margin-bottom: 0.5em;
}

.gl-legal strong {
  font-weight: 600;
}
.gl-legal em {
  font-style: italic;
}

.gl-legal a {
  color: inherit;
  text-decoration: underline;
}

.gl-legal a:hover {
  text-decoration: none;
}

.gl-legal > :first-child {
  margin-top: 0;
}
.gl-legal > :last-child {
  margin-bottom: 0;
}

/* =========================================================
   REMOVE unwanted space before footer (Partners -> Footer flush)
========================================================= */

/* Kill bottom gap on the final thing inside main */
main > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Gutenberg last-block spacing (common culprits) */
.wp-block-group:last-child,
.wp-block-cover:last-child,
.wp-block-columns:last-child,
.wp-block-separator:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* RowLayout / custom block last item (if present) */
.wp-block-ask-rowlayout:last-child,
.wp-block-rowlayout-row:last-child,
.rl-wrap:last-child,
.rl-grid:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Partners anchor/section must not add spacing */
#partners {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* If Partners section is built with RowLayout/cards, remove trailing space */
#partners .rl-card,
#partners .rowlayout-card,
#partners .wp-block-group,
#partners .wp-block-columns {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Footer must not push away from content */
footer {
  margin-top: 0 !important;
}

/* If some plugin adds default margins to sections */
section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* =========================================================
   GLOBAL CONTENT WIDTH CONSTRAINT (1200px)
   ========================================================= */
.gl-site-main > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* Ensure Gutenberg blocks behave */
.gl-site-main .wp-block-group,
.gl-site-main .wp-block-columns,
.gl-site-main .wp-block-cover,
.gl-site-main .wp-block-media-text {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Media safety */
.gl-site-main img,
.gl-site-main video,
.gl-site-main iframe {
  max-width: 100%;
  height: auto;
}

/* Allow intentional full-width sections */
.gl-full-width {
  max-width: none !important;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 0;
  padding-right: 0;
}

body:not(.home) footer {
  margin-top: 75px !important;
}

/* =========================================================
   Mobile Menu: top layer, left slide, leaves hamburger visible
   - Uses CSS variables set by JS:
     --gl-menu-right-edge = space from left of hamburger to screen right
========================================================= */

:root {
  --gl-menu-right-gap: 10px; /* stop 10px before hamburger */
  --gl-menu-right-edge: 76px; /* fallback until JS sets real value */
}

#glMobileMenu.gl-mobile-menu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;

  /* leave space on the right so hamburger stays visible */
  width: calc(100vw - var(--gl-menu-right-edge) - var(--gl-menu-right-gap));
  max-width: 520px;

  background: #ffffff;
  color: #0f172a;
  z-index: 9999;

  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.18);

  /* slide from left */
  transform: translateX(-100%);
  transition: transform 0.25s ease;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#glMobileMenu.gl-mobile-menu.is-open {
  transform: translateX(0);
}

.gl-mobile-link {
  display: block;
  padding: 12px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.gl-mobile-link:hover {
  background: rgba(15, 23, 42, 0.06);
}

.gl-mobile-menu {
  transform: translateX(-100%);
}
.gl-mobile-menu.is-open {
  transform: translateX(0);
}
