/* Custom styles on top of Tufte CSS */

h1 {
  margin-bottom: 1.5rem;
}

section {
  margin-bottom: 2rem;
}

/* Link styling to match simple aesthetic */
a {
  color: #111;
  text-decoration: underline;
  text-decoration-color: #777;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  /* Break at word boundaries, not character level */
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
}

a:hover {
  text-decoration-color: #111;
}

/* Keep names together - prevent breaking within names */
a.nowrap {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Force long URLs to break and wrap */
p,
li {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 900px) {
  p,
  li {
    max-width: 100%;
  }
}

/* Hide bullet points for navigation lists only */
nav ul {
  list-style-type: none;
  padding-left: 0;
}

nav ul li {
  display: inline;
  margin-right: 1em;
}

/* Content lists should match Tufte's 55% width */
details ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
  width: 55%;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

/* Section expanders on reading page */
details {
  margin-top: 2rem;
  max-width: 100%;
  overflow: visible;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  transform: translateY(-0.05em);
}

details[open] > summary::before {
  content: "▾";
}

details > summary h2 {
  display: inline;
  margin: 0;
}

/* Ensure content inside details wraps */
details ul li {
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

details h3, details h4 {
  width: 55%;
  word-wrap: break-word;
}

details p {
  width: 55%;
  word-wrap: break-word;
}

/* Zoomable images */
.zoomable-image {
  cursor: zoom-in;
  transition: transform 0.3s ease;
  display: block;
  max-width: 100%;
  height: auto;
}

.zoomable-image:hover {
  transform: scale(1.5);
  transform-origin: center;
  position: relative;
  z-index: 10;
}

/* Argument Drawings figure matches Tufte's 55% width */
.argument-drawings {
  margin: 2rem 0;
  width: 55%;
}

.argument-drawings img {
  margin-bottom: 1rem;
  width: 100%;
}

.argument-drawings figcaption {
  float: none;
  clear: both;
  max-width: 100%;
  text-align: right;
  display: block;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* Philosophy quote uses full text width */
.philosophy-quote {
  margin: 2rem 0;
}

.philosophy-quote blockquote {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.philosophy-quote blockquote p,
.philosophy-quote blockquote footer {
  width: 100%;
}
