/* Global Styles */
body {
  font-family: monospace;
  line-height: 150%;
  margin: 80px 0px;
  background: url("../images/bg.png") no-repeat center center fixed;
  background-size: cover;
}

/* Container Styles - A4 Letter Proportions */
.container {
  background: #fffef8; /* Slightly warmer paper tone */
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  margin: 100px auto 0;
  max-width: 750px; /* A4-ish width (210mm ≈ 750px at 96dpi) */
  min-height: 1056px; /* A4-ish height (297mm ≈ 1056px at 96dpi) */
  padding: 80px 90px 40px 90px; /* Generous letter margins, less at bottom for footer */
  position: relative;
  width: 85%;
  display: flex;
  flex-direction: column;
  /* Subtle paper texture */
  background-image: 
    linear-gradient(90deg, rgba(200,200,150,0.02) 1px, transparent 1px),
    linear-gradient(rgba(200,200,150,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

.container:before,
.container:after {
  content: "";
  height: 98%;
  position: absolute;
  width: 100%;
  z-index: -1;
}

.container:before {
  background: #fffef8;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  left: -6px;
  top: 5px;
  transform: rotate(-2.5deg);
}

.container:after {
  background: #fffef8;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  right: -4px;
  top: 2px;
  transform: rotate(1.4deg);
}

/* Vintage paper edge effect */
.container::before {
  background: linear-gradient(to bottom, 
    #fffef8 0%, 
    #fffef8 98%, 
    rgba(139, 119, 101, 0.1) 100%);
}

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

.page-link {
  font-weight: bold;
}

a.page-link:hover {
  border-bottom: 4px solid #c00;
}

/* Navigation List */
.navlist {
  padding: 0px;
}

.navlist > li {
  display: inline;
  list-style-type: none;
  padding-right: 10px;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 1em;
}

h1 {
  text-transform: uppercase;
  font-weight: bold;
  text-decoration: underline;
}

h2 {
  font-weight: bold;
  text-decoration: underline;
}

h3 {
  font-weight: bold;
}

.header {
  text-align: center;
  margin-bottom: 100px;
}

.header > h1 {
  letter-spacing: 10px;
  margin-bottom: 10px;
  text-decoration: none;
  text-shadow: 1px 0px 1px #444;
}

/* Posts */
.posts {
  padding-left: 0px;
}

.posts > li {
  list-style-type: none;
  margin: 80px 0px;
}

/* Code Blocks */
.highlight,
blockquote {
  margin: 40px 0px;
  padding: 0px 20px;
  border-left-style: solid;
  border-color: #999;
}

/* Footer */
footer {
  margin-top: auto; /* Push to bottom */
  padding-top: 60px;
  text-align: center;
  font-size: 0.9em;
  color: #666;
}

/* Pagination */
.pagination {
  text-align: center;
}

.pagination > a,
.pagination > span {
  margin: 40px 10px;
}

/* Continue Reading */
.continue {
  text-align: center;
  margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 900px) {
  .container {
    max-width: 700px;
    min-height: 900px;
    padding: 70px 70px;
  }
}

@media (max-width: 768px) {
  .container {
    margin: 40px auto;
    max-width: 90%;
    min-height: 800px;
    padding: 50px 50px;
  }

  .header > h1 {
    letter-spacing: 5px;
  }

  .posts > li {
    margin: 40px 0px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 20px auto;
    max-width: 95%;
    min-height: 600px;
    padding: 40px 30px;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-size: 0.9em;
  }

  .header > h1 {
    letter-spacing: 3px;
  }
}

@keyframes blink {
  0% { opacity: 1; color: red; }
  50% { opacity: 0.5; color: red; }
  100% { opacity: 1; color: red; }
}

.blink-news {
  animation: blink 2s infinite;
  color: red;
}

.blink-nav {
  animation: blink 2s infinite;
  color: red !important;
}
    
/* News resources (inline links inside table cells) */
.news-resources {
  display: inline-block;
  white-space: nowrap;
}

.news-resources a {
  margin-right: 14px;
}

.news-resources a:last-child {
  margin-right: 0;
}

/* Table layout adjustments for better column spacing */
.container table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 30px 0;
}

.container th,
.container td {
  padding: 12px 24px;
  vertical-align: top;
  text-align: left;
}

/* Give predictable column distribution: Date / Description / Resources */
.container th:first-child,
.container td:first-child {
  width: 18%;
  white-space: nowrap;
}

.container th:nth-child(2),
.container td:nth-child(2) {
  width: 62%;
}

.container th:nth-child(3),
.container td:nth-child(3) {
  width: 20%;
}

.container thead th {
  border-bottom: 2px solid #999;
  font-weight: bold;
}

.container td {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Horizontal rules for letter authenticity */
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 40px 0;
}

/* Image styling for vintage look */
.container img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  padding: 5px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}