/* Custom serif font configuration */
:root {
  --pico-font-family-serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
  --pico-font-family: var(--pico-font-family-serif);
}

/* Prevent site title from wrapping */
nav ul li strong {
  white-space: nowrap;
}

/* Workaround for Pico CSS nav underline issue: https://github.com/picocss/pico/discussions/686 */
nav li a[aria-current="page"] {
      text-decoration: underline;
}

/* Responsive Navigation with Fixed Hamburger Menu - Hybrid Solution */

/* Compensate for fixed navigation */
body > header {
  padding-top: 80px;
}

/* Fixed navigation with responsive behavior */
nav {
  background-color: var(--pico-card-background-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  overflow: hidden;
  align-items: center;
  border-bottom: var(--pico-border-width) solid var(--pico-border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Add responsive horizontal padding to match Pico container behavior */
  padding-left: var(--pico-spacing);
  padding-right: var(--pico-spacing);
}

/* Hide the menu toggle checkbox */
nav .menu-btn {
  display: none;
  cursor: pointer;
  user-select: none;
}

/* Hamburger menu icon - hidden by default on larger screens */
nav .menu-icon {
  display: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
  user-select: none;
}

/* Unicode hamburger icon styling */
nav .menu-icon .nav-icon {
  font-size: 1.8em;
  color: var(--pico-color);
  line-height: 1;
}

/* Prevent menu text from wrapping before mobile breakpoint */
nav ul li a {
  white-space: nowrap;
}

/* Mobile responsive behavior */
@media (width < 60em) {
  /* Show hamburger menu on mobile */
  nav .menu-icon {
    display: flex;
  }
  
  /* Enable flex wrap for mobile layout */
  nav {
    flex-wrap: wrap;
  }
  
  /* Style mobile menu */
  nav > ul.menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    background-color: var(--pico-card-background-color);
  }
  
  /* Menu items styling for mobile */
  nav > ul.menu li {
    width: 100%;
  }
  
  nav > ul.menu li a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pico-border-color);
    transition: background-color 0.2s ease;
  }
  
  nav > ul.menu li a:hover {
    background-color: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
  }
  
  nav > ul.menu li:last-child a {
    border-bottom: none;
  }
  
  /* Show menu when checkbox is checked - using sibling selector for better browser support */
  nav .menu-btn:checked ~ ul.menu {
    max-height: 100vh;
  }
  
  /* Simple visual feedback when menu is open - change hamburger to X */
  nav .menu-btn:checked + .menu-icon .nav-icon {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
  }
}

/* Desktop behavior - ensure menu items are displayed normally */
@media (width >= 60em) {
  nav > ul.menu {
    display: flex !important;
    position: static;
    background: none;
    border: none;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
  
  /* Hide hamburger menu on desktop */
  nav .menu-icon {
    display: none;
  }
}

/* Responsive Newsletter Archive Table */
.newsletter-archive {
  margin: var(--pico-spacing) 0;
}

/* Desktop: Normal table display */
@media (width >= 60em) {
  .newsletter-archive table {
    width: 100%;
  }
}

