/*
 * Main stylesheet for Abiel Almonte's site
 *
 * Naming convention:
 *   .site-*     → site-wide elements (header, footer, nav)
 *   .container  → content width wrapper
 *   .article-*  → article/post structure
 *   .content    → where markdown/text goes (typography styles)
 *   .meta-*     → metadata (dates, links, etc.)
 */

/* ============================================
   RESET & BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f4ef;
  color: #000;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ============================================
   SITE HEADER & NAVIGATION
   ============================================ */

.site-header {
  padding: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.site-nav {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 24px;
  font-weight: 400;
  color: #000;
  text-decoration: none;
}

.site-title:hover {
  opacity: 0.7;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #000;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  text-decoration: underline;
}

/* ============================================
   SITE FOOTER
   ============================================ */

.site-footer {
  padding: 32px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 48px;
}

.footer-content {
  max-width: 768px;
  margin: 0 auto;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 14px;
  color: #555;
}

.footer-content a {
  color: #555;
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

.footer-content .separator {
  margin: 0 12px;
  color: #999;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.article-wrapper {
  padding: 48px 24px;
}

.container {
  max-width: 768px;
  margin: 0 auto;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
}

/* ============================================
   ARTICLE HEADER
   ============================================ */

.article-header {
  margin-bottom: 48px;
}

.title {
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 60px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 24px 0;
}

@media (max-width: 768px) {
  .title {
    font-size: 40px;
  }
}

.subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 20px;
  color: #555;
  margin-top: -16px;
  margin-bottom: 24px;
}

.subtitle .mono {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 15px;
  color: #555;
  margin-top: -16px;
  margin-bottom: 24px;
}

/* ============================================
   ARTICLE META (date, email, code links)
   ============================================ */

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: ui-monospace, 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 20px;
}

.meta-row {
  display: flex;
  gap: 16px;
}

.meta-label {
  font-weight: 400;
  min-width: 80px;
}

.meta-value {
  font-weight: 400;
}

.meta-value a {
  color: #000;
  text-decoration: underline;
}

/* ============================================
   CONTENT - Typography
   ============================================ */

.content {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Arial', sans-serif;
  font-size: 18px;
  line-height: 1.625;
  font-weight: 400;
}

.content .mono {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 18px;
  line-height: 1.625;
  font-weight: 400;
}


.content p {
  margin: 0 0 16px 0;
}

.content h2 {
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  margin: 48px 0 24px 0;
}

.content h3 {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Arial', sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.33;
  margin: 48px 0 16px 0;
}

.content h4 {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Arial', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 32px 0 16px 0;
}

.content h5 {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Arial', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  margin: 28px 0 12px 0;
  letter-spacing: 0.03em;
}

/* ============================================
   CONTENT - Links & Inline Elements
   ============================================ */

.content a {
  color: #000;
  text-decoration: underline;
}

.content a:hover {
  opacity: 0.7;
}

.content em {
  font-style: italic;
}

.content strong {
  font-weight: 600;
}

/* ============================================
   CONTENT - Lists
   ============================================ */

.content ul,
.content ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.content li {
  margin-bottom: 8px;
}

/* ============================================
   CONTENT - Code
   ============================================ */

.content code {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
}

.content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 32px 0;
}

.content pre code {
  background-color: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================
   CONTENT - Images & Figures
   ============================================ */

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

.content figure {
  margin: 32px 0;
}

.content figcaption {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.content .figure {
  text-align: center;
  margin: 32px 0;
}

.content .figure img {
  margin: 0 auto;
}

.content .figure-caption {
  font-size: 14px;
  color: #555;
  text-align: center;
  margin-top: 12px;
  font-style: normal;
  line-height: 1.4;
}

/* ============================================
   CONTENT - Blockquotes
   ============================================ */

.content blockquote {
  border-left: 3px solid #000;
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  color: #333;
}

/* ============================================
   CONTENT - Tables
   ============================================ */

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 14px;
}

.content th,
.content td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.content th {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.03);
}

.content tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.content tr.highlight {
  background: rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

/* ============================================
   CONTENT - Horizontal Rules
   ============================================ */

.content hr {
  border: none;
  border-top: 1px solid #000;
  margin: 48px 0;
}

/* ============================================
   CONTENT - Float Utilities
   ============================================ */

.content .float-right {
  float: right;
  margin: 0 0 16px 32px;
  max-width: 50%;
}

.content .float-left {
  float: left;
  margin: 0 32px 16px 0;
  max-width: 50%;
}

@media (max-width: 768px) {
  .content .float-right,
  .content .float-left {
    float: none;
    margin: 32px auto;
    max-width: 100%;
  }
}

.content .clear {
  clear: both;
}

/* ============================================
   CONTENT - Special Components
   ============================================ */

.content .chart-container {
  background-color: rgba(255, 255, 255, 0.5);
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.content .video-container {
  position: relative;
  width: 100vw;
  max-width: 1100px;
  margin-left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 1880/780;
  margin-top: 32px;
  margin-bottom: 32px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.content .video-container video,
.content .video-container iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.content .lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: #333;
}

/* ============================================
   CONTENT - Callouts
   ============================================ */

.content .callout {
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid #333;
  padding: 16px 20px;
  margin: 32px 0;
  border-radius: 0 4px 4px 0;
  font-size: 15px;
}

.content .callout p:last-child {
  margin-bottom: 0;
}

.content .callout strong {
  color: #000;
}

.content .callout-result {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 24px 0;
  display: inline-block;
}

.content .result-number {
  font-family: 'Crimson Text', serif;
  font-size: 24px;
  font-weight: 400;
  display: inline;
}

.content .result-label {
  font-size: 14px;
  color: #555;
  margin-left: 8px;
}

.content .section-break {
  margin: 32px 0;
}

/* ============================================
   CONTENT - Math (MathJax)
   ============================================ */

.content .MathJax {
  font-size: 1.1em;
}

.content mjx-container[display="true"] {
  margin: 24px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.content mjx-container[display="false"] {
  padding: 0 2px;
}

/* ============================================
   CONTENT - Details/Accordion
   ============================================ */

.content details {
  margin: 16px 0;
  border: none;
  background: none;
}

.content details summary {
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  font-weight: 400;
  font-size: 16px;
  font-style: italic;
  color: #555;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.content details summary:hover {
  color: #FC3A52;
}

.content details summary::-webkit-details-marker {
  display: none;
}

.content details summary::before {
  content: '▸';
  font-size: 14px;
  transition: transform 0.15s ease;
  display: inline-block;
  width: 16px;
  color: #999;
}

.content details[open] summary::before {
  transform: rotate(90deg);
}

.content details summary:hover::before {
  color: #FC3A52;
}

.content details .details-content {
  padding: 0;
  margin-top: 16px;
  border: none;
}

.content details .details-content > *:first-child {
  margin-top: 0;
}

.content details .details-content > *:last-child {
  margin-bottom: 0;
}

/* ============================================
   PAGE-SPECIFIC: Home/Index
   ============================================ */

.profile-img {
  display: block;
  margin: 0 0 50px 0;
  max-width: 100%;
  width: 300px;
  padding: 20px;
}

@media (min-width: 768px) {
  .profile-img {
    float: right;
    margin: 0 0 50px 80px;
    padding-left: 20px;
    width: 30%;
    min-width: 330px;
  }
}

/* ============================================
   PAGE-SPECIFIC: Projects List
   ============================================ */

.projects-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.project-table {
  width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
  margin: 2rem 0;
}

.project-table td {
  padding: 20px;
  vertical-align: middle;
}

.project-image-cell {
  width: 40%;
}

.project-content-cell {
  width: 60%;
}

.project-image {
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.project-title {
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 10px;
}

.skills {
  margin: 8px 0;
}

.skill {
  background: rgba(0,0,0,0.08);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-right: 6px;
  display: inline-block;
  font-family: 'Source Sans 3', sans-serif;
}

.project-links {
  margin: 10px 0;
}

.project-links a {
  margin-right: 0px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .project-table td {
    display: block;
    width: 100% !important;
    padding: 10px;
  }
  .project-image-cell {
    text-align: center;
  }
}
