/* ====== Базові стилі ====== */
body {
    font-family: 'Poppins', sans-serif;
    background: #f6fafd;
    color: #1a2536;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}


h1, h2, h3 {
    font-weight: 600;
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ====== Navbar ====== */
header {
  /* Змінено: завжди фіксований, без приховування */
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 2px 16px rgba(37,99,235,0.07), 0 1px 4px rgba(0,0,0,0.04);
  transition: background 0.25s, box-shadow 0.25s, transform 0.3s ease;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0;
  padding: 8px 18px;
  min-height: 58px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px #2563eb11;
}
.logo img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
  background: #eaf6fb;
  box-shadow: 0 1px 4px rgba(37,99,235,0.08);
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.nav-links a {
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1.04rem;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  color: #1a2536;
  position: relative;
}
.nav-links a:not(.btn-primary):hover,
.nav-links a:not(.btn-primary):focus {
  background: #eaf2f8;
  color: #2563eb;
  box-shadow: 0 2px 8px #2563eb11;
}
.nav-links .btn-primary {
  margin-left: 8px;
  margin-right: 0;
  font-size: 1.04rem;
  padding: 8px 22px;
}

.nav-toggle {
  display: none;
}
.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
}
.nav-toggle-label span,
.nav-toggle-label span:before,
.nav-toggle-label span:after {
  display: block;
  background: #2563eb;
  height: 4px;
  width: 28px;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s;
}
.nav-toggle-label span:before,
.nav-toggle-label span:after {
  content: '';
  position: absolute;
}
.nav-toggle-label span:before {
  top: -9px;
}
.nav-toggle-label span:after {
  top: 9px;
}

/* --- Mobile --- */
@media (max-width: 700px) {
  .navbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2563eb;
  }

  .logo img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
    background: #eaf6fb;
    box-shadow: 0 1px 4px rgba(37,99,235,0.08);
    margin: 0; 
  }

  .nav-links {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    padding: 16px 0;
    box-shadow: 0 4px 24px #2563eb11;
    border-radius: 0 0 16px 16px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s ease, opacity 0.35s ease;
    z-index: 99;
  }

  .nav-links a {
    padding: 16px 28px;
    font-size: 1.08rem;
    border-radius: 0;
    border-bottom: 1px solid #eaf2f8;
  }
  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links .mobile-reset {
    margin: 0;
    padding: 16px 28px;
    font-size: 1.08rem;
    border-radius: 0;
    background: none;
    color: #1a2536;
    box-shadow: none;
  }

  .nav-links .mobile-reset:hover,
  .nav-links .mobile-reset:focus {
    background: #eaf2f8;
    color: #2563eb;
    box-shadow: 0 2px 8px #2563eb11;
  }

  .nav-toggle {
    display: block;
    position: absolute;
    right: 18px;
    top: 16px;
    width: 38px;
    height: 38px;
    opacity: 0;
    z-index: 100;
  }

  .nav-toggle-label {
    display: flex;
    position: absolute;
    right: 8px;
    top: 10px;
    z-index: 101;
    cursor: pointer;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle-label span,
  .nav-toggle-label span:before,
  .nav-toggle-label span:after {
    display: block;
    background: #2563eb;
    height: 4px;
    width: 28px;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
  }

  .nav-toggle-label span:before,
  .nav-toggle-label span:after {
    content: '';
    position: absolute;
  }

  .nav-toggle-label span:before {
    top: -9px;
  }
  .nav-toggle-label span:after {
    top: 9px;
  }

  /* відкриття/закриття меню */
  .nav-toggle:checked ~ .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
  }
  .nav-toggle:checked + .nav-toggle-label span:before {
    transform: rotate(45deg);
    top: 0;
  }
  .nav-toggle:checked + .nav-toggle-label span:after {
    transform: rotate(-45deg);
    top: 0;
  }
}

/* ====== Hero ====== */
.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('/src/assets/images/hero_bg.webp') center center/cover no-repeat;
    margin-bottom: 0;
    overflow: hidden;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 40, 80, 0.38);
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px 80px 20px;
    color: #fff;
    max-width: 520px;
    margin: 0 auto;
    animation: fadeInUp 1.2s cubic-bezier(.4,0,.2,1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: none;}
}

.hero-text h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 18px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.18);
    letter-spacing: 1px;
}

.hero-text p {
    font-size: 1.18rem;
    color: #eaf6fb;
    margin-bottom: 32px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.13);
}

.btn-primary, a.btn-primary, button.btn-primary {
  background: rgba(248, 250, 252, 0.65); 
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  color: #2563eb;
  font-size: 1.07em;
  padding: 12px 28px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none; 
  display: inline-block;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    transform 0.32s cubic-bezier(.4,2,.6,1),
    box-shadow 0.18s;
  outline: none;
  box-shadow: 0 2px 8px #2563eb11;
  margin-right: 8px;
  backdrop-filter: blur(8px) saturate(1.4); 
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
}
.btn-primary:hover, a.btn-primary:hover, button.btn-primary:hover {
  background: rgba(224, 231, 239, 0.82);
  color: #1d4ed8;
  border-color: #a5b4fc;
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 18px #2563eb22;
}
.btn-primary:active, a.btn-primary:active, button.btn-primary:active {
  transform: translateY(2px) scale(0.97);
  transition: transform 0.32s cubic-bezier(.4,2,.6,1);
}
.btn-primary:last-child, a.btn-primary:last-child, button.btn-primary:last-child {
  margin-right: 0;
}

/* ====== Page header ====== */
.page-header{
  position: relative;
  overflow: visible;
  padding: 50px 20px;
  max-width: 1200px;
  margin: 0 auto 56px;
  text-align: center;
  pointer-events: none; 
}
.page-header p {
    font-size: 1.2rem;       
    max-width: 700px;        
    margin: 0 auto;          
    line-height: 1.7;        
    color: #374151;         
    font-weight: 400;
}

/* LEFT soft blob */
.page-header::before{
  content: "";
  position: absolute;
  z-index: 0;
  left: -12%;
  top: -18%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle at 30% 30%,
    rgba(37,99,235,0.14) 0%,
    rgba(165,180,252,0.06) 30%,
    rgba(255,255,255,0) 65%);
  filter: blur(44px);
  transform: rotate(-8deg);
  border-radius: 42% 58% 50% 50% / 45% 40% 60% 55%;
  pointer-events: none;
}

/* RIGHT soft blob */
.page-header::after{
  content: "";
  position: absolute;
  z-index: 0;
  right: -8%;
  top: -6%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at 70% 30%,
    rgba(34,84,189,0.10) 0%,
    rgba(127,179,255,0.04) 35%,
    rgba(255,255,255,0) 68%);
  filter: blur(36px);
  transform: rotate(12deg);
  border-radius: 50% 40% 60% 45% / 55% 45% 60% 40%;
  pointer-events: none;
}


.page-header-inner{
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 28px 44px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.82));
  backdrop-filter: blur(6px) saturate(1.06);
  -webkit-backdrop-filter: blur(6px) saturate(1.06);
  box-shadow: 0 18px 42px rgba(9,30,66,0.08);
  pointer-events: auto;
  max-width: 92%;
  text-align: center;
}

/* Heading */
.page-header-inner h2{
  margin: 0 0 10px;
  font-weight: 800;
  color: #1f4ed8;               
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: -0.6px;
}

/* Accent pill under heading */
.page-header-inner .header-accent{
  margin: 10px auto 14px;
  width: 84px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(28,80,190,0.95) 0%, rgba(96,142,255,0.9) 50%, rgba(167,191,255,0.6) 100%);
  box-shadow: 0 8px 20px rgba(37,99,235,0.08);
}

/* Subtext */
.page-header-inner p{
  margin: 0;
  color: #384452;
  font-size: clamp(0.98rem, 1.8vw, 1.06rem);
  line-height: 1.55;
  max-width: 900px;
}

/* small decorative tilt line (optional, thin) */
.page-header-inner::after {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -36px;
  width: 140px;
  height: 10px;
  background: linear-gradient(90deg, rgba(37,99,235,0.14), rgba(165,180,252,0.06));
  transform: rotate(-10deg);
  border-radius: 999px;
  filter: blur(6px);
  z-index: 1;
  opacity: 0.9;
}

/* Responsive: reduce padding and blob sizes on mobile */
@media (max-width: 900px){
  .page-header{ padding: 56px 14px; margin-bottom: 32px; }
  .page-header::before{ left: -22%; top: -28%; width: 420px; height: 420px; filter: blur(40px); }
  .page-header::after{ right: -16%; top: -2%; width: 260px; height: 260px; filter: blur(30px); }
  .page-header-inner{ padding: 20px 20px; border-radius: 14px; }
  .page-header-inner .header-accent{ width: 56px; height: 6px; }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .page-header::before,
  .page-header::after,
  .page-header-inner::after { transition: none; filter: none; }
}





/* ====== About ====== */
.about-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto 80px auto;
  padding: 0 24px;
}

.about-left {
  flex: 1 1 480px;
}

.about-left h3 {
  font-size: 28px;
  font-weight: 700;
  color: #1a2a40;
  margin-bottom: 16px;
  position: relative;
}

.about-left h3::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #2563eb;
  margin-top: 8px;
  border-radius: 2px;
}

.about-left p {
  font-size: 18px;
  line-height: 1.65;
  color: #333;
  margin-bottom: 18px;
}

.about-left ul {
  margin-top: 12px;
  padding-left: 20px;
}

.about-left ul li {
  margin-bottom: 10px;
  color: #222;
  font-size: 16px;
  position: relative;
  padding-left: 18px;
}

.about-left ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-size: 18px;
  line-height: 1;
}

.about-right {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ====== Schedule ====== */
.schedule {
    background: #fff;
    padding: 38px 20px 28px 20px;
    text-align: center;
    border-radius: 10px;
    margin: 32px 0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.schedule-times p {
    font-size: 1.08rem;
    margin: 10px 0;
    color: #003366;
}

.schedule-times i {
    color: #0077c2;
    margin-right: 8px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 24px;
  margin: 0 auto;
  max-width: 900px;
  padding: 12px 0 32px 0;
}

.schedule-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px #0001;
  padding: 18px 16px 16px 16px;
  min-width: 0;
  min-height: 160px;
  max-height: 200px;
  transform-origin: center center;
  position: relative;
  cursor: pointer;
  transition: 
    transform 0.33s cubic-bezier(.22,1,.36,1),
    box-shadow 0.33s cubic-bezier(.22,1,.36,1),
    z-index 0s;
  border: 2.5px solid var(--card-color, #2563eb);
  outline: none;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.schedule-card-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
  font-size: 1.02em;
  font-weight: 600;
  color: var(--card-color, #2563eb);
}

.schedule-card-title {
  font-size: 1.08em;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.schedule-card-title i {
  font-size: 1.1em;
  color: var(--card-color, #2563eb);
}

.schedule-card-desc {
  font-size: 0.98em;
  color: #334155;
  margin-top: 8px;
  opacity: 0;
  max-height: 0;
  transition: opacity 0.3s, max-height 0.3s;
  overflow: hidden;
}

.schedule-card .calendar-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #f3f6ff;
  color: var(--card-color, #2563eb);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 2px 8px #0001;
  opacity: 0.85;
  transition: background 0.18s, color 0.18s, opacity 0.18s;
}
.schedule-card .calendar-btn:hover {
  background: var(--card-color, #2563eb);
  color: #fff;
  opacity: 1;
}

.schedule-card.active {
  transform: scale(1.1);
  box-shadow: 0 8px 32px #0003, 0 2px 8px #2563eb22;
  z-index: 20;
}
.schedule-card.active .schedule-card-desc {
  opacity: 1;
  max-height: 200px;
}
.schedule-card .event-short,
.schedule-card .schedule-card-desc {
  max-height: 80px;     
  overflow-y: auto;      
  width: 100%;
}
.schedule-card.dimmed {
  filter: blur(1.5px) grayscale(0.2) brightness(0.92);
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
}
.schedule-card-date {
  display: inline-block;
  min-width: 80px;
  transition:
    color 0.18s,
    background 0.18s,
    min-width 0.32s cubic-bezier(.4,2,.6,1),
    padding 0.22s;

}
.schedule-card-header:hover .schedule-card-date,
.schedule-card-header:focus-within .schedule-card-date {
  min-width: 150px;

}

@media (max-width: 700px) {
  .schedule-grid { grid-template-columns: 1fr 1fr; }
  .schedule-card.active { transform: scale(1.15) translateY(-4px);}
}
@media (max-width: 480px) {
  .schedule-grid { grid-template-columns: 1fr; }
  .schedule-card.active { transform: scale(1.03);}
}

/* ====== News ====== */
.news {
  background: #f8fafc;
  padding: 38px 20px 28px 20px;
  border-radius: 10px;
  margin-bottom: 32px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin: 0 auto;
  max-width: 1100px;
  padding: 24px 0;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1), box-shadow 0.3s cubic-bezier(.4, 0, .2, 1);
  min-height: 100%;
}

.news-card:hover,
.news-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.35);
}

.news-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.news-card:active {
  transform: translateY(0) scale(0.99);
}

.news-card-image,
.news-card-placeholder {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.news-card-placeholder {
  background: linear-gradient(135deg, #dbeafe 0%, #e2e8f0 100%);
}

.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px 24px 20px;
}

.news-card-date {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.news-card-title {
  font-size: 1.28rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
}

.news-card-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: #334155;
  margin: 0;
}

.news-card-excerpt {
  font-size: 0.98rem;
  line-height: 1.6;
  color: #475569;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-link {
  margin-top: auto;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.news-card:hover .news-card-link,
.news-card:focus-visible .news-card-link {
  color: #1d4ed8;
}

@media (max-width: 900px) {
  .news-card-body {
    padding: 18px 18px 22px 18px;
  }
  .news-card-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .news {
    padding: 32px 14px;
  }
  .news-card-body {
    gap: 8px;
  }
  .news-card-excerpt {
    -webkit-line-clamp: 4;
  }
}

/* ====== News detail ====== */
.news-detail {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 110px 20px 80px 20px;
}

.news-detail-container {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.news-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #2563eb;
  background: #e2e8f0;
  padding: 10px 18px;
  border-radius: 12px;
  margin-bottom: 28px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.news-back-button:hover,
.news-back-button:focus-visible {
  color: #1d4ed8;
  background: #dbeafe;
  transform: translateX(-2px);
}

.news-detail-article {
  background: #ffffff;
  border-radius: 24px;
  padding: 42px 46px;
  box-shadow: 0 20px 40px rgba(15, 76, 129, 0.08);
}

.news-detail-date {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.news-detail-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 14px 0;
  color: #0f172a;
}

.news-detail-subtitle {
  font-size: 1.2rem;
  color: #334155;
  margin: 0 0 26px 0;
}

.news-detail-hero {
  margin: 0 0 26px 0;
}

.news-hero-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.45), rgba(148, 163, 184, 0.25));
  box-shadow: 0 20px 40px rgba(15, 76, 129, 0.12);
}

.news-hero-figure {
  margin: 0;
  width: 100%;
  height: 100%;
}

.news-hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.news-hero-inner:hover .news-hero-figure img {
  transform: scale(1.02);
}

.news-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  visibility: visible;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.news-hero-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

.news-hero-nav span {
  font-size: 30px;
  line-height: 1;
}

.news-hero-nav.prev { left: 18px; }
.news-hero-nav.next { right: 18px; }

.news-hero-nav:hover,
.news-hero-nav:focus-visible {
  background: rgba(37, 99, 235, 0.85);
}

.news-hero-expand {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.news-hero-expand:hover,
.news-hero-expand:focus-visible {
  background: rgba(37, 99, 235, 0.9);
  transform: scale(1.05);
}

.news-hero-expand[disabled] {
  opacity: 0.6;
  cursor: default;
}

.news-detail-gallery {
  margin: 20px auto 12px auto;
  max-width: 760px;
}

.news-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.news-thumb {
  position: relative;
  width: 115px;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-thumb:hover,
.news-thumb:focus-visible {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.18);
  transform: translateY(-2px);
}

.news-thumb.active {
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.news-lightbox[hidden] {
  display: none;
}

.news-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 32px 20px;
}

.news-lightbox-inner {
  position: relative;
  width: min(100%, 960px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-lightbox-frame {
  margin: 0;
  width: 100%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-lightbox-frame img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 76, 129, 0.4);
  background: #0f172a;
}

.news-lightbox-close,
.news-lightbox-nav {
  position: absolute;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.news-lightbox-close {
  top: -12px;
  right: -12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.news-lightbox-close:hover,
.news-lightbox-close:focus-visible {
  background: rgba(37, 99, 235, 0.95);
  transform: scale(1.04);
}

.news-lightbox-nav {
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  transform: translateY(-50%);
}

.news-lightbox-nav.prev { left: -72px; }
.news-lightbox-nav.next { right: -72px; }

.news-lightbox-nav[disabled] {
  opacity: 0.2;
  cursor: default;
}

.news-lightbox-nav:hover:not([disabled]),
.news-lightbox-nav:focus-visible:not([disabled]) {
  background: rgba(37, 99, 235, 0.85);
  transform: translateY(-50%) scale(1.05);
}

.news-lightbox-counter {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  color: #e2e8f0;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .news-lightbox-nav.prev { left: 12px; }
  .news-lightbox-nav.next { right: 12px; }
}

@media (max-width: 640px) {
  .news-lightbox {
    padding: 24px 12px;
  }
  .news-lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
  .news-lightbox-nav.prev { left: 6px; }
  .news-lightbox-nav.next { right: 6px; }
  .news-lightbox-close {
    top: 8px;
    right: 8px;
  }
  .news-lightbox-counter {
    bottom: -24px;
    font-size: 0.85rem;
  }
}

body.news-lightbox-open {
  overflow: hidden;
}

.news-detail-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2c3a4e;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 28px;
}

.news-detail-content p {
  margin: 0;
}

.news-detail-content a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.news-detail-content strong {
  color: #1f2937;
}

.news-detail-video {
  margin-top: 36px;
}

.news-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(15, 76, 129, 0.1);
}

.news-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.news-video-file {
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(15, 76, 129, 0.1);
  background: #000;
}

.news-detail-error {
  font-size: 1.1rem;
  color: #b91c1c;
  font-weight: 600;
  margin-top: 20px;
}

@media (max-width: 960px) {
  .news-detail-article {
    padding: 36px 32px;
  }
  .news-detail-title {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .news-detail {
    padding: 96px 14px 60px 14px;
  }
  .news-detail-article {
    padding: 28px 22px;
    border-radius: 20px;
  }
  .news-detail-title {
    font-size: 1.74rem;
  }
  .news-hero-inner {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }
  .news-hero-nav {
    width: 40px;
    height: 40px;
  }
  .news-hero-nav.prev { left: 10px; }
  .news-hero-nav.next { right: 10px; }
  .news-hero-expand {
    width: 38px;
    height: 38px;
    bottom: 14px;
    right: 14px;
  }
  .news-thumb {
    width: 92px;
    border-radius: 12px;
  }
  .news-back-button {
    margin-bottom: 22px;
  }
}

@media (max-width: 480px) {
  .news-detail-article {
    padding: 26px 18px;
  }
  .news-detail-title {
    font-size: 1.58rem;
  }
  .news-detail-subtitle {
    font-size: 1.08rem;
  }
  .news-thumb {
    width: 78px;
  }
}

/* ====== Contact ====== */
.contact {
    background: #fff;
    padding: 38px 20px 28px 20px;
    border-radius: 10px;
    margin-bottom: 32px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.contact-content {
    display: flex;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
    align-items: flex-start;
}

.contact-form {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form input,
.contact-form textarea {
    padding: 10px 14px;
    border-radius: 7px;
    border: 1px solid #cce3f6;
    font-size: 1rem;
    background: #f6fafd;
    resize: none;
    transition: border 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border: 1.5px solid #0077c2;
    outline: none;
}

.contact-form button {
    margin-top: 6px;
}

.contact-info {
    flex: 1 1 180px;
    min-width: 160px;
    font-size: 1.03rem;
    color: #003366;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
}

.contact-info i {
    color: #0077c2;
    margin-right: 8px;
}

.map-block {
    margin-top: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,119,194,0.07);
}

/* ====== Footer ====== */
footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 24px;
    margin-top: 40px;
    border-radius: 12px 12px 0 0;
    font-size: 1rem;
}

.footer-content a {
    color: #ddd;
    text-decoration: underline;
    margin: 0 5px;
}

.footer-contacts {
    margin-top: 10px;
}

.footer-extra {
    margin-top: 12px;
}


/* ====== Адаптивність ====== */
@media (max-width: 900px) {
    .about-content,
    .contact-content {
        flex-direction: column;
        gap: 18px;
        align-items: stretch;
    }
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 4px;
    }
    .about-right img {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 600px) {
    .hero-text h1 {
        font-size: 1.3rem;
    }
    .page-header h2 {
        font-size: 1rem;
    }
    .about-right img {
        width: 120px;
        height: 120px;
    }
    .navbar {
        padding: 6px 2px;
    }
    .contact, .news, .schedule {
        padding: 16px 3px 10px 3px;
    }
}

/* Модальне вікно для редагування новини */
.modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(30,34,40,0.32);
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: #fff;
  padding: 32px 24px 24px 24px;
  border-radius: 12px;
  min-width: 320px;
  max-width: 95vw;
  box-shadow: 0 8px 32px rgba(30,34,40,0.18);
  position: relative;
}
.close-modal {
  position: absolute;
  right: 18px; top: 12px;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
.close-modal:hover { color: #2563eb; }

/* ====== Flip-панель ====== */
.admin-flip-container {
  perspective: 1200px;
  width: 100%;
  max-width: 760px;
  margin: 40px auto 0 auto;
  min-height: 520px;
  position: relative;
}
.admin-flip-panel {
  width: 100%;
  min-height: 520px;
  transition: transform 0.7s cubic-bezier(.4,1.6,.4,1);
  transform-style: preserve-3d;
  position: relative;
}
.admin-flip-panel .admin-panel {
  background: #f6f8fa;
  border-radius: 18px;
  box-shadow: 0 4px 24px #0001;
  padding: 32px 24px 24px 24px;
  position: absolute;
  width: 100%;
  min-height: 520px;
  top: 0; left: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}
.admin-panel-calendar {
  transform: rotateY(180deg);
}
.admin-flip-panel.flipped {
  transform: rotateY(180deg);
}
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.flip-btn {
  background: #e3e9f3;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  color: #2563eb;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.3s;
  box-shadow: 0 2px 8px #0001;
}
.flip-btn:hover {
  background: #2563eb;
  color: #fff;
  transform: rotate(180deg) scale(1.08);
}

/* --- Відступи для мобільних пристроїв --- */
@media (max-width: 480px) {
  .news-list,
  .schedule-grid,
  .about,
  .contact,
  .page-header {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  footer {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ==== Mobile: padding for cards (schedule + news) ==== */
@media (max-width: 700px) {

  .schedule .schedule-grid,
  .news .news-list {
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important; 
  }


  .schedule .schedule-grid > .schedule-card,
  .news .news-list > .news-card {
    box-sizing: border-box !important;
    width: auto !important;
  }

  
  .schedule, .news {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ---------- Sanity / Prevent accidental horizontal overflow ---------- */
html, body {
  max-width: 100%;
  overflow-x: hidden; 
}

/* Ensure predictable sizing */
*, *::before, *::after { box-sizing: border-box; }

/* ====== About — mobile-friendly rewrite ====== */
.about-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; 
  justify-content: space-between;    
  gap: 24px;                          
  max-width: 1100px;
  width: 100%;
  margin: 0 auto 56px auto;
  padding-left: 12px !important;    
  padding-right: 12px !important;
  padding-top: 0;
  padding-bottom: 0;
  overflow: visible;
}

/* лівий блок */
.about-left {
  flex: 1 1 320px;  /* дозволяємо звужуватись на вузьких екранax */
  min-width: 180px;
}

/* заголовок секції */
.about-left h3 {
  font-size: 1.6rem;     
  font-weight: 700;
  color: #1a2a40;
  margin-bottom: 10px;
  position: relative;
}

/* accent line */
.about-left h3::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: #2563eb;
  margin-top: 8px;
  border-radius: 2px;
}

/* Коротший параграф - clamp до 3 рядків на десктопі, 4 на мобайлі */
.about-left p {
  font-size: 17px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 14px;

  display: -webkit-box;       /* для Chrome/Safari/Edge */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;   

  display: box;               /* старий синтаксис */
  box-orient: vertical;

  line-clamp: 3;              /* стандартний, поки що експериментальний */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}


/* Список та маркери */
.about-left ul {
  margin-top: 10px;
  padding-left: 20px;
}
.about-left ul li {
  margin-bottom: 10px;
  color: #222;
  font-size: 15.5px;
  position: relative;
  padding-left: 20px;
}
.about-left ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-size: 18px;
  line-height: 1;
}

/* правий блок (зображення) */
.about-right {
  flex: 0 0 240px;    /* фіксована ширина, щоб не тягнути всю строку */
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* зображення в about-right — не виходити за межі */
.about-right img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* ===== Mobile adjustments ===== */
@media (max-width: 900px) {
  .about-content {
    gap: 18px;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-bottom: 40px;
  }
  .about-left p {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
  .about-left h3 { font-size: 1.35rem; }
}

/* На дуже вузьких екранах — стекнути колонки */
@media (max-width: 700px) {
  .about-content {
    flex-direction: column;
    align-items: stretch;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 14px;
  }
  .about-left {
    flex: 1 1 100%;
    min-width: 0;
  }
  .about-left p {
    -webkit-line-clamp: 4;
    line-clamp: 4;  
  }
}

