/* Import Google Fonts - Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background: url("../img/background.webp") repeat-y center top;
  background-size: auto;   /* stretches image */
  color: #333;
  line-height: 1.6;
  margin: 0;
}

.container {
  width: 100%;
  max-width: 1100px; /* fixed width as requested */
  margin: 0 auto;
}

/* ========================
   Header / Logo / Nav Menu
   ======================== */
.main-header {
  padding: 10px 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 998;
  background: url("../img/background.png") repeat-y center top;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  max-height: 90px; /* merged from header.css */
  height: auto;
  margin-right: 20px;
  margin-left: 0; /* merged from header.css */
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-menu a {
  text-decoration: none;
  color: #2c2c86;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: #007bff;
}

/* Desktop Header Layout */
@media (min-width: 1025px) {
  .header-container {
    flex-wrap: nowrap;
    align-items: center;
  }

  .nav-menu {
    margin-left: auto;
  }

  .nav-menu ul {
    justify-content: flex-end;
    flex-wrap: nowrap; /* keep all items on one row */
    gap: 16px; /* slightly tighter spacing to fit */
  }

  .nav-menu li {
    flex: 0 0 auto; /* prevent items from shrinking oddly */
    white-space: nowrap; /* avoid breaking labels */
  }

  .nav-menu a {
    font-size: 0.85rem; /* slightly smaller to ensure fit */
  }
  
  .hero-right {
    aspect-ratio: 16/9 !important;
  }
}

/* ========================
   Hamburger Menu Toggle
   ======================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: relative;
}

@media (max-width: 1024px) {
  .menu-toggle {
    z-index: 1001;
    position: relative;
  }
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: #2c2c86;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ========================
   Menu Overlay (Backdrop)
   ======================== */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.menu-overlay.is-active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ========================
   Responsive Design
   ======================== */

/* Tablet Styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
  
  .logo {
    margin-left: 20px;
    max-height: 70px;
  }
  
  /* Show hamburger on tablet */
  .menu-toggle {
    display: flex;
  }
  
  /* Hide desktop nav menu on tablet */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    left: auto;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 80px 20px 20px;
    visibility: hidden;
  }
  
  .nav-menu.is-open {
    right: 0;
    visibility: visible;
  }
  
  .nav-menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    align-items: stretch;
  }
  
  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .nav-menu a {
    display: block;
    padding: 15px 0;
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
  }
  
  .nav-menu .nav-link {
    padding: 15px 0;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-left {
    flex: none;
    margin-bottom: 2rem;
  }
  
  .hero-right {
    flex: none;
    max-width: 100%;
    aspect-ratio: 16/9 !important; /* Maintain 16:9 on tablet */
    width: 100% !important;
  }
  
  .cards {
    gap: 1.5rem;
  }
  
  .card {
    flex: 1 1 280px;
    max-width: 300px;
  }
  
  .category-wrapper {
    gap: 1.5rem;
  }
  
  .category-item {
    flex: 1 1 200px;
    min-width: 200px;
  }
  
  .news-grid {
    gap: 1rem;
  }
  
  .news-card {
    flex: 1 1 200px;
    max-width: 250px;
  }
  
  .footer-content {
    gap: 1.5rem;
  }
  
  .footer-box {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Mobile Styles (max-width: 767px) */
@media (max-width: 767px) {
  .container {
    padding: 0 15px;
  }
  
  .main-header {
    padding: 8px 0;
  }
  
  .header-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    position: relative;
  }
  
  .logo {
    margin: 0;
    max-height: 60px;
  }
  
  /* Show hamburger on mobile */
  .menu-toggle {
    display: flex;
  }
  
  /* Hide desktop nav menu on mobile */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    left: auto;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 80px 20px 20px;
    visibility: hidden;
  }
  
  .nav-menu.is-open {
    right: 0;
    visibility: visible;
  }
  
  .nav-menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    align-items: stretch;
    text-align: left;
  }
  
  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .nav-menu a {
    font-size: 0.9rem;
    padding: 15px 0;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border-radius: 0;
  }
  
  .nav-menu a:hover {
    background: rgba(44, 44, 134, 0.05);
    color: #007bff;
  }
  
  .nav-menu .nav-link {
    padding: 15px 0;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .hero-left {
    flex: none;
  }
  
  .hero-right {
    flex: none;
    max-width: 100%;
    aspect-ratio: 16/9 !important; /* Maintain 16:9 on mobile */
    width: 100% !important;
  }
  
  .hero-badge {
    max-height: 250px;
  }
  
  .features {
    padding: 2rem 1rem;
  }
  
  .cards {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .card {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  
  .category-box {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  
  .category-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .category-item {
    flex: none;
    min-width: auto;
    max-width: 300px;
  }
  
  .category-item img {
    max-width: 120px;
  }
  
  .category-item h3 {
    font-size: 1.4rem;
  }
  
  .news-section {
    padding: 2rem 1rem;
    margin: 1.5rem auto;
  }
  
  .news-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .news-grid {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .news-card {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
  
  .footer {
    padding: 2rem 1rem;
  }
  
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-left {
    flex: none;
  }
  
  .footer-right {
    flex: none;
    justify-content: center;
  }
  
  .footer-box {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
  }
}

/* ===============
   Hero Section
   =============== */
.hero {
  background: #007BFF;
  padding: 4rem 1rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #007BFF;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.3s ease;
}

.btn:hover {
  background: #e0e0e0;
}

.hero-media {
  padding: 2rem 0;
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}

.hero-left {
  flex: 1 1 300px;
  text-align: center;
}

.hero-badge {
  max-width: 100%;
  height: auto;
  max-height: 400px;
}

.hero-right {
  flex: 1 1 600px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  aspect-ratio: 16/9 !important;
  width: 100%;
  max-width: 100%;
}

/* Slider + Hero Enhancements */
/* Hide lazy-loaded content */
.slider-box img[data-src],
.slider-box iframe[data-src] {
  display: none !important;
}

.slider-box .slide {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slider-box .slide.active {
  display: block !important;
}

.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(44, 44, 134, 0.7);
  color: #fff;
  font-size: 2rem;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease;
}

.slider-prev:hover,
.slider-next:hover {
  background: rgba(44, 44, 134, 1);
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.slider-box:hover .slider-prev,
.slider-box:hover .slider-next,
.slider-box:hover .slide-overlay {
  opacity: 1;
  pointer-events: auto;
}

.slide-overlay {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 97%;
  background: rgba(44, 44, 134, 0.7);
  color: white;
  padding: 16px 24px;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  z-index: 5;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  transition: opacity 2s ease, background 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.slide-overlay:hover {
  background: rgba(44, 44, 134, 1);
}

.slide-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Touch controls visible on devices without hover */
@media (hover: none) {
  .slider-prev,
  .slider-next,
  .slide-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* ==================
   Features Section
   ================== */
.features {
  padding: 4rem 1rem;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.cards {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  background: #f1f1f1;
  padding: 2rem;
  border-radius: 8px;
  flex: 1 1 300px;
  max-width: 350px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card h3 {
  margin-bottom: 1rem;
}

/* ==================
   Category Section
   ================== */
.category-box {
  background: #fff;
  margin: 2rem auto;
  padding: 2rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  max-width: 1100px;
}

.category-wrapper {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
  text-align: center;
}

.category-item {
  flex: 1 1 220px;
  min-width: 220px;
}

.category-item img {
  max-width: 150px;
  height: auto;
  margin-bottom: 1rem;
}

.category-item h3 {
  color: #2c2c86;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.category-item ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0;
  margin: 0.5rem 0 0 0;
  list-style: none;
}

.category-item li {
  margin: 0.25rem;
}

.category-item a {
  color: #333;
  text-decoration: underline;
  font-size: 1rem;
}

.category-item a:hover {
  color: #007BFF;
}

/* ==================
   Footer (Merged full footer.css)
   ================== */
.footer {
  background: #727187; /* purple-grey background */
  color: #fff;
  padding: 2rem 0; /* tighter vertical spacing */
}

.footer-content {
  display: flex;
  flex-wrap: nowrap; /* keep columns side-by-side on desktop */
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-kontakt {
  text-decoration: underline;
  font-size: 1.3rem !important;
}

.footer-left {
  flex: 0 0 520px; /* wider left panel */
  text-align: center;
  margin-top: 20px;
}

.footer-heading {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

.footer-left p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.footer-hours,
.footer-address {
  color: #ffffff;
}

.footer-right {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  max-width: 556px; /* smaller right card to complement left width */
  width: 100%;
}

.footer-box {
  background: #ffffff;
  color: #333;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  display: flex;
  gap: 3rem; /* more separation between columns */
  flex: 1;
  justify-content: space-between;
  width: 100%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1) inset; /* subtle edge */
}

.footer-col {
  flex: 0 0 50%; /* two equal columns reaching edges */
}

.footer-col:last-child {
  text-align: left; /* align content to the box's right edge */
  margin-left: 30px;
}

.footer-col p {
  margin: 0 0 1.25rem 0;
  line-height: 1.4;
  font-size: 0.95rem;
}

.footer-col strong {
  display: inline-block;
  margin-bottom: 0.2rem;
  color: #2c2c86;
}

.contact-block {
  margin-bottom: 0.5rem;
}

.label {
  font-weight: bold;
  color: #2c2c86;
  margin-bottom: 0.3rem;
}

.line {
  font-size: 0.95rem;
  line-height: 1.4;
}

.line span {
  font-weight: bold;
  margin-right: 0.25rem;
}

.line.indent span {
  display: none;
}

.line.indent {
  padding-left: 7.3ch;
}

.footer-mail {
  color: #2c2c86;
  text-decoration: none;
}
.footer-mail:hover { text-decoration: underline; }

/* Mobile-only adjustments for category-box (≤768px) */
@media (max-width: 768px) {
  .category-box {
    padding: 0;
    margin: 1.5rem 0;
  }

  .category-box .category-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch;
  }

  .category-box .category-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
  }

  .category-box .category-item img {
    max-width: 72px;
    height: auto;
    margin: 0 auto 8px;
  }

  .category-box .category-item h3 {
    font-size: 1rem;
    margin: 0 0 6px;
  }

  /* collapsed by default; toggled open via .is-open */
  .category-box .category-item ul {
    display: none;
    margin-top: 6px;
    text-align: left;
  }

  .category-box .category-item.is-open ul {
    display: block;
  }

  .category-box .category-item ul li a {
    font-size: 0.95rem;
  }
}

@media (max-width: 620px) {
  .footer-content {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .footer-right {
    justify-content: center;
  }
  .footer-box {
    flex-direction: column;
    align-items: center;
  }
  .footer-col {
    width: 100%;
  }
  .line {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .line span {
    display: block;
    margin-bottom: 0.2rem;
  }
  .line.indent {
    padding: 0;
  }
  .line.indent span {
    display: none;
  }
}

/* ========================
   Responsive Video Embeds
   ======================== */
/* Scope to content areas to avoid interfering with hero/slider iframes */
.post-content iframe[src*="youtube.com"],
.post-content iframe[src*="youtu.be"],
.post-content iframe[src*="vimeo.com"],
.page-container iframe[src*="youtube.com"],
.page-container iframe[src*="youtu.be"],
.page-container iframe[src*="vimeo.com"],
.right-col iframe[src*="youtube.com"],
.right-col iframe[src*="youtu.be"],
.right-col iframe[src*="vimeo.com"],
.left-col iframe[src*="youtube.com"],
.left-col iframe[src*="youtu.be"],
.left-col iframe[src*="vimeo.com"] {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
  max-width: 100%;
}

/* Optional wrapper support if used in markup */
.video-embed {
  max-width: 100%;
  margin: 20px auto;
}
.video-embed iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
}

/* Broader default for embeds placed directly in generic containers (exclude slider) */
:where(main, .container, .content, .post-content, .page-container, .left-col, .right-col) :where(iframe[src*="youtube.com"], iframe[src*="youtu.be"], iframe[src*="vimeo.com"]) {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
}

/* Override any generic rules for slider content - must come after the :where() rule */
.slider-box .slide.active iframe:not([data-src]) {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
  aspect-ratio: unset !important;
  z-index: 2;
  pointer-events: auto;
}

.slider-box .slide.active img:not([data-src]) {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  aspect-ratio: unset !important;
  object-fit: cover;
  object-position: center;
  z-index: 2;
  pointer-events: auto;
}

/* Responsive PDF embeds */
.pdf-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  overflow: hidden;
}

.pdf-embed iframe {
  width: 100% !important;
  max-width: 100%;
  border: 0;
  display: block;
}

/* Responsive PDF embed adjustments */
@media (max-width: 767px) {
  .pdf-embed {
    margin: 15px 0;
  }
  
  .pdf-embed iframe {
    min-height: 400px; /* Minimum readable height on mobile */
  }
}

@media (max-width: 576px) {
  .pdf-embed iframe {
    min-height: 350px;
  }
}
/* ✅ Back button styling */
.post-back {
  margin-top: 25px;
  margin-bottom: 60px;
  text-align: center;
  padding-top: 0;
  border-top: none;
}

.btn-back {
  display: inline-block;
  padding: 12px 30px;
  background: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
}

.btn-back:hover {
  background: #005f87;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
}