/* ===== navbar.css (Mobile-Friendly Improved) ===== */

/* ============================================= */
/* Basic Reset */
/* ============================================= */
/* Ensure consistent box sizing and body styling for full height layout */



html, body {
  font-family: Arial, sans-serif;
}

/* Main content area styling for full height layout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Full viewport height */
}



/* ============================================= */
/* Top Fixed Header Bar (if used) */
/* ============================================= */
.header {
  height: 70px;
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
  overflow: hidden;
}

.header iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Page wrapper uses flex to push footer down */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;	/* Key: full viewport height */
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================= */
/* Main Content Area (Below Header) */
/* ============================================= */
/* Main content grows to fill available space */
.hario-main-content {
  flex: 1 1 auto;              /* Grow to fill space, push footer down */
  position: relative;
  margin-top: 70px;             /* Space for fixed navbar */
  overflow-y: auto;             /* Allow scrolling if inner content is very long */
  -webkit-overflow-scrolling: touch;
}

/* Iframe should fill the hario-main-content completely */
.hario-main-content iframe {
  width: 100%;
  height: 100%;						/* Critical: iframe fills its container */
  min-height: 100%;             /* Extra push */
  border: none;
  display: block;
}

/* ============================================= */
/* Navbar Styles (Desktop + Mobile) */
/* ============================================= */

/* Navbar (keep most of your existing styles) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: white;            /* or your color */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  position: relative;
  min-width: 900px;             /* desktop min-width */
}

/* Logo */
.navbar-logo {
  flex-shrink: 0;
}

.navbar-logo img {
  max-height: 60px;
}

/* Desktop Navigation Links */
.navbar-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
  transition: all 0.3s ease;
}

.navbar-links li a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 16px;
}

.navbar-links li a:hover {
  color: #007BFF;
}

/* Mobile Menu Toggle (Hamburger Icon) */
.navbar-toggle {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  cursor: pointer;
  position: absolute;
  right: 20px;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 3px 0;
  transition: 0.3s;
}

/* ============================================= */
/* Mobile Responsive Styles (Optimized for Mobile-Friendliness) */
/* ============================================= */

@media screen and (max-width: 768px) {
  .navbar {
    position: relative;          /* creates a new stacking context for the whole navbar */
    z-index: 1000;               /* high enough to stay above main content */
  }
  /* 1. Container no longer enforces a 900px min-width on mobile */
  .navbar-container {
    position: relative;
    z-index: 1001;
    justify-content: space-between; /* Logo on left, toggle on right */
    align-items: center;
    min-width: auto;
    padding: 10px 15px;
  }
  .navbar-toggle {
    z-index: 1002;               /* hamburger always clickable */
    display: flex;
  }

  /* 2. Hide desktop-style horizontal nav links by default */
  .navbar-links {
    position: absolute;
    top: 100%; /* Just below the fixed 70px header */
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: #ffffff;
    width: 100%;
    text-align: left; /* Better for mobile readability */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease; /* smoother feel */
    
    /* Starting state (hidden) */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;           /* Prevent interaction when closed */
    
    gap: 0;
    padding: 0;
    border-top: 1px solid #eee;

    /* 👇 Hidden by default, shown when .active class is added (via JS) */
    display: none;
    z-index: 1001;               /* menu above iframe when open */
    /* Optional but recommended: make sure it doesn't get cut off */
    max-height: calc(100vh - 70px); /* adjust 70px if your header/nav height is different */
    overflow-y: auto;
  }



  /* 3. Show nav links when .active class is toggled (by JavaScript) */
  .navbar-links.active {
    display: flex; /* 👈 This makes the menu appear */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* 4. Style each nav item for mobile: better spacing, touch targets */
  .navbar-links li {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .navbar-links li:last-child {
    border-bottom: none;
  }

  .navbar-links li a {
    display: block;
    padding: 15px 20px; /* 👈 Important: Larger touch target (recommended ≥44px height) */
    font-size: 16px; /* Slightly larger than 14px for mobile readability */
    color: #333;
    text-decoration: none;
    font-weight: 500;
  }

  .navbar-links li a:hover {
    background-color: #f8f8f8;
    color: #007BFF;
  }

  /* 5. Show the hamburger menu button on mobile */
  .navbar-toggle {
    display: flex; /* 👈 Show hamburger icon */
    order: 2;
    right: 15px;
  }

  /* 6. Hamburger Animation: Rotate lines for open/close effect */
  .navbar-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .navbar-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* 7. (Optional) Further reduce font if needed */
  /* .navbar-links li a { font-size: 14px; } */ /* Uncomment if you want smaller text */
  /* Force iframe to stay below nav layers */
  body {
    position: relative;
  }
  .hario-main-content {
    margin-top: 60px;          /* Slightly reduce if your mobile navbar is shorter */
  }

  .hario-main-content iframe {
    width: 100% !important;
    min-height: calc(100vh - 60px - 50px); /* Rough: navbar + footer estimate */
  }
  /* Optional: give body/html a stacking helper */
  
  footer {
    font-size: 10px;
    padding: 10px;
  }

  /* Help with iOS safe areas */
  .page-wrapper {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Rest of your navbar styles (logo, links desktop, hamburger animation, etc.) */
  
/* Optional: prevent scrolling of background when menu is open */
	body.menu-open {
	  overflow: hidden;
	}

}

/* Footer – always at bottom */
footer {
  flex-shrink: 0;
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #666;
  width: 100%;
  background: #ffffff;         /* I don't want it visible */
}