/*
Theme Name: ClubHouse
Theme URI: https://viralwebsolutions.com
Author: Viral Web Solutions
Description: Minimal Elementor-ready theme. Centered logo, hamburger drawer using the WordPress menu, customizable top-right button.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: clubhouse
*/

/* Design tokens */
:root {
  --ch-green-900: #19281b;
  --ch-green-700: #34503a;
  --ch-green-500: #4a5a4c;
  --ch-cream-100: #f8f0e0;
  --ch-sans: "Montserrat", system-ui, sans-serif;
  --ch-serif: "Source Serif 4", Georgia, serif;
  --ch-gutter: clamp(1rem, 4vw, 2.5rem);
  --ch-header-h: 4.5rem;
  --ch-header-offset: var(--ch-header-h); /* 0 while the header is transparent */
  --ch-footer-h: 0px;                      /* measured in menu.js */
}

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

body {
  margin: 0;
  background: var(--ch-cream-100);
  color: var(--ch-green-900);
  font-family: var(--ch-serif);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--ch-green-700);
  outline-offset: 2px;
  border-radius: 2px;
}

.ch-skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 60;
  transform: translateY(-200%);
  background: var(--ch-green-900);
  color: var(--ch-cream-100);
  padding: 0.5rem 1rem;
  font-family: var(--ch-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.ch-skip:focus { transform: translateY(0); }

/* Header: hamburger | logo | button */
.ch-header {
  position: relative;
  z-index: 10;
}

.ch-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: var(--ch-header-h);
  padding: 0.75rem var(--ch-gutter);
}

.ch-logo {
  display: block;
  justify-self: center;
  width: clamp(8.7rem, 22.5vw, 12.75rem);
  text-decoration: none;
}
.ch-logo img { display: block; }
.ch-logo--text {
  font-family: var(--ch-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  width: auto;
}

.ch-burger { color: var(--ch-burger-color, currentColor); }

.ch-burger,
.ch-drawer__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: -0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.ch-cta {
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  text-align: right;
  overflow-wrap: anywhere;
  font-family: var(--ch-sans);
  font-size: clamp(0.6875rem, 1.3vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none;
  text-underline-offset: 0.35em;
  padding: 0.5rem 0;
}
.ch-cta:hover { text-decoration: underline; }
.ch-cta:not(.ch-cta--button) { color: var(--ch-btn-fg, currentColor); }

/* Button variant (Customizer) */
.ch-cta--button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.75rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: var(--ch-btn-bg, var(--ch-green-900));
  color: var(--ch-btn-fg, var(--ch-cream-100));
  border-color: var(--ch-btn-bg, var(--ch-green-900));
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}
.ch-cta--button:hover {
  opacity: 0.85;
  text-decoration: none;
}

@media (max-width: 767px) {
  .ch-cta--hide-mobile { display: none; }
}

/* Transparent header stacked on the first section */
.ch-header--overlay {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 20;
  color: var(--ch-cream-100);
  background: transparent;
}
.ch-header--overlay .ch-cta--button {
  background: var(--ch-btn-bg, transparent);
  color: var(--ch-btn-fg, var(--ch-cream-100));
  border-color: var(--ch-btn-bg, currentColor);
}
.ch-header--overlay :focus-visible { outline-color: var(--ch-cream-100); }

/* Transparent header must sit under the admin bar, not behind it. */
body.admin-bar .ch-header--overlay { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .ch-header--overlay { top: 46px; }
}

.ch-has-overlay { --ch-header-offset: 0px; }

/* Add "ch-screen" to an Elementor section to fill the viewport minus header + footer. */
.ch-screen {
  min-height: calc(100dvh - var(--ch-header-offset) - var(--ch-footer-h));
}

/* Drawer */
.ch-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  padding: 0;
  width: min(22rem, 86vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  background: var(--ch-cream-100);
  color: var(--ch-green-900);
  overflow-y: auto;
}
.ch-drawer::backdrop { background: rgb(0 0 0 / 0.45); }

.ch-drawer[open] { animation: ch-slide-in 0.25s ease-out; }
@keyframes ch-slide-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.ch-drawer__head {
  display: flex;
  align-items: center;
  min-height: var(--ch-header-h);
  padding: 0.75rem var(--ch-gutter);
  border-bottom: 1px solid rgb(25 40 27 / 0.15);
}

.ch-drawer nav ul {
  list-style: none;
  margin: 0;
  padding: 1.5rem var(--ch-gutter);
}
.ch-drawer nav li + li { border-top: 1px solid rgb(25 40 27 / 0.15); }
.ch-drawer nav a {
  display: block;
  padding: 1rem 0;
  font-family: var(--ch-sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  text-underline-offset: 0.35em;
  transition: color 0.2s;
}
.ch-drawer nav a:hover { color: var(--ch-green-700); text-decoration: underline; }
.ch-drawer nav .current-menu-item > a { text-decoration: underline; }
/* Submenus: indented, always visible — no JS accordion */
.ch-drawer nav .sub-menu {
  padding: 0 0 0.5rem 1rem;
}
.ch-drawer nav .sub-menu a {
  padding: 0.6rem 0;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  color: var(--ch-green-500);
}
.ch-drawer nav .sub-menu li + li { border-top: 0; }

/* Content fallback for non-Elementor pages */
.ch-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--ch-gutter);
}
.ch-content h1,
.ch-content h2,
.ch-content h3 {
  font-family: var(--ch-sans);
  font-weight: 700;
  text-wrap: balance;
  line-height: 1.2;
}

/* Footer */
.ch-footer {
  padding: 2rem var(--ch-gutter);
  border-top: 1px solid rgb(25 40 27 / 0.15);
  font-family: var(--ch-sans);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.ch-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.ch-footer__nav a {
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  text-underline-offset: 0.35em;
}
.ch-footer__nav a:hover { text-decoration: underline; }
.ch-footer__nav .sub-menu { display: none; }
.ch-footer__text {
  font-weight: 600;
  letter-spacing: 0.1em;
}
.ch-footer__text p { margin: 0; }

.ch-socials {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.ch-socials li { margin: 0; }
.ch-socials a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  transition: background-color 0.2s, color 0.2s;
}
.ch-socials a:hover {
  background: var(--ch-green-900);
  color: var(--ch-cream-100);
}
.ch-socials svg {
  display: block;
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .ch-footer__nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
