/*──────────────────────────────────────────────
  Obsidian Rainbow CSS — v4.7
──────────────────────────────────────────────*/

/*──────────────────────────────────────────────
  Version History
  v3.0 — Actually Fixed Edition
  v3.1 — Removed unused component styles (gradient
          page-card, center-md, gallery, lightbox,
          old post-list); re-added theme toggle
          button styling for light/dark switch
  v3.2 — Two-column layout (sidebar + main content),
          Obsidian-Publish style; stacks to a single
          column under 800px
  v3.3 — Added sidebar navigation styling (Home,
          Blog, Links)
  v4.0 — Rebuilt for the SootyOwl standard-site
          viewer engine (different class names:
          .post-item, .post-title, .site-header,
          etc. instead of .card/.rv-*). Re-added a
          manual light/dark toggle button since
          this engine only follows system
          preference by default.
  v4.1 — Renamed theme (Royal Velvet → Obsidian
          Rainbow). Re-added the two-column sidebar
          layout on top of the new viewer engine,
          plus a crest line at the top of the main
          column matching the one above the footer.
  v4.2 — Fixed mobile layout: align-items:flex-start
          was shrink-wrapping the stacked sidebar/
          content columns to half width once the
          layout switched to flex-direction:column
          under 800px; also tightened the leftover
          desktop sidebar spacing on mobile.
  v4.3 — Matched the top crest-line thickness (1px)
          to the footer's border (2px) so both lines
          look the same weight.
  v4.4 — Added a styled "Subscribe via RSS" button.
  v4.5 — Added a two-column content grid (.rv-two-col)
          for the landing page's main body, stacking
          to one column under 800px.
  v4.6 — Added styling for images and captions
  v4.7 — Added gallery page styling: repeating rows
          of image (left) + text (right), stacking
          to one column under 640px.
──────────────────────────────────────────────*/

/*──────────────────────────────────────────────
  Light Theme (Warm Velvet Daylight)
──────────────────────────────────────────────*/

:root {
  --bg: #f8f3ea;
  --text: #000000;
  --text-secondary: rgba(0, 0, 0, 0.6);
  --border: #d8c9b8;
  --link: #a78bd9;
  --link-hover: #4a7be0;
  --code-bg: #f2e9dd;
  --blockquote-border: #a78bd9;
  --tag-bg: #e9dfd2;
  --tag-text: #000000;
  --error-bg: #fbeaea;
  --error-border: #d97a8c;
  --error-text: #7a2e3d;
  --setup-bg: #eaf1fb;
  --setup-border: #4a7be0;

  --lavender: #a78bd9;
  --sapphire: #4a7be0;
  --teal: #4fbfa8;
  --gold: #d6a85a;
  --rose: #d97a8c;
}

/*──────────────────────────────────────────────
  Dark Theme
──────────────────────────────────────────────*/

html.theme-dark {
  --bg: #111111;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --border: #2a2a2a;
  --link: #cba6f7;
  --link-hover: #89b4fa;
  --code-bg: #1a1a1a;
  --blockquote-border: #cba6f7;
  --tag-bg: #222222;
  --tag-text: #ffffff;
  --error-bg: #2a1a1a;
  --error-border: #f38ba8;
  --error-text: #f38ba8;
  --setup-bg: #1a2230;
  --setup-border: #89b4fa;

  --lavender: #cba6f7;
  --sapphire: #89b4fa;
  --teal: #94e2d5;
  --gold: #f9e2af;
  --rose: #f38ba8;
}

/*──────────────────────────────────────────────
  Base Layout
──────────────────────────────────────────────*/

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Roboto", system-ui, sans-serif !important;
  font-weight: 100;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
  max-width: 100%;
}

/*──────────────────────────────────────────────
  Two-Column Layout (sidebar + main content)
──────────────────────────────────────────────*/

.rv-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
}

.rv-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
  padding: 2.4rem 1.5rem 1.5rem;
}

.rv-blog-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.rv-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 1.05rem;
}

.rv-content {
  flex: 1;
  min-width: 0;
  padding: 0.3rem 1.6rem;
  box-sizing: border-box;
}

/* Decorative gradient bar — mirrors the one above the footer. */
.rv-crest-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #ff6ec7,
    #ffa95f,
    #fff56e,
    #6effa3,
    #6ebaff,
    #c86eff
  );
  opacity: 0.6;
  margin: 1.6rem 0 1.2rem;
}

/*──────────────────────────────────────────────
  Subscribe (RSS) Button
──────────────────────────────────────────────*/

.rv-subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: #f26522;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background-image: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  font-size: 0.95rem;
  font-weight: 400 !important;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rv-subscribe-btn svg { color: #ffffff !important; }

.rv-subscribe-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/*──────────────────────────────────────────────
  Two-Column Content (used on the landing page)
──────────────────────────────────────────────*/

.rv-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 800px) {
  .rv-two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/*──────────────────────────────────────────────
  Gallery Page
──────────────────────────────────────────────*/

.rv-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.rv-gallery-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.rv-gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.rv-gallery-text h2 {
  margin-top: 0;
}

@media (max-width: 640px) {
  .rv-gallery-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .rv-layout {
    flex-direction: column;
    align-items: stretch; /* was flex-start, which shrink-wrapped columns to half width once stacked */
  }

  .rv-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
  }

  .rv-content {
    padding-top: 0;
  }

  .rv-crest-line {
    margin-top: 0.5rem;
  }
}

/*──────────────────────────────────────────────
  Typography
──────────────────────────────────────────────*/

h1 {
  background: linear-gradient(
    90deg,
    #ff6ec7,
    #ffa95f,
    #fff56e,
    #6effa3,
    #6ebaff,
    #c86eff
  );
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;

  font-weight: 400 !important;
  letter-spacing: -0.35px;
  line-height: 1.14;

  font-size: 1.906rem;
  margin: 0.5em 0 0.35em;
}

h2 { margin: 0.45em 0 0.3em; line-height: 1.22; color: var(--teal) !important; }
h3 { margin: 0.4em 0 0.28em; line-height: 1.24; color: var(--sapphire) !important; }
h4 { margin: 0.35em 0 0.25em; line-height: 1.26; color: var(--lavender) !important; }
h5 { color: var(--gold) !important; }
h6 { color: var(--rose) !important; }

p {
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 0.6em 0;
  font-weight: 100;
}

/*──────────────────────────────────────────────
  Gradient Links
──────────────────────────────────────────────*/

a {
  background: linear-gradient(
    90deg,
    #c86eff,
    #6ebaff,
    #6effa3,
    #fff56e,
    #ffa95f,
    #ff6ec7
  );
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  transition: background-position 0.4s ease;
  font-weight: 200 !important;
}

a:hover {
  background-position: 100% 0;
}

/*──────────────────────────────────────────────
  Code
──────────────────────────────────────────────*/

pre,
code {
  background: var(--code-bg);
  color: var(--text);
  padding: 0.45em 0.65em;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 100;
  margin: 0.8em 0;
}

/*──────────────────────────────────────────────
  Blockquotes
──────────────────────────────────────────────*/

blockquote {
  border-left: 3px solid var(--lavender);
  padding-left: 0.9em;
  color: var(--text-secondary);
  margin: 1em 0;
  font-weight: 100;
  font-size: 1.3rem;
  line-height: 1.62;
}

/*──────────────────────────────────────────────
  Site Header
──────────────────────────────────────────────*/

.site-header {
  text-align: center;
  padding: 0.5rem 1rem 2rem;
  margin-bottom: 0.6rem;
}

.refresh-btn {
  color: var(--text-secondary) !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
  background: none !important;
  background-image: none !important;
  font-weight: 400 !important;
}

/*──────────────────────────────────────────────
  Site Footer
──────────────────────────────────────────────*/

.site-footer {
  text-align: center;
  padding: 1.6rem 1rem 1.8rem;
  margin-top: 2.2rem;
  opacity: 0.85;
  border-top: 2px solid transparent;
  border-image: linear-gradient(
    90deg, #ff6ec7, #ffa95f, #fff56e, #6effa3, #6ebaff, #c86eff
  ) 1;
}

/*──────────────────────────────────────────────
  Post List (cards)
──────────────────────────────────────────────*/

.post-list {
  padding: 0;
}

.post-item {
  background: var(--code-bg);
  border: none;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.post-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* The whole card is an <a>, which would otherwise inherit the
   global gradient/transparent link style above and go blank.
   Force solid, readable text inside cards instead. */
.post-item a,
.post-item a * {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  background-image: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
}

.post-item .post-title {
  color: var(--link) !important;
  -webkit-text-fill-color: var(--link) !important;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
}

/*──────────────────────────────────────────────
  Theme Toggle
──────────────────────────────────────────────*/

.rv-theme-toggle {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.rv-theme-toggle:hover {
  transform: scale(1.06);
}
 
/*──────────────────────────────────────────────
  images
──────────────────────────────────────────────*/

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

figure { 
  display: block; 
  position: relative; 
  overflow: hidden; 
}

figcaption { 
  position: absolute; 
  background: rgba(0,0,0,0.75); 
  color: white; 
  font-size: 80%;
  padding: 10px 20px; 

  opacity: 0;
  bottom: 0; 
  right: -30%;
  -webkit-transition: all 0.6s ease;
  -moz-transition:    all 0.6s ease;
  -o-transition:      all 0.6s ease;
}

figure:hover figcaption {
  opacity: 1;
  right: 0;
}

/*──────────────────────────────────────────────
  Generic Button
──────────────────────────────────────────────*/
 
.rv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--link);
  color: var(--bg) !important;
  -webkit-text-fill-color: var(--bg) !important;
  background-image: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  font-size: 0.95rem;
  font-weight: 400 !important;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
 
.rv-btn svg { color: inherit !important; }
 
.rv-btn:hover {
  background: var(--link-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.rv-btn-pink {
  background: #ff6ec7;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
 
.rv-btn-pink:hover {
  background: #c86eff;
}