/* Базовые переменные */
:root {
  --dark-bg: #0d0d0d;
  --darker-bg: #080808;
  --dark-gray: #1a1a1a;
  --medium-gray: #2d2d2d;
  --light-gray: #e0e0e0;
  --accent: #b22222;
  --accent-light: #d63030;
  --accent-dark: #8b0000;
  --text: #ffffff;
  --text-secondary: #cccccc;
  --gold: #d4af37;
  
  
  /* Размеры для адаптации */
  --header-height: 100px;
  --header-height-mobile: 80px;
  --candle-width: 120px;
  --candle-height: 320px;
}

/* Общие стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--dark-bg);
  color: var(--text);
  line-height: 1.7;
  padding-top: var(--header-height);
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка */
.header {
  background: var(--darker-bg);
  padding: 15px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(178, 34, 34, 0.3);
  transition: all 0.3s ease;
}

.header.scrolled {
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.8rem;
  color: var(--text);
  margin: 0;
  font-weight: 700;
  letter-spacing: 1px;
  position: relative;
}

.site-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
}

.site-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
}

.grant-logo {
  height: 50px;
  filter: brightness(0.9);
  transition: all 0.3s ease;
}

.grant-logo:hover {
  filter: brightness(1.1);
}
/* Стили для кликабельного логотипа */
.logo-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: all 0.3s ease;
}

.logo-link:hover .site-title {
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}

.logo-link:hover .site-subtitle::after {
  background: linear-gradient(to right, transparent, var(--accent-light), transparent);
  width: 90%;
}

.header-brand {
  cursor: pointer;
}

.site-title {
  font-size: 2.2rem;
  color: var(--header-text);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(to right, #ffffff, #ffcccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0;
  position: relative;
}

.site-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
  margin-top: 5px;
}

.site-subtitle::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--header-accent), transparent);
}
/* Основной контент */
.hero-page {
  min-height: calc(100vh - var(--header-height) - 100px);
  padding: 40px 0;
}

/* Заголовок героя */
.hero-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.hero-title h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.hero-title p {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* Контейнер для контента */
.hero-content-wrapper {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

/* Информация о герое */
.hero-info {
  flex: 2;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.hero-photo-container {
  flex: 1 0 300px;
  max-width: 100%;
}

.hero-photo {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.hero-photo:hover {
  transform: scale(1.02);
}

.hero-text {
  flex: 2 1 500px;
}

.hero-bio {
  margin-top: 20px;
  padding: 20px;
  background: var(--dark-gray);
  border-radius: 5px;
  line-height: 1.6;
}

.hero-bio h3 {
  margin-bottom: 15px;
  color: var(--accent);
}

/* Свеча памяти */
.hero-candle {
  flex: 0 0 200px;
  position: sticky;
  top: 150px;
  align-self: flex-start;
}

.memorial-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.candle-holder {
  width: var(--candle-width);
  height: var(--candle-height);
  position: relative;
  margin: 0 auto;
}

.candle-holder *,
.candle-holder *:before,
.candle-holder *:after {
  position: absolute;
  content: "";
}

.candle {
  bottom: 0;
  width: var(--candle-width);
  height: calc(var(--candle-height) - 80px);
  border-radius: 150px / 40px;
  box-shadow: 
    inset 20px -30px 50px 0 rgba(0, 0, 0, 0.4), 
    inset -20px 0 50px 0 rgba(0, 0, 0, 0.4);
  background: linear-gradient(#e48825, #e78e0e, #833c03, #4c1a03 50%, #1c0900);
}

.candle:before {
  width: calc(var(--candle-width) - 5px);
  height: 40px;
  border-radius: 50%;
  border: 2px solid #d47401;
  background: radial-gradient(#eaa121, #8e4901 45%, #b86409 80%);
}

.candle:after {
  width: 34px;
  height: 10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  top: 14px;
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.5);
  background: radial-gradient(rgba(0, 0, 0, 0.6), transparent 45%);
}

.thread {  
  width: 6px;
  height: 36px;
  top: -17px;
  left: 50%;
  z-index: 1;
  border-radius: 40% 40% 0 0;
  transform: translateX(-50%);
  background: linear-gradient(#d6994a, #4b232c, #121212, black, #e8bb31 90%);
}

.flame {
  width: 24px;
  height: 120px;
  left: 50%;
  transform-origin: 50% 100%;
  transform: translateX(-50%);
  bottom: 100%;
  border-radius: 50% 50% 20% 20%;
  background: linear-gradient(white 80%, transparent);
  animation: 
    moveFlame 6s linear infinite, 
    enlargeFlame 5s linear infinite,
    flicker 2s ease-in-out infinite;
  box-shadow: 0 0 15px 0 rgba(247, 93, 0, 0.4), 
              0 -6px 4px 0 rgba(247, 128, 0, 0.7);
}

.glow {
  width: 26px;
  height: 60px;
  border-radius: 50% 50% 35% 35%;
  left: 50%;
  top: -48px;
  transform: translateX(-50%);
  background: rgba(0, 133, 255, 0.7);
  box-shadow: 
    0 -40px 30px 0 #dc8a0c, 
    0 40px 50px 0 #dc8a0c, 
    inset 3px 0 2px 0 rgba(0, 133, 255, 0.6), 
    inset -3px 0 2px 0 rgba(0, 133, 255, 0.6);
}

.glow:before {
  width: 70%;
  height: 60%;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}

.blinking-glow {
  width: 100px;
  height: 180px;
  left: 50%;
  top: -55%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--accent-light);
  filter: blur(60px);
  animation: blinkIt 0.1s infinite;
}

.candle-text {
  margin-top: 30px;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.1rem;
  position: relative;
  text-align: center;
}

.candle-text::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

/* Кнопка свечи */
.candle-btn {
  background-color: var(--accent);
  color: var(--text);
  padding: 10px 20px;
  margin-top: 20px;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.candle-btn:hover {
  background-color: var(--accent-light);
}

.candle-counter {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Галерея */
.hero-gallery {
  margin-top: 30px;
  padding: 20px;
  background: var(--dark-gray);
  border-radius: 5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.gallery-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--accent-dark);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-grid img:hover {
  transform: scale(1.03);
}

/* Кнопка возврата */
.back-link {
  text-align: center;
  margin: 40px 0;
}

.back-link a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
}

.back-link a:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
}

/* Футер */
.footer {
  background: var(--darker-bg);
  color: var(--text);
  padding: 40px 0 20px;
  border-top: 1px solid var(--accent-dark);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.org-logo {
  height: 80px;
  transition: all 0.3s ease;
}

.org-logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.footer-contacts {
  text-align: center;
  margin: 20px 0;
}

.footer-contacts p {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.vk-icon {
  width: 48px;
  height: 48px;
  transition: all 0.3s ease;
  filter: brightness(0.9);
}

.vk-icon:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

/* Модальное окно */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--accent);
}

/* Анимации */
@keyframes moveFlame {
  0%, 100% { transform: translateX(-50%) rotate(-2deg); }
  50% { transform: translateX(-50%) rotate(2deg); }
}

@keyframes enlargeFlame {
  0%, 100% { height: 120px; }
  50% { height: 140px; }
}

@keyframes blinkIt {
  50% { opacity: 0.8; }
}

@keyframes flicker {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.7; }
}

/* Адаптивность */
@media (max-width: 1200px) {
  .hero-content-wrapper {
    gap: 30px;
  }
  
  .hero-candle {
    flex: 0 0 180px;
  }
}

@media (max-width: 992px) {
  .hero-content-wrapper {
    flex-direction: column;
  }
  
  .hero-info {
    flex-direction: column;
  }
  
  .hero-photo-container {
    flex: 1 0 100%;
  }
  
  .hero-candle {
    position: relative;
    top: auto;
    order: -1;
    margin-bottom: 30px;
    align-self: center;
  }
  
  .hero-photo {
    max-height: 50vh;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding-top: var(--header-height-mobile);
  }
  
  .header {
    padding: 10px 0;
  }
  
  .site-title {
    font-size: 1.5rem;
  }
  
  .hero-title h1 {
    font-size: 1.8rem;
  }
  
  .hero-title p {
    font-size: 1rem;
  }
  
  .hero-content-wrapper {
    gap: 20px;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  :root {
    --candle-width: 100px;
    --candle-height: 280px;
  }
}

@media (max-width: 576px) {
  .header-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .site-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .hero-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    margin-top: 70px;
  }
  
  .hero-title h1 {
    font-size: 1.5rem;
  }
  
  .hero-bio {
    padding: 15px;
    font-size: 0.95rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
  }
  
  .footer-contacts p {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .hero-title h1 {
    font-size: 1.3rem;
  }
  
  .candle-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  .back-link a {
    font-size: 0.9rem;
  }
}

/* Горизонтальная ориентация для мобильных */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-content-wrapper {
    flex-direction: row;
  }
  
  .hero-info {
    flex-direction: row;
  }
  
  .hero-photo-container {
    flex: 1 0 40%;
  }
  
  .hero-text {
    flex: 1 0 50%;
  }
  
  .hero-candle {
    order: 0;
    margin-bottom: 0;
  }
}

/* Стили для блока наград */
.hero-awards {
    margin-top: 30px;
    padding: 20px;
    background: var(--dark-gray);
    border-radius: 5px;
    border-left: 4px solid var(--accent);
}

.hero-awards h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.awards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.award-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(178, 34, 34, 0.1);
    padding: 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    flex: 1 0 300px;
}

.award-item:hover {
    background: rgba(178, 34, 34, 0.2);
    transform: translateY(-3px);
}

.award-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.award-info h4 {
    color: var(--gold);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.award-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .award-item {
        flex: 1 0 100%;
    }
    
    .award-image {
        width: 50px;
        height: 50px;
    }
}


/* Стили для модального окна наград */
.modal-overlay .award-modal-content {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.modal-overlay .award-modal-content img {
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 15px;
}

.modal-overlay .award-title {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.modal-overlay .award-description {
    color: var(--text);
    font-size: 1.1rem;
}
/* Стили для хроники службы */
.service-history {
    margin-top: 40px;
    padding: 25px;
    background: var(--dark-gray);
    border-radius: 5px;
    border-left: 4px solid var(--accent);
}

.service-history h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
}

.service-timeline {
    position: relative;
    padding-left: 30px;
}

.service-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--accent);
}

.service-item {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(178, 34, 34, 0.3);
}

.service-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.service-date {
    position: relative;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.service-date::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--gold);
}

.service-content h4 {
    color: var(--text);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.service-content p {
    margin: 5px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .service-timeline {
        padding-left: 20px;
    }
    
    .service-date::before {
        left: -25px;
        width: 10px;
        height: 10px;
    }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-modal:hover {
    color: var(--accent);
}

.award-modal-content {
    text-align: center;
    color: white;
    max-width: 90%;
}

.award-title {
    color: var(--gold);
    margin-top: 15px;
    font-size: 1.5rem;
}

.award-description {
    margin-top: 10px;
    font-size: 1.1rem;
}