/* CSS Variables */
:root {
  /* Colors */
  --brand-red: #b30115;
  --brand-red-dark: #8b010f;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --black: #000000;
  
  /* Typography */
  --font-cabin: 'Cabin', sans-serif;
  --font-poppins: 'Poppins', sans-serif;
  --font-pt-serif: 'PT Serif', serif;
  --font-inter: 'Inter', sans-serif;
  
  /* Spacing */
  --container-max-width: 1152px;
  --section-padding-desktop: 96px 64px;
  --section-padding-tablet: 64px 32px;
  --section-padding-mobile: 48px 16px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  font-size: 16px;
  /* ENHANCED: Prevent bounce/overscroll behavior */
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
  /* Prevent iOS bounce */
  -webkit-overflow-scrolling: touch;
  position: relative;
}

body {
  font-family: var(--font-inter);
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* ENHANCED: Prevent bounce/overscroll behavior */
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
  /* Prevent mobile pull-to-refresh */
  overflow-x: hidden;
  /* Force hardware acceleration for smooth scrolling */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
}

/* RED CAMOUFLAGE BORDER - Keep for safety */
.red-camouflage-border {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  height: 2px !important;
  background-color: #b30115 !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  /* Enhanced positioning to cover bounce effects */
  min-height: 2px !important;
  max-height: 2px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--brand-red);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
}

h3 {
  font-size: 1.875rem;
  font-weight: 700;
}

h4 {
  font-size: 1.5rem;
  font-weight: 600;
}

p {
  margin-bottom: 1em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}

/* Utility Classes */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* NEW: Clean Header Section - NO NAVIGATION */
.header-section {
  background: var(--white);
  padding: 2rem 1rem;
}

.header-content {
  text-align: center;
}

/* NEW: Responsive Main Title */
.main-title {
  font-family: var(--font-cabin);
  font-weight: 700;
  color: var(--brand-red);
  letter-spacing: 0.1em;
  user-select: none;
  /* Base size (mobile) - equivalent to text-3xl */
  font-size: 3rem;
  /* Remove any possible outlines, borders, or focus styles */
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  background: transparent !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* NEW: Responsive title sizing - 3xl → 4xl → 5xl progression */
@media (min-width: 768px) {
  .main-title {
    font-size: 3.5rem; /* 4xl equivalent */
  }
}

@media (min-width: 1024px) {
  .main-title {
    font-size: 4rem; /* 5xl equivalent */
  }
}

/* Prevent any pseudo-elements that could create lines */
.main-title::before,
.main-title::after {
  display: none !important;
  content: none !important;
}

/* Force remove focus/hover/active states on main title */
.main-title:focus,
.main-title:hover,
.main-title:active,
.main-title:visited {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  background: transparent !important;
}

/* Research Section */
.research-section {
  background: var(--white);
  padding: 2rem 1rem;
}

.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-image-container {
  position: relative;
}

.hero-image-wrapper {
  margin-top: 1.5rem;
  aspect-ratio: 4/5;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: -2.5rem;
  left: 0;
  right: 0;
}

.overlay-content {
  background: rgba(229, 231, 235, 0.65);
  padding-top: 1.2rem;
  padding-right: 1.2rem;
  padding-bottom: 0.2rem;
  padding-left: 1.2rem;
  backdrop-filter: blur(4px);
}

.overlay-text {
  font-family: var(--font-poppins);
  font-weight: 600;
  color: var(--gray-800);
  font-size: 1rem;
  line-height: 1.4;
}

.research-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* NEW: Alignment class for adjusted overlay - MATCHES YOUR OVERLAY POSITION */
.research-content-aligned {
  /* Align with your adjusted overlay position (top: -1.5rem) */
  margin-top: -1.5rem; /* Base alignment */
}

.content-block h3 {
  font-family: var(--font-pt-serif);
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.content-block p {
  color: var(--gray-600);
  line-height: 1.6;
}

/* Timeline Section */
.timeline-section {
  background: var(--gray-50);
  padding: var(--section-padding-desktop);
}

.section-header {
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--font-poppins);
  font-weight: 700;
  color: var(--black);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-family: var(--font-poppins);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 1.25rem;
}

.timeline-container {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4rem;
  padding: 4rem;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
}

.timeline-item-wide {
  grid-column: span 1;
}

.timeline-icon {
  width: 48px;
  height: 48px;
  background: var(--brand-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-icon svg {
  width: 24px;
  height: 24px;
  color: var(--white);
}

.timeline-content h3 {
  font-family: var(--font-cabin);
  font-weight: 600;
  color: var(--black);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.timeline-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-details p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
}

/* Researchers Section */
.researchers-section {
  background: var(--white);
  padding: var(--section-padding-desktop);
}

.researchers-section h2 {
  font-family: var(--font-poppins);
  font-weight: 700;
  color: var(--black);
  font-size: 2rem;
  margin-bottom: 3rem;
}

.researchers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.researcher-card {
  position: relative;
}

.researcher-image {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.profile-image {
  width: 256px;
  height: 256px;
  border-radius: 50%;
  object-fit: cover;
}

.researcher-bio {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.researcher-header h3 {
  font-family: var(--font-cabin);
  font-weight: 700;
  color: var(--black);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.researcher-title {
  font-family: var(--font-cabin);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 1.125rem;
  margin: 0;
}

.researcher-content p {
  color: var(--gray-600);
  line-height: 1.6;
  font-size: 0.875rem;
}

.bio-link {
  color: inherit;
  text-decoration: underline;
  transition: color var(--transition-normal);
}

.bio-link:hover,
.bio-link:focus {
  color: var(--brand-red);
}

.bio-link-footer {
  color: var(--black);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-normal);
  margin: 0;
}

.bio-link-footer:hover {
  color: var(--brand-red);
}

/* Partners Section */
.partners-section {
  background: var(--white);
  padding: var(--section-padding-desktop);
}

.partners-section h2 {
  font-family: var(--font-poppins);
  font-weight: 700;
  color: var(--black);
  font-size: 2rem;
  margin-bottom: 3rem;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.upper-partners {
  margin-bottom: 5rem;
}

.lower-partners {
  margin-bottom: 5rem;
}

.partner-card {
  text-align: center;
}

.partner-card h3 {
  font-family: var(--font-cabin);
  font-weight: 600;
  color: var(--black);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.partner-logo {
  background: var(--gray-800);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.partner-logo img {
  width: 100%;
  height: auto;
  max-width: 12rem;
}

.nunnery-logo {
  width: 8rem;
  height: 6rem;
}

.partner-link {
  color: var(--black);
  text-decoration: underline;
  transition: color var(--transition-normal);
}

.partner-link:hover,
.partner-link:focus {
  color: var(--brand-red);
}

.ahrc-logo {
  display: flex;
  justify-content: center;
}

.ahrc-logo img {
  height: 5rem;
  width: auto;
}

/* Footer */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 4rem 1rem 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-section h4 {
  font-family: var(--font-inter);
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: transform var(--transition-normal);
}

.social-link:hover {
  transform: scale(1.1);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--black);
  text-decoration: none;
  transition: color var(--transition-normal);
  font-size: 0.875rem;
}

.footer-link:hover,
.footer-link:focus {
  color: var(--brand-red);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-section {
    padding: 1.5rem 2rem;
  }
  
  .research-section,
  .timeline-section,
  .researchers-section,
  .partners-section {
    padding: var(--section-padding-tablet);
  }
  
  .timeline-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .timeline-item-wide {
    grid-column: span 2;
  }
  
  .timeline-container {
    padding: 2rem;
    border-radius: 3rem;
  }
}

@media (max-width: 768px) {
  .header-section {
    padding: 1rem;
  }
  
  .research-section,
  .timeline-section,
  .researchers-section,
  .partners-section {
    padding: var(--section-padding-mobile);
  }
  
  .research-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-image-wrapper {
    aspect-ratio: 3/4;
  }
  
  .overlay-text {
    font-size: 1rem;
  }
  
  .timeline-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .timeline-item-wide {
    grid-column: span 1;
  }
  
  .timeline-container {
    padding: 1.5rem;
    border-radius: 2rem;
  }
  
  .researchers-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .profile-image {
    width: 192px;
    height: 192px;
  }
  
  .researcher-bio {
    padding: 1.5rem;
  }
  
  .partners-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .section-subtitle {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .hero-image-wrapper {
    aspect-ratio: 4/5;
  }
  
  .timeline-container {
    padding: 1rem;
    border-radius: 1.5rem;
  }
  
  .researcher-bio {
    padding: 1rem;
  }
  
  .footer {
    padding: 2rem 1rem;
  }
}

/* Standard anchor link behavior */
a[href^="#"]:not([href="#"]) {
  color: inherit;
  text-decoration: none;
}

a[href^="#"]:not([href="#"]):hover {
  color: var(--brand-red);
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus,
[role="button"]:focus,
[role="link"]:focus {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* Prevention of focus outline on non-interactive elements */
h1,
h2,
h3,
h4,
h5,
h6,
.main-title,
div:not([tabindex]),
span:not([tabindex]),
p:not([tabindex]) {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Specifically target any possible focus states */
h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus,
.main-title:focus,
div:focus:not([tabindex]),
span:focus:not([tabindex]),
p:focus:not([tabindex]) {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Print styles */
@media print {
  * {
    background: white !important;
    color: black !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-overlay .overlay-content {
    background: rgba(0, 0, 0, 0.9);
  }
  
  .overlay-text {
    color: white;
  }
  
  .timeline-container {
    background: white;
    border: 2px solid black;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* BOUNCE EFFECT PREVENTION - Enhanced CSS */
@media screen {
  /* Target all scroll containers to prevent bounce */
  body,
  html,
  #root,
  .App,
  [data-react-root] {
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    overscroll-behavior-x: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Prevent mobile pull-to-refresh */
  body {
    position: relative;
    overflow-x: hidden;
  }
  
  /* Prevent any element from causing bounce effects */
  * {
    overscroll-behavior: inherit;
  }
}

/* WEBKIT SPECIFIC bounce prevention */
@supports (-webkit-appearance: none) {
  body,
  html {
    -webkit-overflow-scrolling: touch;
    overflow: auto;
    height: 100%;
  }
}
