/* 

html {
  font-family: 'EB Garamond', serif;
  font-weight: normal;
  font-size: 17px;
  line-height: 1.6;
}

body {
    background-color: #fff1e5;
}

a {
    color: #8B4513;
    text-decoration: none;
}

a:visited {
    color: #8B4513;
}

*/

@font-face {
  font-family: 'EB Garamond';
  src: url('garamond.ttf') format('truetype');
  font-weight: 100 700;
  font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --accent-primary: #ff6b35;
  --accent-secondary: #ff006e;
  --accent-glow: rgba(255, 107, 53, 0.15);
  --bg: #ffffff;
  --text: #1a1a1a;
  --date-color: #666;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --text: #d4d4d4;
    --accent-glow: rgba(255, 107, 53, 0.3);
    --date-color: #999;
  }
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --text: #d4d4d4;
  --accent-glow: rgba(255, 107, 53, 0.3);
  --date-color: #999;
}

html {
  font-family: -apple-system, 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

main {
  width: 90%;
  max-width: 800px;
  margin: auto;
  padding: 0 0 3rem 0;
}

.directory {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1rem;
  margin: 2rem 0 2rem 0;
  padding: 0;
}

.directory li {
  font-size: 1rem;
}

.directory .active-item {
  font-size: 1rem;
}

.directory li a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.directory li a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 15px var(--accent-glow);
}

.directory li a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

.directory li a:hover::before {
  width: 100%;
}

.container {
  width: 100%;
  font-size: 1.05rem;
  line-height: 1.5rem;
}

.intro {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1.5rem;
}

.intro p {
  margin: 0 0 1.25rem 0;
}

.links-list p {
  margin: 0.15rem 0;   
  font-size: 1rem;
  line-height: 1.2rem;
  white-space: normal;  
  text-overflow: clip;
  overflow: visible;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 15px var(--accent-glow);
}

a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

a:hover::before {
  width: 100%;
}

h1, h2, h3 {
  font-weight: 400;
  margin: 2rem 0 1rem 0;
  color: var(--accent-primary);
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.1rem;
}

@media (max-width: 800px) {
  main {
    width: 92%;
    padding: 0 0.75rem 2rem 0.75rem;
  }

  .directory {
    gap: 0.5rem;
    margin: 1.5rem 0;
  }

  .directory li {
    font-size: 0.95rem;
  }

  .container {
    font-size: 1rem;
    line-height: 1.45rem;
  }
}

div.picture-container {
    width: 100%;
    max-width: 300px;
}

img {
    width: 100%;
}

@media (max-width: 500px) {
  main {
    width: 95%;
    padding: 0 0.5rem 2rem 0.5rem;
  }

  .directory {
    flex-direction: column;
    gap: 0.3rem;
  }

  .directory li {
    font-size: 0.9rem;
  }
}

p.title {
    margin-bottom: 0
}

p.desc {
    margin-top: 0;
    margin-bottom: 0
}

p.links {
    margin-top: 0;
    margin-bottom: 0;
    font-size: .95rem;
}

div.links-list p {
    margin: .3rem auto;
    font-size: 1rem;
    line-height: 1.2rem;
    text-overflow: ellipsis;
    white-space: normal;
    overflow: visible;
}

span.date {
    font-family: monospace;
    font-size: .8rem;
    position: relative;
    bottom: 1px;
    margin-right: 1rem;
    color: var(--date-color);
}

.footnote-ref {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.8em;
    vertical-align: super;
    line-height: 0;
}

.footnote-ref:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 15px var(--accent-glow);
}

.footnotes {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--accent-primary);
    font-size: 0.9em;
}

.footnotes h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.footnote {
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: justify;
    text-justify: inter-word;
}

.footnote-number {
    color: var(--accent-primary);
    font-weight: bold;
}

.footnote-backref {
    color: var(--accent-primary);
    text-decoration: none;
    margin-left: 5px;
    font-size: 0.8em;
}

.footnote-backref:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 15px var(--accent-glow);
}

.video-grid {
    display: flex;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.video-container {
    flex: 1;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .video-grid {
        flex-wrap: wrap;
    }
}

.post-date {
    font-family: 'EB Garamond';
    margin-top: 0.5rem;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.container p {
  text-align: justify;
  text-justify: inter-word;
}

/* Theorem / Definition / Proposition blocks */
.theorem-block {
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}

.theorem-block .theorem-head {
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.theorem-block p {
  margin: 0.4rem 0;
}

/* Indented axiom / condition list */
.axiom-list {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.axiom-list .axiom-row {
  display: flex;
  align-items: baseline;
  margin: 0.25rem 0;
  line-height: 1.5rem;
}

.axiom-list .axiom-label {
  color: var(--accent-primary);
  min-width: 3.5rem;
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.axiom-list .axiom-name {
  color: var(--accent-primary);
  margin-left: auto;
  padding-left: 1rem;
  white-space: nowrap;
}

.axiom-list .axiom-content {
  flex: 1;
  display: flex;
  align-items: baseline;
}

/* Theme toggle */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--accent-primary);
  transition: color 0.2s ease;
}

#theme-toggle:hover {
  color: var(--accent-secondary);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
}

.icon-sun { display: none; }

[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: inline; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}