* {
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: "Bookman Old Style", Palatino, Georgia, serif;
  color: black;
  font-size: 1em;
  max-width: 1200px; /* Limit the width of the body */
  margin: 0 auto; /* Center the body content */
}

p {
  font-size: 1em;
  padding-bottom: 1em;
}

a {
  color: #3B5213;
  text-decoration: underline;
  font-weight: bold;
}

a:hover { 
  color: #2E7D32; 
}

h1 {
  font-size: 1.5em;
  padding-bottom: 1em;
}


h2 {
  font-size: 1.3em;
  padding-bottom: 1em;
}

h3 {
  font-size: 1.1em; 
  font-weight: normal; 
  text-decoration: underline;
  padding-bottom: 1em;
}

h4 {
  font-size: 1.3em;
}

.video-caption {
  font-size: 0.8em;
  padding-bottom: 1em;
  text-align: left;
  color: #555; /* Optional: Adjust the color */
}

.current { color: #2E7D32; } 

.grid-container {
  display: grid;
  grid-template-areas:
    'header header header header header header'
    'main main main main main menu'
    'block block block block block menu'
    'post post post post post menu'
    'footer footer footer footer footer footer';
  gap: 0.5em;
  background-color: #ebf7f7;
  padding: 1em;
}

.grid-container > div {
  padding: 1em;
  font-size: 1em;

}

/* Header */
.item1 {
  grid-area: header;
  background-color: #C4E290;
  color: black;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item1 h4 {
  font-size: 2em;
}


/* Toggle button in header */
.toggle-button {
  display: none;
  background-color: #214F31;
  color: white;
  padding: 0.5em 1em;
  font-size: 1em;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 1em;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 0.3em;
}

@media (max-width: 768px) {
  .item1 {
    justify-content: space-between; /* Pushes h4 left and button right */
    padding: 0.8em 1em;
  }
  .item1 h4 {
    font-size: 1em; 
  }
  .toggle-button {
    display: block; /* Show button on smaller screens */
    padding: 0.4em 0.8em;   /* slightly smaller padding */
    font-size: 0.9em;      /* slightly smaller text + icon */
  }

}

/* Main and Post*/

/* Assign grid areas */
.item2 { grid-area: main; }
.item5 { grid-area: post; }

/* Shared styles for .item2 (main) and .item5 (post) */

/* Images inside .item2 and .item5 */
.item2 img, .item5 img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1em;
}

/* Videos inside .item2 and .item5 */
.item2 .myvideo, .item5 .myvideo {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Ensure iframes (embedded videos) are responsive */
.item2 iframe, .item5 iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}


/* Blocks */

.item3 {
  grid-area: block;
}


.item3 ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  padding: 0;
  list-style-type: none;
}

.item3 li {
  flex: 1 1 calc(33.33% - 0.6em);
  min-width: 150px;
  padding: 0.5em;
  background-color: #C4E290;
  color: black;
  text-align: center;
}

.item3 li:hover {
  background-color: #cdec98;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .grid-container {
    display: grid;
    grid-template-areas:
      'header header header header header header'
      'main main main main main main'
      'block block block block block block'
      'post post post post post post'
      'footer footer footer footer footer footer';
  }
  
  .item3 li {
    flex: 1 1 calc(50% - 0.6em);
  }
}

@media (max-width: 480px) {
  .item3 li {
    flex: 1 1 100%;
    margin-bottom: 0.6em; /* Optional: To add spacing between items on small screens */
  }
}

/* Side menu (item4) */


.item4 {
  grid-area: menu;
  background-color: #ebf7f7;
  padding: 1em;
  color: black;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.item4 ul {
  list-style: none;
  padding: 0.4em;
  overflow: auto;
}

.item4 li { 
  padding: 0.5em; 
  white-space: nowrap;
} 

/* Hide item4 on mobile */
@media (max-width: 768px) {
.item4 {
    position: fixed;
    top: 6em;
    right: 1em;
    width: 50%;
    height: 80%;
    background: #ebf7f7;
    padding: 1.5em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1000;
  }

.item4 li { 
  padding: 0.6em; 
  } 
}

/* Show when active */
.item4.show {
  transform: translateX(0);
  opacity: 1;
}


/* Footer */

.item6 {
  grid-area: footer;
  background-color: #C4E290;
  color: black;
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
}
/* Table Styles – Compact & Fully Responsive */
table {
  width: 100%;
  max-width: 100%;
  margin: 0.5rem auto;
  border-collapse: collapse;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #1a5d8c;
  color: white;
  font-weight: 600;
  border-bottom: 3px solid #0e4a75;
}

tr:nth-child(even) { background-color: #f8f9fc; }
tr:hover            { background-color: #f0f7ff; }
tr:last-child td    { border-bottom: none; }

.rate { font-weight: 600; color: #d35400; }
.note { font-size: 0.9rem; color: #555; }

.table-wrapper {
  overflow-x: auto;
  margin: 0.5rem 0;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile stacked view */
@media (max-width: 768px) {
  table, thead, tbody, th, td, tr { display: block; }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid #ccc;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    padding: 0.35rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  td {
    border: none;
    position: relative;
    padding: 0.55rem 1rem 0.55rem 52%;
    text-align: right;
    border-bottom: 1px solid #eee;
  }

  td:last-child { border-bottom: none; }

  td:before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 44%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    text-align: left;
    color: #333;
  }

  /* Optional custom labels (remove or edit if you don’t need them) */
  td[data-label="Genre"]:before          { content: "Genre: "; }
  td[data-label="Typical Length"]:before { content: "Length: "; }
  td[data-label="Turnaround"]:before     { content: "Turnaround: "; }
  td[data-label="Example Rate (¥)"]:before { content: "Rate: "; }
  td[data-label="Notes"]:before          { content: "Notes: "; }
}

@media (max-width: 480px) {
  table { font-size: 0.9rem; }
  td    { padding-left: 55%; }
}

#sideMenu hr.menu-divider {
  margin: 14px 70px 14px 20px; 
  border-top: 2px solid #000;
}