/*
Theme Name: KJ Isley
Theme URI: https://kjisleywrites.com
Author: K.J. Isley
Description: Custom author theme for K.J. Isley — speculative fiction writer.
Version: 1.3
License: GNU General Public License v2 or later
Text Domain: kj-isley
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Mono:wght@300;400&display=swap');

/* ══════════════════════════════════════════
   VARIABLES
══════════════════════════════════════════ */
:root {
  --ink:          #1a1714;
  --paper:        #f5f0e8;
  --cream:        #ede6d6;
  --warm-mid:     #b8a98e;
  --accent:       #7a4f2e;
  --accent-light: #c4884f;
  --muted:        #8a7d6b;
  --serif:        'Cormorant Garamond', Georgia, serif;
  --mono:         'DM Mono', monospace;
  --nav-height:   72px;
  --max-w:        1200px;
  --pad:          4rem;
}

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 300;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   NAV
══════════════════════════════════════════ */
.admin-bar nav#site-nav { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar nav#site-nav { top: 46px; } }

nav#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad);
  height: var(--nav-height);
  background: var(--paper);
  border-bottom: 1px solid var(--cream);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 2rem;
}
.nav-logo:hover { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a { color: var(--ink); }

/* Subscribe button in nav */
.nav-subscribe {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--paper);
  padding: 0.55rem 1.25rem;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-subscribe:hover { background: var(--ink); color: var(--paper); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink);
  padding: 0.25rem;
  line-height: 1;
}

.site-content { padding-top: var(--nav-height); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn-primary,
.wp-block-button.is-style-fill .wp-block-button__link {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--accent) !important;
  color: var(--paper) !important;
  font-family: var(--mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  border-radius: 0 !important;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary:hover,
.wp-block-button.is-style-fill .wp-block-button__link:hover {
  background: var(--ink) !important;
  color: var(--paper) !important;
  transform: translateY(-1px);
}

.btn-secondary,
.wp-block-button.is-style-outline .wp-block-button__link {
  display: inline-block;
  padding: 0.85rem 2rem;
  border: 1px solid var(--warm-mid) !important;
  color: var(--ink) !important;
  font-family: var(--mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  border-radius: 0 !important;
  background: none !important;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.btn-secondary:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ══════════════════════════════════════════
   SHARED TYPOGRAPHY HELPERS
══════════════════════════════════════════ */
.section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
  display: block;
}
.section-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 3rem;
}
.section-title em { font-style: italic; color: var(--accent); }

/* ══════════════════════════════════════════
   HERO
   Left col: text. Right col: photo filling full height.
   Photo is roughly 50% width, same height as text col.
══════════════════════════════════════════ */
.hero {
  display: grid;
  grid-template-columns: 55% 45%;
  min-height: calc(100vh - var(--nav-height));
}

.hero-text {
  padding: 6rem var(--pad) 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero-title {
  font-size: clamp(3.2rem, 5vw, 5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.4s forwards;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-tagline {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.6s forwards;
  font-style: normal;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.8s forwards;
}

/* Right panel — photo fills the column */
.hero-visual {
  position: relative;
  background: var(--cream);
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.3s forwards;
}

/* Hero author photo — covers the right column */
/* 1. Target the image */
.hero-author-photo {
  position: relative; /* Switch from absolute */
  width: 100%;        /* Fill the column width */
  max-width: 400px;   /* Cap the size so it doesn't get huge */
  height: auto;       /* Auto height maintains aspect ratio */
  object-fit: contain;
  display: block;
  margin: 0 auto;     /* Centers it horizontally */
}

/* 2. Ensure the parent isn't forcing a height */
/* You might need to inspect the parent class (e.g., .hero-column) 
   and remove any 'height: 100%' or 'min-height' if it's fighting the image */

.hero-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--cream);
}
.hero-author-photo {
  position: static !important;
  width: auto !important;
  height: auto !important;
}
.hero-photo-placeholder span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--warm-mid);
}
.hero-photo-placeholder small {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--accent);
  text-align: center;
  padding: 0 2rem;
  line-height: 1.5;
}

.hero-separator { height: 1px; background: var(--cream); }

/* ══════════════════════════════════════════
   SELECTED WORKS — homepage
══════════════════════════════════════════ */
.section {
  padding: 6rem var(--pad);
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  /* section is full width but content is capped */
  box-sizing: border-box;
  width: 100%;
}

/* For full-bleed sections (newsletter, footer) override max-w */
.section--full {
  max-width: none;
  padding: 5rem var(--pad);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px;
}

.work-card {
  background: var(--cream);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.work-card:hover { background: #e4daca; color: inherit; }
.work-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.work-card:hover::after { transform: scaleX(1); }
.work-card--dark { background: var(--ink); color: var(--paper); }
.work-card--dark:hover { background: #2a2622; color: var(--paper); }
.work-card--dark::after { background: var(--accent-light); }

.work-type {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
  display: block;
}
.work-title {
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}
.work-pub {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--warm-mid);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: block;
}
.work-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.work-card--dark .work-desc { color: rgba(245,240,232,0.6); }
.work-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.2s;
}
.work-card:hover .work-link { color: var(--ink); }
.work-card--dark .work-link { color: var(--accent-light); }

/* ══════════════════════════════════════════
   NEWSLETTER
══════════════════════════════════════════ */
.newsletter-section {
  padding: 5rem var(--pad);
  border-top: 1px solid var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  flex-wrap: wrap;
}
.newsletter-title { font-size: 1.75rem; font-weight: 300; line-height: 1.2; margin-bottom: 0.6rem; }
.newsletter-title em { font-style: italic; color: var(--accent); }
.newsletter-sub { font-size: 0.95rem; color: var(--muted); line-height: 1.6; max-width: 36ch; }
.newsletter-text { max-width: 40ch; }
.newsletter-form { display: flex; flex: 1; max-width: 480px; min-width: 260px; }
.newsletter-input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  background: var(--cream);
  border: 1px solid var(--warm-mid);
  border-right: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink);
  outline: none;
  letter-spacing: 0.05em;
}
.newsletter-input::placeholder { color: var(--warm-mid); }
.newsletter-input:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer#site-footer {
  background: var(--ink);
  border-top: none;
  padding: 2.5rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-name { font-style: italic; font-size: 1rem; color: var(--paper); }
.footer-copy { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--warm-mid); }

/* ══════════════════════════════════════════
   ABOUT PAGE
   Top strip: name + role (PHP).
   Rest: block editor inside .about-block-content
══════════════════════════════════════════ */
.about-page-wrap { padding-top: var(--nav-height); }

.about-top {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem var(--pad) 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.about-name {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.02em;
}
.about-name em { font-style: italic; color: var(--accent); }
.about-role {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-mid);
  line-height: 1.6;
  margin-top: 0.75rem;
}

.about-block-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--pad) 6rem;
}
/* Images inside block editor — constrained, not full-bleed */
.about-block-content .wp-block-image { max-width: 420px; }
.about-block-content .wp-block-image img { width: 100%; height: auto; object-fit: cover; }
.about-block-content .wp-block-image.alignwide,
.about-block-content .wp-block-image.alignfull { max-width: 100%; }

.about-block-content .wp-block-columns { gap: 4rem; }
.about-block-content h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 300; line-height: 1.15; font-style: italic; }
.about-block-content h3 { font-size: 1.35rem; font-weight: 300; font-style: italic; color: var(--accent); margin-bottom: 1rem; }
.about-block-content p { font-size: 1.05rem; line-height: 1.85; }
.about-block-content ul { list-style: none; padding-left: 0; }
.about-block-content li {
  font-size: 0.95rem; color: var(--muted); font-style: italic;
  line-height: 1.6; margin-bottom: 0.5rem;
  padding-left: 1.25rem; position: relative;
}
.about-block-content li::before { content: '—'; position: absolute; left: 0; color: var(--warm-mid); font-style: normal; }
.about-block-content .wp-block-separator { border-color: var(--cream) !important; border-top-width: 1px; margin: 2.5rem 0; }

/* ══════════════════════════════════════════
   WORKS PAGE
══════════════════════════════════════════ */
.works-page-wrap { padding-top: var(--nav-height); }
.works-block-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem var(--pad) 6rem;
}
.works-block-content h1 { font-size: clamp(2.5rem, 4vw, 4rem); font-weight: 300; font-style: italic; line-height: 1.05; margin-bottom: 1rem; }
.works-block-content h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 300; font-style: italic; line-height: 1.1; margin-bottom: 0.75rem; }
.works-block-content p { font-size: 1.05rem; line-height: 1.85; }
.works-block-content .wp-block-columns { gap: 4rem; }
.works-block-content .wp-block-image img { max-width: 100%; height: auto; }
.works-block-content .wp-block-separator { border-color: var(--cream) !important; margin: 0.5rem 0 3rem; }
.works-block-content .wp-block-group { margin-bottom: 2px; }

/* ══════════════════════════════════════════
   JOURNAL — archive listing
══════════════════════════════════════════ */
.journal-page-wrap { padding-top: var(--nav-height); }
.journal-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem var(--pad) 2rem;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad) 6rem;
}
.blog-card { background: var(--cream); padding: 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; transition: background 0.2s; }
.blog-card:hover { background: #e4daca; }
.blog-card-thumbnail { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 0.5rem; }
.blog-card-meta { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--warm-mid); }
.blog-card-title { font-size: 1.4rem; font-style: italic; font-weight: 300; line-height: 1.3; color: var(--ink); }
.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-excerpt { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.blog-card-link { display: inline-block; margin-top: auto; padding-top: 0.75rem; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* ══════════════════════════════════════════
   SINGLE POST
══════════════════════════════════════════ */
.single-post {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 4rem) var(--pad) 6rem;
}
.single-post h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; font-style: italic; line-height: 1.1; margin-bottom: 1rem; }
.post-meta { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--warm-mid); margin-bottom: 3rem; display: block; }
.entry-content { font-size: 1.1rem; line-height: 1.9; }
.entry-content p + p { margin-top: 1.5rem; }
.entry-content h2 { font-size: 1.5rem; font-style: italic; font-weight: 300; color: var(--accent); margin: 2.5rem 0 1rem; }
.entry-content blockquote { border-left: 2px solid var(--warm-mid); padding-left: 2rem; margin: 2rem 0; font-style: italic; color: var(--muted); }
.entry-content img { margin: 2rem 0; max-width: 100%; }

/* ══════════════════════════════════════════
   GENERIC PAGE
══════════════════════════════════════════ */
.generic-page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 4rem) var(--pad) 6rem;
}
.generic-page-wrap h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; font-style: italic; margin-bottom: 2.5rem; }
.generic-page-wrap .entry-content { font-size: 1.05rem; line-height: 1.85; }

/* ══════════════════════════════════════════
   404
══════════════════════════════════════════ */
.error-404-wrap { padding: calc(var(--nav-height) + 6rem) var(--pad) 6rem; text-align: center; }
.error-404-wrap h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 300; font-style: italic; margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════
   BLOCK EDITOR UTILITIES
══════════════════════════════════════════ */
.has-ink-color            { color: var(--ink) !important; }
.has-paper-color          { color: var(--paper) !important; }
.has-cream-color          { color: var(--cream) !important; }
.has-accent-color         { color: var(--accent) !important; }
.has-accent-light-color   { color: var(--accent-light) !important; }
.has-muted-color          { color: var(--muted) !important; }
.has-warm-mid-color       { color: var(--warm-mid) !important; }
.has-ink-background-color    { background-color: var(--ink) !important; }
.has-cream-background-color  { background-color: var(--cream) !important; }
.has-paper-background-color  { background-color: var(--paper) !important; }

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --pad: 1.5rem; }

  nav#site-nav { padding: 0 1.5rem; gap: 1rem; }
  .nav-toggle { display: flex; align-items: center; }
  .nav-right { gap: 1rem; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--cream);
    z-index: 999;
    padding: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--cream); }
  .nav-links a { display: block; padding: 1rem 1.5rem; font-size: 0.8rem; }
  .nav-subscribe { display: none; }
  /* Show subscribe in mobile menu instead */
  .nav-links .nav-subscribe-mobile { display: block; }

  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 65vw; position: relative; }
  .hero-author-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-position: center 25%; }
  .hero-text { padding: 4rem 1.5rem 2.5rem; }

  .newsletter-section { flex-direction: column; gap: 2rem; }
  .newsletter-form { max-width: 100%; width: 100%; min-width: 0; }

  .about-block-content .wp-block-columns { flex-direction: column !important; }
  .works-block-content .wp-block-columns { flex-direction: column !important; }

  .blog-grid { grid-template-columns: 1fr; }

  .single-post { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (max-width: 540px) {
  .works-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
}
