/* --- Global Box Sizing (Crucial for Mobile) --- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* --- Basic Page Setup & Margins --- */
body {
  font-family: Arial, Helvetica-neue, Helvetica, sans-serif;
  font-size: 18px; 
  line-height: 1.6;
  color: #333333;
  background-color: #fcfcfc;
  margin: 0; 
  padding: 20px 15px; 
  /* Prevents long text/URLs from breaking the mobile layout */
  overflow-wrap: break-word; 
  word-wrap: break-word;
}

/* This expands your content and nav menu to the full 1000px */
#content {
  max-width: 1000px; 
  width: 100%;
  margin: 0 auto; /* Centers the content nicely on the page */
  overflow: hidden;
}

/* --- Typography & Headings --- */
h1, h2, h3, h4, h5 {
  color: #1a365d; /* A professional dark blue */
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: normal;
}

h1 {
  line-height: 1.5em;
}

h3 {
  line-height: 1.2;
}

h1 a {
  text-decoration: none;
  color: inherit;
}

p {
  color: #333333;
  line-height: 1.6;
  margin: 12px 0;
}

.entry p, .entry ol, .entry ul {
  margin-bottom: 15px; /* Tightened paragraph gaps */
}

blockquote {
  border-left: 1px solid #a5abab;
  margin: 0px;
  padding: 0 12px 0 12px;
}

/* --- Links --- */
a, a:link, a:visited {
  color: #333;
  text-decoration: none;
}

a:hover {
  color: #0056b3; 
  text-decoration: underline;
}

/* --- Lists --- */
ul {
  padding: 0.5em 0em 1em 3.2em;
}
ol {
  margin-top: 0;
  padding: 0.5em 0em 0em 3.2em;
}
li {
  line-height: 18px;
  padding: 6px 0 0 0;
}

/* --- The Navigation Menu --- */
#header {
  position: fixed;
}

#header h2 {
  padding: 0;
  margin: 0;
  font-size: 16pt;
}

#header h3 {
  padding: 5px 0 20px 0;
  margin: 0;
  color: #777777;
  font-size: 12pt;
}

.main-nav {
  background-color: #eaeaea;
  padding: 15px;
  text-align: center;
  margin-bottom: 30px;
  border-radius: 8px;
}

.main-nav a {
  display: inline-block;
  margin: 0 15px;
  font-weight: bold;
}

.main-nav a:hover {
  color: #0056b3;
}

/* --- Modern UI Elements (Cards & Notices) --- */
.content-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
}

.notice-box {
  background: #fef3c7; 
  border: 1px solid #f59e0b; 
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  color: #92400e; 
}

/* --- Image & Caption Styling --- */
img {
  border: none;
}

img a {
  border: none;
}

.responsive-figure {
  max-width: 100%;
  margin: 0 auto 30px auto;
  padding: 0;
}

.image-caption {
  font-size: 0.85em;
  text-align: center;
  color: #555555;
  margin-top: 8px;
}

/* Strictly Horizontal 3-Image Gallery */
.image-gallery {
  display: flex;
  flex-direction: row; 
  justify-content: space-between;
  gap: 15px; 
  margin-bottom: 25px;
}

.image-gallery figure {
  margin: 0;
  flex: 1; 
  min-width: 0; 
  border-radius: 6px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.image-gallery img {
  width: 100%;
  height: 180px; 
  object-fit: cover; 
  display: block;
}

.image-gallery figcaption {
  text-align: center;
  font-size: 0.85em;
  color: #555;
  padding: 8px 5px;
  border-top: 1px solid #eee;
}

/* --- Entry & Course Styles --- */
.entry a:link, .entry a:visited {
  color: #303030;
  border-bottom: 1px solid #c0c0c0;
}

.entry a:hover {
  background: #e7eef8;
  text-decoration: none;
}

.entry strong {
  font-weight: bold;
  font-size: 1em;
  color: #111111;
}

.bold-text {
  font-weight: bold;
}

.indented {
  display: inline-block;
  padding-left: 20px;
}

.courseitem {
  padding-left: 20px;
  margin: 0;
}

.centered {
  display: inline-block;
  text-align: center;
}

b {
  display: inline-block;
  margin-bottom: 0;
}

/* --- Layout Utilities --- */
.left {
  width: 30%;
  padding: 0 3px 0 0;
  float: left;
}

.right {
  width: 65%;
  padding: 0 10px 0 0;
  float: left;
}

.row:after {
  content: "";
  display: table;
  clear: both;
}

/* --- Footers & Special Sections --- */
#footer, #poetry {
  background: #fff;
  clear: both;
  width: 100%;
}

#footer p, #poetry p, #poetry h1 {
  padding: 14px 0;
  margin: 0;
  text-align: center;
}

#footer a, #poetry a {
  color: #666;
}

#footer a:hover, #poetry a:hover {
  color: #000000;
}

/* --- Diagram Arrows --- */
.arrow-cell {
  position: relative;
}

.arrow-left, .arrow-right, .arrow {
  position: absolute;
  top: 80%;
  left: 0px;
  right: 0px;
  transform: translateY(-50%);
}

.arrow-left, .arrow-right {
  height: 1px;
  background-color: black;
}

.arrow {
  height: 3px;
  background-color: grey;
}

.arrow-right::after {
  content: '';
  position: absolute;
  top: 70%;
  width: 5px;
  height: 5px;
  border-top: 3px solid grey;
  border-right: 3px solid grey;
  right: 0px;
  transform: translateY(-50%) rotate(45deg);
}

.arrow-left::after {
  content: '';
  position: absolute;
  top: 70%;
  width: 5px;
  height: 5px;
  border-top: 3px solid grey;
  border-right: 3px solid grey;
  left: 0px;
  transform: translateY(-50%) rotate(-135deg);
}

/* --- Mobile Adjustments & Media Queries --- */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px; /* Shrinks text slightly for mobile readability */
    padding: 10px;   /* Reduces the empty space on the edges */
  }

  /* Stack the layout utility columns on mobile */
  .left, .right {
    width: 100%;
    float: none;
    padding: 0;
  }

  /* Stack the image gallery vertically on phones */
  .image-gallery {
    flex-direction: column; 
  }

  .image-gallery img {
    height: auto; /* Let images scale naturally on mobile */
  }

  /* Adjust navigation for mobile */
  .main-nav a {
    display: block; /* Stacks nav links so they are easy to tap */
    margin: 10px 0;
  }
}
