/* Responsive CSS for ibericonogueira.com */

/* Base mobile styles (up to 576px) */
@media (max-width: 576px) {
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  /* Mobile Navigation - Keep menu visible and allow wrapping */
  .nav-wrapper {
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center; /* Center items when wrapped */
  }

  .logo {
    margin-bottom: var(--spacing-sm); /* Add space below logo when wrapped */
    width: 100%; /* Allow logo to take full width if needed */
    text-align: center; /* Center logo text */
  }

  .nav-menu {
    /* Remove fixed positioning and hiding */
    /* position: fixed; */
    /* top: 0; */
    /* right: -100%; */
    /* width: 80%; */
    /* height: 100vh; */
    /* background-color: var(--primary-color); */
    /* color: var(--secondary-color); */
    flex-direction: row; /* Keep horizontal layout */
    flex-wrap: wrap; /* Allow menu items to wrap */
    justify-content: center; /* Center menu items */
    align-items: center;
    /* transition: right var(--transition-medium); */
    /* box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3); */
    /* z-index: 1000; */
    /* padding: 50px 0; */
    display: flex; /* Ensure flex display is always applied */
    /* visibility: hidden; */ /* Remove hiding */
    /* opacity: 0; */ /* Remove hiding */
    width: 100%; /* Take full width */
    padding: 0; /* Reset padding */
    gap: var(--spacing-sm); /* Add gap between items */
  }
  
  /* Remove active state styles */
  /* .nav-menu.active { */
    /* right: 0; */
    /* visibility: visible; */
    /* opacity: 1; */
  /* } */
  
  .nav-item {
    margin: 0; /* Remove vertical margin */
    width: auto; /* Adjust width */
    text-align: center;
  }
  
  .nav-link {
    /* color: var(--secondary-color); */ /* Color handled in main.css */
    font-size: 0.9rem; /* Adjust font size if needed */
    padding: 5px 10px; /* Adjust padding */
    display: inline-block; /* Change display */
    width: auto;
  }
  
  /* .nav-link:hover, 
  .nav-link.active {
    color: var(--accent-color);
  } */
  
  /* .nav-link::after {
    background-color: var(--accent-color);
  } */
  
  /* Remove menu toggle display */
  /* .menu-toggle {
    display: block;
    z-index: 1001;
    position: relative;
    cursor: pointer; 
  } */
  
  /* Remove menu toggle bar styles */
  /* .menu-toggle .bar { ... } */
  /* .menu-toggle.active .bar { ... } */
  /* .menu-toggle.active .bar:nth-child(1) { ... } */
  /* .menu-toggle.active .bar:nth-child(2) { ... } */
  /* .menu-toggle.active .bar:nth-child(3) { ... } */
  
  /* Remove overlay */
  /* body.menu-open::before { ... } */
  
  /* Hero Section */
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  /* Footer */
  .footer-content {
    flex-direction: column;
  }
  
  .footer-column {
    width: 100%;
    margin-bottom: var(--spacing-md);
  }
  
  /* Store Page */
  .product-card {
    margin-bottom: 30px;
  }
  
  .category-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    justify-content: flex-start;
  }
  
  /* Book Page */
  .book-formats {
    flex-direction: column;
  }
  
  .format-option {
    margin-bottom: 10px;
    text-align: center;
  }
  
  .book-actions {
    flex-direction: column;
  }
  
  .book-actions .btn {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* Media Page */
  .media-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .media-tab {
    padding: 15px 20px;
  }
  
  /* Publishing Page */
  .submission-form {
    padding: 20px;
  }
  
  /* Contact Page */
  .contact-info-card {
    margin-top: 30px;
  }
  
  .social-links-large {
    justify-content: center;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .container {
    max-width: 540px;
  }
  
  .footer-content {
    flex-wrap: wrap;
  }
  
  .footer-column {
    width: 50%;
    margin-bottom: var(--spacing-md);
  }
  
  /* Mobile Navigation - Keep menu visible and allow wrapping */
  .nav-wrapper {
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center; /* Center items when wrapped */
  }

  .logo {
    margin-bottom: var(--spacing-sm); /* Add space below logo when wrapped */
    width: 100%; /* Allow logo to take full width if needed */
    text-align: center; /* Center logo text */
  }

  .nav-menu {
    /* Remove fixed positioning and hiding */
    flex-direction: row; /* Keep horizontal layout */
    flex-wrap: wrap; /* Allow menu items to wrap */
    justify-content: center; /* Center menu items */
    display: flex; /* Ensure flex display is always applied */
    width: 100%; /* Take full width */
    padding: 0; /* Reset padding */
    gap: var(--spacing-sm); /* Add gap between items */
  }
  
  /* Remove active state styles */
  /* .nav-menu.active { ... } */
  
  .nav-item {
    margin: 0; /* Remove vertical margin */
    width: auto; /* Adjust width */
  }
  
  .nav-link {
    font-size: 0.9rem; /* Adjust font size if needed */
    padding: 5px 10px; /* Adjust padding */
    display: inline-block; /* Change display */
    width: auto;
  }
  
  /* Remove menu toggle display */
  /* .menu-toggle { ... } */
  
  /* Remove menu toggle active styles */
  /* .menu-toggle.active .bar { ... } */
  
  /* Remove overlay */
  /* body.menu-open::before { ... } */
  
  /* Store Page */
  .category-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .category-tab {
    margin-bottom: 10px;
  }
  
  /* Media Page */
  .media-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    max-width: 720px;
  }
  
  /* Navigation - Ensure full menu is visible and wraps */
  .nav-wrapper {
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center; /* Center items when wrapped */
  }

  .logo {
    margin-bottom: var(--spacing-sm); /* Add space below logo when wrapped */
    width: 100%; /* Allow logo to take full width if needed */
    text-align: center; /* Center logo text */
  }

  .nav-menu {
    /* Remove fixed positioning and hiding */
    flex-direction: row; /* Keep horizontal layout */
    flex-wrap: wrap; /* Allow menu items to wrap */
    justify-content: center; /* Center menu items */
    display: flex; /* Ensure flex display is always applied */
    width: 100%; /* Take full width */
    padding: 0; /* Reset padding */
    gap: 15px; /* Keep original gap or adjust */
  }
  
  .nav-item {
    margin: 0; /* Remove vertical margin */
    width: auto; /* Adjust width */
  }

  .nav-link {
    padding: 10px; /* Keep original padding or adjust */
    display: inline-block; /* Change display */
    width: auto;
  }
  
  /* Remove menu toggle display */
  /* .menu-toggle { ... } */
  
  /* Remove mobile navigation for tablets section */
  /* @media (max-width: 991.98px) { ... } */
  
  /* Store Page */
  .product-card {
    height: calc(100% - 30px);
    margin-bottom: 30px;
  }
  
  /* Book Page */
  .book-meta {
    flex-wrap: wrap;
  }
  
  /* Media Page */
  .media-tab {
    padding: 15px 20px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  /* Restore default navigation layout for larger screens */
  .nav-wrapper {
    flex-wrap: nowrap; /* Prevent wrapping */
    justify-content: space-between; /* Original layout */
  }

  .logo {
    margin-bottom: 0; /* Remove bottom margin */
    width: auto; /* Reset width */
    text-align: left; /* Reset text align */
  }

  .nav-menu {
    flex-direction: row; /* Ensure horizontal layout */
    flex-wrap: nowrap; /* Prevent wrapping */
    justify-content: flex-end; /* Align to the right */
    width: auto; /* Reset width */
    gap: 20px; /* Original gap */
  }

  .nav-item {
    margin-left: var(--spacing-md); /* Restore original margin */
  }

  .nav-link {
    padding: 0; /* Reset padding */
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .container {
    max-width: 960px;
  }
  
  /* Navigation */
  .nav-menu {
    gap: 20px;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

/* Responsive grid columns */
@media (min-width: 576px) {
  .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  
  .offset-sm-1 { margin-left: 8.333333%; }
  .offset-sm-2 { margin-left: 16.666667%; }
  .offset-sm-3 { margin-left: 25%; }
  .offset-sm-4 { margin-left: 33.333333%; }
  .offset-sm-5 { margin-left: 41.666667%; }
  .offset-sm-6 { margin-left: 50%; }
  .offset-sm-7 { margin-left: 58.333333%; }
  .offset-sm-8 { margin-left: 66.666667%; }
  .offset-sm-9 { margin-left: 75%; }
  .offset-sm-10 { margin-left: 83.333333%; }
  .offset-sm-11 { margin-left: 91.666667%; }
}

@media (min-width: 768px) {
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  
  .offset-md-1 { margin-left: 8.333333%; }
  .offset-md-2 { margin-left: 16.666667%; }
  .offset-md-3 { margin-left: 25%; }
  .offset-md-4 { margin-left: 33.333333%; }
  .offset-md-5 { margin-left: 41.666667%; }
  .offset-md-6 { margin-left: 50%; }
  .offset-md-7 { margin-left: 58.333333%; }
  .offset-md-8 { margin-left: 66.666667%; }
  .offset-md-9 { margin-left: 75%; }
  .offset-md-10 { margin-left: 83.333333%; }
  .offset-md-11 { margin-left: 91.666667%; }
}

@media (min-width: 992px) {
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  
  .offset-lg-1 { margin-left: 8.333333%; }
  .offset-lg-2 { margin-left: 16.666667%; }
  .offset-lg-3 { margin-left: 25%; }
  .offset-lg-4 { margin-left: 33.333333%; }
  .offset-lg-5 { margin-left: 41.666667%; }
  .offset-lg-6 { margin-left: 50%; }
  .offset-lg-7 { margin-left: 58.333333%; }
  .offset-lg-8 { margin-left: 66.666667%; }
  .offset-lg-9 { margin-left: 75%; }
  .offset-lg-10 { margin-left: 83.333333%; }
  .offset-lg-11 { margin-left: 91.666667%; }
}

/* Responsive utility classes */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
}

/* Responsive text alignment */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

@media (min-width: 576px) {
  .text-sm-center { text-align: center !important; }
  .text-sm-left { text-align: left !important; }
  .text-sm-right { text-align: right !important; }
}

@media (min-width: 768px) {
  .text-md-center { text-align: center !important; }
  .text-md-left { text-align: left !important; }
  .text-md-right { text-align: right !important; }
}

@media (min-width: 992px) {
  .text-lg-center { text-align: center !important; }
  .text-lg-left { text-align: left !important; }
  .text-lg-right { text-align: right !important; }
}

/* Responsive spacing */
.mb-sm { margin-bottom: var(--spacing-sm) !important; }
.mb-md { margin-bottom: var(--spacing-md) !important; }
.mb-lg { margin-bottom: var(--spacing-lg) !important; }

.mt-sm { margin-top: var(--spacing-sm) !important; }
.mt-md { margin-top: var(--spacing-md) !important; }
.mt-lg { margin-top: var(--spacing-lg) !important; }

@media (max-width: 576px) {
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  .mb-lg {
    margin-bottom: var(--spacing-md);
  }
  
  .mt-lg {
    margin-top: var(--spacing-md);
  }
  
  /* Form elements */
  .form-field {
    flex-direction: column;
  }
  
  .form-field input {
    margin-bottom: 10px;
    width: 100%;
  }
  
  .form-field button {
    width: 100%;
  }
  
  /* Newsletter form */
  .newsletter-form {
    padding: 0 10px;
  }
}

/* Responsive images */
.img-fluid {
  max-width: 100%;
  height: auto;
  width: 100%;
  object-fit: contain;
}

/* Touch-friendly elements for mobile */
@media (max-width: 768px) {
  .btn, 
  .nav-link,
  .social-link,
  .category-tab,
  .format-option,
  .custom-file-upload {
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  input, 
  select, 
  textarea {
    font-size: 16px; /* Prevent zoom on focus in iOS */
  }
  
  /* Improve form usability on mobile */
  .form-control {
    padding: 12px 15px;
  }
}

/* Hide scrollbar for cleaner mobile experience */
@media (max-width: 576px) {
  ::-webkit-scrollbar {
    display: none;
  }
  
  body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  
  /* Adjust animations for better performance on mobile */
  .reveal, 
  .reveal-left, 
  .reveal-right, 
  .reveal-delay-1, 
  .reveal-delay-2, 
  .reveal-delay-3 {
    transition-duration: 0.5s;
  }
}

/* Fix for fixed elements on iOS */
@supports (-webkit-touch-callout: none) {
  .nav-container {
    position: sticky;
  }
  
  /* Remove fixed positioning for nav-menu on iOS */
  /* .nav-menu { */
    /* position: fixed; */
    /* height: 100%; */
    /* height: -webkit-fill-available; */
  /* } */
}

/* Improve accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Remove additional styles for menu toggle */
/* .menu-toggle { ... } */
/* .menu-toggle .bar { ... } */


/* Hide Store navigation item */
.nav-menu a[href="store.html"] {
    display: none !important;
}

/* Navigation bar style to match old design */
.nav-container {
    background-color: transparent !important;
}

.nav-container .logo,
.nav-container .nav-link,
.nav-container .bar {
    color: #000 !important;
    fill: #000 !important;
}

.nav-container.scrolled {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.nav-container.scrolled .logo,
.nav-container.scrolled .nav-link,
.nav-container.scrolled .bar {
    color: #000 !important;
    fill: #000 !important;
}

/* Remove text shadow on navigation items */
.nav-container .logo,
.nav-container .nav-link,
.nav-container .bar,
.nav-container.scrolled .logo,
.nav-container.scrolled .nav-link,
.nav-container.scrolled .bar {
    text-shadow: none !important;
}

/* Invert logo image color */
.nav-container .logo img,
.nav-container.scrolled .logo img {
    filter: invert(1) !important;
}
