/* ═══════════════════════════════════════════
   ARZU — feed.css
   Loaded by every page (feed, editor, list).
   editor.css adds the admin-only delta on top.
   Light theme. For dark: swap the palette block.
   ═══════════════════════════════════════════ */

:root{
  /* palette */
  --bg:#f5f6f8;
  --surface:#ffffff;
  --surface-hover:#edeef2;
  --card:#ffffff;
  --card-border:#d5d8e0;
  --accent:#e05040;
  --accent-soft:rgba(224,80,64,.08);
  --heart:#e8364a;
  --text:#1a1c24;
  --text-mid:#4a4e5c;
  --text-dim:#8890a0;
  --green:#18a058;
  --blue:#3574d4;
  --orange:#c87a20;
  --icon:#3a3d48;
  --hover-veil:rgba(0,0,0,.06);
  --chip:rgba(0,0,0,.55);              /* dark chip behind white text (badges, counters, arrows) */

  /* layout */
  --content-width:680px;

  /* sizes — mobile defaults, desktop overrides below */
  --font-title:18px;
  --font-body:12px;                    /* NOTE: reaches .card-read-more only; post text is .post-html (18px) */
  --font-author:14px;
  --font-handle:14px;
  --font-engage:18px;
  --logo-height:22px;
  --icon-engage:30px;
  --avatar-size:40px;
}
@media(min-width:768px){
  :root{--font-engage:14px;--icon-engage:24px;--avatar-size:36px}
}
@media(min-width:1200px){
  :root{--content-width:800px}
}


/* ═══ RESET ═══ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{overflow-y:scroll;overflow-anchor:none;scroll-behavior:auto !important}
body{
  background:var(--bg);color:var(--text);
  line-height:1.5;min-height:100vh;
  -webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;
}
::-webkit-scrollbar{width:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--card-border);border-radius:3px}
button{font-family:inherit;cursor:pointer}
input,textarea,select{font-family:inherit}
img{display:block}
a{color:inherit;text-decoration:none}


/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulseLike{0%{transform:scale(1)}40%{transform:scale(1.35)}100%{transform:scale(1)}}
@keyframes heartBurst{0%{transform:scale(1)}15%{transform:scale(1.3)}30%{transform:scale(.95)}45%{transform:scale(1.1)}60%{transform:scale(1)}}
@keyframes dotPulse{0%,80%,100%{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}
.fade-in{animation:fadeIn .35s ease both}
.pulse-like{animation:pulseLike .4s ease}
.heart-burst{animation:heartBurst .45s cubic-bezier(.17,.89,.32,1.28)}


/* ═══ PANES ═══ */
.pane{display:none;width:100%;min-height:100vh}
.pane.pane-active{display:block}


/* ═══ TOPBAR (feed: fixed, transparent, click-through) ═══ */
.topbar{
  position:fixed;top:0;left:0;right:0;z-index:100;
  height:32px;
  background:transparent;
  pointer-events:none;                 /* only the buttons inside catch clicks */
  transition:opacity .15s ease;
}
.topbar *{pointer-events:auto}
.topbar.hidden{transform:translateY(-100%)}
.topbar.video-playing,
.topbar.header-faded{opacity:0}
.topbar.header-faded{transition-duration:.3s}
.topbar.video-playing *,
.topbar.header-faded *{pointer-events:none}

.topbar-inner{
  max-width:var(--content-width);margin:0 auto;padding:0 12px;height:100%;
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;
}
.topbar-left{display:flex;align-items:center;justify-self:start;padding-top:4px}
.topbar-actions{display:flex;align-items:center;gap:12px;justify-self:end}
.topbar svg{stroke:var(--icon);fill:none}

.topbar .btn-icon{
  background:none;border:none;padding:0 8px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s;
}
.topbar .btn-icon:hover,
.topbar .btn-icon:active{background:var(--hover-veil)}

.topbar-back{opacity:0;pointer-events:none;transition:opacity .2s}
.topbar-back.visible{opacity:1;pointer-events:auto}

.arzu-logo{cursor:pointer;display:flex;align-items:center;justify-self:center}
.arzu-logo img{height:var(--logo-height)}
.arzu-logo svg path{fill:var(--icon)}


/* ═══ FEED CONTAINERS ═══ */
.feed-layer,
.card-child-feed.feed-active{
  max-width:var(--content-width);margin:0 auto;padding:0 0 80px;
  display:flex;flex-direction:column;gap:2px;
  min-height:200px;overflow-anchor:none;
}
.card-child-feed{display:none}
.feed-layer.feed-hidden{display:none}
.feed-layer.feed-has-active-child > .feed-loader{display:none}

.feed-loader{padding:24px;text-align:center}
.feed-loader .dots{display:inline-flex;gap:8px}
.feed-loader .dots span{
  width:8px;height:8px;border-radius:50%;background:var(--text-dim);
  animation:dotPulse 1.2s ease-in-out infinite;
}
.feed-loader .dots span:nth-child(2){animation-delay:.2s}
.feed-loader .dots span:nth-child(3){animation-delay:.4s}
.feed-end{padding:24px;text-align:center;color:var(--text-dim);font-size:13px}


/* ═══ CARD ═══ */
.card{background:var(--card);border-bottom:1px solid var(--card-border)}
.card:has(.right-nested-category:hover){position:relative;z-index:10}   /* lift card so the open menu covers the next card */
.card.card-has-active-child > .card-content,
.card.card-has-active-child > .card-body,
.card.card-sibling-hidden{display:none}

/* banner / gallery share the black media box */
.card-banner,.card-gallery{position:relative;overflow:hidden;background:#000}
.card-banner{width:100%}
.card-banner img{width:100%;object-fit:contain}
.card-type-badge{
  position:absolute;top:10px;left:10px;
  color:#fff;font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;
  padding:3px 8px;border-radius:6px;backdrop-filter:blur(4px);
}

.card-gallery{line-height:0;min-height:40px;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.gallery-track{display:flex;transition:transform .3s ease}
.gallery-track.no-transition{transition:none}
.gallery-slide{min-width:100%;width:100%;flex-shrink:0}
.gallery-slide img{width:100%;pointer-events:none;-webkit-user-drag:none}
.gallery-prev,.gallery-next{
  position:absolute;top:50%;transform:translateY(-50%);z-index:4;
  width:36px;height:36px;border:0;border-radius:50%;
  background:var(--chip);backdrop-filter:blur(4px);color:#fff;
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity .25s;pointer-events:auto;
}
.gallery-prev{left:8px}
.gallery-next{right:8px}
.card-gallery:hover .gallery-prev,.card-gallery:hover .gallery-next,
.card-gallery.arrows-visible .gallery-prev,.card-gallery.arrows-visible .gallery-next{opacity:1}
.gallery-counter{
  position:absolute;top:10px;right:10px;z-index:4;
  background:var(--chip);color:#fff;font:12px/1.2 system-ui,sans-serif;
  padding:3px 8px;border-radius:10px;
}
.gallery-dots{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);display:flex;gap:5px;z-index:4}
.gallery-dot{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.4);transition:all .2s}
.gallery-dot.active{background:#fff;transform:scale(1.3)}

.card-body{padding:12px 14px}

/* author */
.card-author{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.card-author-avatar{width:var(--avatar-size);height:var(--avatar-size);border-radius:50%;object-fit:cover;flex-shrink:0;cursor:pointer}
.card-author-info{min-width:0;flex:1}
.card-author-name{font-size:var(--font-author);font-weight:600;cursor:pointer;transition:color .15s}
.card-author-name:hover{color:var(--accent)}
.card-author-handle{font-size:var(--font-handle);color:var(--text-dim);display:flex;align-items:center}
.card-author-handle .at-link{cursor:pointer;transition:color .15s}
.card-author-handle .at-link:hover{color:var(--text-mid)}

/* title */
.card-title{color:var(--text-mid);font-size:var(--font-title);line-height:1.2;margin-bottom:10px;cursor:pointer}
.card-title .hashtag-link{color:var(--blue);cursor:pointer;transition:opacity .15s}
.card-title .hashtag-link:hover{opacity:.7}

/* body text — look comes from .post-html below; this is only the collapse box */
.card-body-text{
  color:var(--text-mid);cursor:pointer;position:relative;margin-bottom:10px;
  max-height:3.2em;overflow:hidden;
  transition:max-height .4s cubic-bezier(.25,.8,.25,1);
}
.card-body-text.expanded,
.card-body-text.no-overflow{max-height:none}
.card-read-more{color:var(--accent);font-size:var(--font-body);font-weight:600;cursor:pointer;padding:4px 0;transition:color .15s}
.card-read-more:hover{color:var(--text)}

/* engage bar */
.card-engage{
  border-top:1px solid var(--card-border);margin-top:8px;padding-top:6px;
  display:flex;align-items:center;background:var(--card);z-index:2;
}
.card-engage.sticky{position:sticky;bottom:0;padding:8px 0}
.card-engage .spacer{flex:1}
.engage-btn{
  background:none;border:none;border-radius:8px;padding:6px 10px;
  display:flex;align-items:center;gap:6px;transition:background .15s;
}
.engage-btn:hover{background:var(--surface-hover)}
.engage-btn svg{width:var(--icon-engage);height:var(--icon-engage);stroke:var(--icon);stroke-width:1.5;fill:none}
.engage-btn span{font-size:var(--font-engage);color:var(--icon);font-weight:500}
.heart-btn svg{transition:transform .15s,fill .15s,stroke .15s}
.heart-btn.liked svg{fill:var(--heart);stroke:var(--heart)}
.heart-btn.liked span{color:var(--heart)}

/* audio seek bar (rest of the player is inline in render_post) */
.audio-seek::-webkit-slider-runnable-track{height:3px;background:var(--icon);border-radius:999px}
.audio-seek::-moz-range-track{height:5px;background:var(--icon);border-radius:999px}
.audio-seek::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:var(--accent);margin-top:-6px;cursor:pointer}
.audio-seek::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--accent);border:none;cursor:pointer}


/* ═══ POST HTML — the editor's whitelist output ═══
   One class for both places: the editor surface (editPost.html) and the
   feed card (render_post). Geometry is NOT here — the container owns it.
   Hexes in .c-* and .t-* must match editPost.html + xSanitizeHtml.inc. */
.post-html{font:15px/1.1 Arial,Verdana,sans-serif}
.post-html a{color:var(--accent);text-decoration:underline;cursor:pointer}
.post-html a:hover{opacity:.8}
.post-html hr{border:0;border-top:1px solid var(--card-border);margin:2em 0;clear:both}
.post-html ul,.post-html ol{margin:0 0 1em;padding-left:1.6em}
.post-html li{margin:.25em 0}
.post-html table{border-collapse:collapse;width:100%;margin:1em 0;font-size:16px;display:block;overflow-x:auto}
.post-html th,.post-html td{border:1px solid var(--card-border);padding:8px 12px;text-align:left}
.post-html th{background:rgba(127,127,127,.18);font-weight:700}
.post-html button{background:var(--green);color:#fff;border:0;border-radius:20px;padding:10px 22px;font-size:15px}

.post-html img{max-width:100%;height:auto;border-radius:4px}
.post-html .img-left{float:left;margin:.3em 1.2em .8em 0}
.post-html .img-right{float:right;margin:.3em 0 .8em 1.2em}
.post-html .img-center{display:block;margin:1em auto}
.post-html .w-100px{width:100px}
.post-html .w-200px{width:200px}
.post-html .w-300px{width:300px}
.post-html .w-25{width:25%}
.post-html .w-50{width:50%}
.post-html .w-100{width:100%}

.post-html .t-small{font-size:14px}
.post-html .t-large{font-size:20px}
.post-html .c-red{color:#d93025}
.post-html .c-blue{color:#1a73e8}
.post-html .c-green{color:#188038}
.post-html .c-orange{color:#e8710a}
.post-html .c-gray{color:#757575}

.post-html .file-pdf{
  display:inline-block;background:var(--surface);border:1px solid var(--card-border);
  border-radius:8px;padding:8px 14px;margin:2px 0;color:var(--text);font-size:16px;text-decoration:none;
}
.post-html .file-pdf::before{content:"\1F4C4  "}
.post-html .file-pdf:hover{background:var(--surface-hover)}


/* ═══ RESPONSIVE ═══ */
@media(max-width:600px){
  .topbar-inner{padding:0 8px}
  .card-body{padding:10px 12px}
  .gallery-prev,.gallery-next{width:30px;height:30px}
  /* floated % images stack instead of squeezing text */
  .post-html .img-left.w-25,.post-html .img-right.w-25,
  .post-html .img-left.w-50,.post-html .img-right.w-50{float:none;display:block;width:100%;margin:1em 0}
}
