/* =========================================================
   HOME LAYOUT CSS
   Source: inline <style> homepage cackoe.com
   Scope: layout utama, grid, card, feed, trending, responsive
   ========================================================= */

/* =========================
   ROOT & BASE
   ========================= */
:root{
  --pad:14px;
  --gap:14px;
  --leftW:260px;
  --rightW:340px;
}

html, body{ height:100%; }

body{
  overflow:hidden;
}

*{ box-sizing:border-box; }

img, video{
  max-width:100%;
  height:auto;
}

/* =========================
   VIEWPORT & GRID
   ========================= */
.twViewportScroll{
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  padding: var(--pad);
  padding-left: calc(var(--pad) + var(--leftW) + var(--gap));
}

.twLeftFixed{
  position: fixed;
  left: var(--pad);
  top: var(--pad);
  width: var(--leftW);
  height: calc(100vh - (var(--pad) * 2));
  overflow: hidden;
  z-index: 50;
}

.twCenter{
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rightW);
  gap: var(--gap);
  align-items: stretch;
}

.twMid,
.twRight{
  min-width:0;
}

.twRight{
  position: relative;
  height: 100%;
  overflow: visible;
  align-self: stretch;
}

.twRightSticky{
  position: sticky;
  top: var(--pad);
  z-index: 10;
}

/* =========================
   CARD BASE
   ========================= */
.twCard{
  border:1px solid var(--border);
  background: rgba(11,18,38,.85);
  border-radius: 18px;
  padding: 14px;
  overflow: hidden;
  min-width: 0;
}

/* =========================
   SEARCH (RIGHT)
   ========================= */
.rightSearch{
  display:flex;
  gap:8px;
  align-items:center;
  padding:10px;
  border-radius:18px;
  border:1px solid var(--border);
  background: rgba(17,28,51,.75);
  backdrop-filter: blur(8px);
}

.rightSearch input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(11,18,38,.85);
  color:var(--text);
  outline:none;
}

.rightSearch button{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(58,160,255,.18);
  color:var(--text);
  cursor:pointer;
  font-weight:900;
  white-space:nowrap;
}

.rightSearch button:hover{
  background:rgba(58,160,255,.28);
}

.widgetTitle{
  font-weight:900;
  margin:0 0 10px;
  font-size:14px;
}

/* =========================
   FEED TABS
   ========================= */
.feedTabs{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:12px;
  margin-bottom:12px;
  width:100%;
}

.feedTab{
  flex:1;
  text-align:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.14);
  color:rgba(231,236,255,.92);
  text-decoration:none;
  font-weight:900;
  font-size:12px;
}

.feedTab.active{
  background:rgba(58,160,255,.18);
  border-color:rgba(58,160,255,.25);
  color:#fff;
}

/* =========================
   FEED AVATAR
   ========================= */
.feedAvatarImg{
  width:42px;
  height:42px;
  border-radius:14px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  display:block;
  flex:0 0 auto;
}

.feedAvatarFallback{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(58,160,255,.18);
  display:grid;
  place-items:center;
  font-weight:900;
  color:#fff;
  flex:0 0 auto;
  letter-spacing:.5px;
}

/* =========================
   TRENDING WIDGET
   ========================= */
.trendList{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.trendItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.12);
  text-decoration:none;
  color:rgba(231,236,255,.92);
}

.trendItem:hover{
  background:rgba(255,255,255,.06);
}

.trendTitle{
  font-weight:900;
  line-height:1.25;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.trendMeta{
  margin-top:6px;
  color:rgba(168,179,207,.92);
  font-size:12px;
}

.trendThumb{
  width:52px;
  height:52px;
  border-radius:10px;
  background:#0b1226;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.trendThumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.trendExcerpt{
  margin-top:4px;
  font-size:12px;
  color:rgba(168,179,207,.95);
  line-height:1.35;
}

/* =========================
   RESPONSIVE LAYOUT
   ========================= */
@media (max-width: 980px){
  .twCenter{
    grid-template-columns:minmax(0,1fr);
  }
  .twRight{
    display:none;
  }
  .twViewportScroll{
    padding-left: calc(var(--pad) + var(--leftW) + var(--gap));
  }
}

@media (max-width: 760px){
  body{ overflow:auto; }

  .twLeftFixed{ display:none; }

  .twViewportScroll{
    position:static;
    inset:auto;
    overflow:visible;
    padding:12px;
  }

  .twCenter{
    grid-template-columns:1fr;
  }
}
