


/* =============================================================================
   SHORTDREAM — MASTER CSS
   PART 1 of 4 — FOUNDATIONS & IDENTITY
   =============================================================================
   Purpose:
   - Prevent FOUC
   - Define design tokens
   - Establish brand identity
   - Create stable layout primitives

   Sublime:
   - Use ⌘+R / Ctrl+R to collapse sections
   ============================================================================= */


/* #region 01 — PAGE LOAD & BOOTSTRAP ======================================= */

  /* Prevent flash of unstyled content */
  .js-loading {
    visibility: hidden;
  }

  /* Smooth reveal once JS removes class */
  html:not(.js-loading) {
    transition: visibility 0s 0.1s;
  }


html {
  scroll-behavior: smooth;
}

#top {
  scroll-margin-top: 5rem;
}


/* #endregion */


/* #region 02 — COLORS & FONTS ================================ */

  :root {
    /* Light theme */
    --bg-color-light: #f1f3f3;
    --panel-color-light: #f8f9fa;
    --comment-bg-light: #f9f9fc;
    --text-color-light: #333;
    --card-bg-light: #ffffff;

    /* Brand */
    --accent-color-light: #87a726;
    --highlight-color-light: #a95818;

    /* Utility */
    --border-color-light: #e0e0e0;
    --grey-for-buttons: #6f6f6f;
    --green-for-hover: #87a726;

    /* Text hierarchy */
    --ink-strong: #2b2b2b;   /* headings, primary nav */
    --ink-base:   #4a4a4a;   /* body text */
    --ink-muted:  #7a7a7a;   /* secondary / meta */
    --ink-faint:  #9a9a9a;   /* labels, low priority */

    /* Brand accent */
    --accent: #8fbf1f;       /* your green */


  /* Font stacks */
  --font-titles: "Roboto Slab", Georgia, serif;
  --font-reading: "Open Sans", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --font-weight-reading: 400;
  --font-weight-reading-strong: 500;
  --font-weight-ui-strong: 600;

  }


/* #endregion */


/* #region 03 — HEADER & BRAND IDENTITY ===================================== */

  /*
    Identity rule:
    The user must always know:
    - what system this is
    - where they are inside it
  */

  /* Logo cluster */
  .flex-item-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
    line-height: 1.2;
  }



  /* Small screens */
  @media (max-width: 480px) {
    .flex-item-left {
      flex-direction: column;
      align-items: flex-start;
    }

  }
/* #endregion */


/* #region 04 — OLD BUTTON SYSTEM ======================================= */
/* 
  .btn,
  .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
    font-size: 0.8em;
    padding: 0.5em 1em;
    border-radius: 0.375em;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--comment-bg-light);
    transition: all 0.2s ease;
  }

  .btn-primary {
    background-color: var(--accent-color-light);
    color: #fff;
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
   */

/* #endregion */


/* #region 05 — INPUTS & TEXTAREAS ========================================= */

  textarea {
    width: 100%;
    padding: 10px;
    font-size: 0.95em;
    border-radius: 5px;
    border: 1px solid #ced4da;
    resize: none;
  }

  textarea:focus {
    outline: none;
    border-color: var(--accent-color-light);
  }
/* #endregion */



/* =============================================================================
   SHORTDREAM — MASTER CSS
   PART 2 of 4 — CONTENT ENGINE
   =============================================================================
   Purpose:
   - Control how content reads, flows, wraps, and breathes
   - Chats, articles, images, videos, headers, pagination
   - This is the “reader experience” layer

   Rule:
   If it affects how text/media is consumed → it lives here
   ============================================================================= */



/* #region — CHAT CONTENT (MARKDOWN FLOW) =========================================== */

  /*  .chat-content only styles things from markdown. No layout. No page logic. If it didn’t come out of render_chat_markdown(), it does not belong here.  */
  /*  The classes below describe how conversation text flows.  They are content semantics, not layout */

  .chat-content {
    margin-bottom: 0.3em;
  }

  /* Clear floats inside chat content - delete if we dont use floats - legacy support  */
  .chat-content::after {
    content: "";
    display: block;
    clear: both;
  }

  .chat-content p {
    margin-bottom: 0.6em;
    /* max-width: 105ch; */   /*  to keep paragraphs from feeling too stretched without constraining layout */
  }

  .chat-content p strong {
    display: inline-block;
    margin-bottom: 0.05em; /* tighter after label */
    font-weight: 600;
    color: #555; /* slightly muted */
    opacity: 0.85;    
  }

  .chat-content p:has(strong) {
    margin-top: 0.5em; /* more air before James: -  */
  }

  /* Markdown generates headings. Those headings are content, not UI. This is the only place they should ever be styled
    We delete :
    .single-chat h3
    .section-header h3
    any “except in chat” overrides
  */

  .chat-content h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.6em;
  }

  .chat-content hr + h2 {
    margin-top: 1em;
    margin-bottom: 1em;
  }

  .chat-content h3 {
    font-size: 1.2em;
    margin-top: 1.3em;
    margin-bottom: 0.4em;
  }

  .chat-content h4 {
    font-size: 1.1em;
    margin-top: 1.1em;
    margin-bottom: 0.35em;
  }


  /*
  Define a readable text column for chat previews and individual chat pages. On wide screens, the content now has a center of gravity.
  Then center the whole chat block, not just the image
  */
  /*
  .chat,
  .chat-preview,
  .chat-single {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
  }
  */

  /* Lists inside chat content - correctly scoped here*/
  .chat-content ul,
  .chat-content ol {
    margin: 0.6em 0 0.8em;
    padding-left: 2.25em;
  }

  /* Nested lists */
  .chat-content ul ul,
  .chat-content ol ol {
    padding-left: 2em;
  }

  /* Ordered list styling (numbers restored) */
  .chat-content ol {
    list-style: decimal;
  }

  .chat-content ol li {
    margin-bottom: 1em;
  }

  .chat-content ol li::marker {
    font-weight: 550;
  }

  /* Mobile tightening */
  @media (max-width: 600px) {
    .chat-content ul,
    .chat-content ol {
      padding-left: 1.25em;
    }
  }


/* #endregion */


/* #region — CHAT FILTER, TAGS, LIKES =============================================== */


  .button.pill {
    border-radius: 999px;
    padding: 0.7em 0.9em;
    font-size: 0.8em;
    line-height: 0.4rem;
    height: auto;
  }


  /* Make the container explicitly control row spacing using flex + row-gap  */
  .chat-filters {
    display: flex;
    flex-wrap: wrap;

    column-gap: 0.5rem;   /* space between pills horizontally */
    row-gap: 0.65rem;     /* 👈 controls space between rows */
    margin-bottom: 1.8rem;
  }


  /* Active filter */
  .chat-filters .button.active,
  .chat-filters .button.primary {
    background: #87a726;
    color: #fff !important;
    box-shadow: none;
  }


  /* Tags on previews - no link */
  .chat-tags-nolink {
    font-size: 0.8em;
    color: #7a7a7a; /* or var(--text-muted) */
    margin-top: 0.75em;
    margin-bottom: 1em;
    letter-spacing: 0.02em;
  }

  .chat-tags-nolink span {
    margin-right: 0.4em;
  }

  .tag-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9a9a9a;
    margin-right: 0.4em;
    opacity: 0.9;    
  }

  /* Tags at bottom of single chat - with link 
      - Scope everything to .chat-tags-linked
      - No duplication. Scoped and safe.
      - We've separated .chat-filters (on chat list page) and .chat-tags-linked (under an individual chat)
      - tighter and quieter than filters
      - add spacing
      - Use flex + gap
  */

  .chat-tags-linked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem; /* row gap, column gap */
  }

  .chat-tags-linked .button {
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    opacity: 0.85;
    border-radius: 999px;   
    line-height: 1rem;     
  }

  .chat-tags-linked span {
    margin-right: 0.4em;
  }

  .chat-tags-linked a,
  .chat-tags-linked a:hover,
  .chat-tags-linked a:visited {
    text-decoration: none;
  }

  .chat-tags-linked .button:hover {
    opacity: 1;
  }

  /*  this is for the LIKE THIS CHAT button on the view_chat.php 
      <div class="chat-like">
        <button class="like-button liked" data-chat-id="16">♥ Like this chat</button>
      </div>
  */

  .chat-like {
    margin-top: 0.8em;
  }

  .like-button {
    padding: 0.45em 0.9em;
    font-size: 0.8em;
    border-radius: 6px;   
    border: 1px solid #bbb;
    border: none;
    background: transparent;
    color: #444;
    padding-left: 0.5rem;
    padding-right: 0.5rem;    
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .like-button.liked {
    border-color: #7fbf4a;
    color: #5a9c2f;
    background: rgba(127,191,74,0.08);
  }

  .like-button a,
  .like-button a:hover,
  .like-button a:visited {
    text-decoration: none;
  }


  .like-button:hover {
    color: var(--accent);
    background: rgba(143, 191, 31, 0.1);
  }


/* #endregion */


/* #region —  BUTTON CORE (single authority) - .button is the ONLY base ============================================ */
 
  /*
  .button {
    display: inline-block;
    padding: 0.6em 1.4em;
    border-radius: 4px;
    border: 1px solid currentColor;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
  }

  .button.primary {
    background: var(--accent, #6ab04c);
    color: #fff;
    border-color: var(--accent, #6ab04c);
  }
  */


  .button,
  button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.55em 1.2em;
    border-radius: 4px;

    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;

    cursor: pointer;
    text-decoration: none;

    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);

    transition:
      background-color 0.2s ease,
      color 0.2s ease,
      transform 0.15s ease;
  }

  /* ONE hover rule, globally. Never redefine hover anywhere else. */
  .button:hover {
    background-color: var(--accent);
    color: #fff;
  }


/* #endregion */


/* #region — ACTIONS ============================================ */
 
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    padding-left: 0;
    margin: 0;
    /* margin-top: 2em; */
  }

  .actions li {
    display: inline-block;
  }


  /* 
  CSS basics:

      <div class="actions-read">
        <a href="contact.php" class="button">Book a Session</a>
      </div> 
              ==> ".actions-read .button { font-size: 0.75rem; }"  when ".actions-read" is a parent of ".button" 


      <div class="actions-read button">
        <a href="contact.php">Book a Session</a>
      </div> 
              ==> ".actions-read.button { font-size: 0.75rem; }"  when .actions-read" is same level as ".button" 
  */

  /* Filters */
  .chat-filters .button {
    border-radius: 999px;
    font-size: 0.75rem;
  }

  /* Read / More buttons */
  .actions-read .button {
    font-size: 0.75rem;
    padding: 0.45em 1.1em;
    opacity: 0.85;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  /* Footer is centred */
  .actions-nav {
    justify-content: center;    
  }

  /* Footer buttons */
  .actions-nav .button {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 1rem;  
    transition: background-color 0.2s ease, color 0.2s ease;      
  }

  /* ===== Page End Cap ===== */

  .nav-endcap {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.15);
  }

  .nav-endcap .endcap-label {
    text-align: center;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }


/* #endregion */


/* #region 09 — IMAGES & FLOATS ============================================= */

  /* Responsive images */
  .chat-content img {
    max-width: 100%;
    height: auto;
  }

  @media (max-width: 768px) {
    .chat-header img,
    .chat-hero img,
    .chat-content img {
      display: block;
      margin: 0.4rem auto 0.6rem;
      float: none;
    }
  }

  /* Utility floats */
  .img-wrap-right {
    float: right;
    width: 50%;
    margin: 0 0 0.5em 1em;
  }

  .img-center {
    display: block;
    width: 60%;
    margin: 0.5em auto 1em;
  }



/* #endregion */


/* #region 10 — VIDEO CONTAINERS ============================================ */

  /* Landscape (16:9) */
  .video-container {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 320px;
    border-radius: 0.75em;
    background: #000;
    margin: 0 auto;
  }

  .video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }

  /* Shorts (9:16) */
  .shorts-video-container {
    width: min(100%, 380px);
    margin: 0 auto;      /* CENTER it */
    aspect-ratio: 9 / 16;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
  }

  .shorts-video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }


  /* Meta lines (e.g. Day 3) */
  .video-meta {
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(0, 0, 0, 0.55);
      margin-top: 0.8rem;
      opacity: 0.7;    
  }


  .video-preview {
    max-width: 420px;  
    text-align: center;
    font-family: var(--font-reading);
    padding-top: 1rem;    
  }

  .video-desc {
    max-width: 28ch;
    min-height: 5.5em;    
    margin: 1rem auto 0;
  }


  /* new video classes under latest chat */

  .latest-videos {
    margin-top: 0.3rem;
  }

  .latest-videos .posts > article {
    border-left: none;
    padding-left: 0;
  }

  /* HARD STOP: remove HTML5UP post dividers in video grid */
  .latest-videos .posts article::before,
  .latest-videos .posts article::after {
    display: none !important;
    content: none !important;
  }


  .video-row {
    display: grid;
    align-items: start;
    justify-items: center;  
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(3rem, 8vw, 6rem);    
    margin-top: 2rem;
    gap: 4rem;
  }

  .video-row .shorts-video-container {
    width: min(100%, 260px);
  }

  .video-row .video-preview {
    max-width: 300px;
  }

  .video-row .video-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 0.6rem;
  }

  .video-row .video-meta {
    font-size: 0.7rem;
    margin-top: 0.4rem;
  }

  /* Kill HTML5UP post dividers inside video rows */
  .video-row > article {
    border-left: none !important;
    padding-left: 0 !important;
  }

  .video-row:before,
  .video-row:after {
    display: none !important;
  }

  /* Single column on mobile and Tablet */
  @media (max-width: 900px) {
    .video-row {
      grid-template-columns: 1fr;
    }
  }




  .view-videos .posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6rem;
    justify-items: center;    
  }

  .view-videos .shorts-video-container {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
  }

  .view-videos .video-preview {
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
  }





/* #endregion */


/* #region 11 — CHAT HEADERS  ========================================= */

  /* 1. Make the header block the spacing authority - Now the entire title area breathes as a unit. */
  .chat-header {
    margin-bottom: 0.2rem;
    display: block;    
  }

.chat-header .chat-hero,
.chat-header .image {
  display: block;
  margin: 0.75rem 0 1.25rem;
}

/*
.chat-header img {
  max-height: 100%;
  width: auto;
  margin-left: 0.25rem; 
}
*/

.chat-preview .chat-header img {
  max-height: 75px;
}


.chat-single .chat-header img {
  max-height: 130px;
}



  /* 2. Make each semantic child responsible for its own local spacing  */
  .chat-title {
    font-size: 1.6rem;
    line-height: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: var(--ink-strong);  
  }

  /* Links inside titles do NOT recolor */
  .chat-title a {
    color: inherit;
    text-decoration: none;
  }

  /* Intentional hover */
  .chat-title a:hover {
    color: var(--accent);
  }


  .chat-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink-base);    
    margin-bottom: 0;  
  }

  .chat-preview .chat-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


  /* Meta lines (e.g. Day 3) */
  .chat-meta {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.75);
    margin-top: 0.3rem;
    opacity: 0.7;      
  }

  .chat-hero {
    margin: 0.75rem 0 0;
    /* text-align: center; */
  }

  .chat-hero img {
    max-height: 100px;
    opacity: 0.8;
  }

  /* scale the fonts by the context - either featuredChat on homepage, fullChat in view_chat.php or previewChats in view_chats.php */
  .chat-preview .chat-title { font-size: 1.4rem; }
  .chat-featured .chat-title { font-size: 1.4rem; }
  .chat-full .chat-title { font-size: 1.8rem; }


  /* Chat preview image containment */
  .chat-preview .image {
    max-height: 100%;    
    margin-bottom: 0.5rem;
  }

  .chat-preview .image img {
    height: 100%;
    width : auto;
    display: block;
  }

  .chat-single .image {
    margin: 0 0 1.5rem 0;
    text-align: left;
  }

  .chat-single .image img {
    max-height: 100%;
    width: auto;
  }

/* Stop images from influencing perceived alignment. You currently allow floats and left alignment in places that visually drag the text.
Kill floats for single chat content. Option 1 means images are interruptions, not anchors. 
.chat-single .chat-content img {
  float: none !important;
  display: block;
  margin: 1.25rem auto;
}


Titles must live in the same gravity well as the text. Right now, titles look aligned but aren’t formally constrained 
.chat-single .chat-header,
.chat-single .chat-content {
  max-width: 70rem;
  margin-left: auto;
  margin-right: auto;
}
*/

  .myHilite {
    color:#ffffff;
    background-color:#7cac03;     /* #87a726; */   
    /* font-weight: bolder;   */
    /* font-size:15px;  */
    padding:3px;
    border-radius: 5px;
  } 

  .myHilite2 {
    color:#8f4e1e;
    /* background-color:#7cac03;  */
    font-weight: bolder; 
    /* font-size:15px;  */
    padding:2px;
    /* border-radius: 3px; */
  } 

  .myHilite3 {
      background-color: #fff2cc;
      padding: 0 3px;
  }




/* #endregion */


/* #region 12 — PAGINATION & NAV INSIDE CONTENT ============================= */

/*
Notes:
  pagination is a flex container (because it has .actions) - just tell pagination to centre its kids via "justify-content: center"
    <div class="pagination actions actions-read">
      <a href="view_chats.php?mode=topic&amp;page=2" class="button">Previous</a>
        <span class="page-number">Page 3 of 3</span>
    </div>
      .actions        → display: flex
      .pagination     → center the flex items
      .actions-read   → button sizing + hover
*/
  .pagination {
    margin-top: 2em;
    text-align: center;
    justify-content: center;
    align-items: center;    
  }

  .pagination .page-number {
    display: inline-block;
    padding: 0 1em;
  }

  /* Inline nav buttons */
  .nav-button-secondary,
  .next-button,
  .prev-button {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.4em 1em;
    border: 1px solid #ddd;
    border-radius: 0.375em;
    background: transparent;
    color: #777;
    text-decoration: none;
  }

  .nav-button-secondary:hover,
  .next-button:hover,
  .prev-button:hover {
    background-color: #f7f7f7;
    color: #555;
  }
/* #endregion */


/* #region 13 — RESPONSIVE CONTENT TWEAKS =================================== */

  @media (max-width: 736px) {
    .img-wrap-right,
    .chat .image.main {
      float: none;
      max-width: 100%;
      margin: 0 0 1em 0;
    }

    .img-center {
      width: 90%;
    }
  }
/* #endregion */




/* =============================================================================
   SHORTDREAM — MASTER CSS
   PART 3 of 4 — INTERACTION ENGINE
   =============================================================================
   Purpose:
   - Responses, comments, replies
   - Reaction icons & menus
   - Edit / delete / reply controls
   - Collapsible sections & toggles
   - Popup menus & hover bridges

   Rule:
   If JS toggles a class → this file defines what happens
   ============================================================================= */


/* #region 14 — RESPONSE CARDS ============================================== */

  .response {
    position: relative;
    background: var(--panel-color-light);
    border: 1px solid #ced4da;
    border-top: 24px solid #7e9b18;
    border-radius: 8px;
    margin: 15px 0 20px;
    padding: 10px;
    overflow: visible;
  }

  .response.other-user {
    border-top-color: #b2b25c;
  }

  .response-header,
  .response-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: var(--comment-bg-light);
  }

  .response-header {
    border-bottom: 1px solid var(--border-color-light);
  }

  .response-footer {
    border-top: 1px solid var(--border-color-light);
  }

  .response-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .response-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
/* #endregion */


/* #region 15 — RESPONSE ACTION ICONS ======================================= */

  .response-actions {
    display: flex;
    gap: 10px;
  }

  .action-btn {
    background: none;
    border: none;
    font-size: 0.7em;
    color: var(--grey-for-buttons);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s;
  }

/*
  .action-btn:hover {
    background: #f0f0f0;
    color: var(--green-for-hover);
  }
*/

  .action-btn i {
    margin-right: 5px;
  }
/* #endregion */


/* #region 16 — COMMENTS & REPLIES ========================================== */

  .response-comments {
    background: var(--comment-bg-light);
    border-top: 1px solid var(--border-color-light);
  }

  .comment,
  .reply {
    background: #e9e9e9;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    position: relative;
  }

  .reply {
    margin-left: 30px;
  }

  .comment-header,
  .reply-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .comment-content,
  .reply-content {
    display: none;
    margin-left: 40px;
    line-height: 1.6;
    font-size: 15px;
    color: #222;
  }

  .comment-content.active,
  .reply-content.active {
    display: block;
  }
/* #endregion */


/* #region 17 — COMMENT / REPLY FORMS ======================================= */

  .comment-form-container,
  .reply-form-container {
    display: none;
    margin: 12px 0;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
  }

  .comment-form-container.active,
  .reply-form-container.active {
    display: block;
  }

  .comment-input,
  .reply-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    resize: vertical;
  }

  /* Note:
  Buttons are reusable - use the ".button" class as the base
  Spacing, hover, etc belongs to context - which is ".form-actions" here
  Context here = contact form  */

  .form-actions {
    margin-top: 2em;
  }

  /*
  .form-actions input[type="submit"],
  .form-actions input[type="reset"] {
    appearance: none;
    border: none;
    border-radius: 4px;
    padding: 0.6em 1.2em;
    background: #828282;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .form-actions input[type="submit"]:hover,
  .form-actions input[type="reset"]:hover {
    background-color: var(--accent);
    color: #ffffff;
  }
  */

  .form-actions input:focus,
  form input[type="text"]:focus,
  form input[type="email"]:focus,
  form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 160, 120, 0.35);
  }


  .honeypot {
    position: absolute;
    left: -9999px;
  }


/* #endregion  */


/* #region 18 — REACTION SYSTEM ============================================= */

  .reaction-container {
    position: relative;
    display: inline-block;
  }

  .reaction-smile {
    font-size: 20px;
    cursor: pointer;
    color: #555;
  }

  .reaction-popmenu {
    position: absolute;
    right: 120%;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
  }

  .reaction-popmenu.active {
    display: flex;
  }

  .reaction-popmenu i {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
  }

  .reaction-popmenu i:hover {
    transform: scale(1.3);
  }
/* #endregion */


/* #region 19 — POPUP MENUS (ELLIPSIS) ====================================== */

  .comment-menu-trigger {
    position: relative;
    display: inline-block;
  }

  .menu-popup {
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
    background: #fff;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    min-width: 120px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
  }

  .comment-menu-trigger:hover .menu-popup {
    display: block;
  }

  .menu-item {
    padding: 6px 10px;
    cursor: pointer;
  }

  .menu-item:hover {
    background: #f5f5f5;
  }
/* #endregion */


/* #region 20 — COLLAPSIBLE SECTIONS ======================================== */

  .collapsible-content {
    transition: max-height 0.4s ease;
    overflow: hidden;
  }

  .collapsible-content.collapsed {
    max-height: 0;
    padding: 0;
  }

  .toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-color-light);
  }

  .toggle-button i {
    transition: transform 0.3s;
  }

  .toggle-button.collapsed i {
    transform: rotate(180deg);
  }
/* #endregion */


/* #region 21 — EDITING STATES ============================================== */

  .response.editing .response-actions {
    display: none;
  }

  .editor-initializing {
    opacity: 0;
    visibility: hidden;
  }

  .editor-ready {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
  }
/* #endregion */


/* #region 22 — Z-INDEX SAFETY ============================================== */

  /* Editors must always sit above popups */
  .ql-toolbar,
  .ql-picker,
  .ql-tooltip {
    position: relative;
    z-index: 10002;
  }
/* #endregion */


/* =============================================================================
   SHORTDREAM — MASTER CSS
   PART 4 of 4 — SPINE, NAV, RESPONSIVE & DETOX
   =============================================================================
   Purpose:
   - Fixed top spine header
   - Slide-in left navigation rail
   - Page offset + overlay click-to-close
   - Responsive breakpoints
   - HTML5UP sidebar neutralisation

   Rule:
   If it positions, slides, overlays, or hides by screen size → it lives here
   ============================================================================= */


/* #region 23 — SPINE HEADER (FIXED TOP BAR) ================================= */

  .spine-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0 0.75em;
    background: #fff;
    border-bottom: 1px solid #ddd;
    z-index: 1000;
  }

  .spine-header .location {
    color: var(--ink-muted);
  }
  .spine-header .location:hover,
  .spine-header .location:focus {
    color: var(--accent);
  }


  .spine-toggle {
      padding: 0;
      line-height: 1;
      background: none;
      border: 0;
      font-size: 1.2rem;
      cursor: pointer;
      /* opacity: 0.4;  */
      transition: opacity 150ms ease;
  }

  .spine-toggle:hover,
  .spine-toggle:focus {
      /* opacity: 0.85;  */
      color: var(--accent);
  }

  .brand {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      text-decoration: none;
  }

  .brand-logo {
      width: 28px;
      height: 28px;
      display: block;

      /* calm, not clickable */
      filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
      transition: transform 180ms ease, filter 180ms ease;
  }

  /* hover on portal makes it twist */
  .brand:hover .brand-logo {
      transform: rotate(6deg) scale(1.03);
      filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  }

  .brand-text {
      font-weight: 600;
      /* color: var(--accent);  */
      color: #89a535;    /* olive green */
      white-space: nowrap;
  }

  .brand-text:hover {
    color: var(--accent);
  }

  .spine-context {
    flex: 1;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top:0.5em;

    /*  new */
    display: flex;
    align-items: center;
    gap: 0.2rem;
  }

  .spine-context strong {
    color: #87a726;
  }

  .spine-context .mode {
    font-weight: 600;
    color: #3d4449;
  }

  .spine-context .sep {
    color: #87a726;
    margin: 0 0.3em;
  }

  .spine-user {
    font-size: 1.2em;
    text-decoration: none;
  }

/* #endregion */


/* #region — SINGLE CHAT LAYOUT OVERRIDES */


  /* Add a subtle internal gutter so text on single chat isn’t hard against the edge:  */
  .chat-list.single-chat > * {
    padding-left: 2.5rem;
    padding-right: 1.5rem;
  }


  /* Give .chat-list.single-chat a single inner column and constrain both header + body inside it. Add a content column wrapper via CSS  */
  .chat-list.single-chat {
    /*
    max-width: 70rem;
    margin-left: auto;
    margin-right: auto;
    */
    margin-left: calc(-1 * clamp(1rem, 4vw, 3rem));
    margin-right: calc(-1 * clamp(1rem, 4vw, 3rem));
    padding-left: 0;
    padding-right: 0;
  }

  /* Single chat should not behave like a grid card */
  .chat-list.single-chat .posts {
    margin: 0;
    width: 100%;
  }

  .chat-list.single-chat .posts > article {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Kill grid dividers for single content */
  .chat-list.single-chat .posts article::before,
  .chat-list.single-chat .posts article::after {
    display: none;
  }

  .chat-list.single-chat .posts {
    margin-left: 0;
    width: 100%;
  }

  /* As excerpts and full chat are inside {.posts article}, they're assigned to grid view. Let's opt full chat out of the grid.  */
  .chat-list.single-chat .posts > article.chat-full {
    width: 100%; 
  }

  /* Combine both types of related chats (topic based and daily) in the related-topic section.   
    <h3 class="related-title">Other chats on these themes</h3>  */
  .related-title {
    margin-top: 0;
    margin-bottom: 1em;
    font-weight: 550;
    border-bottom: solid 3px #87a726;
  }

/* #endregion */


/* #region — MODE NAV / CONTEXT LINKS */

  /* Mode swap link (secondary navigation hint) */
  .mode-swap {
    margin-top: 0.2em;
    margin-bottom: 1.6em;
    font-size: 0.85em;
  }

  .mode-swap a {
    color: #87a726;            /* brand green */
    text-decoration: none;
    font-weight: 500;
    opacity: 0.85;
    border-bottom: 1px dotted rgba(135, 167, 38, 0.5);
  }

  .mode-swap a:hover {
    opacity: 1;
    border-bottom-style: solid;
  }

  /* Optional: slightly quieter on small screens */
  @media (max-width: 736px) {
    .mode-swap {
      font-size: 0.8em;
    }
  }
/* #endregion */


/* #region 24 — SPINE RAIL (SLIDE-IN SIDEBAR) ================================ */

  .spine-rail {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;    /*  Without this, children can overflow visually.  */
    background: #fafafa;
    border-right: 1px solid #ddd;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 999;
    overflow-y: auto;
    padding: 1.25rem;
  }


  body.spine-open .spine-rail {
    transform: translateX(0);
  }


  /* Spine sections */
  .spine-section {
    padding: 1em;
    /* border-bottom: 1px solid #eee;   */
  }

  .spine-title {
    font-size: 0.75em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 0.5em;
  }

  .spine-modes a {
    display: block;
    padding: 0.6rem 0;
    font-weight: 600;
    font-size: 1rem;
    /* color: #2b2b2b;   strong */
    color: var(--ink-strong);  
    text-decoration: none;
  }

  .spine-modes a.active {
    /* color: #8fbf1f;    my green  */
    color: var(--accent);    
    font-weight: 600;
  }

  .spine-modes a:hover {
    /* color: #8fbf1f;    my green  */
    color: var(--accent);    
    font-weight: 600;
  }


  .spine-secondary {
    margin-top: 0.1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.08);
  }

  .spine-secondary a {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    /* color: #7a7a7a;  muted */
    color: var(--ink-muted);
  }

  .spine-secondary a:hover {
    /* color: #2b2b2b;   strong */
    color: var(--accent);    
  }

  .spine-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    /* color: #9a9a9a;         labels, low priority */
    color: var(--ink-faint);    
    margin-bottom: 0.3rem;
  }

  /*
  How the layout works:   
   - fixed / sliding side rail
   - stacked flex column
   - mixed padding responsibilities
   - Any child without box-sizing: border-box or explicit padding will visually ignore the rail’s internal rhythm.
  */

  .spine-footer {
    color: blue;   
    font-size: 0.8em;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.12);
    box-sizing: border-box;
  }

  .spine-footer .sub {
    display: block;    
    padding-top: 0.25rem;
    opacity: 0.85;
  }

  .spine-footer .sub a {
    font-size: 0.85rem;
    color: var(--accent);
    color: var(--ink-muted);  
    text-decoration: none;
  }

  .spine-footer .sub a:hover {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: underline;
  }

  .brand-dot {
    color: var(--accent);
    margin-right: 0.25rem;
    font-weight: 700;
  }

/* #endregion */


/* #region 25 — BACKDROP OVERLAY (CLICK ANYWHERE TO CLOSE) ================== */

  /* Backdrop stays global  */
  .spine-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
  }

  body.spine-open .spine-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
/* #endregion */


/* #region — ASSIGN FONTS - AND BODY TOP PADDING */

  /* Push all page content below fixed header */
  body {
    padding-top: 52px;
  }

  /* Set the default body to reading voice  */
  body {
    font-family: var(--font-reading);
    font-weight: var(--font-weight-reading);
    color: var(--ink-base);    /*  #7f888f;  */
    font-size: clamp(0.875rem, 0.82rem + 0.35vw, 0.98rem);
    line-height: 1.6;
  }



  /* Titles & conceptual anchors */
  .chat-title,
  .chat-subtitle,
  .related-title,
  .chat-meta,
  .video-meta {
    font-family: var(--font-titles);
  }

  /* Titles & conceptual anchors */
  .chat-content,
  .posts article {
    font-family: var(--font-reading);
  }


  /* Keep UI clean */
  .spine-header,
  .spine-rail,
  .chat-filters,
  .actions,
  .button,
  .like-button,
  .mode-swap,
  .pagination {
    font-family: var(--font-ui);
  }

  h1, h2, h3, h4, h5, .chat-title, .related-title {
    font-family: var(--font-titles);
  }
 
/* #endregion */


/* #region — ANDROID / FIREFOX WIDTH FIX */

  /* Mobile override */
  @media (max-width: 768px) {
    .row,
    .spine-header,
    .spine-context {
      flex-wrap: wrap;
    }
  }

  /* Text overflow safety */
  p,
  div,
  article {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* DEBUG — REMOVE WHEN DONE */
  /*
  * {
    outline: 1px solid rgba(255,0,0,0.15);
  }
  */

/* #endregion */




/* #region — Flex children without min-width: 0  - Any flex container that contains text, images, or long words must allow shrinking: */

  .row,
  .spine-header,
  .spine-context,
  .content {
    min-width: 0;
  }

/* #endregion */


/* #region — SIMPLE FLEX GRID  (simplified, mobile-first) */

  /*
    Core defines (#main > .inner padding + max-width), 
    
    min-width: 0 should live only on flex items that contain text/media (e.g. .content, .spine-context, .row > *), not on section or #main. 
    Surgically add min-width: 0 where flex actually needs to shrink — that’s the stable foundation.
  */
  
  /*  
    - flex-basis participates correctly with gap
    - Flex can shrink instead of wrapping prematurely
    - min-width: 0 prevents input fields from forcing overflow */

  .row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    /* position: relative;
    z-index: 0;   */
  }

/*
  .roXXXXXXw > * {
    position: relative;
    z-index: 1;
  }
*/

  .col-6 {
    flex: 1 1 calc(50% - 2rem);
    min-width: 0;
  }

  @media (max-width: 736px) {
    .col-6 {
      flex-basis: 100%;
    }
  }

/* #endregion */


/* #region — header main */

  header.main {
    margin-bottom: 2rem;
  }

  header.main h1,
  header.main h2,
  header.main h3 {
    margin-bottom: 0.5rem;
  }


/* #endregion */




/* #region — Typography helpers */

  .align-left { text-align: left; }
  .align-center { text-align: center; }
  .align-right { text-align: right; }

/* #endregion */


/* #region — Icon spacing (Font Awesome glue) */

  .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .icon.solid {
    font-weight: 900;
  }

/* #endregion */


/* #region — Images must be explicitly constrained */

  img { max-width: 100%; height: auto; }

  .image { display: block; margin-bottom: 2rem; }

/* #endregion */


/* #region — section */
/* 
  .section {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--panel-color-light);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    clear: both;
  }
  */

  /* Sections (vertical rhythm only)  */
  section {
    margin: 0;    
    padding: 1rem 0;
  }

  @media (max-width: 768px) {
    section {
      padding: 1rem 0;
    }
  }

  section:first-of-type {
    padding-top: 0.2rem;
  }



section::before {
  pointer-events: none;
}


/* #endregion */


/* #region - HOMEPAGE BANNER has HTML5UP split layout - flex rules. Mobile stays stacked automatically because flex wraps ======== */

  #banner {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
  }


  #banner .content {
    flex: 1 1 auto;
  }


  #banner .content img.floattoright {
    float: right;
    max-width: 33%;
    margin-left: 2rem;
    margin-bottom: 1rem;
    border-radius: 6px;
  }


  @media (max-width: 768px) {
    #banner {
      flex-direction: column;
    }
    #banner .content {
      width: 100%;
    }
  }


  #banner header h1 {
    white-space: normal;
    max-width: 20ch;   /* matches old feel */
  }

  #banner .content header {
    overflow: hidden; /* float containment */
  }


  #banner .content img {
    display: block;
    margin-left: auto;
  }
  @media (max-width: 768px) {
    #banner .content img {
      margin: 0 auto 1.25rem;
    }
  }


/* #endregion */



/* #region -  LAYOUT CORE  ====================================== */

  /* Prevent accidental horizontal scroll */
  html, body { overflow-x: hidden; }

  #wrapper, #main { width: 100%; }

  #main > .inner {
    max-width: 110em;
    padding: clamp(1rem, 4vw, 3rem);
  }

  /* reduces horizontal scroll - prevents width math from lying (padding + borders blowing past containers), especially with flex, grids, and mobile browsers */
  *, *::before, *::after { box-sizing: border-box; }

  /* Debug utility — toggle during layout work */
  /*
  .debug-outline * {
    outline: 1px solid rgba(255,0,0,0.15);
  }
  */

/* #endregion */


/*
TO DO 
- dups on img { max-width:100% }
- repeated html, body { overflow-x:hidden }
- multiple .row definitions) 

- horizontal-scroll won’t creep back unless a future rule sets widths beyond 100%.
*/


/* #region -  HTML5UP FEEL (SAFE SUBSET)  ====================================== */

  /*
  HTML5UP offered:

    - Baseline typography rhythm (line-heights, heading margins)
    - Subtle spacing defaults (section gaps, article breathing room)

  Note:
    .row means layout
    .actions means controls
    .primary means emphasis
  */


  /* Typography rhythm */
  body {
    line-height: 1.65;
  }

  h1, h2, h3, h4 {
    line-height: 1.25;
    margin-top: 0;
  }

  p {
    margin: 0 0 1.2em;
  }

  /* Article / content breathing room */
  .posts article {
    margin-top: 1rem;
    margin-bottom: 3rem;
  }

  /* Light separators (no pseudo-elements, no transforms) */
  hr {
    border: 0;
    border-top: 1px solid rgba(0,0,0,0.12);
    margin: 2.5rem 0;
  }


  header.major > :last-child {
    border-bottom: solid 3px #87a726;
  }

  /* Button anchors: old authority */
  
  a.button,
  a.button:visited {
    /* color: var(--ink-base);    
    box-shadow: inset 0 0 0 1px var(--accent);  
    color: var(--accent);    */
    text-decoration: none;
  }

  /*
  a.button {
    display: inline-block;
    padding: 0.6em 1.2em;
    border-radius: 4px;
    font-weight: 600;
  }


  a.button:hover {
    background: var(--accent); 
  }
  */


  /* Inputs */
  input[type="text"],
  input[type="email"],
  textarea {
    width: 100%;
    padding: 0.65em 0.75em;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
    /* background: #fff;  */
  }

  textarea {
    resize: vertical;
    min-height: 8rem;
  }


/*
    input {
    background: #5a5a5a; 
    color: #fff;
    border: none;
    font-size: 0.8rem;
    padding: 0.45em 1.1em;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;    
  }

  input:hover {
    background: #6a6a6a;
    background-color: var(--accent);
    color: #ffffff;
  }

*/


  form label {
    display: block;
    margin: 0.5rem 0 0.25rem;
    font-weight: 600;
  }


  ul.actions {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    gap: 1rem;
  }

  ul.actions li {
    margin: 0;
  }




/* #endregion */

