/* Custom styles for Future in Bio Newsletter */

/* Newsletter-specific colors */
:root {
  --biotech-primary: #1e40af;
  --biotech-secondary: #059669; 
  --biotech-accent: #dc2626;
  --light-teal: #f0fdfa;
}

/* Light teal header background */
.bg-light-teal {
  background-color: var(--light-teal) !important;
}

/* Compact navbar styling */
.navbar {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  min-height: auto;
}

.navbar-brand {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  margin-right: 1rem;
  font-size: 1.1rem;
  line-height: inherit;
}

.navbar-nav .nav-link {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.navbar-toggler {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

/* Adjust container padding to match reduced navbar height */
.navbar > .container {
  padding-top: 0;
  padding-bottom: 0;
}

/* Reduced font sizes for posts */
.article-headline.display-4 {
  font-size: 2.5rem !important;
  line-height: 1.2;
}

.article-post {
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-post h1 {
  font-size: 2rem;
  line-height: 1.3;
}

.article-post h2 {
  font-size: 1.75rem;
  line-height: 1.3;
}

.article-post h3 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.article-post h4 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.article-post h5 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.article-post h6 {
  font-size: 1rem;
  line-height: 1.3;
}

.article-post p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-post ul, 
.article-post ol {
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-post li {
  margin-bottom: 0.25rem;
}

.article-post blockquote {
  font-size: 1rem;
  line-height: 1.5;
}

/* Mobile font size adjustments */
@media (max-width: 768px) {
  .article-headline.display-4 {
    font-size: 2rem !important;
  }
  
  .article-post {
    font-size: 0.9rem;
  }
  
  .article-post h1 {
    font-size: 1.75rem;
  }
  
  .article-post h2 {
    font-size: 1.5rem;
  }
  
  .article-post h3 {
    font-size: 1.25rem;
  }
  
  .article-post p {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .article-headline.display-4 {
    font-size: 1.75rem !important;
  }
  
  .article-post {
    font-size: 0.85rem;
  }
  
  .article-post p {
    font-size: 0.85rem;
  }
}

/* Reduce max width of post content */
.container-lg .col-md-12.col-lg-10 {
  max-width: 700px;
  margin: 0 auto;
}

/* Ensure the post content area is properly centered and constrained */
.article-post {
  max-width: 100%;
  margin: 0 auto;
}

/* Adjust the jumbotron header area to match */
.jumbotron .col-md-12.col-lg-10 {
  max-width: 700px;
  margin: 0 auto;
}

/* Social sharing buttons */
.social-share-links {
  display: flex;
  align-items: center;
}

.social-share-links .btn {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-share-links .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.social-share-links .btn-outline-primary {
  border-color: #1da1f2;
  color: #1da1f2;
}

.social-share-links .btn-outline-primary:hover {
  background-color: #1da1f2;
  border-color: #1da1f2;
  color: white;
}

.social-share-links .btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.social-share-links .btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
}

/* Social platform specific colors */
.social-share-links .btn[href*="twitter"]:hover {
  background-color: #1da1f2 !important;
  border-color: #1da1f2 !important;
}

.social-share-links .btn[href*="linkedin"]:hover {
  background-color: #0077b5 !important;
  border-color: #0077b5 !important;
}

.social-share-links .btn[href*="facebook"]:hover {
  background-color: #1877f2 !important;
  border-color: #1877f2 !important;
}

.social-share-links .btn[href*="mailto"]:hover {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
}

/* Mobile responsiveness for social sharing */
@media (max-width: 768px) {
  .social-share-links {
    flex-direction: column;
    align-items: flex-end;
    margin-top: 15px;
  }
  
  .social-share-links .btn {
    margin-bottom: 5px !important;
    margin-right: 0 !important;
    margin-left: 5px;
  }
  
  .social-share-links span {
    margin-bottom: 10px;
    margin-right: 0 !important;
  }
}

@media (max-width: 576px) {
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .social-share-links {
    width: 100%;
    justify-content: flex-end;
    margin-top: 15px;
  }
  
  .social-share-links {
    flex-direction: row;
    align-items: center;
  }
  
  .social-share-links .btn {
    margin-bottom: 0;
    margin-left: 5px;
  }
}

/* Newsletter article cards */
.newsletter-article-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.3s ease;
}

.newsletter-article-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.newsletter-article-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.newsletter-article-title a {
  color: var(--biotech-primary);
  text-decoration: none;
}

.newsletter-article-title a:hover {
  color: var(--biotech-accent);
  text-decoration: underline;
}

.newsletter-article-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.newsletter-article-summary {
  color: #374151;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.newsletter-article-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-tag {
  background-color: #f3f4f6;
  color: #374151;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.category-tag:hover {
  background-color: var(--biotech-primary);
  color: white;
  text-decoration: none;
}

/* Newsletter summary alert */
.newsletter-summary {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.newsletter-summary strong {
  color: var(--biotech-primary);
}

/* Science-themed icons and elements */
.topic-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Enhanced newsletter navigation */
.newsletter-nav {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  padding: 1rem;
}

.newsletter-nav a {
  color: var(--biotech-primary);
  text-decoration: none;
  font-weight: 500;
}

.newsletter-nav a:hover {
  color: var(--biotech-accent);
  text-decoration: underline;
}

/* Subscribe CTA enhancements */
.subscribe-cta {
  background: linear-gradient(135deg, #065f46 0%, #059669 100%);
  color: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.subscribe-cta h4,
.subscribe-cta h5 {
  color: white;
}

.subscribe-cta .btn-primary {
  background-color: white;
  border-color: white;
  color: var(--biotech-secondary);
  font-weight: 600;
  padding: 0.75rem 2rem;
}

.subscribe-cta .btn-primary:hover {
  background-color: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Newsletter stats and sidebar enhancements */
.newsletter-stats {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 8px;
  padding: 1.5rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .newsletter-article-card {
    padding: 1rem;
  }
  
  .newsletter-article-categories {
    margin-top: 1rem;
  }
  
  .subscribe-cta {
    padding: 1.5rem 1rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .newsletter-article-card {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }
  
  .newsletter-article-title a {
    color: #60a5fa;
  }
  
  .newsletter-article-meta {
    color: #9ca3af;
  }
  
  .newsletter-article-summary {
    color: #d1d5db;
  }
}

/* Biotech-themed gradients and accents */
.bg-biotech-gradient {
  background: linear-gradient(135deg, #1e40af 0%, #059669 100%);
}

.text-biotech-primary {
  color: var(--biotech-primary) !important;
}

.text-biotech-secondary {
  color: var(--biotech-secondary) !important;
}

.border-biotech {
  border-color: var(--biotech-primary) !important;
}

/* Animation for newsletter loading */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.newsletter-card {
  animation: fadeInUp 0.6s ease-out;
}

/* Newsletter archive enhancements */
.year-divider {
  border-top: 3px solid var(--biotech-primary);
  margin: 3rem 0 2rem 0;
  position: relative;
}

.year-divider::before {
  content: attr(data-year);
  background: white;
  color: var(--biotech-primary);
  font-weight: bold;
  padding: 0.5rem 1rem;
  position: absolute;
  top: -1rem;
  left: 0;
}

/* Beehiiv Subscribe Form Styles */
.beehiiv-subscribe-form .input-group {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.beehiiv-subscribe-form .input-group .form-control {
    border: none;
    border-right: none !important;
    border-radius: 0;
    background-color: transparent;
}

.beehiiv-subscribe-form .input-group .form-control:focus {
    border: none !important;
    border-right: none !important;
    outline: none;
    box-shadow: none;
}

.beehiiv-subscribe-form .input-group .btn {
    border: none;
    border-radius: 0;
    border-left: 1px solid #dee2e6;
}

/* Unified border highlight when input is focused */
.beehiiv-subscribe-form .input-group:focus-within {
    border-color: #03a87c;
    box-shadow: 0 0 0 0.2rem rgba(3, 168, 124, 0.25);
}

.beehiiv-subscribe-form .input-group:focus-within .form-control {
    box-shadow: none;
}

.beehiiv-subscribe-form .input-group:focus-within .btn {
    box-shadow: none;
    border-left-color: #dee2e6 !important;
}

/* Ensure perfect border-radius alignment */
.beehiiv-subscribe-form .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.beehiiv-subscribe-form .input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Validation states for input */
.beehiiv-subscribe-form .form-control.is-valid {
    border-color: #28a745;
    background-image: none;
}

.beehiiv-subscribe-form .form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* Loading state for buttons */
.beehiiv-subscribe-form .btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Muted placeholder text */
.beehiiv-subscribe-form .input-group .form-control::placeholder {
    color: #6c757d;
    opacity: 0.6;
}

/* Post layout subscription form styles */
.beehiiv-subscribe-form .beehiiv-form {
    width: 100%;
}

.beehiiv-subscribe-form .input-group {
    margin-bottom: 0;
}

/* Success state styling */
.beehiiv-form button.subscribed {
    background-color: #28a745;
    border-color: #28a745;
}

.beehiiv-form button.subscribed:hover {
    background-color: #28a745;
    border-color: #28a745;
}

/* Newsletter Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: var(--light-teal);
    border-radius: 12px 12px 0 0;
}

.modal-title {
    color: var(--biotech-primary);
    font-weight: 600;
    font-size: 1.5rem;
}

.modal-body {
    padding-left: 2rem;
    padding-right: 2rem;
}

.modal-footer {
    background: transparent;
    border-radius: 0 0 12px 12px;
}

/* Enhanced form controls in modal */
.modal .form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.modal .form-control-lg:focus {
    border-color: var(--biotech-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.1);
}

.modal .form-control.is-valid {
    border-color: #28a745;
    background-image: none;
}

.modal .form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* Modal form control placeholders - lighter grey */
.modal .form-control::placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.modal .form-control::-webkit-input-placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.modal .form-control::-moz-placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.modal .form-control:-ms-input-placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

/* Modal buttons */
.modal .btn-primary {
    background-color: #03a87c !important;
    border-color: #03a87c !important;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal .btn-primary:hover:not(:disabled) {
    background-color: #028a66 !important;
    border-color: #028a66 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3, 168, 124, 0.3);
}

.modal .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.modal .btn-outline-secondary {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    font-size: 1rem;
}

/* Loading animation */
.btn-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success animation */
.alert-success {
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Improved form styling for different form instances */
.beehiiv-subscribe-form[data-form-id="main"] .input-group {
    max-width: 400px;
    margin: 0 auto;
}

.beehiiv-subscribe-form[data-form-id="post"] .input-group {
    width: 100%;
}

.beehiiv-subscribe-form[data-form-id="cta"] {
    display: inline-block;
}

/* Responsive modal */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 1rem;
        max-width: none;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal .form-control-lg {
        font-size: 1rem;
        padding: 0.625rem 0.875rem;
    }
}

/* Hover effects for subscribe buttons */
.newsletter-subscribe-btn {
    transition: all 0.3s ease;
}

.newsletter-subscribe-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(3, 168, 124, 0.3);
}

/* Focus states */
.newsletter-email-input:focus {
    border-color: var(--biotech-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.1);
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Close button styling */
.modal .close {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.modal .close:hover {
    opacity: 1;
}

/* Form label improvements */
.modal .form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.modal .text-muted {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Newsletter icon in modal */
.modal-title .fas {
    font-size: 1.2rem;
}

/* Gradient background for CTA section */
.bg-lightblue {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%) !important;
    border: 1px solid #0ea5e9;
    border-radius: 12px;
}

/* Explicit fix: always keep the inner border grey between input and button, even on focus */
.beehiiv-subscribe-form .input-group .btn,
.beehiiv-subscribe-form .input-group .btn:focus,
.beehiiv-subscribe-form .input-group .btn:active {
    border-left: 1px solid #dee2e6 !important;
    border-right: none !important;
    box-shadow: none !important;
}
.beehiiv-subscribe-form .input-group .form-control,
.beehiiv-subscribe-form .input-group .form-control:focus,
.beehiiv-subscribe-form .input-group .form-control:active {
    border-right: none !important;
    box-shadow: none !important;
    outline: none !important;
}
.beehiiv-subscribe-form .input-group:focus-within .btn {
    border-left: 1px solid #dee2e6 !important;
}