/* ===========================================
   Norwich RNA Club - Stylesheet
   =========================================== */

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --border-color: #e0e0e0;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  line-height: 1.6;
  background: var(--bg-color);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: var(--bg-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 60px;
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.nav a:hover,
.nav a.active {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
  color: white;
  padding: 100px 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(52, 152, 219, 0.3) 0%, rgba(44, 62, 80, 0.5) 100%);
  pointer-events: none;
}

.hero-bg .container {
  position: relative;
  z-index: 1;
}

/* Short Hero for subpages */
.hero-short {
  min-height: 45vh;
}

.hero-short h1 {
  font-size: 2.8rem;
}

.hero-short p {
  font-size: 1.2rem;
}

/* Hero Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.hero-bg h1 {
  animation: fadeInUp 0.8s ease-out;
  font-size: 3.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-bg p {
  animation: fadeInUp 0.8s ease-out 0.2s both;
  font-size: 1.3rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.hero-bg .btn {
  animation: fadeInUp 0.8s ease-out 0.4s both;
  margin: 5px 10px;
}

.hero-bg .btn:hover {
  animation: pulse 0.5s ease-in-out;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* Section */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 50px;
  color: var(--primary-color);
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-top: -40px;
  margin-bottom: 50px;
}

/* Events/Conferences */
.events-grid {
  display: grid;
  gap: 30px;
}

.event-card {
  background: var(--bg-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: 200px 1fr;
  transition: transform 0.3s, box-shadow 0.3s;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.event-card.featured {
  border-left: 4px solid var(--accent-color);
}

.event-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  background: var(--bg-light);
}

.event-content {
  padding: 25px;
}

.event-date {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 15px;
}

.event-card.past .event-date {
  background: var(--text-light);
}

.event-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.event-speaker {
  color: var(--secondary-color);
  font-weight: 500;
  margin-bottom: 5px;
}

.event-affiliation {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.event-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 15px;
}

.event-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-description {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Team Grid */
.team-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.team-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.team-row-leaders {
  padding-bottom: 20px;
  border-bottom: 2px solid var(--bg-light);
}

.team-card {
  text-align: center;
  min-width: 180px;
  max-width: 200px;
}

.team-card img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 4px solid var(--secondary-color);
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}

.team-row-members .team-card img {
  border-color: var(--bg-light);
  width: 120px;
  height: 120px;
}

.team-card h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.team-card .title {
  color: var(--secondary-color);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.team-card .affiliation {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Join Section */
.join-section {
  background: var(--bg-light);
}

.join-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.join-content p {
  margin-bottom: 30px;
  color: var(--text-light);
}

/* Contact Card */
.contact-card {
  background: linear-gradient(135deg, var(--bg-light) 0%, #ffffff 100%);
  padding: 50px;
  border-radius: 20px;
  margin-top: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 40px;
  text-align: left;
}

.contact-logo {
  flex-shrink: 0;
}

.contact-logo img {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.contact-details {
  flex: 1;
}

.contact-message {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 25px;
  line-height: 1.7;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
  color: white;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(52, 152, 219, 0.3);
  margin-bottom: 20px;
}

.email-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
  color: white;
}

.email-icon {
  font-size: 1.3rem;
}

.contact-location,
.contact-events {
  color: var(--text-light);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .contact-card {
    flex-direction: column;
    text-align: center;
    padding: 30px;
    gap: 25px;
  }

  .contact-logo img {
    width: 100px;
    height: 100px;
  }

  .email-btn {
    padding: 12px 25px;
    font-size: 1rem;
  }
}

/* Contact Form */
.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 40px 0;
  text-align: center;
}

.footer p {
  opacity: 0.8;
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: white;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
}

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.about-text p {
  color: var(--text-light);
  margin-bottom: 15px;
}

.about-image {
  display: flex;
  justify-content: center;
}

.about-image img {
  max-width: 320px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 5px solid white;
  transition: transform 0.3s ease;
}

.about-image img:hover {
  transform: scale(1.02);
}

/* Featured Event */
.featured-event {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
  color: white;
  padding: 50px;
  border-radius: 15px;
  margin-bottom: 50px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.featured-event-content {
  flex: 1;
}

.featured-event h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.featured-event h3 {
  font-size: 1.75rem;
  margin-bottom: 15px;
}

.featured-event .speaker {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.featured-event .meta {
  opacity: 0.9;
  margin-bottom: 20px;
}

.featured-event .affiliation {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 15px;
  font-style: italic;
}

.featured-event-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255,255,255,0.3);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.featured-event-avatar:hover {
  transform: scale(1.05);
}

/* Loading */
.loading {
  text-align: center;
  padding: 50px;
  color: var(--text-light);
}

/* Responsive */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero-bg h1 {
    font-size: 4rem;
  }

  .hero-bg p {
    font-size: 1.5rem;
    max-width: 700px;
  }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
}

/* Tablet Landscape / Small Desktop (992px - 1199px) */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }

  .hero-bg {
    min-height: 75vh;
  }

  .hero-bg h1 {
    font-size: 3rem;
  }

  .about-content {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .about-image img {
    max-width: 280px;
  }
}

/* Tablet Portrait (768px - 991px) */
@media (max-width: 991px) {
  .container {
    max-width: 720px;
  }

  .hero-bg {
    min-height: 65vh;
  }

  .hero-bg h1 {
    font-size: 2.5rem;
  }

  .hero-bg p {
    font-size: 1.1rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-text {
    order: 2;
  }

  .about-image {
    order: 1;
  }

  .about-image img {
    max-width: 300px;
  }

  .featured-event {
    padding: 40px;
  }

  .team-row {
    gap: 25px;
  }
}

/* Mobile Landscape / Large Phone (576px - 767px) */
@media (max-width: 767px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  }

  .nav.active {
    display: flex;
  }

  .hero-bg {
    min-height: 70vh;
    background-attachment: scroll;
  }

  .hero-bg h1 {
    font-size: 2.2rem;
  }

  .hero-bg p {
    font-size: 1rem;
    padding: 0 10px;
  }

  .hero-bg .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: 30px;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-image {
    width: 100%;
    height: 200px;
  }

  .featured-event {
    padding: 30px;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .featured-event-avatar {
    width: 120px;
    height: 120px;
    order: -1;
    margin: 0 auto 20px;
  }

  .team-row {
    gap: 20px;
  }

  .team-card {
    min-width: 140px;
    max-width: 160px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

/* Mobile Portrait (max-width: 575px) */
@media (max-width: 575px) {
  .container {
    padding: 0 15px;
  }

  .header .container {
    padding: 10px 15px;
  }

  .logo img {
    height: 50px;
  }

  .hero-bg {
    min-height: 60vh;
  }

  .hero-bg h1 {
    font-size: 1.8rem;
  }

  .hero-bg p {
    font-size: 0.95rem;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .about-image img {
    max-width: 250px;
  }

  .team-row {
    gap: 15px;
  }

  .team-card {
    min-width: 120px;
    max-width: 140px;
  }

  .team-card img {
    width: 100px;
    height: 100px;
  }

  .team-row-members .team-card img {
    width: 90px;
    height: 90px;
  }

  .team-card h3 {
    font-size: 0.95rem;
  }

  .team-card .title,
  .team-card .affiliation {
    font-size: 0.8rem;
  }

  .featured-event {
    padding: 25px 20px;
  }

  .featured-event h3 {
    font-size: 1.4rem;
  }

  .featured-event-avatar {
    width: 100px;
    height: 100px;
  }

  .event-content {
    padding: 20px;
  }

  .event-title {
    font-size: 1.1rem;
  }

  .event-meta {
    flex-direction: column;
    gap: 5px;
  }

  .footer {
    padding: 30px 0;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Small Mobile (max-width: 400px) */
@media (max-width: 400px) {
  .hero-bg {
    min-height: 55vh;
  }

  .hero-bg h1 {
    font-size: 1.5rem;
  }

  .hero-bg .btn {
    display: block;
    margin: 8px auto;
    max-width: 200px;
  }

  .team-card {
    min-width: 100px;
    max-width: 120px;
  }

  .team-card img {
    width: 80px;
    height: 80px;
  }

  .team-row-members .team-card img {
    width: 70px;
    height: 70px;
  }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-bg {
    min-height: 100vh;
    padding: 20px 0;
  }

  .hero-bg h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }

  .hero-bg p {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }

  .section {
    padding: 30px 0;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-bg::before {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Zoomable Images */
.zoomable-image {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zoomable-image:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Image Lightbox Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 1001;
}

.modal-close:hover {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-caption {
  color: #fff;
  text-align: center;
  padding: 15px 20px;
  font-size: 1.1rem;
  max-width: 90%;
  margin-top: 15px;
}

/* Modal responsive styles */
@media (max-width: 767px) {
  .modal-close {
    top: 15px;
    right: 20px;
    font-size: 30px;
  }

  .modal-content {
    max-width: 95%;
    max-height: 70vh;
  }

  .modal-caption {
    font-size: 0.95rem;
    padding: 10px 15px;
  }
}

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

  .back-to-top {
    transition: none;
  }
}

/* Event Card Links */
.event-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.event-card-link:hover {
  color: inherit;
}

.event-card-link:hover .event-card {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.event-card-link .event-title {
  transition: color 0.3s;
}

.event-card-link:hover .event-title {
  color: var(--secondary-color);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.back-to-top:active {
  transform: translateY(0);
}
