/**
 * WordPress compatibility styles
 * Nav dropdowns, screen reader text, pagination, wp-block styles, etc.
 */

/* ============================================
   DESKTOP NAV — compact spacing
   ============================================ */
#desktop-menu {
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  #desktop-menu {
    gap: 0.5rem;
  }
}

@media (min-width: 1280px) {
  #desktop-menu {
    gap: 0.625rem;
  }
}

/* ============================================
   DESKTOP NAV — shadcn-style morphing viewport
   ============================================ */
.nav-menu-trigger,
.nav-menu-link-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.5rem 0.75rem;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.025em;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.nav-menu-trigger:hover,
.nav-menu-link-top:hover,
.nav-menu-trigger.active {
  background: rgba(89, 152, 197, 0.08);
  color: #5998C5;
}

.nav-menu-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.nav-menu-trigger.active .nav-menu-chevron {
  transform: rotate(180deg);
}

/* Ensure the sticky nav doesn't clip the dropdown */
#site-nav {
  overflow: visible !important;
}

/* Viewport positioner — anchored below #site-nav */
.nav-menu-viewport-position {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  padding-top: 0.625rem;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  perspective: 2000px;
}

.nav-menu-viewport-position.open {
  pointer-events: auto;
}

/* Small arrow pointing upward */
.nav-menu-viewport-position::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px 0 0 0;
  transform: translateX(-50%) rotate(45deg);
  z-index: 101;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-menu-viewport-position.open::before {
  opacity: 1;
}

/* The morphing viewport container */
.nav-menu-viewport {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 16px 70px -12px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  transform-origin: top center;
  opacity: 0;
  transform: scale(0.96) rotateX(-2deg);
  transition:
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.nav-menu-viewport.open {
  opacity: 1;
  transform: scale(1) rotateX(0deg);
  pointer-events: auto;
}

/* Content panels inside viewport */
.nav-menu-content {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.nav-menu-content.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Links inside dropdown panels */
.nav-menu-item-link {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.nav-menu-item-link:hover {
  background: rgba(89, 152, 197, 0.08);
}

.nav-menu-item-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
}

.nav-menu-item-link:hover .nav-menu-item-title {
  color: #5998C5;
}

.nav-menu-item-desc {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.4;
  white-space: normal;
  max-width: 220px;
}

/* ============================================
   MOBILE DROPDOWN
   ============================================ */
.mobile-dropdown-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.25s ease,
              margin 0.35s ease;
  margin-top: 0;
}

.mobile-dropdown-panel.mobile-dropdown-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.5rem;
}

.mobile-dropdown-panel > * {
  overflow: hidden;
}

.mobile-dropdown-link {
  text-decoration: none;
}

.mobile-dropdown-trigger {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

/* Wrap inner dropdown links with a container div for overflow:hidden */
.mobile-dropdown-panel {
  padding: 0;
}

/* ============================================
   SHRINK UTILITY (not in compiled Tailwind)
   ============================================ */
.shrink-0 {
  flex-shrink: 0;
}

/* Screen reader text (accessibility) */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f5f9;
  border-radius: 0.5rem;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #334155;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 1rem 1.5rem;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* WordPress pagination */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.nav-links .page-numbers:hover {
  background: #5998C5;
  color: #fff;
  border-color: #5998C5;
}

.nav-links .page-numbers.current {
  background: #5998C5;
  color: #fff;
  border-color: #5998C5;
}

.nav-links .page-numbers.dots {
  background: transparent;
  border: none;
}

/* WordPress content styles (for the_content()) */
.entry-content p {
  margin-bottom: 1.5em;
}

.entry-content h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #334155;
  margin: 2em 0 0.75em;
}

.entry-content h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #334155;
  margin: 1.5em 0 0.75em;
}

.entry-content h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #334155;
  margin: 1.5em 0 0.5em;
}

.entry-content ul,
.entry-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.entry-content ul {
  list-style-type: disc;
}

.entry-content ol {
  list-style-type: decimal;
}

.entry-content li {
  margin-bottom: 0.5em;
}

.entry-content a {
  color: #5998C5;
  text-decoration: underline;
  text-decoration-color: #5998C5;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.entry-content a:hover {
  color: #4A80A6;
}

.entry-content blockquote {
  border-left: 4px solid #5998C5;
  padding: 1em 1.5em;
  margin: 1.5em 0;
  background: #f8fafc;
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: #64748b;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 1.5em 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.entry-content th,
.entry-content td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.entry-content th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

/* WordPress alignment */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.5em;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5em 0;
}

.gallery-item img {
  border-radius: 0.75rem;
  width: 100%;
  height: auto;
}
