/* Norman Theme - Base Styles */
/* Reset and base setup */

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #f2ead9;
  background: #131009;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  line-height: 1.2;
}

/* Stage */
.stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.stage-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.stage::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(13, 11, 8, 0.3) 0%,
    rgba(13, 11, 8, 0.6) 50%,
    rgba(13, 11, 8, 0.8) 100%
  );
  pointer-events: none;
}

/* Author Identity */
.author-identity {
  position: fixed;
  bottom: 68px;
  left: 40px;
  z-index: 10;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(242, 234, 217, 0.12);
  border-radius: 8px;
  padding: 20px 28px;
}

.a-eyebrow {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 234, 217, 0.7);
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.a-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(52px, 6vw, 88px);
  font-weight: 300;
  line-height: 1.1;
  color: #f2ead9;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.a-sub {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-style: italic;
  color: rgba(242, 234, 217, 0.8);
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Name Flourish Canvas */
.name-flourish {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

/* Navigation */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: rgba(13, 11, 8, 0.92);
  backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 40;
  border-top: 1px solid rgba(242, 234, 217, 0.1);
}

.nav-item {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 234, 217, 0.7);
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.nav-item:hover {
  color: #f2ead9;
}

.nav-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.nav-item:hover .nav-pip {
  opacity: 1;
}

/* Watermark */
.wm {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 234, 217, 0.3);
  z-index: 1;
  pointer-events: none;
}

/* Flourishing Zone */
.flourishing {
  position: fixed;
  bottom: 52px;
  left: 0;
  width: 100%;
  height: 56px;
  z-index: 38;
  pointer-events: none;
}

.flourish-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(196, 163, 90, 0.3) 50%,
    transparent 100%
  );
}

.flourish-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(13, 11, 8, 0.1) 100%
  );
}

#flourish-canvas {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
}


/* Responsive */
@media (max-width: 768px) {
  .author-identity {
    bottom: 62px;
    left: 16px;
    right: 16px;
    max-width: none;
    padding: 14px 18px;
  }

  .a-name {
    font-size: clamp(32px, 8vw, 52px);
    margin-bottom: 8px;
  }

  .a-sub {
    font-size: 16px;
  }
  
  .nav {
    gap: 20px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex-shrink: 0;
  }
  
}

@media (max-width: 480px) {
  .author-identity {
    bottom: 58px;
    left: 10px;
    right: 10px;
    padding: 12px 14px;
  }

  .a-eyebrow {
    margin-bottom: 6px;
  }

  .a-name {
    font-size: clamp(28px, 7vw, 40px);
    margin-bottom: 6px;
  }

  .a-sub {
    font-size: 14px;
  }
  
  .nav {
    gap: 16px;
    padding: 0 12px;
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Koenig Editor Width Classes */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: auto calc(50% - 42.5vw);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  min-width: 100%;
  margin: auto calc(50% - 50vw);
}

.kg-width-full img {
  max-width: 100vw;
}

/* Book Page Layout */
.book-page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.book-page-inner {
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.book-back {
  display: inline-block;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s ease;
}

.book-back:hover {
  color: var(--text-primary);
}

.book-cover-img {
  display: block;
  max-width: 280px;
  margin: 0 auto 32px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.book-page-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 12px;
}

.book-page-meta {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.book-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}

.book-page-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: left;
}

.book-page-body p {
  margin-bottom: 1.2em;
}

.book-page-body a {
  color: var(--accent-primary);
  text-decoration: none;
}

.book-page-body a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .book-cover-img {
    max-width: 200px;
  }

  .book-page-title {
    font-size: 28px;
  }
}

/* Post Page Layout */
.post-template {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.post {
  max-width: 720px;
  width: 100%;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 40px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 16px;
}

.post-meta {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-author {
  color: var(--text-tertiary);
}

.post-content {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  color: var(--text-primary);
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.2em;
}

.post-content h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
  margin: 2em 0 0.8em;
}

.post-content h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 1.5em 0 0.6em;
}

.post-content a {
  color: var(--accent-primary);
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

.post-content blockquote {
  border-left: 2px solid var(--accent-primary);
  padding-left: 20px;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-comments {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.post-comments h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .post-title {
    font-size: 28px;
  }

  .post-content {
    font-size: 16px;
  }
}

/* Ghost Card Buttons */
:root {
  --button-color: var(--accent-primary);
}

/* Flourishing-specific button colors */
body.flourish-fantasy-fire   { --button-color: #d4773a; }
body.flourish-romance-petals { --button-color: #d4728a; }
body.flourish-scifi-scan     { --button-color: #2ab8d4; }
body.flourish-horror-blood   { --button-color: #a82020; }
body.flourish-thriller-fog   { --button-color: #8a8ea0; }
body.flourish-childrens-bubbles { --button-color: #c07ad4; }
body.flourish-memoir-handwriting { --button-color: #c4a35a; }
body.flourish-litfic-ink     { --button-color: #4a5068; }
body.flourish-coastal-tide   { --button-color: #1a9eb8; }

/* Flourishing Author Name Gradient Animation */
@keyframes flourish-text-rise {
  0%   { background-position: 50% 100%; }
  50%  { background-position: 50% 0%; }
  100% { background-position: 50% 100%; }
}

body[class*="flourish-"]:not(.flourish-none) .a-name {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 100% 300%;
  animation: flourish-text-rise 8s ease-in-out infinite;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

body.flourish-fantasy-fire .a-name {
  background-image: linear-gradient(to top,
    #a04a10, #d4773a 25%, #e8a54a 50%, #f2d9a0 75%, #f2ead9);
}

body.flourish-romance-petals .a-name {
  background-image: linear-gradient(to top,
    #8a2040, #d4728a 25%, #e8a0b4 50%, #f2d0d8 75%, #f2ead9);
}

body.flourish-scifi-scan .a-name {
  background-image: linear-gradient(to top,
    #0a6080, #2ab8d4 25%, #60d8f0 50%, #b0eaf8 75%, #f2ead9);
}

body.flourish-horror-blood .a-name {
  background-image: linear-gradient(to top,
    #500808, #a82020 25%, #c84040 50%, #d88080 75%, #f2ead9);
}

body.flourish-thriller-fog .a-name {
  background-image: linear-gradient(to top,
    #4a4e60, #8a8ea0 25%, #b0b4c0 50%, #d0d2d8 75%, #f2ead9);
}

body.flourish-childrens-bubbles .a-name {
  background-image: linear-gradient(to top,
    #6a2a8a, #c07ad4 25%, #d8a8e8 50%, #e8ccf0 75%, #f2ead9);
}

body.flourish-memoir-handwriting .a-name {
  background-image: linear-gradient(to top,
    #7a6820, #c4a35a 25%, #d8c080 50%, #e8d8b0 75%, #f2ead9);
}

body.flourish-litfic-ink .a-name {
  background-image: linear-gradient(to top,
    #1a2038, #4a5068 25%, #707888 50%, #a0a8b8 75%, #f2ead9);
}

body.flourish-coastal-tide .a-name {
  background-image: linear-gradient(to top,
    #084858, #1a9eb8 25%, #40c0d8 50%, #90dae8 75%, #f2ead9);
}

.kg-btn,
.kg-button,
.kg-btn-accent,
.kg-header-card-button,
.kg-signup-card-button,
.kg-product-card-button,
.kg-callout-card .kg-callout-card-button {
  background-color: var(--button-color) !important;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.kg-btn:hover,
.kg-button:hover,
.kg-btn-accent:hover,
.kg-header-card-button:hover,
.kg-signup-card-button:hover,
.kg-product-card-button:hover,
.kg-callout-card .kg-callout-card-button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dim {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.dimmed .author-identity {
  opacity: 0.3;
}

/* ── Focus & Accessibility ──────────────────────────────── */

[role="button"]:focus-visible,
.nav-item:focus-visible,
.ps-close:focus-visible,
.works-cat:focus-visible,
.book-item:focus-visible,
.content-item:focus-visible,
.event-tag:focus-visible,
.prop-back:focus-visible,
.works-back-btn:focus-visible,
.subscribe-tab:focus-visible,
.ev-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Ghost Portal Theming ───────────────────────────────── */

/* Portal trigger button (floating subscribe button) */
.gh-portal-triggerbtn-iframe {
  opacity: 0.7 !important;
}

/* Portal popup background overlay */
.gh-portal-popup-background {
  background: rgba(13, 10, 5, 0.85) !important;
}
