/*
 * IMPROVEMENT 4: CSS Additions
 * ============================
 * DROP-IN INSTRUCTIONS:
 *   Append this entire file to the bottom of style.css
 *   OR enqueue it as a separate stylesheet after the main style.
 *
 * Contents:
 *   A) Share row + buttons (for Improvement 3)
 *   B) Sticky mobile CTA (for Improvement 3)
 *   C) "More calculators" nav dropdown (for Improvement 1 header)
 *   D) Author block (for Improvement 2 — copied here for convenience)
 *   E) Bug fix: info-card h3 mt-32 gap
 *   F) Print stylesheet — clean output for the Print button
 */


/* ═══════════════════════════════════════════════════════════════════
   A) SHARE ROW + BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 16px;
  padding: 16px 20px;
  background: rgba(0,150,199,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.share-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0,150,199,0.05);
}

.share-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.share-btn--copy:hover  { border-color: var(--primary); }
.share-btn--share:hover { border-color: #34C759; color: #34C759; }
.share-btn--print:hover { border-color: var(--text-secondary); color: var(--text-primary); }

@media (max-width: 480px) {
  .share-row   { flex-direction: column; align-items: flex-start; }
  .share-btn   { flex: 1; justify-content: center; }
}


/* ═══════════════════════════════════════════════════════════════════
   B) STICKY MOBILE CTA
   ═══════════════════════════════════════════════════════════════════ */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,150,199,0.12);
  /* Hidden by default — JS adds .visible */
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta-btn {
  display: block;
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0,150,199,0.35);
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.sticky-cta-btn:active {
  transform: scale(0.98);
}

/* Only show on mobile — the desktop form always has the button visible */
@media (min-width: 768px) {
  .sticky-cta { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════
   C) "MORE CALCULATORS" NAV DROPDOWN
   ═══════════════════════════════════════════════════════════════════ */

.nav-more {
  position: relative;
}

.nav-more-btn {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-more-btn:hover,
.nav-more-btn[aria-expanded="true"] {
  color: var(--primary);
  background: var(--surface);
}

.nav-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 150;
  padding: 6px;
  animation: fadeInUp 0.18s ease both;
}

.nav-more-dropdown.open {
  display: block;
}

.nav-more-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}

.nav-more-dropdown a:hover {
  color: var(--primary);
  background: var(--surface);
}

/* On mobile the dropdown becomes a flat list inside the open mobile menu */
@media (max-width: 900px) {
  .nav-more-btn   { display: none; }
  .nav-more-dropdown {
    display: flex;
    flex-direction: column;
    position: static;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    animation: none;
  }
  .nav-more-dropdown a { padding: 12px; }
}

/* JS toggle — add to app.js or functions.php inline script: */
/*
document.getElementById('nav-more-btn')?.addEventListener('click', function(e) {
  e.stopPropagation();
  const open = document.getElementById('nav-more-dropdown').classList.toggle('open');
  this.setAttribute('aria-expanded', String(open));
});
document.addEventListener('click', function() {
  document.getElementById('nav-more-dropdown')?.classList.remove('open');
  document.getElementById('nav-more-btn')?.setAttribute('aria-expanded', 'false');
});
*/


/* ═══════════════════════════════════════════════════════════════════
   D) AUTHOR / REVIEWER BLOCK
   ═══════════════════════════════════════════════════════════════════ */

.author-block {
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
}

.author-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* If you use a real headshot instead of initials: */
.author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.author-info    { flex: 1; min-width: 0; }
.author-label   {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.author-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.author-name a  { color: var(--primary); text-decoration: none; }
.author-name a:hover { text-decoration: underline; }
.author-title   {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.author-credentials {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 6px;
}
.author-bio     {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.5;
}
.author-reviewed {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 110px;
  text-align: right;
}
.reviewed-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.reviewed-date  {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .author-card     { flex-wrap: wrap; }
  .author-reviewed { align-items: flex-start; text-align: left; }
}


/* ═══════════════════════════════════════════════════════════════════
   E) BUG FIX: Info card h3 excessive top margin
   ═══════════════════════════════════════════════════════════════════
   The dehydration signs cards in front-page.php have:
     <h3 class="mt-32">
   The mt-32 utility class adds 32px top margin — fine in content sections
   but creates an ugly 32px gap between the icon and title inside a compact
   card. This selector overrides that utility class specifically inside cards.
   ═══════════════════════════════════════════════════════════════════ */

.info-card h3.mt-32,
.info-card h3[class*="mt-"] {
  margin-top: 8px !important; /* was 32px */
}


/* ═══════════════════════════════════════════════════════════════════
   F) PRINT STYLESHEET
   Triggered by the Print button in the share row.
   Strips navigation, hero, and FAQ — shows only calculator + results.
   ═══════════════════════════════════════════════════════════════════ */

@media print {
  .site-header,
  .site-nav,
  .nav-toggle,
  .hero-badge,
  .hero p,
  .calc-section-title,
  .unit-toggle,
  .advanced-toggle,
  .advanced-section,
  .btn-calculate,
  .privacy-note,
  .share-row,
  .content-section,
  .faq-list,
  .calc-links-section,
  .site-footer,
  .sticky-cta {
    display: none !important;
  }

  .hero     { background: white !important; padding: 12px 0 !important; }
  .calc-card { box-shadow: none !important; border: 1px solid #ccc !important; }
  .results-panel {
    display: block !important;
    background: white !important;
    border: 1px solid #ccc !important;
  }
  .result-value { color: #000 !important; }

  body { font-size: 12pt; color: #000; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 10pt; color: #555; }
}
