/* /assets/css/header.css
   The Cloud Forest Retreat global header system
   Fixes raw header rendering when header.html is injected by site.js.
*/

:root{
  --tcfr-header-bg: rgba(161,191,170,0.86);
  --tcfr-header-border: rgba(13,89,37,0.14);
  --tcfr-header-text: #0B2B12;
  --tcfr-header-green: #0D5925;
  --tcfr-header-orange: #E0643A;
  --tcfr-header-cream: #F5F5DC;
  --tcfr-header-shadow: 0 18px 45px rgba(11,43,18,0.10);
  --tcfr-header-radius: 999px;
  --tcfr-header-max: 1120px;
  --tcfr-header-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tcfr-header,
.tcfr-header *,
.tcfr-header *::before,
.tcfr-header *::after{
  box-sizing: border-box;
}

.tcfr-header{
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: var(--tcfr-header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tcfr-header-border);
  font-family: var(--tcfr-header-font);
  color: var(--tcfr-header-text);
}

.tcfr-shell{
  max-width: var(--tcfr-header-max);
  margin: 0 auto;
  min-height: 74px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.tcfr-brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--tcfr-header-green);
  text-decoration: none;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.tcfr-logo{
  width: 46px;
  height: 46px;
  max-width: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tcfr-brandText{
  display: inline-block;
  color: var(--tcfr-header-green);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.tcfr-navDesktop{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.tcfr-link,
.tcfr-ddBtn{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--tcfr-header-green);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  padding: 10px 0;
  cursor: pointer;
  white-space: nowrap;
}

.tcfr-link:hover,
.tcfr-ddBtn:hover,
.tcfr-link:focus-visible,
.tcfr-ddBtn:focus-visible{
  color: var(--tcfr-header-text);
  outline: none;
}

.tcfr-dd{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tcfr-caret{
  display: inline-block;
  margin-left: 3px;
  font-size: 11px;
  line-height: 1;
  transform: translateY(-1px);
}

.tcfr-ddMenu{
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  min-width: 245px;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 10px;
  display: grid;
  gap: 4px;
  border-radius: 18px;
  background: rgba(245,245,220,0.98);
  border: 1px solid rgba(13,89,37,0.16);
  box-shadow: var(--tcfr-header-shadow);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.tcfr-dd:hover .tcfr-ddMenu,
.tcfr-dd:focus-within .tcfr-ddMenu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tcfr-ddItem{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--tcfr-header-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.tcfr-ddItem:hover,
.tcfr-ddItem:focus-visible{
  background: rgba(13,89,37,0.10);
  color: var(--tcfr-header-green);
  outline: none;
}

.tcfr-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

.tcfr-lang{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--tcfr-header-radius);
  border: 1px solid rgba(13,89,37,0.16);
  background: rgba(255,255,255,0.16);
}

.tcfr-langBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--tcfr-header-radius);
  color: var(--tcfr-header-green);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.tcfr-langBtn:hover,
.tcfr-langBtn:focus-visible,
.tcfr-langBtn[aria-current="page"],
.tcfr-langBtn.is-active{
  background: rgba(13,89,37,0.10);
  outline: none;
}

.tcfr-cta,
.tcfr-mobileCta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--tcfr-header-radius);
  background: var(--tcfr-header-orange);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 14px 28px rgba(224,100,58,0.20);
  white-space: nowrap;
}

.tcfr-cta:hover,
.tcfr-mobileCta:hover,
.tcfr-cta:focus-visible,
.tcfr-mobileCta:focus-visible{
  filter: brightness(0.98);
  outline: none;
}

.tcfr-burger{
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(13,89,37,0.18);
  background: rgba(255,255,255,0.18);
  cursor: pointer;
}

.tcfr-burgerLines{
  display: grid;
  gap: 5px;
}

.tcfr-burgerLines span{
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: var(--tcfr-header-green);
}

.tcfr-mobileOverlay{
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(11,43,18,0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tcfr-mobilePanel{
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  width: min(390px, 88vw);
  height: 100dvh;
  overflow-y: auto;
  padding: 18px;
  background: rgba(245,245,220,0.98);
  border-left: 1px solid rgba(13,89,37,0.18);
  box-shadow: -24px 0 60px rgba(11,43,18,0.22);
}

.tcfr-mobileTop{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.tcfr-mobileTitle{
  color: var(--tcfr-header-green);
  font-size: 16px;
  font-weight: 950;
}

.tcfr-close{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(13,89,37,0.18);
  background: rgba(13,89,37,0.08);
  color: var(--tcfr-header-green);
  font-weight: 950;
  cursor: pointer;
}

.tcfr-navMobile{
  display: grid;
  gap: 8px;
}

.tcfr-mLink,
.tcfr-mGroup,
.tcfr-mSubLink{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--tcfr-header-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.tcfr-mGroup{
  appearance: none;
  border: 0;
  background: rgba(13,89,37,0.08);
  font-family: var(--tcfr-header-font);
  cursor: pointer;
}

.tcfr-mLink:hover,
.tcfr-mGroup:hover,
.tcfr-mSubLink:hover,
.tcfr-mLink:focus-visible,
.tcfr-mGroup:focus-visible,
.tcfr-mSubLink:focus-visible{
  background: rgba(13,89,37,0.10);
  outline: none;
}

.tcfr-mSub{
  display: grid;
  gap: 4px;
  padding: 2px 0 6px 10px;
}

.tcfr-mSubLink{
  min-height: 38px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255,255,255,0.40);
}

.tcfr-mobileDivider{
  height: 1px;
  background: rgba(13,89,37,0.16);
  margin: 10px 0;
}

.tcfr-mobileLang{
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.tcfr-mobileLangLabel{
  color: rgba(11,43,18,0.72);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rawLangLinks{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1080px){
  .tcfr-shell{ gap: 14px; }
  .tcfr-navDesktop{ gap: 12px; }
  .tcfr-brandText{ font-size: 15px; }
  .tcfr-link,
  .tcfr-ddBtn{ font-size: 13px; }
  .tcfr-cta{ padding: 0 16px; }
}

@media (max-width: 920px){
  .tcfr-shell{
    min-height: 68px;
    padding: 9px 14px;
  }
  .tcfr-brandText{
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tcfr-navDesktop,
  .tcfr-cta{ display: none; }
  .tcfr-burger{ display: inline-flex; }
  .tcfr-actions{ gap: 8px; }
}

@media (max-width: 520px){
  .tcfr-logo{
    width: 42px;
    height: 42px;
    max-width: 42px;
  }
  .tcfr-brandText{
    max-width: 150px;
    font-size: 14px;
  }
  .tcfr-lang{ display: none; }
  .tcfr-mobilePanel{ width: min(360px, 92vw); }
}
