/**
 * Professional Header & Footer Styles for SpeedRead Theme
 * Modern, clean, responsive design
 */

/* === HEADER STYLES === */
.site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%) !important;
  box-shadow: 0 4px 25px rgba(79, 70, 229, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header .container {
  padding: 0 1rem;
}

/* Ensure header background is applied */
header.site-header,
#masthead.site-header,
.site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%) !important;
  min-height: 70px;
}

/* Navigation Styles */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  position: relative;
}

.nav__logo {
  flex-shrink: 0;
}

.custom-logo {
  max-width: 200px;
  max-height: 100px;
  width: auto;
  height: auto;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 8px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-logo:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nav__logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.nav__logo-link:hover {
  transform: scale(1.05);
  color: rgba(255, 255, 255, 0.9);
}

.nav__site-title {
  background: linear-gradient(45deg, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* Mobile Toggle Button */
.nav__toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav__hamburger {
  width: 24px;
  height: 2px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* Menu Styles */
.nav__menu-wrap {
  display: flex;
  align-items: center;
}

.nav__menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav__menu li {
  position: relative;
}

.nav__menu a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav__menu a:hover,
.nav__menu a:focus {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav__menu a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav__menu a:hover::before {
  width: 80%;
}

/* Search Styles */
.nav__item--search {
  margin-left: 1rem;
}

.nav__search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 0.5rem 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav__search:focus-within {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav__search-field {
  background: none;
  border: none;
  color: white;
  font-size: 0.9rem;
  width: 200px;
  outline: none;
}

.nav__search-field::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.nav__search-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.nav__search-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* === FOOTER STYLES === */
.site-footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grain)"/></svg>') repeat;
    opacity: 0.3;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-title {
    color: #f7fafc;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 2rem;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 1px;
}

/* Column 1: About */
.footer-about {
    text-align: center;
}

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

.footer-logo .custom-logo,
.footer-custom-logo {
    max-height: 80px;
    max-width: 250px;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
}

.footer-logo-link {
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.footer-site-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.footer-site-title a {
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    color: #cbd5e0;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.footer-tagline {
    color: #a0aec0;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-style: italic;
}

.footer-social {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Columns 2-4: Links */
.footer-links,
.footer-books {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-books li {
    margin-bottom: 0.75rem;
}

.footer-links a,
.footer-books a {
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-links a::before,
.footer-books a::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
    color: #667eea;
}

.footer-links a:hover,
.footer-books a:hover {
    color: #f7fafc;
    padding-left: 1.5rem;
}

.footer-links a:hover::before,
.footer-books a:hover::before {
    opacity: 1;
}

/* Top Books Column Special Styling */
.footer-books li {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-books li:last-child {
    border-bottom: none;
}

.footer-books a {
    display: block;
    padding: 0.25rem 0 0.25rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    line-height: 1.3;
}

.footer-books a:hover {
    background: rgba(102, 126, 234, 0.1);
    padding-left: 1.5rem;
}

/* Remove view count styling - no longer needed */

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.footer-copyright {
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Footer SEO Article Section */
.footer-seo-article {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.footer-seo-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ec4899);
}

.seo-article-content {
    position: relative;
    z-index: 1;
}

.seo-article-title {
    color: #f7fafc;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.seo-article-text {
    color: #cbd5e0;
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: justify;
}

.seo-article-text:last-child {
    margin-bottom: 0;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-about {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-about {
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-links,
    .footer-books {
        text-align: center;
    }
    
    .footer-links li,
    .footer-books li {
        text-align: center;
    }
    
    .footer-logo .custom-logo,
    .footer-custom-logo {
        max-height: 70px;
        max-width: 200px;
    }
    
    .footer-site-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-container {
        padding: 0 1rem;
    }
    
    .site-footer {
        padding: 2rem 0 1rem;
    }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .custom-logo {
    max-width: 150px;
    max-height: 75px;
  }
  
  .nav__toggle {
    display: flex;
  }
  
  .nav__menu-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    pointer-events: none;
  }
  
  .nav__menu-wrap.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  .nav__menu {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }
  
  .nav__menu li {
    width: 100%;
  }
  
  .nav__menu a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1001;
  }
  
  .nav__item--search {
    margin-left: 0;
    margin-top: 1rem;
  }
  
  .nav__search {
    width: 100%;
    justify-content: center;
  }
  
  .nav__search-field {
    width: 100%;
    max-width: 200px;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-widget {
    padding: 0.5rem;
    text-align: center;
  }
  
  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .custom-logo {
    max-width: 120px;
    max-height: 60px;
  }
  
  .nav {
    padding: 0.75rem 0;
  }
  
  .nav__logo-link {
    font-size: 1.25rem;
  }
  
  .nav__search-field {
    width: 150px;
    min-height: 44px; /* Touch-friendly */
  }
  
  .nav__toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
  }
  
  .nav__menu a {
    padding: 1.2rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .site-footer {
    padding: 2rem 0 1rem;
  }
  
  .footer-widgets {
    gap: 1rem;
  }
  
  .footer-container {
    padding: 0 1rem;
  }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
  .custom-logo {
    max-width: 100px;
    max-height: 50px;
  }
  
  .nav {
    padding: 0.5rem 0;
  }
  
  .nav__logo-link {
    font-size: 1.1rem;
  }
  
  .nav__search-field {
    width: 120px;
  }
  
  .footer-container {
    padding: 0 0.5rem;
  }
  
  .site-footer {
    padding: 1.5rem 0 1rem;
  }
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999999;
  padding: 8px 16px;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  left: 6px;
  top: 7px;
}

/* Screen Reader Text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
