body {
    font-family: Arial, sans-serif;
    margin: auto 5%;
    padding: 20px;
    text-align: center;
}

video {
    max-width: 80%;
    display: flex;
    margin: auto;
}

.container {
  display: flex;
  flex-wrap: wrap;
}

.item {
  flex: 1 1 calc(33% - 10px);
  margin: 5px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    max-width: 1000px;
    margin: 0 auto 20px;
    padding: 0 10px;
}

.markdown-content {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 10px;
    text-align: left;
}

h1 {
    font-size: 2rem;
    margin: 0;
    text-align: left;
}

h2 {
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

input[type="text"] {
    width: 90%;
    max-width: 300px;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.navinput[type="text"] {
    margin-bottom: 0px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #2c3e50;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #4c6075;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav form {
    margin-left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

nav input[type="text"] {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 200px;
    box-sizing: border-box;
}

nav button {
    padding: 6px 10px;
    border: none;
    background-color: #2c3e50;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

nav button:hover {
    background-color: #4c6075;
}

header h1 a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

a,
a:link,
a:visited {
    color: #2c3e50;
    text-decoration: none;
    transition: color 150ms ease;
}

a:hover,
a:focus {
    color:#4c6075;
    text-decoration: underline;
}

a:active {
    color:#16a085;
}

.content-image,
main img {
  max-width: 100%;
  height: auto;
}

#page-map {
  z-index: 1;
  width: 80%;
  margin: 0 auto 1rem;
}

ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

header h1 a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.section-list-no-bullets {
  padding-right: 10%;
  padding-left: 10%;
}

.site-icon {
    width: 50px;
    height: 50px;
    display: inline-block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.pub-date {
  color: #666;
  font-size: 0.9rem;
  margin: 0.25rem 0;
  text-align: center;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 1.4rem;
  padding: 6px 8px;
  cursor: pointer;
}

.tags {
  text-align: center;
}

.toc {
  text-align: center;
}

.main-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav-list .nav-item {
  position: relative;
}

.main-nav-list a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  padding: 6px 8px;
}

/* dropdown menu (desktop) */
.dropdown {
  display: block;                 /* keep element present for pointer-events/opacity control */
  position: absolute;
  left: 0;
  top: calc(100% - 2px);          /* small overlap to avoid a 1–2px gap when moving pointer */
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  list-style: none;
  padding: 6px 0;
  min-width: 180px;
  z-index: 200;
  border-radius: 6px;

  /* hide visually but keep it in document so mouse entering it doesn't close it */
  opacity: 0;
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 140ms ease, transform 140ms ease;
  transform: translateY(-6px);
}

.dropdown li a {
  display: block;
  padding: 8px 12px;
  white-space: nowrap;
  color: #2c3e50;
}

/* show when parent hovered/focus-within OR when the dropdown itself is hovered */
.nav-item-has-dropdown:hover > .dropdown,
.nav-item-has-dropdown:focus-within > .dropdown,
.nav-item-has-dropdown .dropdown:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* small arrow indicator (optional) */
.nav-item-has-dropdown > a::after {
  content: " ▾";
  font-size: 0.8em;
  margin-left: 6px;
  opacity: 0.8;
}

.dropdown-sep {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 6px 0;
  list-style: none;
}

.view-all a {
  display: block;
  padding: 10px 12px;
  font-weight: 600;
  color: #0b63c4;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* subtle hover for view-all */
.view-all a:hover {
  background: rgba(11,99,196,0.06);
}

.section-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.item-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 96px;
  background: #f4f4f4;
}

.item-body {
  flex: 1 1 auto;
  text-align: left;
}

.item-title {
  display: inline-block;
  font-weight: 600;
  color: inherit;
  margin-bottom: 4px;
  text-decoration: none;
}

.item-date {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.item-summary {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
}

.thumb-link {
  display: block;
}

.thumb-wrap {
  flex: 0 0 96px;         /* reserve space on desktop */
  width: 250px;
  aspect-ratio: 3 / 2;    /* keep a consistent ratio (change to taste) */
  overflow: hidden;
  border-radius: 6px;
  background: #f4f4f4;
  display: inline-block;
}

.thumb-wrap img,
.item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* crop to cover, no distortion */
  display: block;
}

/* mobile layout: show toggle, hide nav by default */
@media (max-width: 720px) {
  .list-item {
    flex-direction: column;
    gap: 8px;
  }
  .item-thumb {
    width: 100%;
    height: 160px;
    flex: none;
  }
  .main-nav-list {
    flex-direction: column;
    align-items: stretch;
  }  
  .nav-item-has-dropdown > .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 12px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    display: none;
  }
  .nav-item-has-dropdown.open > .dropdown {
    display: block;
  }
  .nav-search form {
    display: flex;
    gap: 6px;
    width: 100%;
  }
  .dropdown li a {
    padding: 8px 6px;
  }
  .hamburger {
    display: block;
  }

  .thumb-wrap {
    width: 100%;
    flex: none;
    aspect-ratio: 16 / 9;
  }

  .nav-toggle {
    display: block;
    align-items: center;
    justify-content: center;
  }

  /* nav hidden by default on mobile */
  #main-nav {
    z-index: 10;
    position: absolute;
    inset-inline-start: 4px;
    inset-block-start: 80px;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    margin: 8px;
    background: white;
    
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  }

  header > h1 {
    order: 1;
    flex: 1 1 auto;             /* allow title to take remaining space */
    text-align: center;         /* centered between toggle and any right items */
    margin: 0;
  }

  #main-nav.open {
    display: flex;
  }

  /* ensure form and inputs full width on mobile */
  #main-nav form {
    display: flex;
    gap: 6px;
    width: 100%;
  }
  #main-nav input[type="text"] {
    flex: 1 1 auto;
    width: auto;
  }
  .markdown-content {
    max-width: 100%;
}
}