/* =========================
   Base and reset
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: #eeeeee;
  color: #2d3448;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.6;
}

/* =========================
   Global elements
   ========================= */

a {
  color: #2d3448;
}

a:hover,
a:focus {
  text-decoration: underline;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 1rem;
}

/* =========================
   Accessibility helpers
   ========================= */

a[href="#main"] {
  position: absolute;
  left: -9999px;
}

a[href="#main"]:focus {
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
}

/* =========================
   Header and branding
   ========================= */

.site-header {
  background: #2d3448;
}

.site-header > .container {
  max-width: none;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.site-branding {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-height: 55px;
  padding-top: 1.2rem;
}

.site-title {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
}

.site-title a {
  color: #ffffff;
  text-decoration: none;
}

.site-title a:hover,
.site-title a:focus {
  text-decoration: underline;
}

.tagline {
  margin: 0;
  font-family: "Times New Roman", serif;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1;
  color: #ffd800;
  white-space: nowrap;
}

.header-stripes {
  display: grid;
  grid-template-rows: repeat(4, 10px);
}

.stripe {
  display: block;
}

.stripe-1 {
  background: #2d3448;
}

.stripe-2 {
  background: #47506b;
}

.stripe-3 {
  background: #7c86a1;
}

.stripe-4 {
  background: #d7dbe5;
}

/* =========================
   Shared layout
   ========================= */

.container {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
}

main {
  padding: 0 0 1.5rem;
}

.layout {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
}

.sidebar,
.content {
  background: #ffffff;
  border: 1px solid #d7dbe5;
}

.sidebar {
  padding: 1.5rem;
}

.content {
  min-width: 0;
  padding: 1.5rem 0;
}

.content .container {
  width: min(100% - 4rem, 48rem);
}

/* =========================
   Main content typography
   ========================= */

main .container {
  max-width: 46rem;
}

main h1,
main h2,
main h3 {
  line-height: 1.2;
}

main h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2rem;
  letter-spacing: 0.01em;
}

/* =========================
   Sidebar
   ========================= */

.sidebar h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

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

.sidebar li + li {
  margin-top: 0.75rem;
}

.sidebar a {
  color: #47506b;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a:focus {
  color: #2d3448;
  text-decoration: underline;
}

.sidebar-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #d7dbe5;
}

.sidebar-section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

/* =========================
   Content media
   ========================= */

.content img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* =========================
   Home page
   ========================= */

.home-content {
  margin-bottom: 2rem;
}

.home-content p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  max-width: 62ch;
  font-size: 1.125rem;
  line-height: 1.75;
}

.home-posts {
  padding-top: 1.5rem;
  border-top: 1px solid #d7dbe5;
}

.home-posts h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.5rem;
}

.home-posts ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-posts li + li {
  margin-top: 0.75rem;
}

.home-posts a {
  color: #2d3448;
  text-decoration: none;
  font-weight: 600;
}

.home-posts a:hover,
.home-posts a:focus {
  text-decoration: underline;
}

.home-posts-link {
  margin: 1.5rem 0 0 0;
}

.home-posts-link a {
  font-weight: 600;
}

/* =========================
   Contact page
   ========================= */

.contact-form {
  margin-top: 1.5rem;
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #b8c0d4;
  background: #ffffff;
  color: #2d3448;
  font: inherit;
  line-height: 1.5;
}

.form-field textarea {
  resize: vertical;
  min-height: 10rem;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid #2d3448;
  outline-offset: 2px;
  border-color: #2d3448;
}

.form-actions {
  margin-top: 1.5rem;
}

.form-actions button {
  padding: 0.8rem 1.2rem;
  border: 1px solid #2d3448;
  background: #2d3448;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.form-actions button:hover,
.form-actions button:focus {
  background: #47506b;
  border-color: #47506b;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
}

.form-message {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid;
}

.form-error {
  background: #fff5f5;
  border-color: #e0a1a1;
  color: #7a1f1f;
}

.form-success {
  background: #f3f7f3;
  border-color: #a9c4a9;
  color: #2d5a2d;
}

.form-message ul {
  margin: 0.5rem 0 0 1.25rem;
}

.form-message p {
  margin: 0;
}

/* =========================
   Post lists and post meta
   ========================= */

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

.post-list-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid #d1d5db;
}

.home-posts .post-list-item:last-child {
  border-bottom: 1px solid #d1d5db;
}

.post-list-title {
  margin: 0 0 0.5rem 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.875rem;
  line-height: 1.2;
}

.post-list-title a {
  color: inherit;
  text-decoration: none;
}

.post-list-title a:hover,
.post-list-title a:focus {
  text-decoration: underline;
}

.post-date {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #6b7280;
}

article header .post-date {
  margin-top: 0.5rem;
}

.post-excerpt {
  margin: 0;
  max-width: 62ch;
  line-height: 1.7;
  color: #374151;
}

/* =========================
   Article content
   ========================= */

article header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #d7dbe5;
}

article header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #2d3448;
}

/* =========================
   Footer
   ========================= */

footer {
  border-top: 1px solid #d7dbe5;
  color: #47506b;
  font-size: 0.95rem;
  padding: 1.5rem 0;
}

/* =========================
   Responsive layout
   ========================= */

@media (min-width: 56rem) {
  .layout {
    display: grid;
    grid-template-columns: 18rem minmax(0, 44rem);
    gap: 1.5rem;
    align-items: start;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
  }

  .sidebar {
    position: sticky;
    top: 1rem;
    padding-top: 1.5rem;
  }

  .content .container {
    width: min(100% - 4rem, 44rem);
    margin: 0 auto;
  }

  .sidebar,
  .content {
    min-height: 100%;
  }
}
