@import "common.css";
@import '../blueimp/css/blueimp-gallery.min.css';

/*
 * Custom CSS for Primaria Odobesti Website
 * A modern Bootstrap 5 template
 */

:root {
  /* Primary colors based on original site */
  --primary-color: #1e73be;
  --primary-dark: #165a96;
  --primary-light: #3a8fd6;
  --secondary-color: #9e9e9e;
  --accent-color: #f2f2f2;
  --text-color: #333333;
  --light-text: #ffffff;
  --dark-text: #000000;
  --link-color: #1e73be;
  --link-hover: #165a96;
  --border-color: #dee2e6;
  --header-bg: #f8f9fa;
  --footer-bg: #212529;
}

/* General Styles */
body {
  font-family: 'Trebuchet MS', 'Helvetica', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: #fff;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

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

.text-primary {
  color: var(--primary-color) !important;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Header Styles */
header {
  > .container {
    background-image: url('/images/header-bg.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center right;
  }
}

.logo img {
  max-height: 100px;
}

/* Top Bar */
.top-bar {
  font-size: 0.9rem;
}

.top-bar .dropdown-toggle {
  background-color: transparent;
  border: none;
  padding: 0;
  color: var(--light-text);
}

.top-bar .dropdown-toggle:hover,
.top-bar .dropdown-toggle:focus {
  background-color: transparent;
  color: var(--light-text);
  text-decoration: underline;
}

/* Navigation */
.navbar {
  padding: 0;
}

/* Hamburger Icon Styling */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  margin-right: 1rem;
  color: var(--light-text);
  background-color: transparent;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler-icon {
  width: 1.5em;
  height: 1.5em;
}

/* Mobile Menu Styling */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 80vh;
    overflow-y: auto;
    transition: all 0.3s ease;
  }

  .navbar-collapse.show {
    display: block;
  }

  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    background-color: var(--primary-dark);
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .navbar-nav .dropdown-item {
    color: var(--light-text);
    padding: 0.75rem 1.5rem;
  }

  .navbar-nav .dropdown-item:hover,
  .navbar-nav .dropdown-item:focus {
    background-color: var(--primary-light);
  }

  .dropdown-submenu .dropdown-menu {
    margin-left: 1rem;
  }
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem 1.5rem;
  font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff;
  background-color: var(--primary-dark);
}

.dropdown-menu {
  border-radius: 0;
  margin-top: 0;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 0.5rem 1.5rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--primary-light);
  color: white;
}

/* Dropdown Submenu */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
}

/* Desktop Navigation - Hover-based dropdowns */
@media (min-width: 992px) {
  .navbar-dark .navbar-nav .dropdown-menu {
    display: none;
    position: absolute;
  }

  .navbar-dark .navbar-nav .dropdown:hover > .dropdown-menu {
    display: block;
  }

  .navbar-dark .navbar-nav .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }
}

/* Hero Slider */
#heroSlider .carousel-item {
  height: 400px;
  background-color: #000;
}

#heroSlider .carousel-item img {
  object-fit: cover;
  height: 100%;
  opacity: 0.7;
}

#heroSlider .carousel-caption {
  bottom: 20%;
}

#heroSlider .carousel-caption h2 {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#heroSlider .carousel-caption p {
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Main Content */
.section-title {
  font-weight: 700;
  color: var(--primary-color);
  border-bottom-color: var(--primary-color) !important;
}

/* News Cards */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
}

.news-date {
  position: absolute;
  top: 10px;
  right: 10px;
}

.card-title {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

.card-text {
  color: #666;
}

/* Sidebar */
.sidebar .card-header {
  font-weight: 700;
}

.sidebar .list-group-item {
  border-left: none;
  border-right: none;
  padding: 0.75rem 1.25rem;
}

.sidebar .list-group-item:first-child {
  border-top: none;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
}

footer h5 {
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--light-text);
}

footer a {
  color: var(--light-text);
}

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

.social-links a {
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-links a:hover {
  transform: scale(1.2);
  color: var(--primary-light) !important;
  text-decoration: none;
}

/* Accessibility Widget */
.accessibility-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.accessibility-widget .btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .navbar-dark .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }

  #heroSlider .carousel-item {
    height: 300px;
  }

  #heroSlider .carousel-caption h2 {
    font-size: 2rem;
  }
}

@media (max-width: 767.98px) {
  .logo img {
    max-height: 80px;
  }

  #heroSlider .carousel-item {
    height: 250px;
  }

  #heroSlider .carousel-caption h2 {
    font-size: 1.75rem;
  }

  #heroSlider .carousel-caption p {
    font-size: 1rem;
  }

  .card-img-top {
    height: 180px;
  }
}

@media (max-width: 575.98px) {
  .logo img {
    max-height: 60px;
  }

  #heroSlider .carousel-item {
    height: 200px;
  }

  #heroSlider .carousel-caption {
    bottom: 10%;
  }

  #heroSlider .carousel-caption h2 {
    font-size: 1.5rem;
  }

  .card-img-top {
    height: 160px;
  }
}

/* High Contrast Mode (for accessibility) */
body.high-contrast {
  background: black;
  color: white;
}

body.high-contrast a,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6 {
  color: yellow !important;
}

body.high-contrast .card,
body.high-contrast .navbar,
body.high-contrast .dropdown-menu,
body.high-contrast footer {
  background: black !important;
  color: white !important;
}

body.high-contrast .btn {
  background: white !important;
  color: black !important;
  border: 2px solid yellow !important;
}

/* Link Highlighting (for accessibility) */
body.highlight-links a {
  text-decoration: underline !important;
  font-weight: bold !important;
}

/* Font Size Adjustments (for accessibility) */
body.font-large {
  font-size: 120%;
}

body.font-larger {
  font-size: 150%;
}

body.font-largest {
  font-size: 200%;
}

body.grayscale {
  filter: grayscale(100%);
}

.alert {
  p:first-of-type {
    display: inline;
  }
}


/* Mobile Push Sidebar */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: #ffffff;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1040; /* above content, below modal */
  overflow-y: auto;
}

.mobile-sidebar-body {
  padding: 0.5rem 0;
  overflow-y: scroll;
  height: calc(100vh - 63px);
}

.mobile-nav-link {
  padding: 0.75rem 1rem;
  color: var(--dark-text);
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-link:hover, .mobile-nav-link:focus {
  text-decoration: none;
  background: var(--accent-color);
}

.toggle-submenu {
  color: var(--primary-color);
  text-decoration: none;
}

.mobile-submenu {
  display: none;
  padding-left: 1rem;
  background: #fafafa;
}

.mobile-nav-item.open > .mobile-submenu {
  display: block;
}

.mobile-submenu-link {
  display: block;
  padding: 0.5rem 1rem 0.5rem 1.5rem;
  color: var(--text-color);
}

.mobile-submenu-link:hover, .mobile-submenu-link:focus {
  background: #f1f1f1;
  text-decoration: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1030;
}

/* Push effect */
body.sidebar-open {
  transform: translateX(280px);
  overflow: hidden;
  transition: transform 0.3s ease;
}

body.sidebar-open .mobile-sidebar {
  @media screen and (min-width: 992px) {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  }
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 992px) {
  .mobile-sidebar, .sidebar-overlay {
    display: none !important;
  }

  body.sidebar-open {
    transform: none;
    overflow: auto;
  }
}

.detail-carousel {
  .carousel-item {
    height: 100% !important;

    &:before {
      display: none;
    }
  }
}
