/* BTW Minimal theme styles */

/* ==========================================================
   Tokens / variables
   ========================================================== */

:root{
  --btw-header-bg: var(--wp--preset--color--btw-orange);
  --btw-header-h: 92px;

  --btw-radius-none: 0px;
  --btw-radius-md: 12px;
  --btw-radius-xl: 24px;
  --btw-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}

/* Template color variants */
.btw-template--orange{
  --btw-header-bg: var(--wp--preset--color--btw-orange);
}

.btw-template--blue{
  --btw-header-bg: var(--wp--preset--color--btw-blue);
}

html{ scroll-behavior: smooth; }

/* Ensure anchored sections aren't hidden behind fixed header */
[id]{ scroll-margin-top: calc(var(--btw-header-h) + 12px); }

/* ==========================================================
   Gutenberg / layout defaults
   ========================================================== */

/* Between template parts (header -> content, content -> footer, etc.) */
.wp-site-blocks > .wp-block-template-part + .wp-block-template-part{
  margin-block-start: 0;
}

/* Homepage: remove gap between header template-part and first block */
body.home .wp-site-blocks > .wp-block-template-part + *{
  margin-block-start: 0;
}

/* Homepage: remove Gutenberg flow spacing between the full-height cover sections */
body.home .btw-template.is-layout-flow > *{
  margin-block-start: 0 !important;
}

/* Homepage: ensure no extra bottom spacing before footer */
body.home .wp-site-blocks > .wp-block-group.btw-template{
  margin-block-end: 0 !important;
}
body.home .wp-site-blocks > .wp-block-group.btw-template > :last-child{
  margin-block-end: 0 !important;
}

/* ==========================================================
   Header (SOLID + FIXED)  &#9989; robust "sticky" behavior
   ========================================================== */

.btw-site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  width: 100%;
  color: #fff;
  padding: 0.85rem 0;

  transition:
    background 200ms ease,
    box-shadow 200ms ease,
    padding 200ms ease;

  /* Solid background (no transparency/glass) */
  background: var(--btw-header-bg);

  /* No blur/glass */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Admin bar offset */
body.admin-bar .btw-site-header{ top: 32px; }
@media (max-width: 782px){
  body.admin-bar .btw-site-header{ top: 46px; }
}

/* Push ALL page content down so hero always starts under the header */
.wp-site-blocks{
  padding-top: var(--btw-header-h);
}
body.admin-bar .wp-site-blocks{
  padding-top: calc(var(--btw-header-h) + 32px);
}
@media (max-width: 782px){
  body.admin-bar .wp-site-blocks{
    padding-top: calc(var(--btw-header-h) + 46px);
  }
}

/* Make header alignment consistent across ALL post types. */
.btw-site-header__inner{
  max-width: var(--wp--style--global--wide-size, 1120px);
  margin: 0 auto;
  padding-left: var(--wp--preset--spacing--4);
  padding-right: var(--wp--preset--spacing--4);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Ensure navigation block actually centers */
.btw-site-header .wp-block-navigation{
  margin-left: auto;
  margin-right: auto;
}

/* Nav readability */
.btw-site-header a,
.btw-site-header .wp-block-navigation-item__label{
  color: #fff;
  text-decoration: none;
  text-shadow: none;
}

/* Spacing between menu items */
.btw-site-header .wp-block-navigation__container{
  gap: 22px !important;
  align-items: center;
}

/* Underline active menu item */
.btw-site-header .current-menu-item > a,
.btw-site-header .current-menu-ancestor > a,
.btw-site-header .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.btw-site-header .wp-block-navigation-item.current-menu-ancestor > .wp-block-navigation-item__content{
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.btw-site-header a:hover{
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Scrolled state */
body.btw-is-scrolled .btw-site-header{
  padding: 0.60rem 0;
  box-shadow: var(--btw-shadow);
  background: var(--btw-header-bg);
}

/* ==========================================================
   Hero (theme hero, not TJ hero)
   ========================================================== */

.btw-hero{ min-height: 360px; }
@media (max-width: 900px){
  .btw-hero{ min-height: 280px; }
}
.btw-hero .wp-block-cover__background{
  background: linear-gradient(180deg, rgba(15,23,42,0.55), rgba(15,23,42,0.72));
}
.btw-hero__inner{
  padding: calc(var(--wp--preset--spacing--6) * 1) 0;
}
.btw-hero h1,
.btw-hero p{ color: #fff; }

/* Main */
.btw-main{ max-width: 100%; }

/* Buttons (core/button) */
.wp-block-button__link{
  border-radius: 14px;
  padding: 0.8rem 1.1rem;
}

/* Images: block styles from functions.php */
.is-style-no-radius img{ border-radius: var(--btw-radius-none) !important; }
.is-style-rounded img{ border-radius: var(--btw-radius-md) !important; }
.is-style-rounded-xl img{ border-radius: var(--btw-radius-xl) !important; }

/* Lists with SVG markers */
.is-style-list-neutral,
.is-style-list-personal,
.is-style-list-travel,
.is-style-list-business{
  list-style: none;
  padding-left: 0;
}

.is-style-list-neutral li,
.is-style-list-personal li,
.is-style-list-travel li,
.is-style-list-business li{
  position: relative;
  padding-left: 1.6rem;
  margin: 0.4rem 0;
}

.is-style-list-neutral li::before,
.is-style-list-personal li::before,
.is-style-list-travel li::before,
.is-style-list-business li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 1rem;
  height: 1rem;
  background-color: currentColor;

  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;

  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.is-style-list-neutral li::before{
  mask-image: url('../svg/marker-neutral.svg');
  -webkit-mask-image: url('../svg/marker-neutral.svg');
}
.is-style-list-personal li::before{
  mask-image: url('../svg/marker-personal.svg');
  -webkit-mask-image: url('../svg/marker-personal.svg');
}
.is-style-list-travel li::before{
  mask-image: url('../svg/marker-travel.svg');
  -webkit-mask-image: url('../svg/marker-travel.svg');
}
.is-style-list-business li::before{
  mask-image: url('../svg/marker-business.svg');
  -webkit-mask-image: url('../svg/marker-business.svg');
}

/* Footer */
.btw-site-footer{
  background: var(--wp--preset--color--btw-muted);
  border-top: 1px solid var(--wp--preset--color--btw-border);
}

/* Travel Journey gentle alignment (bridge) */
.btw-tj-wrap a{ color: var(--wp--preset--color--btw-orange); }

/* Tables */
.wp-block-table table,
table{
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 15px;
  line-height: 1.45;
}
.wp-block-table thead th,
table thead th{
  background: var(--btw-header-bg);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
}
.wp-block-table tbody td,
table tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: top;
}
.wp-block-table,
table{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--btw-radius-md);
  overflow: hidden;
  background: #fff;
}

/* Travel Journal: let theme control widths */
.btw-tj-wrap{
  max-width: var(--wp--style--global--wide-size, 1120px) !important;
  margin: 0 auto;
  padding-left: var(--wp--preset--spacing--4);
  padding-right: var(--wp--preset--spacing--4);
}
.btw-tj .btw-tj-prose{
  max-width: var(--wp--style--global--content-size, 760px) !important;
}

/* ==========================================================
   Travel Journal cards (ensure card view always works)
   ========================================================== */

.btw-tj-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px){
  .btw-tj-cards{ grid-template-columns: 1fr; }
}

.btw-tj-card{
  display:flex;
  flex-direction:column;
  border-radius: var(--btw-radius-md, 12px);
  overflow:hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  text-decoration:none;
  color: inherit;
}

.btw-tj-card__img{
  height: 160px;
  background-size:cover;
  background-position:center;
}
.btw-tj-card__body{
  padding: 12px 14px 14px 14px;
}
.btw-tj-card__title{
  font-weight: 700;
  margin-bottom: 6px;
}
.btw-tj-aside .btw-tj-cards{
  grid-template-columns: 1fr;
}

/* ==========================================================
   Mobile navigation – fullscreen app-style menu
   ========================================================== */

/* Fullscreen overlay with fixed dark background */
.wp-block-navigation:not(.has-background)
.wp-block-navigation__responsive-container.is-menu-open{
  background-color: #32373c !important;
  color: #fff !important;

  height: 100vh;
  min-height: 100vh;
  overflow: hidden !important;

  display: flex;
}

/* Content fills the screen and starts from the top (app feel) */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-content{
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  flex: 1;
  padding-top: 6rem !important;   /* space for close button */
  padding-bottom: 3rem !important;
}

/* Menu list spacing (vertical rhythm) */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__container{
  gap: 22px !important;
}

/* Menu items – larger tap targets, app-like */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content{
  padding: 0.45rem 0 !important;
  font-size: 1.15rem;
}

/* Text & links */
.wp-block-navigation:not(.has-background)
.wp-block-navigation__responsive-container.is-menu-open a,
.wp-block-navigation:not(.has-background)
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__label{
  color: #fff !important;
  text-shadow: none;
}

/* Hamburger + close icon */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close{
  color: #fff !important;
}

/* ==========================================================
   Homepage safety
   ========================================================== */

/* Extra safety: ensure no ancestor blocks layout */
body.home .wp-site-blocks,
body.home .wp-block-template-part{
  overflow: visible;
}

/* Homepage: remove the gap between last section and the footer template part */
body.home .wp-site-blocks > .wp-block-template-part{
  margin-block-start: 0 !important;
}

/* Safety: ensure last homepage section doesn't add bottom spacing */
body.home .wp-site-blocks > .wp-block-group.btw-template{
  margin-block-end: 0 !important;
}
body.home .wp-site-blocks > .wp-block-group.btw-template > :last-child{
  margin-block-end: 0 !important;
}