.essay-card-with-image {
  overflow: hidden;
}

.essay-card-image-link {
  display: block;
  margin: -1rem -1rem 1rem -1rem;
}

.essay-card-image {
  width: 100%;
  height: 100px;
  object-fit: contain;
  display: block;
  background: #f5f7fa;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.essay-card-with-image h3 {
  margin-top: 0.5rem;
}

.logic-page-title-with-image {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  text-align: left;
}

.logic-title-text {
  flex: 1 1 auto;
}

.logic-title-image {
  flex: 0 0 auto;
}

.logic-title-image img {
  width: 120px;
  max-width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 700px) {
  .logic-page-title-with-image {
    flex-direction: column;
    text-align: center;
  }
  .logic-page-title {
    flex-direction: column;
    text-align: center;
  }
  .page-header-image {
    margin-top: 1rem;
  }
}
.logic-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logic-title-text {
  flex: 1;
}

.page-header-image {
  flex-shrink: 0;
}

.page-header-image img {
  max-width: 120px;
  height: auto;
}
.term {
  position: relative;
  cursor: help;
}

.term-first {
  border-bottom: 1px dotted #2c3e50;
  text-decoration: none;
}

.term-hidden {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.term-hidden:visited,
.term-hidden:hover,
.term-hidden:focus,
.term-hidden:active {
  color: inherit;
  text-decoration: none;
}

.term:hover::after,
.term:focus::after {
  content: attr(data-definition);
  position: absolute;
  left: 0;
  bottom: 130%;
  width: 260px;
  background: #2c3e50;
  color: white;
  padding: 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
  z-index: 999;
}

footer a {
  color: #facc15;            /* yellow/gold */
}

main.logic-main {
    max-width: none;
    width: 100%;
    padding: 2rem 0;
  }

  .logic-main .breadcrumbs,
  .logic-main .logic-page-title,
  .logic-main .legend,
  .logic-main .logic-note {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }


.logic-page-title {
      text-align: center;
      margin-bottom: 1rem;
    }

    .logic-page-title h2 {
      margin-bottom: 0.5rem;
    }

    .logic-intro {
      max-width: 900px;
      margin: 0 auto 1.5rem auto;
      text-align: center;
    }

    .legend {
      display: flex;
      justify-content: center;
      gap: 1.5rem;
      flex-wrap: wrap;
      margin: 1.5rem 0 2rem 0;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.98rem;
    }

    .legend-box {
      width: 18px;
      height: 18px;
      border-radius: 4px;
      border: 1px solid rgba(0,0,0,0.15);
    }

    .logic-wrapper {
      position: relative;
      width: 100%;
  overflow-x: auto;
  overflow-y: visible;
        padding-bottom: 1rem;
      margin: 0;
      padding: 0;
    }

    .logic-board {
      position: relative;
      width: 1400px;
      height: 1020px;
        max-width: 1400px;
  width: 100%;
      margin: 0 auto;
      background: linear-gradient(to bottom, #ffffff, #fbfbfb);
      border: 1px solid #e3e3e3;
      border-radius: 14px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    }

    .logic-svg {
      position: absolute;
        overflow: visible;
      top: 0;
      left: 0;
      width: 1400px;
      height: 1020px;
      pointer-events: none;
      z-index: 1;
    }

    .logic-svg path,
    .logic-svg line {
      stroke: #6b7280;
      stroke-width: 2.5;
      fill: none;
    }

    .logic-node {
      position: absolute;
        border: 1px solid rgba(0,0,0,0.08);
      width: 210px;
      min-height: 88px;
    line-height: 1.4;
      padding: 0.9rem 1rem;
      border-radius: 12px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.08);
      z-index: 2;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      border: 1px solid rgba(0,0,0,0.12);
      cursor: pointer;
    }

    .logic-node:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 18px rgba(0,0,0,0.13);
    }

    .logic-node a {
      color: inherit;
      text-decoration: none;
      display: block;
    }

    .logic-node-title {
      font-size: 1rem;
      font-weight: bold;
      margin-bottom: 0.35rem;
      line-height: 1.3;
    }

    .logic-node-short {
      font-size: 0.93rem;
      line-height: 1.4;
    }

    .node-axiom {
      background: #f7b2a8;
    }

    .node-implication {
      background: #b7e8ab;
    }

    .node-conclusion {
      background: #adcfff;
    }

    .node-meta {
      background: #ececec;
    }

    .logic-tooltip {
      position: absolute;
      max-width: 260px;
      background: rgba(32, 38, 46, 0.96);
      color: white;
      font-size: 0.9rem;
      line-height: 1.45;
      padding: 0.75rem 0.85rem;
      border-radius: 8px;
      box-shadow: 0 8px 18px rgba(0,0,0,0.22);
      z-index: 5;
      display: none;
      pointer-events: none;
    }

.logic-note {
  max-width: 920px;
  margin: 1rem auto 0 auto;
  font-size: 0.97rem;
}

body {
  font-family: Georgia, serif;
  line-height: 1.7;
  margin: 0;
  padding: 0;
  background: #fdfdfd;
  color: #222;
}

header {
  background: #2c3e50;
  color: white;
  padding: 2rem;
  text-align: center;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: normal;
}

header p {
  margin: 0.7rem 0 0 0;
  font-size: 1.1rem;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
}

.header-logo {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 80px;
  height: auto;
}

.navbar {
  background-color: #2c3e50;
  color: white;
  position: relative;
  z-index: 5;
}

.menu-toggle {
  display: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  padding: 0.75rem 1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}

.nav-links li {
  position: relative;
}

.nav-links li a {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
}

.nav-links li a:hover,
.nav-links li a:focus {
  background-color: #34495e;
}

.nav-group-head {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.nav-group-head a {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
}

.submenu-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 1rem 0.6rem;
  font-size: 1rem;
}

.nav-group-head a:hover,
.nav-group-head a:focus,
.submenu-toggle:hover,
.submenu-toggle:focus {
  background-color: #34495e;
}

.submenu {
  display: none;
  position: absolute;
  background-color: #34495e;
  top: 100%;
  left: 0;
  min-width: 240px;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 10;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.submenu li a {
  display: block;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.nav-links li.open > .submenu {
  display: flex;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

.breadcrumbs {
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
  color: #555;
}

.breadcrumbs a {
  color: #0b4f8a;
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #777;
  margin: 0 0.35rem;
}

* {
  box-sizing: border-box;
}

.hero,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hero {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
  margin-bottom: 2rem;
}

.hero-text,
.page-header-text {
  flex: 1 1 520px;
}

.hero-text h2,
.page-header-text h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.9rem;
  font-weight: normal;
}

.hero-text p,
.page-header-text p {
  margin-top: 0.75rem;
  font-size: 1.08rem;
}

.hero-image img,
.page-header-image img {
  width: 120px;
  max-width: 100%;
  height: auto;
  display: block;
}

h2 {
  color: #2c3e50;
  margin: 0 0 1rem 0;
  font-size: 1.9rem;
  font-weight: normal;
}

h3 {
  color: #2c3e50;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  font-weight: normal;
  scroll-margin-top: 1rem;
}

h4 {
  color: #2c3e50;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: normal;
}

p {
  font-size: 1.02rem;
  margin: 1rem 0;
}

ul,
ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  font-size: 1.02rem;
}

hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 2rem 0;
}

.callout {
  background: #fafafa;
  border-left: 4px solid #2c3e50;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.quick-links {
  background: #f6f8fa;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem 0;
}

.quick-links h3,
.quick-links h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.quick-links ul {
  margin-bottom: 0;
}

.summary-grid,
.essay-grid,
.link-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2rem 0;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.essay-grid,
.link-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.essay-card,
.link-card,
.discussion-box,
.forum-box {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 1rem;
  background: #fafafa;
}

.card h3,
.essay-card h3,
.link-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p,
.essay-card p,
.link-card p {
  margin-bottom: 0;
}

.essay-card a.more-link {
  font-weight: bold;
  text-decoration: none;
}

.essay-card a.more-link:hover,
.essay-card a.more-link:focus {
  text-decoration: underline;
}

.top-right-image {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 100px;
  height: auto;
}

.back-to-top {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.forum-button {
  display: inline-block;
  background: #2c3e50;
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.forum-button:hover,
.forum-button:focus {
  background: #34495e;
  text-decoration: none;
}

a {
  color: #0b4f8a;
}

a:hover,
a:focus {
  text-decoration: underline;
}

footer {
  background: #2c3e50;
  color: #fff;
  padding: 2rem;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #2c3e50;
  }

  .nav-links.show {
    display: flex;
  }

  .submenu {
    position: static;
    box-shadow: none;
    background-color: #3c5a6b;
    border-left: 3px solid #555;
  }

  .hero,
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-image,
  .page-header-image {
    align-self: center;
  }

  .header-logo {
    position: static;
    display: block;
    margin: 1rem auto 0 auto;
    transform: none;
  }

  .top-right-image {
    position: static;
    display: block;
    margin: 0 auto 1rem auto;
  }

  header h1 {
    font-size: 1.8rem;
  }

  h2,
  .hero-text h2,
  .page-header-text h2 {
    font-size: 1.6rem;
  }
  main {
    padding: 1.5rem;
  }
}
@media (max-width: 700px) {
  .page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0 !important;
    margin-bottom: 1rem;
  }

  .page-header-text {
    flex: 0 1 auto !important;
    width: 100%;
    margin-bottom: 0 !important;
  }

  .page-header-text p:last-child {
    margin-bottom: 0 !important;
  }

  .page-header-image {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .page-header-image img {
    margin-top: 0.35rem;
  }
}