/**
 * ============================================
 * LUMO CMS - THEME DEFAULT CSS v1.0
 * Universal Base Styles for All Templates
 * ============================================
 * 
 * This file contains:
 * - Layout structures (header, navigation, footer)
 * - Component base styles
 * - Grid systems
 * - Responsive breakpoints
 * - Animation keyframes
 * - Utility classes
 * 
 * DO NOT modify colors, fonts, or spacing here!
 * Use theme.[template-name].css for customization
 * 
 * @version 1.0
 * @date 2025-11-24
 * @author Lumo CMS Team
 * ============================================
 */

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-normal, 400);
  line-height: var(--line-height-base, 1.6);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sticky Footer Layout */
main {
  flex: 1 0 auto;
  min-height: 0;
  position: relative;
  z-index: 1;
}

footer {
  flex-shrink: 0;
}

/* Body padding per header fisso */
body {
  padding-top: var(--header-height-normal, 100px);
}

/* Hero full-bleed: tira l'hero sotto l'header fisso (solo per pagine con hero image) */
.hero-under-header {
  margin-top: calc(-1 * var(--header-height-normal, 100px));
}

/* ============================================
   HEADER PRO - STRUCTURE
   ============================================ */

.header-pro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--header-padding-normal, 1rem) 0;
  height: var(--header-height-normal, 100px);
  display: flex;
  align-items: center;
}

.header-pro.sticky {
  padding: var(--header-padding-sticky, 0.5rem) 0;
  height: var(--header-height-sticky, 70px);
}

/* Logo Structure */
.header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-logo-img {
  height: var(--logo-height-normal, 60px);
  width: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-pro.sticky .header-logo-img {
  height: var(--logo-height-sticky, 45px);
}

.header-logo-text {
  font-size: var(--logo-text-size-normal, 1.5rem);
  font-weight: var(--logo-text-weight, 700);
  transition: all 0.3s ease;
}

.header-pro.sticky .header-logo-text {
  font-size: var(--logo-text-size-sticky, 1.25rem);
}

/* ============================================
   NAVIGATION - STRUCTURE
   ============================================ */

.header-nav {
  display: flex;
  align-items: center;
}

.header-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--nav-gap, 0.5rem);
}

.header-nav-item {
  position: relative;
}

.header-nav-link {
  display: flex;
  align-items: center;
  padding: var(--nav-link-padding, 0.75rem 1.25rem);
  text-decoration: none;
  font-weight: var(--nav-link-weight, 500);
  font-size: var(--nav-link-size, 0.95rem);
  border-radius: var(--nav-link-radius, 8px);
  transition: all 0.3s ease;
  position: relative;
}

/* Active state underline */
.header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 1.25rem;
  right: 1.25rem;
  height: var(--nav-active-underline-height, 3px);
  border-radius: 2px;
  animation: slideIn 0.3s ease;
}

/* Dropdown Structure */
.header-nav-dropdown {
  position: relative;
}

.header-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: var(--dropdown-min-width, 220px);
  border-radius: var(--dropdown-radius, 12px);
  list-style: none;
  margin: 0.5rem 0 0 0;
  padding: var(--dropdown-padding, 0.5rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.header-nav-dropdown:hover .header-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-dropdown-item {
  display: block;
  padding: var(--dropdown-item-padding, 0.75rem 1rem);
  text-decoration: none;
  font-size: var(--dropdown-item-size, 0.9rem);
  border-radius: var(--dropdown-item-radius, 8px);
  transition: all 0.2s ease;
}

.header-dropdown-item:hover {
  padding-left: 1.25rem;
}

/* Dropdown Arrow */
.dropdown-arrow {
  font-size: var(--font-size-sm, 0.75rem);
  transition: transform 0.3s ease;
}

.header-nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* ============================================
   SOCIAL ICONS - STRUCTURE
   ============================================ */

.header-social {
  display: flex;
  align-items: center;
  gap: var(--social-gap, 1rem);
}

.header-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--social-icon-size, 38px);
  height: var(--social-icon-size, 38px);
  font-size: var(--social-icon-font-size, 1.25rem);
  text-decoration: none;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.header-social-link:hover {
  transform: translateY(-2px);
}

/* Theme Toggle Button */
.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--theme-toggle-size, 38px);
  height: var(--theme-toggle-size, 38px);
  border: 2px solid;
  background: transparent;
  border-radius: 50%;
  font-size: var(--theme-toggle-icon-size, 1.1rem);
  cursor: pointer;
  transition: all 0.3s ease;
}

.header-theme-toggle:hover {
  transform: rotate(20deg);
}

/* Mobile Toggle */
.header-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid;
  background: transparent;
  border-radius: var(--mobile-toggle-radius, 8px);
  cursor: pointer;
  transition: all 0.3s ease;
}

/* ============================================
   MOBILE NAVIGATION - STRUCTURE
   ============================================ */

.mobile-nav-item {
  margin-bottom: 0.25rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: var(--mobile-nav-padding, 1rem);
  text-decoration: none;
  font-weight: var(--mobile-nav-weight, 500);
  border-radius: var(--mobile-nav-radius, 8px);
  transition: all 0.3s ease;
}

.mobile-nav-sublink {
  display: block;
  padding: var(--mobile-subnav-padding, 0.75rem 1rem);
  text-decoration: none;
  font-size: var(--mobile-subnav-size, 0.9rem);
  border-radius: var(--mobile-subnav-radius, 8px);
  transition: all 0.3s ease;
}

.mobile-nav-sublink:hover {
  padding-left: 1.25rem;
}

/* ============================================
   TYPOGRAPHY - STRUCTURE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--heading-weight, 700);
  line-height: var(--heading-line-height, 1.2);
  margin-bottom: 1rem;
}

h1 { font-size: var(--h1-size, 3rem); }
h2 { font-size: var(--h2-size, 2.5rem); }
h3 { font-size: var(--h3-size, 2rem); }
h4 { font-size: var(--h4-size, 1.75rem); }
h5 { font-size: var(--h5-size, 1.5rem); }
h6 { font-size: var(--h6-size, 1.25rem); }

.lead {
  font-size: var(--lead-size, 1.25rem);
  font-weight: var(--lead-weight, 300);
}

/* ============================================
   BUTTONS - STRUCTURE
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--btn-padding, 0.75rem 1.5rem);
  font-size: var(--btn-font-size, 1rem);
  font-weight: var(--btn-weight, 600);
  text-decoration: none;
  border: 2px solid;
  border-radius: var(--btn-radius, 8px);
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 0.5rem;
}

.btn-lg {
  padding: var(--btn-lg-padding, 1rem 2rem);
  font-size: var(--btn-lg-size, 1.125rem);
}

.btn-sm {
  padding: var(--btn-sm-padding, 0.5rem 1rem);
  font-size: var(--btn-sm-size, 0.875rem);
}

/* ============================================
   CARDS - STRUCTURE
   ============================================ */

.card {
  border-radius: var(--card-radius, 12px);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-img-top {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.card-body {
  padding: var(--card-padding, 1.5rem);
}

.card-title {
  font-size: var(--card-title-size, 1.5rem);
  font-weight: var(--card-title-weight, 700);
  margin-bottom: 0.75rem;
}

.card-text {
  font-size: var(--card-text-size, 1rem);
  line-height: var(--card-text-line-height, 1.6);
}

/* ============================================
   ANIMATIONS - KEYFRAMES
   ============================================ */

@keyframes slideIn {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1399px) {
  h1 { font-size: var(--h1-size-xl, 2.75rem); }
  h2 { font-size: var(--h2-size-xl, 2.25rem); }
}

@media (max-width: 1199px) {
  h1 { font-size: var(--h1-size-lg, 2.5rem); }
  h2 { font-size: var(--h2-size-lg, 2rem); }
}

@media (max-width: 991px) {
  h1 { font-size: var(--h1-size-md, 2.25rem); }
  h2 { font-size: var(--h2-size-md, 1.875rem); }
  h3 { font-size: var(--h3-size-md, 1.625rem); }
}

@media (max-width: 767px) {
  h1 { font-size: var(--h1-size-sm, 2rem); }
  h2 { font-size: var(--h2-size-sm, 1.75rem); }
  h3 { font-size: var(--h3-size-sm, 1.5rem); }
  
  body {
    padding-top: var(--header-height-mobile, 80px);
  }
}

@media (max-width: 575px) {
  h1 { font-size: var(--h1-size-xs, 1.75rem); }
  h2 { font-size: var(--h2-size-xs, 1.5rem); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Breadcrumb sizing */
.breadcrumb {
  font-size: 0.875rem;
}

/* Widget content text - adapts to light/dark theme */
.widget-content {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .widget-content {
  color: rgba(255, 255, 255, 0.9);
}

.transition {
  transition: all 0.3s ease;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.box-shadow {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Scroll-based utilities */
.fade-in-up {
  animation: slideUp 0.6s ease;
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: var(--primary-contrast-color, white);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* ============================================
   MOBILE TOGGLE HAMBURGER ICON
   Bootstrap navbar-toggler-icon inside custom header-mobile-toggle
   ============================================ */
.header-mobile-toggle .navbar-toggler-icon {
  display: block;
  width: 1.5em;
  height: 1.5em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='currentColor' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Light mode - dark icon */
.header-mobile-toggle {
  color: var(--nav-link-color, #333);
}

/* Dark mode - light icon */
[data-theme="dark"] .header-mobile-toggle {
  color: var(--nav-link-color, #f8f9fa);
}
