/* ============================================================
   mhowardStyles.css
   Marv Howard — Warm Editorial Theme
   copyright 2025 Marv Howard, all rights reserved
   ============================================================ */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --ink:          #1c1917;
  --warm:         #78716c;
  --pale:         #fdf8f3;
  --cream:        #f5ede0;
  --rule:         #e7ddd3;
  --accent:       #b45309;
  --accent-light: #fef3c7;
  --accent-dark:  #92400e;
  --success:      #15803d;
  --success-bg:   #dcfce7;
  --max:          1080px;
  --radius:       8px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover { 
  color: var(--accent-dark); 
}

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

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  background: var(--ink);
  color: var(--pale);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 64px;
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.masthead-monogram {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  transition: background 0.15s;
}

.masthead-brand:hover .masthead-monogram { 
  background: var(--accent-dark); 
}

.masthead-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--pale);
}

.masthead-tagline {
  font-size: 0.7rem;
  color: #a8a29e;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.masthead-nav {
  display: flex;
  align-items: stretch;
}

.masthead-nav a {
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  color: #a8a29e;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  border-left: 1px solid #2d2d2d;
  transition: color 0.15s, background 0.15s;
}

.masthead-nav a:hover {
  color: var(--pale);
  background: #2a2a2a;
}

.masthead-nav a.active {
  color: white;
  background: var(--accent);
  border-left-color: var(--accent);
}

/* ============================================================
   SECTION BAR
   ============================================================ */
.section-bar {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  padding: 9px 0;
}

.section-bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-bar-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
}

.section-bar-date {
  font-size: 0.75rem;
  color: var(--warm);
  letter-spacing: 0.04em;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.content-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 4.5rem;
  align-items: start;
}

/* ============================================================
   JOURNAL POSTS
   ============================================================ */
.post {
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

.post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post-datestamp {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.post-datestamp-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm);
  font-weight: 600;
  white-space: nowrap;
}

.post-datestamp-bar {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.post-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.2rem;
  line-height: 1.25;
}

.post-title em {
  font-style: italic;
  color: var(--accent);
}

.post-title .edit-icon {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.post-title .edit-icon:hover { 
  opacity: 1; 
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #44403c;
}

.post-content p {
  margin: 0 0 1.3rem;
}

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

.post-content h2,
.post-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--cream);
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-content img.imgRight {
  float: right;
  margin: 0 0 1rem 1.5rem;
  width: 40%;
  border-radius: var(--radius);
}

.post-content pre {
  background: #1c1917;
  color: #e7ddd3;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: 'Inconsolata', 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--cream);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent-dark);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.clearIt { 
  clear: both; 
  height: 1px; 
}

/* ============================================================
   SIDEBAR
   ============================================================ */
aside {
  position: sticky;
  top: 80px;
}

.sidebar-section {
  margin-bottom: 2.5rem;
}

.sidebar-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--ink);
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}

aside li:last-child { 
  border-bottom: none; 
}

aside a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.15s;
}

aside a:hover { 
  color: var(--accent); 
}

.archive-count {
  font-size: 0.72rem;
  color: var(--warm);
  background: var(--cream);
  padding: 2px 8px;
  border-radius: 10px;
}

.book-card {
  background: white;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}

.book-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.book-card-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 6px;
}

.book-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
}

.book-badge.available {
  background: var(--success-bg);
  color: var(--success);
}

.book-badge.soon {
  background: var(--accent-light);
  color: var(--accent);
}

.book-badge.progress {
  background: #f1f5f9;
  color: #64748b;
}

.about-blurb {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #57534e;
}

.about-blurb strong {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ============================================================
   ADMIN UI
   ============================================================ */
.admin-bar {
  background: var(--ink);
  color: #a8a29e;
  font-size: 0.78rem;
  padding: 7px 0;
  border-bottom: 1px solid #2d2d2d;
}

.admin-bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-bar a {
  color: #a8a29e;
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.admin-bar a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  max-width: 360px;
  margin: 8rem auto;
  padding: 2.5rem;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.login-wrap h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
  color: var(--ink);
}

.login-wrap p {
  font-size: 0.88rem;
  color: var(--warm);
  margin: 0 0 1.5rem;
}

.login-wrap input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-bottom: 1rem;
  font-family: inherit;
  background: var(--pale);
  transition: border-color 0.15s;
}

.login-wrap input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.login-wrap button {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.login-wrap button:hover { 
  background: var(--accent-dark); 
}

.login-error {
  color: #b91c1c;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fecaca;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--ink);
  color: #78716c;
  font-size: 0.82rem;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer a {
  color: #a8a29e;
  text-decoration: none;
}

footer a:hover { 
  color: var(--pale); 
}

/* ============================================================
   UTILITIES
   ============================================================ */
.iconLink {
  height: 1.4rem;
  vertical-align: middle;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.iconLink:hover { 
  opacity: 1; 
}

.myButton {
  display: inline-block;
  padding: 0.5em 1.2em;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.myButton:hover { 
  background: var(--accent-dark); 
}

pre[class*="language-"] {
  background: #1c1917;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .content-wrap {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 2rem 1.25rem;
  }

  aside {
    position: static;
    border-top: 1px solid var(--rule);
    padding-top: 2.5rem;
  }

  .masthead-tagline { 
    display: none; 
  }

  .masthead-nav a {
    padding: 0 0.8rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 520px) {
  .masthead-inner { 
    padding: 0 1rem; 
  }
  
  .content-wrap { 
    padding: 1.5rem 1rem; 
  }
  
  .section-bar-inner { 
    padding: 0 1rem; 
  }
  
  .footer-inner { 
    flex-direction: column; 
    gap: 0.5rem; 
    text-align: center; 
  }

  .masthead-nav a { 
    padding: 0 0.6rem; 
    letter-spacing: 0.04em; 
  }
}
