/* ABOUTME: Writer's Notebook theme for dylanreed.com author site. */
/* ABOUTME: Ruled paper background, margin notes, taped-in photo, genre tags. */

/* ========== Reset & Base ========== */

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

:root {
  --color-bg: #f4efe4;
  --color-text: #2c2420;
  --color-text-light: #8b7355;
  --color-rule: rgba(204, 107, 107, 0.25);
  --color-accent: #cc6b6b;
  --color-link: #6b5040;
  --color-link-hover: #2c2420;
  --color-tape: rgba(255, 255, 240, 0.67);
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --line-height: 1.8rem;
  --margin-left: 80px;
  --content-max: 680px;
}

html {
  font-size: 16px;
  line-height: 1.8;
}

body {
  font-family: var(--font-serif);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--color-rule) 1px, transparent 1px);
  background-size: 100% var(--line-height);
  background-position: 0 0;
  min-height: 100vh;
}

/* ========== Margin Rule ========== */

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: var(--margin-left);
  width: 2px;
  height: 100vh;
  background: var(--color-rule);
  z-index: 0;
  pointer-events: none;
}

/* ========== Typography ========== */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }

p {
  margin-bottom: var(--line-height);
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-link-hover);
}

/* ========== Navigation ========== */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-rule);
  position: relative;
  z-index: 10;
}

.nav-home {
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: 0.5px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-light);
  letter-spacing: 0.5px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ========== Page Content ========== */

.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}


.notebook-page {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ========== Margin Notes ========== */

.margin-note {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--color-text-light);
  display: block;
  margin-bottom: 0.5rem;
}

@media (min-width: 1300px) {
  .margin-note {
    position: absolute;
    left: -180px;
    width: 150px;
    text-align: right;
    display: block;
    margin-bottom: 0;
  }
}

/* ========== Taped Photo ========== */

.taped-photo {
  position: relative;
  display: inline-block;
  transform: rotate(-1.5deg);
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
}

.taped-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.taped-photo::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 80px;
  height: 24px;
  background: var(--color-tape);
  border: 1px solid rgba(200, 200, 180, 0.4);
  z-index: 2;
}

/* ========== Hero Section ========== */

.hero {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 4rem;
  position: relative;
}

.hero-photo {
  flex-shrink: 0;
  width: 240px;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.hero-intro {
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.hero-margin-note {
  display: block;
  margin-bottom: 0.5rem;
  text-align: center;
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.hero-cta:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.hero-cta-secondary {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-left: 1rem;
  color: var(--color-text-light);
}

/* ========== Section Headers ========== */

.section-header {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-header .margin-note {
  top: 0.2rem;
}

/* ========== Book Cards ========== */

.book-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.book-card {
  border: 1px solid rgba(139, 115, 85, 0.2);
  padding: 1.5rem;
  background: rgba(255, 255, 250, 0.4);
  transition: box-shadow 0.2s;
}

.book-card:hover {
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.08);
}

.book-card-with-cover a {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.book-card-cover {
  width: 120px;
  flex-shrink: 0;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.12);
}

.book-card-text {
  flex: 1;
}

/* ========== Sticky Note Placeholder Covers ========== */

.cover-placeholder {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sticky-note {
  position: relative;
  width: 85%;
  padding: 14px 10px 16px;
  border-radius: 1px;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.2);
  transform: rotate(var(--note-rotation, 0deg));
}

.sticky-tape {
  position: absolute;
  height: 14px;
  background: rgba(255, 255, 240, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 2;
}

.sticky-note__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sticky-note__divider {
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  margin: 7px 0;
  position: relative;
  z-index: 1;
}

.sticky-note__status {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 7px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Detail page: larger sticky note */
.book-detail-cover.cover-placeholder {
  width: 200px;
}

.book-detail-cover .sticky-note {
  width: 75%;
  padding: 18px 14px 22px;
}

.book-detail-cover .sticky-note__title {
  font-size: 16px;
}

.book-detail-cover .sticky-note__divider {
  margin: 9px 0;
}

.book-detail-cover .sticky-note__status {
  font-size: 9px;
}

/* ========== Book Detail Page ========== */

.book-detail-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.book-detail-cover {
  width: 200px;
  flex-shrink: 0;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
}

.book-detail-info {
  flex: 1;
}

@media (max-width: 768px) {
  .book-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-detail-cover {
    width: 160px;
  }
}

.book-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.book-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.genre-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.6rem;
  color: white;
  text-transform: uppercase;
}

.book-card .hook {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}

.book-card .status {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.6rem;
}

.book-card .free-badge {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 500;
}

/* ========== Universe Sections ========== */

.universe-section {
  margin-bottom: 3rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(139, 115, 85, 0.15);
}

.universe-section h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.universe-description {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.universe-works {
  list-style: none;
}

.universe-works li {
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.universe-works li:last-child {
  border-bottom: none;
}

/* ========== Blog Feed ========== */

.blog-feed {
  margin-bottom: 3rem;
}

.blog-post-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.blog-post-item:last-child {
  border-bottom: none;
}

.blog-post-item h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.blog-post-item h3 a {
  color: var(--color-text);
}

.blog-post-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.blog-post-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-top: 0.3rem;
}

/* ========== Full Blog Post ========== */

.blog-post-full h1 {
  margin-bottom: 0.3rem;
}

.blog-post-full .blog-post-date {
  display: block;
  margin-bottom: 2rem;
}

.blog-post-content {
  line-height: 1.8;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

.blog-post-content h2 {
  margin-top: 2rem;
}

.blog-post-content blockquote {
  border-left: 2px solid var(--color-text-light);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-light);
  font-style: italic;
}

.blog-post-content hr {
  border: none;
  border-top: 1px solid rgba(139, 115, 85, 0.2);
  margin: 2rem 0;
}

/* ========== Free Story Callout ========== */

.free-story-callout {
  margin-bottom: 3rem;
}

.free-story-inner {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border: 1px solid rgba(139, 115, 85, 0.2);
  background: rgba(255, 255, 250, 0.4);
}

.free-story-cover {
  width: 140px;
  flex-shrink: 0;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
}

.free-story-text {
  flex: 1;
}

.free-story-text h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.free-story-text p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

@media (max-width: 768px) {
  .free-story-inner {
    flex-direction: column;
    text-align: center;
  }

  .free-story-cover {
    width: 120px;
  }

  .free-story-text .margin-note {
    text-align: center;
  }
}

/* ========== Newsletter ========== */

.newsletter-section {
  padding: 2rem;
  border: 1px solid rgba(139, 115, 85, 0.2);
  background: rgba(255, 255, 250, 0.4);
  margin-bottom: 3rem;
}

.newsletter-section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.newsletter-section p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid rgba(139, 115, 85, 0.3);
  background: var(--color-bg);
  color: var(--color-text);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--color-text-light);
}

.newsletter-form button {
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
  cursor: pointer;
  transition: opacity 0.2s;
}

.newsletter-form button:hover {
  opacity: 0.85;
}

/* ========== Contact ========== */

.contact-block {
  margin-bottom: 2rem;
}

.contact-block h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* ========== Bio Blocks ========== */

.bio-formal {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px dashed rgba(139, 115, 85, 0.3);
  background: rgba(255, 255, 250, 0.3);
  position: relative;
}

.bio-formal-label {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.8rem;
}

.bio-formal p {
  font-size: 0.95rem;
}

/* ========== 404 ========== */

.page-404 {
  text-align: center;
  padding: 4rem 2rem;
}

/* ========== Footer ========== */

.site-footer {
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-light);
  border-top: 1px solid var(--color-rule);
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-text-light);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.footer-sep {
  margin: 0 0.5rem;
}

.footer-copy {
  font-size: 0.75rem;
}

/* ========== Empty State ========== */

.empty-state {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-light);
  padding: 1.5rem 0;
}

/* ========== Responsive ========== */

@media (max-width: 768px) {
  :root {
    --margin-left: 0px;
  }

  body::before {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-rule);
    gap: 0.8rem;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-photo {
    width: 180px;
  }

  .taped-photo {
    transform: rotate(-0.5deg);
  }

  .margin-note {
    position: static;
    width: auto;
    text-align: left;
    display: block;
    margin-bottom: 0.5rem;
  }

  .page-content {
    padding: 2rem 1.2rem;
  }

  .book-cards {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .hero-cta-secondary {
    display: block;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 15px;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }
}
