/* ==========================================================================
   Typography & Font Faces
   ========================================================================== */
@font-face {
  font-family: charter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/charter_regular.woff2") format("woff2");
}
@font-face {
  font-family: charter;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/charter_italic.woff2") format("woff2");
}
@font-face {
  font-family: charter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/charter_bold.woff2") format("woff2");
}
@font-face {
  font-family: charter;
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/charter_bold_italic.woff2") format("woff2");
}

/* ==========================================================================
   Reset & Root Variables
   ========================================================================== */
:root {
  --bg-color: #f7f1e5;
  --bg-surface: #efe7d6;
  --text-main: #2e261f;
  --text-muted: #807164;
  --accent: #b4691e;
  --accent-light: rgba(180, 105, 30, 0.12);
  --border-color: rgba(60, 40, 20, 0.12);
  --shadow-sm: 0 2px 8px rgba(46, 38, 31, 0.05);
  --shadow-md: 0 8px 24px rgba(46, 38, 31, 0.08);
}

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

html {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: charter, Georgia, Cambria, serif;
  font-size: 19px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

a:active {
  transform: scale(0.97);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Article Layout & Prose
   ========================================================================== */
article {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 140px;
}

article p {
  font-size: 1.05rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  margin-bottom: 1.75rem;
  color: var(--text-main);
}

/* Subtle Drop Cap on the First Paragraph */
article > p:first-of-type::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* ==========================================================================
   Navigation (Pill Chips)
   ========================================================================== */
article .paging {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}

article .paging.top {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

article .paging.bottom {
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  margin-top: 3.5rem;
}

article .paging a {
  padding: 6px 14px;
  border-radius: 999px;
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 500;
  border: 1px solid transparent;
}

article .paging a:hover {
  background-color: var(--accent-light);
  color: var(--accent);
  border-color: rgba(180, 105, 30, 0.2);
}

/* ==========================================================================
   Expandable Media Details
   ========================================================================== */
article .ss {
  margin: 2.2rem 0;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease;
}

article .ss[open] {
  box-shadow: var(--shadow-md);
}

article .ss summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background-color 0.2s ease;
}

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

article .ss summary:hover {
  background-color: var(--accent-light);
}

/* Visual toggle chevron beside emoji */
article .ss summary::after {
  content: "▾";
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

article .ss[open] summary::after {
  transform: rotate(180deg);
}

article .ss img {
  width: 100%;
  object-fit: cover;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Feedback Form & Action Bar
   ========================================================================== */
form#issue-form {
  margin-top: 3rem;
  padding: 18px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

form#issue-form textarea {
  width: 100%;
  height: 90px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

form#issue-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

form#issue-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

form#issue-form .btn-con {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

form#issue-form .btn-con button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

form#issue-form .btn-con button:hover {
  background-color: var(--accent-light);
  border-color: rgba(180, 105, 30, 0.3);
  transform: translateY(-1px);
}

form#issue-form .btn-con button:active {
  transform: translateY(1px);
}

form#issue-form pre {
  margin-top: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.2em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Desktop Split / Dual-Pane Layout
   ========================================================================== */
@media (min-width: 100000px) {
  body {
    display: flex;
    justify-content: center;
    background-color: #eee7d8;
  }

  article {
    position: relative;
    max-width: 1080px;
    width: 100%;
    margin: 40px auto;
    padding: 48px 56px;
    background-color: var(--bg-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
  }

  /* Two-column layout if images are pinned */
  article .ss {
    float: right;
    width: 320px;
    margin: 0 0 24px 32px;
  }
}

/* ==========================================================================
   Desktop Comparison Layout (min-width: 1000px)
   Image: 400px (Pinned/Fixed on Left) | Reader: 500px (Scrollable on Right)
   ========================================================================== */
@media (min-width: 1000px) {
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #eee7d8;
  }

  /* Main wrapper centered on the screen */
  article {
    position: relative;
    width: 900px;              /* 400px (image) + 500px (text) */
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    background-color: var(--bg-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    min-height: 100vh;
  }

  /* ----------------------------------------------------
     LEFT COLUMN: Fixed Image (Locks to screen)
     ---------------------------------------------------- */
  article .ss:first-of-type {
    position: fixed;           /* Locks the image in place */
    top: 0;
    width: 400px;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    display: flex !important;  /* Centers image neatly */
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;          /* Prevents image from scrolling */
    z-index: 10;
  }

  article .ss:first-of-type summary {
    display: none;             /* Hides the fold toggle button */
  }

  article .ss:first-of-type img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* Keeps entire image visible without distortion */
    border: none;
    margin: 0;
  }

  /* Hide the duplicate inline screenshot on desktop */
  article .ss:not(:first-of-type) {
    display: none;
  }

  /* ----------------------------------------------------
     RIGHT COLUMN: 500px Text Stream (Scrolls with page)
     ---------------------------------------------------- */
  article > :not(.ss) {
    width: 500px;
    margin-left: 400px;        /* Clears the fixed 400px image on the left */
    padding-left: 35px;
    padding-right: 35px;
  }

  article .paging.top {
    margin-top: 0;
    padding-top: 25px;
  }

  article form#issue-form {
    margin-bottom: 80px;
  }
}