/* General Styles */
.new-look-banner {
  /*background-color: #18a5de;*/
  text-align: right !important;
  padding-bottom: 10px;
}

.new-look-banner h1 {
  color: white;
  font-weight: 600;
}

.new-look-banner p {
  color: white;
  font-size: 16px;
}

.highlight-article {
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.card.mb-3 {
  background: transparent;
  border: none;
}

.highlight-article img {
  border-radius: 16px;
}

.highlight-article .badge {
  /*background-color: #18a5de;*/
  color: white;
}

.highlight-article .card-title {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 25px;
}

.highlight-article .card-text {
  color: #838383;
  font-size: 14px;
}

.highlight-article .card-text small:first-child {
  color: #18a5de;
}

.article-grid .card img {
  border-radius: 16px;
}

.article-grid .card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  /*background-color: #18a5de;*/
  color: white;
}

.article-grid .card-title {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 20px;
}

.article-grid .card-text {
  color: #838383;
  font-size: 14px;
}

.article-grid .card-text small:first-child {
  color: #18a5de;
  font-size: 14px;
}

.pagination .page-item.active .page-link {
  background-color: #e5e7eb;
  border-radius: 16px;
  padding: 10px 16px;
  margin: 0 5px;
  border: none;
  color: #4b5563;
}

.category-banner {
  /*background-color: #18a5de33;*/
  padding: 40px 80px;
}

.category-banner h3 {
  font-weight: 600;
  font-size: 24px;
  color: #1a1a1a;
  margin-bottom: 20px;
}

.category-banner .badge {
  background-color: white;
  color: #1a1a1a;
  padding: 10px 15px;
  font-size: 14px;
  border-radius: 999px;
}

/* Article Page Styles */
.article-content img {
  border-radius: 16px;
}

.author-section {
  background-color: #f9fafb;
}

.author-section img {
  border-radius: 100px;
}

.latest-posts .list-unstyled img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

img.me-3.author {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.explore-categories .badge {
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 10px 15px;
  font-size: 14px;
  border: 1px solid #dee2e6;
  border-radius: 999px;
}

/* Footer Styles */
.footer {
  /*background-color: #232323;*/
  color: white;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.footer .nav-link {
  color: white;
}

.footer #logo-footer {
  height: 40px;
}

/* Styles for ContentPage images and highlight section */

.highlight-article {
  background: linear-gradient(#daf4ff, #ffffff);
}

.highlight-article img,
.article-grid .card img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center;
}

img.img-fluid.my-3.article {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
}

.card .mb-3 .content {
  border-radius: 16px;
  border: none;
}

.row .px-5 .article-grid {
  background: #ffffff;
}

img.faviconurl {
  max-width: 32px;
  max-height: 32px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Search Bar Styles */
#form_search .input-group {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: stretch;
}

#form_search #base_search {
  flex: 1;
  min-width: 0;
}

#form_search #button_search {
  flex-shrink: 0;
  width: auto;
  min-width: 48px;
  padding: 0.5rem 1rem;
}

#form_search #search_icon {
  width: 18px;
  height: 18px;
}

/* Ensure search bar stays inline on mobile */
@media (max-width: 767.98px) {
  #form_search .input-group {
    height: 48px !important;
  }

  #form_search #base_search {
    font-size: 16px;
  }

  #form_search #button_search {
    min-width: 52px;
  }
}

/* ===========================
   MOBILE RESPONSIVE STYLES
   =========================== */

/* Hamburger Menu */
.navbar-light .navbar-toggler,
.navbar-toggler {
  border: 0px solid #dee2e6 !important;
  padding: 0.42rem 0.6rem;
  background-color: #ffffff !important;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.navbar-toggler:hover {
  transform: translateY(-1px);
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 4px 10px rgba(24, 165, 222, 0.18) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Navigation */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #ffffff;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .navbar-nav {
    text-align: center;
  }

  .nav-item {
    margin: 0.5rem 0;
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
    font-size: 16px;
  }
}

/* Mobile Container Padding */
@media (max-width: 767.98px) {
  .container-fluid.px-5,
  .container.px-5,
  .navbar.px-5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .row.px-5 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* Reduce excessive margins on mobile */
  .mt-4,
  .my-4 {
    margin-top: 1.5rem !important;
  }

  .mb-4,
  .my-4 {
    margin-bottom: 1.5rem !important;
  }

  .mt-5,
  .my-5 {
    margin-top: 2rem !important;
  }

  .mb-5,
  .my-5 {
    margin-bottom: 2rem !important;
  }
}

/* Images - Responsive */
@media (max-width: 767.98px) {
  .highlight-article img,
  .article-grid .card img {
    height: 200px;
  }

  img.img-fluid.my-3.article {
    height: 250px;
  }

  .latest-posts .list-unstyled img,
  img.me-3.author {
    width: 60px;
    height: 60px;
  }

  #logo {
    height: 32px !important;
  }

  .footer #logo-footer {
    height: 32px;
  }
}

/* Typography - Mobile */
@media (max-width: 767.98px) {
  .highlight-article .card-title {
    font-size: 20px;
  }

  .article-grid .card-title {
    font-size: 16px;
  }

  .category-banner h3 {
    font-size: 20px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  .new-look-banner h1 {
    font-size: 1.75rem;
  }

  .new-look-banner p {
    font-size: 14px;
  }
}

/* Category Banner - Mobile */
@media (max-width: 767.98px) {
  .category-banner {
    padding: 20px 15px;
  }

  .category-banner .badge {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Responsive logo styles (appended) */
.brand-logo {
  max-height: 42px; /* default */
  height: auto;
  width: auto;
  display: inline-block;
}

@media (max-width: 991.98px) {
  .brand-logo {
    max-height: 36px;
  }
}

@media (max-width: 575.98px) {
  .brand-logo {
    max-height: 32px;
  }
  /* Slightly tighten navbar padding on small devices to give logo more space */
  .navbar .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .navbar-brand {
    padding: 0;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    max-height: 28px;
  }
}

/* Prefer SVG (scales without losing quality) */
.brand-logo[src$=".svg"] {
  max-height: none;
  height: auto;
}

/* Fallback: override older #logo/#logo-footer rules where present */
#logo,
.footer #logo-footer {
  /*max-height: none !important;*/
  max-height: 4rem;
  height: auto !important;
}

/* Cards - Mobile Stacking */
@media (max-width: 767.98px) {
  .card.mb-3 {
    margin-bottom: 1.5rem !important;
  }

  .article-grid .card {
    margin-bottom: 1.5rem;
  }

  .article-grid .card .badge {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* Footer - Mobile */
@media (max-width: 767.98px) {
  .footer {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    text-align: center;
  }

  .footer .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer .row {
    margin-bottom: 1rem;
  }

  .footer .nav {
    flex-direction: column;
    align-items: center;
  }

  .footer .nav-item {
    margin: 0.25rem 0;
  }

  .footer p {
    font-size: 14px;
    margin-bottom: 0.5rem;
  }
}

/* Forms - Mobile */
@media (max-width: 767.98px) {
  .form-control,
  .form-control-sm,
  textarea.form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .button_contatti,
  button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 16px;
    min-height: 44px; /* Touch-friendly */
  }
}

/* Article Page - Mobile */
@media (max-width: 767.98px) {
  .article-content h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .breadcrumb {
    font-size: 14px;
    padding: 0.5rem 0;
  }

  .author-section {
    padding: 1rem !important;
  }

  .author-section .d-flex {
    flex-direction: column;
    text-align: center;
  }

  .author-section img {
    margin: 0 auto 1rem auto;
  }
}

/* Pagination - Mobile */
@media (max-width: 767.98px) {
  .pagination {
    font-size: 14px;
  }

  .pagination .page-item.active .page-link {
    padding: 8px 12px;
    margin: 0 2px;
  }
}

/* Tables - Mobile Responsive */
@media (max-width: 767.98px) {
  table {
    font-size: 14px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Touch Targets - Minimum 44px */
@media (max-width: 767.98px) {
  .nav-link,
  .btn,
  button,
  a.badge,
  .card-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
  }
}

/* Prevent Horizontal Scroll */
body {
  overflow-x: hidden;
}

.container-fluid,
.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Stock Market - Mobile */
@media (max-width: 767.98px) {
  .row_stockmarket {
    display: none;
  }

  .row_stockmarket_mobile {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem;
  }

  .vl_stockmarket_mobile {
    padding-left: 1rem;
  }

  .data_stockmarket {
    font-size: 14px !important;
    margin-bottom: 0.25rem;
  }

  .simbolo_currency {
    font-size: 14px !important;
  }

  #arrow_up_icon,
  #arrow_down_icon {
    width: 12px;
    height: 12px;
  }
}

/* Ensure proper spacing */
@media (max-width: 767.98px) {
  .col-lg-8,
  .col-lg-4 {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* About viewport wrapper: centers About page content and keeps footer at bottom */
.about-viewport {
  min-height: calc(100vh - 320px); /* reserve header+footer space */
}
