/* ==========================================================================
   Literary Quarterly — Stylesheet
   Personal Website for osadchaya.me
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Colors — Archival Cream palette */
  --color-bg-content: #F8F5F0;      /* Warm ivory — page/content panel */
  --color-bg-surround: #2A2D30;     /* Slate charcoal — desktop body */
  --color-text-primary: #2A2522;    /* Warm black — body text */
  --color-text-display: #1A1714;    /* Deep charcoal — headings */
  --color-text-secondary: #6B6560;  /* Mid gray — nav, metadata */
  --color-accent: #8B3A3A;          /* Oxblood — links, hover */
  --color-border: #C4A68A;          /* Faded terra cotta — rules, borders */

  /* Typography */
  --font-display: 'Goudy Bookletter 1911', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing */
  --content-max-width: 33vw;
  --content-padding-x: 3.5rem;
  --content-padding-y: 4rem;
  --section-margin: 4rem;
  --paragraph-margin: 1.5em;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg-surround);
}

/* --------------------------------------------------------------------------
   Content Panel — The "page" floating on the desk
   -------------------------------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  width: var(--content-max-width);
  min-width: 320px;
  max-width: 600px;
  height: calc(100vh - 6rem);
  margin: 3rem auto;
  padding: var(--content-padding-y) var(--content-padding-x);
  background-color: var(--color-bg-content);
  overflow: hidden;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   Page Header — Page number + Menu toggle
   -------------------------------------------------------------------------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-primary);
}

.page-header .page-number {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

/* Display headings */
h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--color-text-display);
  margin: 0 0 1.5rem 0;
}

/* Section headings */
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--color-text-display);
  margin: var(--section-margin) 0 1rem 0;
}

h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-style: normal;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-display);
  margin: 2rem 0 0.75rem 0;
}

/* Body text */
p {
  margin: 0 0 var(--paragraph-margin) 0;
}

/* Emphasis */
em, i {
  font-style: italic;
}

strong, b {
  font-weight: 500;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Lists */
ul, ol {
  margin: 0 0 var(--paragraph-margin) 0;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

/* --------------------------------------------------------------------------
   Pull Quotes
   -------------------------------------------------------------------------- */
blockquote {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: normal;
  line-height: 1.5;
  margin: 2rem 0 2rem 2rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border);
  color: var(--color-text-primary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Horizontal Rules
   -------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--section-margin) 0;
}

/* --------------------------------------------------------------------------
   Navigation Overlay
   -------------------------------------------------------------------------- */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

.nav-overlay .nav-content {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.25s ease;
}

.nav-overlay.collapsed .nav-content {
  transform: translateY(-1rem);
  opacity: 0;
  pointer-events: none;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: var(--content-max-width);
  min-width: 320px;
  max-width: 600px;
  height: calc(100vh - 6rem);
  margin: 3rem auto;
  padding: var(--content-padding-y) var(--content-padding-x);
  background-color: rgba(248, 245, 240, 0.96);
  pointer-events: auto;
}

.nav-content .site-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: normal;
  color: var(--color-text-display);
  order: 2;
  text-align: right;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  order: 1;
}

.nav-list li {
  margin-bottom: 0.5rem;
}

.nav-list a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--color-text-primary);
  font-weight: 500;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Hamburger Menu Button
   -------------------------------------------------------------------------- */
.menu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--color-text-primary);
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.menu-toggle:hover {
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Bottom Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-primary);
}

.pagination a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.pagination a:hover {
  opacity: 0.6;
  text-decoration: none;
}

.pagination .page-number {
  font-family: var(--font-mono);
  font-weight: 500;
}

.pagination .next,
.pagination .prev {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.pagination .next:empty,
.pagination .prev:empty {
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Endnotes / Apparatus
   -------------------------------------------------------------------------- */
.endnotes {
  margin-top: var(--section-margin);
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.endnotes h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-style: normal;
  margin-bottom: 1rem;
}

.endnotes ol {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  padding-left: 1.5em;
}

.endnotes li {
  margin-bottom: 0.75rem;
}

/* Footnote markers in text */
sup {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  vertical-align: super;
}

sup a {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Folio Markers
   -------------------------------------------------------------------------- */
.folio {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Resume / CV Specific Styles
   -------------------------------------------------------------------------- */
.resume-section {
  margin-bottom: 3rem;
}

.resume-entry {
  margin-bottom: 2rem;
}

.resume-entry h3 {
  margin-bottom: 0.25rem;
}

.resume-meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.resume-description {
  margin-top: 0.5rem;
}

/* Skills list */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills-list li {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: rgba(107, 101, 96, 0.1);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0;
}

/* Skills categories */
.skills-category {
  margin-bottom: 1.5rem;
}

/* Back to questions link */
.back-to-questions {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.back-to-questions a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-to-questions a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.skills-category h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem 0;
}

/* Back-to-questions navigation */
.back-to-questions {
  margin-top: 1.5rem;
  margin-bottom: 0;
  text-align: right;
}

.back-to-questions a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.back-to-questions a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Section Navigation (inline dot-separated links)
   -------------------------------------------------------------------------- */
.section-nav {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.section-nav a {
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

.section-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Reading List Styles
   -------------------------------------------------------------------------- */
.reading-item {
  margin-bottom: 2rem;
}

.reading-item .title {
  font-style: italic;
}

.reading-item .author {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* About portrait */
.about-portrait {
  width: 100%;
  height: auto;
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   Contact Styles
   -------------------------------------------------------------------------- */
.contact-email {
  font-size: 0.75rem;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (≤768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --content-padding-x: 1.25rem;
    --content-padding-y: 2rem;
  }

  body {
    background-color: var(--color-bg-content);
  }

  .page {
    max-width: 100%;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1rem;
  }

  blockquote {
    margin-left: 0;
    margin-right: 0;
  }


  .nav-content {
    width: 100%;
    min-width: unset;
    max-width: 100%;
    padding: calc(var(--content-padding-y) + 2rem) var(--content-padding-x);
    flex-direction: column;
  }

  .nav-content .site-title {
    order: 1;
    text-align: left;
    margin-bottom: 2rem;
  }

  .nav-list {
    order: 2;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: white;
  }

  .page {
    max-width: 100%;
    padding: 0;
    box-shadow: none;
  }

  .nav-overlay,
  .menu-toggle,
  .pagination {
    display: none;
  }

  a {
    color: var(--color-text-primary);
    text-decoration: underline;
  }
}
