/* Manrope (variable, 200-800) — tự lưu trên VPS, không tải từ Google Fonts nữa:
   không gửi IP khách cho Google, không phụ thuộc bên thứ ba, cho phép CSP chặt (font-src 'self').
   Giấy phép: SIL OFL (xem static/vendor/fonts/LICENSE). */
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../vendor/fonts/manrope-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../vendor/fonts/manrope-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../vendor/fonts/manrope-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* page chrome (header, pagination, empty state) — light text on black */
  --bg: #11161c;
  --chrome-text: #e9edf1;
  --chrome-text-muted: #8d9aa6;
  --chrome-border: #2b3641;
  --accent: #f2a93b;
  --accent-dim: #caa15b;

  /* post card content — dark text on white */
  --card-bg: #ffffff;
  --card-border: #e6e4dc;
  --card-text: #1e2126;
  --card-text-muted: #6b7280;
  --card-link: #a9660a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: #6fae7a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='white' stroke-width='1.6' stroke-opacity='0.30' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='20' cy='24' r='8'/%3E%3Cpath d='M60 18 l4 8 9 1 -6.5 6 1.5 9 -8-4.5 -8 4.5 1.5-9 -6.5-6 9-1 z'/%3E%3Cpath d='M95 30c-4-6 3-11 8-7 2-6 12-6 12 2 5 0 6 8 0 9h-18c-5 0-6-2-2-4z'/%3E%3Cpath d='M20 70c-6-6-16 2-8 10l8 8 8-8c8-8-2-16-8-10z'/%3E%3Cpath d='M55 90 q8 -10 16 0 t16 0'/%3E%3Ccircle cx='110' cy='95' r='3'/%3E%3Ccircle cx='118' cy='100' r='2'/%3E%3Ccircle cx='104' cy='103' r='2'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #d8d84a 0%, #8fce7a 45%, #4aa88f 100%);
  background-repeat: repeat, no-repeat;
  background-size: 140px 140px, cover;
  background-attachment: fixed, fixed;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--chrome-text);
}

.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
}

.feed-wrap { max-width: 1200px; margin: 0 auto; padding: 12px 16px 40px; }

.header-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-row .site-header { padding: 0; margin: 0; justify-content: flex-start; max-width: none; min-height: 0; }
.header-row .search-album-row { padding: 0; margin: 0; max-width: 380px; flex: 0 1 auto; }

.hero-tagline { max-width: 1200px; margin: 0 auto; padding: 4px 16px 12px; }
.hero-tagline h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--chrome-text);
}

.search-album-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-album-row input[type=text] {
  flex: 1;
  max-width: 340px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  font-size: 13.5px;
  font-family: inherit;
}
.search-album-row button {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #1a1305;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.search-album-row .search-clear {
  color: #1a2b1f;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

/* True masonry, computed in static/js/masonry-feed.js: each post is placed
   into whichever column is currently shortest, so a taller/shorter post
   never leaves a gap the way the old CSS `column-count` layout did. That
   old approach isn't real masonry — the browser just estimates a height
   and balances columns to it up front, and when posts vary a lot in
   height (different photo/video counts and aspect ratios) that estimate
   is often wrong, leaving a visible empty strip at the bottom of one
   column while the others keep going. Before JS runs (or if it's
   disabled), this falls back to one plain stacked column. */
.feed-grid { display: block; }
.feed-grid.feed-grid--js { display: flex; gap: 20px; align-items: flex-start; }
.feed-grid--js .post-card { margin-bottom: 0; }
.feed-column { display: flex; flex-direction: column; gap: 20px; flex: 1 1 0; min-width: 0; }

.post-card {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.new-ribbon {
  position: absolute;
  top: 14px;
  right: -34px;
  transform: rotate(45deg);
  background: #e6362b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 42px;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.post-media {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 0;
  background: var(--card-bg);
}
.media-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
/* Width/height of each tile is computed and set precisely by
   justified-media.js so every row fills exactly edge-to-edge with no
   gaps, without cropping any image or video's own aspect ratio. */
.media-tile {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  display: block;
  cursor: zoom-in;
}
img.media-tile { object-fit: cover; }

.video-tile {
  cursor: pointer;
  background: linear-gradient(135deg, #232a33, #0f1318);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-tile-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-tile .play-icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #14181d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 3px;
}
.video-tile.video-pending {
  background: #f2f1ec;
  color: var(--card-text-muted);
  font-size: 12px;
  text-align: center;
  cursor: default;
  padding: 8px;
}

.post-body { padding: 16px 18px; }
.post-content {
  margin: 0;
  font-size: var(--post-font-size, 14.5px);
  font-weight: var(--post-font-weight, 400);
  line-height: 1.7;
  word-break: break-word;
  color: var(--card-text);
}
.post-content a {
  color: var(--card-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(169, 102, 10, 0.35);
}
.post-content a:hover { border-bottom-color: var(--card-link); }

.post-signature {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f6f3ea;
  border: 1px solid var(--card-border);
  color: var(--card-text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.post-signature p { margin: 0; }
.post-signature a { color: var(--card-link); }

.post-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--card-text-muted);
}

.pagination-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.pg-label { color: #eef1f4; font-size: 13px; margin-right: 6px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.pg-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--chrome-border);
  background: #1a222b;
  color: var(--chrome-text);
  text-decoration: none;
  font-size: 13px;
}
.pg-btn.active { background: var(--accent); color: #1a1305; border-color: var(--accent); font-weight: 700; }
.pg-ellipsis { color: var(--chrome-text-muted); padding: 0 2px; }

/* Denser, Telegram-style thumbnails on phones since a post can have many images/videos */
@media (max-width: 599px) {
  .media-tile { border-radius: 8px; }
  .video-tile .play-icon { width: 32px; height: 32px; font-size: 12px; }
}

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--chrome-border);
  background: #1a222b;
  color: var(--chrome-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.page-btn:hover { border-color: var(--accent-dim); }
.page-btn.active { background: var(--accent); color: #1a1305; border-color: var(--accent); font-weight: 700; }

/* Fullscreen media viewer (images + videos, swipeable) */
.media-viewer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 12, 0.95);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.media-viewer-overlay.open { display: flex; }
.mv-content {
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mv-content img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}
.mv-content iframe {
  width: min(94vw, 960px);
  aspect-ratio: 16 / 9;
  max-height: 90vh;
  border: none;
  border-radius: 8px;
  background: #000;
}
.mv-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.mv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.mv-nav:hover { background: rgba(255, 255, 255, 0.28); }
.mv-prev { left: 12px; }
.mv-next { right: 12px; }
@media (max-width: 599px) {
  .mv-nav { width: 38px; height: 38px; font-size: 22px; }
}

.empty { text-align: center; color: #1a2b1f; padding: 60px 20px; font-size: 14px; text-shadow: 0 1px 2px rgba(255,255,255,0.3); }

/* Footer */
.site-footer {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 24px 16px 40px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a {
  color: #111318;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.footer-links a:hover { text-decoration: underline; }
.footer-sitename { font-size: 18px; font-weight: 800; color: #0d0f13; margin-bottom: 10px; }
.footer-sitename a { color: inherit; text-decoration: none; }
.footer-sitename a:hover { text-decoration: underline; }
.footer-sitename .accent { color: var(--accent); }
.footer-copyright { font-size: 11.5px; color: #2b2f36; }

/* Legal / static pages */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.legal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px 28px;
  color: var(--card-text);
}
.legal-card h1 { text-align: center; font-size: 24px; margin: 0 0 6px; color: var(--card-text); }
.legal-card .legal-updated { text-align: center; font-size: 12.5px; color: var(--card-text-muted); margin-bottom: 24px; }
.legal-card .legal-subtitle { text-align: center; font-size: 14px; color: var(--card-text-muted); margin-bottom: 24px; }
.legal-warning {
  background: rgba(220, 170, 40, 0.12);
  border: 1px solid rgba(190, 140, 20, 0.4);
  color: #7a5a0d;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 26px;
}
.legal-body h2 {
  font-size: 16px;
  color: var(--card-text);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 26px 0 10px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { font-size: 13.5px; line-height: 1.75; color: var(--card-text); margin: 0 0 12px; }
.legal-body ul { margin: 0 0 12px; padding-left: 20px; }
.legal-body li { font-size: 13.5px; line-height: 1.75; color: var(--card-text); margin-bottom: 4px; }
.legal-body a { color: var(--card-link); }
.legal-footnote {
  border-top: 1px solid var(--card-border);
  margin-top: 26px;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--card-text-muted);
  line-height: 1.7;
}
.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(55, 138, 221, 0.1);
  border: 1px solid rgba(55, 138, 221, 0.4);
  color: #2170b8;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.telegram-btn:hover { background: rgba(55, 138, 221, 0.2); }
.dmca-contact-box {
  background: #f6f7f9;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px;
  margin: 14px 0;
}
.dmca-contact-box .resp-time { font-size: 12.5px; color: var(--card-text-muted); margin-top: 10px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 599px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: #f6f7f9;
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px;
}
.contact-card h3 { font-size: 14.5px; margin: 0 0 8px; color: var(--card-text); }
.contact-card p { font-size: 13px; color: var(--card-text-muted); line-height: 1.6; margin: 0 0 14px; }

/* Announcement popup */
.announcement-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 12, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.announcement-overlay.open { display: flex; }
.announcement-box {
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.announcement-box h2 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--accent-dim);
}
.announcement-box p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.announcement-box .announcement-content { margin-bottom: 20px; text-align: left; }
.announcement-box .announcement-content p:last-child { margin-bottom: 0; }
.announcement-box p a { color: var(--card-link); }
.announcement-btn {
  border: none;
  background: var(--accent);
  color: #1a1305;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 28px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.announcement-btn:hover { background: #ffb84d; }
