<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Blog</title>
  <link rel="icon" type="image/x-icon" href="/img/logo.png">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet"
    type="text/css" />
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Playfair+Display:700,900" rel="stylesheet">
  <link rel="stylesheet" href="/css/style.css">
</head>
<header class="p-2 fixed-top">
  <div class="container">
    <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-start">
      <img class="d-none d-md-block" src="/img/logo.png" alt="logo"
        style="height: 50px; width: 50px; padding:0%; margin:0%;">
      <ul class="nav col-12 col-md-auto me-lg-auto mb-2 justify-content-center mb-md-0">
        <li class="d-none d-md-block"><a href="/" class="lnk nav-link px-2 text-black">Home</a></li>
        <li class="d-none d-md-block">
          <div class="dropdown">
            <a class="lnk nav-link px-2 text-black">Category</a>
            <div class="dropdown-content">
              <a href="/Category1">Category1</a>
              <a href="/Category2">Category2</a>
              <a href="/Category3">Category3</a>
              <a href="/Category4">Category4</a>
            </div>
          </div>
        </li>
        <li class="d-none d-md-block"><a href="/contact" class="lnk nav-link px-2 text-black">Contact</a></li>
        <li class="d-none d-md-block"><a href="/subscribe" class="lnk nav-link px-2 text-black">Subscribe</a></li>
      </ul>
      <form action="/search" method="post" class="row row-cols-md-auto mx-1 g-3">
        <div class="col">
          <input type="search" class="form-control form-control-light text-bg-light col d-none d-md-block"
            placeholder="Search..." name="search">
        </div>

        <div class="col d-none d-md-block">
          <button type="submit" class="btn lnk">Search</button>
        </div>
      </form>
      <div class="row row-cols-md-auto mx-1 g-3 ">
        <%if(login){%>
          <a class="btn lnk d-none d-md-block" href="/compose">Compose</a>
          <form class="d-none d-md-block mt-3 mx-1" action="/Logout" method="post" id="logout">
            <a class="btn lnk" onclick="document.getElementById('logout').submit()">Logout</a>
          </form>
          <%}else{%>
            <a class="btn lnk mx-1 d-none d-md-block" href="/login">Login</a>
            <a class="btn lnk mx-1 d-none d-md-block" href="/register">Register</a>
            <%}%>
      </div>
    </div>
  </div>

  <div class="alt-nav">
    <div class="center">
      <button class="btn btn-secondary d-block d-md-none" id="button-toggle" onclick="Button()"><i
          class="bi bi-list"></i></button>
      <form action="/search" method="post" class="col-10">
        <input type="search" class="form-control form-control-light text-bg-light d-block d-md-none"
          placeholder="Search..." name="search">
      </form>
    </div>
    <div class="d-block d-md-none">
      <div id="altNav" hidden>
        <a href="/" class="lnk nav-link px-2 text-black">Home</a>
        <a href="/contact" class="lnk nav-link px-2 text-black">Contact</a>
        <a href="/subscribe" class="lnk nav-link px-2 text-black">Subscribe</a>
        <a href="/Category1" class="lnk nav-link px-2 text-black">Category1</a>
        <a href="/Category2" class="lnk nav-link px-2 text-black">Category2</a>
        <a href="/Category3" class="lnk nav-link px-2 text-black">Category3</a>
        <a href="/Category4" class="lnk nav-link px-2 text-black">Category4</a>
        <%if(login){%>
          <a href="/compose" class="lnk nav-link px-2 text-black">Compose</a>
          <form action="/Logout" method="post" id="logout">
            <a class="lnk nav-link px-2 text-black" onclick="document.getElementById('logout').submit()">Logout</a>
          </form>
          <%}else{%>
            <a href="/Login" class="lnk nav-link px-2 text-black">Login</a>
            <a href="/Register" class="lnk nav-link px-2 text-black">Register</a>
            <%}%>
      </div>
    </div>
  </div>
</header>

<body>