/* Base styles for "Русская научная мысль" */

/* Google Fonts Montserrat for modern look */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

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

:root {
  /* Modern Color Palette */
  --primary: #0d47a1;      /* Deep Blue */
  --primary-light: #5472d3;
  --primary-dark: #002171;
  --accent: #ffb300;       /* Amber */
  --accent-light: #ffe54c;
  --accent-dark: #c68400;
  --light: #ffffff;
  --dark: #121212;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-800: #424242;
  --gray-900: #212121;
  
  /* Typography */
  --font-primary: 'Montserrat', sans-serif;
  
  /* Spacing - 8pt grid */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 1rem;    /* 16px */
  --space-4: 1.5rem;  /* 24px */
  --space-5: 2rem;    /* 32px */
  --space-6: 3rem;    /* 48px */
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.10);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--light);
  background-color: var(--gray-100);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-3);
  color: var(--light);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--space-3);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 2px solid transparent;
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
}

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

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

.btn-accent {
  background-color: var(--accent);
  color: var(--dark);
}

.btn-accent:hover {
  background-color: var(--accent-light);
}

.btn-outline {
  background-color: transparent;
  border-color: currentColor;
}

.btn-lg {
  padding: var(--space-3) var(--space-5);
  font-size: 1.125rem;
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: 0.875rem;
}

/* Cards */
.card {
  background-color: var(--light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-normal), 
              box-shadow var(--transition-normal);
  color: var(--gray-900); /* ensure readable text on white backgrounds */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-3);
}

/* Muted text inside cards */
.card .muted {
  color: var(--gray-800);
}

/* High-contrast form controls inside cards */
.card label { color: var(--gray-900); }
.card input,
.card select,
.card textarea {
  color: var(--gray-900);
  background: var(--light);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}
.card input[type="file"] {
  padding: 6px;
  background: var(--light);
}

.card-title {
  margin-top: 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Layout & Section Blocks - Modern UI */
.section {
  padding: var(--space-6) 0;
}
.section--dark {
  background-color: var(--primary-dark);
  color: var(--light);
}
.section-header {
  margin-bottom: var(--space-4);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  text-align: center;
  color: var(--light);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/hero-bg.jpg') center/cover no-repeat;
  opacity: 0.5;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-4);
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-3);
}
.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  max-width: 60ch;
  margin: 0 auto var(--space-4);
}

/* Grid Utilities */
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Tile Component */
.tile {
  background-color: var(--light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.tile-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.tile-body {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tile-title {
  margin: 0 0 var(--space-2);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
}
.tile-text {
  flex: 1;
  margin-bottom: var(--space-3);
  color: var(--gray-800);
}

/* Navbar */
.navbar {
  background-color: var(--light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-dark);
}
.navbar-menu {
  display: flex;
  gap: var(--space-4);
}
.navbar-link {
  color: var(--primary-dark);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.navbar-link:hover {
  color: var(--primary);
}

/* Footer */
.footer {
  background-color: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-6) 0;
}
.footer a {
  color: var(--gray-100);
}
.footer a:hover {
  color: var(--accent);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fadeUp {
  animation: fadeUp var(--transition-normal) forwards;
}

/* Responsive Navbar */
@media (max-width: 768px) {
  .navbar-menu {
    display: none;
  }
}

/* Responsive */
@media (max-width: 992px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* ==== Custom background image ==== */
body {
  /* Set background image for all content below the hero video */
  background: url('../images/202506.png') no-repeat center top fixed;
  background-size: cover;
  background-color: var(--gray-100);
  color: var(--light); /* lighter text for contrast */
}

.section-title,
.section h2,
.section h3,
.section h4,
.section h5,
.news-item h3,
.about-item h3,
.news-date,
.news-excerpt {
  color: var(--light);
}

/* Announcement bar (site-wide) */
.announcement-bar {
  position: relative;
  z-index: 1200; /* above header (1000) and mobile nav (<=900/110) */
  background: var(--accent);
  color: var(--dark);
  padding: var(--space-2) 0;
  box-shadow: var(--shadow-sm);
}
.announcement-bar .container {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}
.announcement-bar .announcement-text {
  font-weight: 600;
  font-size: 1.05rem;
}
.announcement-bar .btn {
  white-space: nowrap;
}

/* Media page gallery */
.media-gallery {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.media-thumb {
  background: var(--light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.media-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.media-thumb .meta {
  padding: var(--space-2) var(--space-3);
  color: var(--gray-800);
}

/* === Override palette: use accent colors globally === */
:root {
  --primary: var(--accent);
  --primary-light: var(--accent-light);
  --primary-dark: var(--accent-dark);
}
