/* Portal Header Widget — matches 3K Academy portal header exactly */

:root {
  --ph-primary: #546088;
  --ph-primary-dark: #3D4870;
  --ph-text: #303030;
  --ph-meta: #989898;
  --ph-border: #E3E3E3;
  --ph-bg-light: #FAFAFA;
  --ph-cta-bg: #1a1a1a;
  --ph-white: #FFFFFF;
}

/* ── Font faces ──────────────────────────────────────────── */
/* Load Inter & Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Header container ────────────────────────────────────── */
#portal-header-root {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ph-white);
  border-bottom: 1px solid var(--ph-border);
  font-family: 'Inter', sans-serif;
}

/* WordPress admin bar offset */
body.admin-bar #portal-header-root {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar #portal-header-root {
    top: 46px;
  }
}

.ph-inner {
  max-width: 80rem;  /* max-w-7xl */
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;  /* h-16 */
}

@media (min-width: 640px) {
  .ph-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .ph-inner {
    padding: 0 2rem;
  }
}

/* ── Logo ────────────────────────────────────────────────── */
.ph-logo {
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}
.ph-logo:hover {
  opacity: 0.8;
}
.ph-logo img {
  height: 3.5rem;  /* h-14 */
  width: auto;
}

/* ── Navigation ──────────────────────────────────────────── */
.ph-nav {
  display: flex;
  align-items: center;
  gap: 2rem;  /* gap-8 */
}

.ph-nav-link {
  color: var(--ph-text);
  font-size: 18px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.ph-nav-link:hover,
.ph-login-link:hover {
  color: var(--ph-primary);
}
/* .ph-login-link — shown for unauthenticated users in the desktop nav */
.ph-login-link {
  color: var(--ph-text);
  font-size: 18px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

/* ── Programs dropdown ───────────────────────────────────── */
.ph-dropdown {
  position: relative;
}
.ph-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--ph-text);
  font-size: 18px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  white-space: nowrap;
}
.ph-dropdown-btn:hover {
  color: var(--ph-primary);
}
.ph-dropdown-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}
.ph-dropdown.open .ph-dropdown-arrow {
  transform: rotate(180deg);
}
.ph-dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: 14rem;  /* w-56 */
  background: var(--ph-white);
  border: 1px solid var(--ph-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 0.5rem 0;
  z-index: 50;
  display: none;
}
.ph-dropdown.open .ph-dropdown-menu {
  display: block;
}
.ph-dropdown-item {
  display: block;
  padding: 0.625rem 1rem;  /* py-2.5 px-4 */
  color: var(--ph-text);
  text-decoration: none;
  transition: background 0.15s;
  font-size: 0.875rem;
}
.ph-dropdown-item:hover {
  background: var(--ph-bg-light);
}
.ph-dropdown-item .ph-item-title {
  font-weight: 600;
  display: block;
}
.ph-dropdown-item .ph-item-sub {
  font-size: 0.75rem;
  color: var(--ph-meta);
  display: block;
  margin-top: 0.125rem;
}

/* ── CTA button (Book a Preview Session) ─────────────────── */
.ph-btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ph-cta-bg);
  color: var(--ph-white);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.ph-btn-cta:hover {
  background: #333;
  transform: scale(1.02);
}

/* ── Auth section ────────────────────────────────────────── */
.ph-auth {
  position: relative;
}
.ph-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ph-primary);
  color: var(--ph-white);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.ph-avatar-btn:hover {
  background: var(--ph-primary-dark);
}
.ph-avatar-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: 12rem;  /* w-48 */
  background: var(--ph-white);
  border: 1px solid var(--ph-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 0.25rem 0;
  z-index: 50;
  display: none;
}
.ph-auth.open .ph-avatar-dropdown {
  display: block;
}
.ph-avatar-dropdown a,
.ph-avatar-dropdown button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--ph-text);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.ph-avatar-dropdown a:hover,
.ph-avatar-dropdown button:hover {
  background: var(--ph-bg-light);
}

/* ── Loading state ───────────────────────────────────────── */
.ph-loading {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.ph-loading .ph-skeleton {
  height: 1rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  animation: ph-pulse 1.5s ease-in-out infinite;
}
.ph-skeleton-sm { width: 80px; }
.ph-skeleton-md { width: 100px; }
.ph-skeleton-lg { width: 130px; }

@keyframes ph-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Hamburger button (mobile only — display toggled in @media) */
.ph-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ph-text);
  font-family: inherit;
  transition: color 0.2s;
}
.ph-hamburger:hover {
  color: var(--ph-primary);
}
.ph-hamburger-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* ── Mobile slide-out overlay ────────────────────────────── */
.ph-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  animation: ph-fade-in 0.3s ease;
}
.ph-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: calc(100% - 60px);
  max-width: 360px;
  height: 100vh;
  background: var(--ph-white);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  animation: ph-slide-in 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

/* ── Mobile panel header ────────────────────────────────── */
.ph-mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--ph-border);
  flex-shrink: 0;
}
.ph-mobile-panel-logo {
  display: flex;
  align-items: center;
}
.ph-mobile-panel-logo img {
  height: 2.5rem;
  width: auto;
}
.ph-mobile-close-btn {
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ph-text);
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}
.ph-mobile-close-btn:hover {
  color: var(--ph-primary);
}
.ph-mobile-back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ph-text);
  padding: 0;
  transition: color 0.2s;
}
.ph-mobile-back-btn:hover {
  color: var(--ph-primary);
}
.ph-mobile-back-arrow {
  width: 20px;
  height: 20px;
}

/* ── Mobile menu content ────────────────────────────────── */
.ph-mobile-menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
}

/* ── Mobile links ───────────────────────────────────────── */
.ph-mobile-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.25rem;
  font-size: 18px;
  color: var(--ph-text);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  transition: color 0.2s;
}
.ph-mobile-link:hover {
  color: var(--ph-primary);
}
.ph-mobile-link-title {
  font-weight: 600;
  display: block;
}
.ph-mobile-link-sub {
  font-size: 12px;
  color: var(--ph-meta);
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

/* ── Mobile dropdown button (programs/resources rows) ───── */
.ph-mobile-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.25rem;
  font-size: 18px;
  color: var(--ph-text);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  background: none;
  border: none;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-mobile-dropdown-btn:hover {
  color: var(--ph-primary);
}
.ph-mobile-sub-arrow {
  width: 20px;
  height: 20px;
  color: var(--ph-meta);
  flex-shrink: 0;
}

/* ── Mobile submenu title ───────────────────────────────── */
.ph-mobile-submenu-title {
  font-size: 14px;
  color: var(--ph-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

/* ── Mobile divider ─────────────────────────────────────── */
.ph-mobile-divider {
  height: 1px;
  background: var(--ph-border);
  margin: 1rem 0;
}

/* ── Mobile CTA ─────────────────────────────────────────── */
.ph-mobile-cta {
  display: block;
  text-align: center;
  background: var(--ph-cta-bg);
  color: var(--ph-white);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  margin-top: 1rem;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  transition: background 0.2s, transform 0.15s;
}
.ph-mobile-cta:hover {
  background: #333;
  transform: scale(1.02);
}

/* ── Mobile auth / user info ────────────────────────────── */
.ph-mobile-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  font-size: 16px;
  color: var(--ph-text);
  font-family: 'Inter', sans-serif;
}
.ph-mobile-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--ph-primary);
  color: var(--ph-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.ph-mobile-logout-btn {
  color: #EF0000;
}
.ph-mobile-logout-btn:hover {
  color: #EF0000;
  opacity: 0.85;
}

/* ── Body no-scroll when mobile menu is open ────────────── */
body.ph-no-scroll {
  overflow: hidden;
}

/* ── Mobile slide-out animations ────────────────────────── */
@keyframes ph-fade-in {
  from { opacity: 0; }
  to { opacity: 0.5; }
}
@keyframes ph-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ── Mobile responsive (≤767px) ─────────────────────────── */
@media (max-width: 767px) {
  /* Hide desktop nav, show hamburger */
  .ph-desktop-nav {
    display: none;
  }
  .ph-hamburger {
    display: flex;
  }
  /* Shrink header logo to fit smaller viewport */
  .ph-logo img {
    height: 2.5rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */

#portal-footer-root,
.ph-footer-root {
  display: block;
  width: 100%;
  background: var(--ph-text);
  color: var(--ph-white);
  font-family: 'Inter', sans-serif;
}

.ph-footer {
  width: 100%;
}

.ph-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

@media (min-width: 640px) {
  .ph-footer-inner { padding: 3rem 1.5rem; }
}
@media (min-width: 1024px) {
  .ph-footer-inner { padding: 3rem 2rem; }
}

/* Logo */
.ph-footer-logo { margin-bottom: 2rem; }
.ph-footer-logo-img {
  height: 2.5rem;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Grid */
.ph-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .ph-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .ph-footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.ph-footer-col-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ph-white);
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
}

.ph-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ph-footer-link {
  color: #d1d5db;  /* text-gray-300 */
  font-size: 18px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: color 0.2s;
}
.ph-footer-link:hover { color: var(--ph-white); }

/* Copyright */
.ph-footer-copy {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #374151;  /* border-gray-700 */
  text-align: center;
}
.ph-footer-copy p {
  font-size: 0.875rem;
  color: #9ca3af;  /* text-gray-400 */
  margin: 0;
}

/* Scroll to top */
.ph-footer-scroll {
  text-align: center;
  margin-top: 1.5rem;
}
.ph-footer-scroll-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}
.ph-footer-scroll-btn:hover { color: var(--ph-white); }
