/* ═══════════════════════════════════════════════════════════════
   HABIBAYAN SHARED THEME
   Injected into all Jinja pages via hooks.py web_include_css
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ─── CSS VARIABLES ─── */
:root {
  --sunset: #E8622A;
  --sunset-dark: #c9511e;
  --gold: #F5A623;
  --deep: #1A1A2E;
  --ocean: #16213E;
  --sky: #0F3460;
  --cream: #FDF6EC;
  --warm-white: #FEFAF4;
  --sand: #F2E8D5;
  --text-dark: #1C1A16;
  --text-mid: #5A5248;
  --text-light: #9C9080;
  --accent-green: #2D6A4F;
}

/* ─── FRAPPE OVERRIDES ─── */
.page-header-wrapper,
.page-footer {
  display: none !important;
}

.page-content-wrapper,
.page-content-wrapper .container,
.page-content-wrapper .container-fluid,
main.container.my-4 {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ─── BASE BODY ─── */
body {
  font-family: 'DM Sans', sans-serif !important;
  background: var(--warm-white) !important;
  color: var(--text-dark);
  overflow-x: hidden;
  margin: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ─── NAVBAR ─── */
.hb-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(253, 246, 236, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 98, 42, 0.08);
  transition: box-shadow 0.3s ease;
}

.hb-nav.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.hb-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.hb-nav-logo:hover {
  text-decoration: none;
}
.hb-nav-logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
}
/* Fallback text logo styling */
.hb-nav-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--sunset);
  letter-spacing: -0.5px;
}
.hb-nav-logo-text span {
  color: var(--gold);
}

.hb-nav-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 28px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.hb-nav-main::-webkit-scrollbar {
  display: none;
}

.hb-nav-main-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.hb-nav-main-link:hover {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.06);
  text-decoration: none;
}

.hb-nav-main-link.active {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.1);
  border-color: rgba(232, 98, 42, 0.15);
  font-weight: 600;
}

.hb-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.hb-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hb-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sunset), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(232, 98, 42, 0.2);
}

.hb-nav-username {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-mid);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-nav-login,
.hb-nav-signup {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

.hb-nav-login {
  color: var(--text-mid);
  border: 1.5px solid var(--sand);
  background: transparent;
}
.hb-nav-login:hover {
  color: var(--sunset);
  border-color: var(--sunset);
  text-decoration: none;
}

.hb-nav-signup {
  background: var(--sunset);
  color: #fff;
  border: 1.5px solid var(--sunset);
}
.hb-nav-signup:hover {
  background: var(--sunset-dark);
  border-color: var(--sunset-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.hb-profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
  padding: 8px;
  display: none;
  z-index: 1200;
}

.hb-profile-menu.open {
  display: block;
}

.hb-profile-menu-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 10px 6px;
}

.hb-profile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-mid);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.hb-profile-menu-item:hover {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.08);
  text-decoration: none;
}

/* Accordion toggle button - High specificity to override Frappe */
.hb-nav .hb-nav-toggle,
nav.hb-nav button.hb-nav-toggle,
.hb-nav-toggle {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid var(--sand);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.hb-nav-toggle:hover {
  border-color: var(--sunset);
  background: rgba(232, 98, 42, 0.06);
}
.hb-nav-toggle span {
  display: block !important;
  width: 18px;
  height: 2px;
  background: var(--text-mid);
  margin: 2px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hb-nav-toggle.active {
  border-color: var(--sunset);
  background: rgba(232, 98, 42, 0.08);
}
.hb-nav-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-4px, 4px);
}
.hb-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.hb-nav-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-4px, -4px);
}

/* Show hamburger toggle on mobile - Override Frappe with high specificity */
@media (min-width: 769px) {
  .hb-nav .hb-nav-toggle,
  nav.hb-nav button.hb-nav-toggle,
  .hb-nav-toggle,
  .hb-accordion-nav,
  .hb-nav-overlay {
    display: none !important;
    visibility: hidden !important;
  }
}

@media (max-width: 768px) {
  .hb-nav .hb-nav-toggle,
  nav.hb-nav button.hb-nav-toggle,
  .hb-nav-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .hb-accordion-nav {
    display: block !important;
  }
  .hb-nav-overlay {
    display: block !important;
  }
}

/* ─── ACCORDION NAV PANEL ─── */
.hb-accordion-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 1099;
  background: rgba(253, 246, 236, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 98, 42, 0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.hb-accordion-nav.open {
  max-height: 600px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.hb-accordion-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px 24px;
}

/* Direct nav links */
.hb-accordion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hb-accordion-link {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.hb-accordion-link:hover {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.06);
  text-decoration: none;
}
.hb-accordion-link.active {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.1);
  border-color: rgba(232, 98, 42, 0.15);
  font-weight: 600;
}

/* Nav groups */
.hb-nav-group {
  margin-bottom: 4px;
}

.hb-nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.hb-nav-group-header:hover {
  background: rgba(232, 98, 42, 0.06);
  color: var(--sunset);
}

.hb-nav-group-arrow {
  font-size: 0.65rem;
  transition: transform 0.3s ease;
  color: var(--text-light);
}
.hb-nav-group.open .hb-nav-group-arrow {
  transform: rotate(180deg);
}

.hb-nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 18px;
}
.hb-nav-group.open .hb-nav-group-items {
  max-height: 200px;
}

.hb-nav-group-item {
  display: block;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-mid);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 2px;
}
.hb-nav-group-item:hover {
  color: var(--sunset);
  background: rgba(232, 98, 42, 0.06);
  text-decoration: none;
  padding-left: 22px;
}

/* Accordion nav overlay */
.hb-nav-overlay {
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1098;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.hb-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ─── COMMON BUTTONS ─── */
.hb-btn-primary {
  background: var(--sunset);
  color: #fff;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(232, 98, 42, 0.3);
  letter-spacing: 0.2px;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.hb-btn-primary:hover {
  background: var(--sunset-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(232, 98, 42, 0.4);
}

.hb-btn-ghost {
  color: rgba(255, 255, 255, 0.85);
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.hb-btn-ghost:hover {
  color: var(--gold);
  text-decoration: none;
}

.hb-btn-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.hb-btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

/* ─── COMMON SECTION STYLES ─── */
.hb-section {
  padding: 100px 60px;
}

.hb-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hb-section-tag {
  display: inline-block;
  background: rgba(232, 98, 42, 0.1);
  color: var(--sunset);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hb-section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.hb-section-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 580px;
  font-weight: 300;
}

/* ─── COMMON CARD ─── */
.hb-card {
  background: var(--cream);
  border-radius: 20px;
  padding: 36px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.hb-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

/* ─── FOOTER ─── */
.hb-footer {
  background: var(--text-dark);
  padding: 60px 60px 32px;
  color: rgba(255, 255, 255, 0.6);
}

.hb-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hb-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 56px;
}

.hb-footer-brand .hb-nav-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.hb-footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 24px;
  font-weight: 300;
}

.hb-footer-social {
  display: flex;
  gap: 12px;
}

.hb-footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: all 0.2s;
}
.hb-footer-social a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hb-footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.hb-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hb-footer-col li {
  margin-bottom: 10px;
}

.hb-footer-col a {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 300;
  transition: color 0.2s;
}
.hb-footer-col a:hover {
  color: rgba(255, 255, 255, 0.85);
}

.hb-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.hb-footer-bottom p {
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── PAGE CONTENT OFFSET (below fixed navbar) ─── */
.hb-page-content {
  padding-top: 64px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hb-nav {
    padding: 0 20px;
  }

  .hb-nav-main {
    gap: 4px;
    margin-left: 12px;
  }

  .hb-nav-main-link {
    padding: 7px 12px;
    font-size: 0.84rem;
  }

  .hb-accordion-inner {
    padding: 16px 20px 20px;
  }

  .hb-section {
    padding: 60px 20px;
  }

  .hb-footer {
    padding: 48px 20px 24px;
  }

  .hb-footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hb-footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .hb-nav-username {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Navbar adjustments for tablet/mobile */
  .hb-nav {
    padding: 0 16px;
    height: 68px;
    gap: 8px;
  }

  .hb-nav-logo img {
    height: 54px;
  }

  .hb-accordion-nav {
    top: 68px;
  }

  .hb-nav-overlay {
    top: 68px;
  }

  .hb-page-content {
    padding-top: 68px;
  }

  /* Hide main nav links on mobile - use accordion instead */
  .hb-nav-main {
    display: none;
  }

  .hb-nav-login,
  .hb-nav-signup {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .hb-accordion-links {
    flex-direction: column;
    gap: 4px;
  }

  .hb-section {
    padding: 48px 16px;
  }

  /* Footer mobile */
  .hb-footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hb-footer-brand {
    text-align: center;
  }

  .hb-footer-brand .hb-nav-logo {
    justify-content: center;
  }

  .hb-footer-col {
    text-align: center;
  }

  .hb-footer-social {
    justify-content: center;
  }

  /* Cards and grids */
  .hb-card {
    padding: 24px;
  }

  .hb-section-title {
    font-size: 1.75rem;
  }

  .hb-section-lead {
    font-size: 1rem;
  }

  /* Buttons */
  .hb-btn-primary {
    padding: 12px 24px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hb-nav {
    padding: 0 12px;
    height: 64px;
  }

  .hb-nav-logo img {
    height: 50px;
  }

  .hb-accordion-nav {
    top: 64px;
  }

  .hb-nav-overlay {
    top: 64px;
  }

  .hb-page-content {
    padding-top: 64px;
  }

  .hb-nav-login {
    display: none;
  }

  .hb-nav-signup {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .hb-nav-toggle {
    width: 36px;
    height: 36px;
  }

  .hb-section {
    padding: 36px 12px;
  }

  .hb-section-title {
    font-size: 1.5rem;
  }

  .hb-footer {
    padding: 36px 12px 20px;
  }

  .hb-footer-bottom {
    font-size: 0.75rem;
  }

  .hb-card {
    padding: 20px;
    border-radius: 16px;
  }
}
