/* Lenovo ISG Social Posts — ported 1:1 from the SPFx web part stylesheet. */

:root {
  --red: #e2231a;
  --ink: #171717;
  --muted: #666;
  --line: #e5e5e5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
}

.gallery-app {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(24px, 2.1vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: grid;
  flex: none;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.gallery-content,
.detail-view {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 46px 28px 80px;
}

.category { margin: 0 0 66px; }

.category > h2 {
  margin: 0 0 10px;
  font-size: clamp(25px, 2vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.category-rule {
  width: 42px;
  height: 3px;
  margin-bottom: 22px;
  background: var(--red);
}

/* Masonry: tiles keep their own aspect ratio and pack into columns, so nothing
   is letterboxed. Order runs down each column, the way Pinterest does. */
.grid {
  columns: 4;
  column-gap: 24px;
}

.card {
  display: inline-block;
  width: 100%;
  margin: 0 0 34px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.card h3 {
  margin: 11px 2px 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  /* Overridden inline per card from the video's real dimensions. */
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 6px;
  background: #f0f0f0;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.media-button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.media-button:hover .play-mark,
.media-button:focus-visible .play-mark {
  transform: scale(1.08);
  background: var(--red);
}

/* The tile already matches the video's aspect ratio, so cover fills it exactly —
   it only guards against a sub-pixel rounding sliver. */
.poster,
.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f0f0f0;
}

.hidden { opacity: 0; }

.play-mark {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  transition: transform 150ms ease, background 150ms ease;
}

.play-mark svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.detail-view { padding-top: 30px; }

.back-button,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.back-button svg,
.share-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.back-button {
  gap: 9px;
  padding: 0 16px;
  border: 1px solid #bbb;
  color: var(--ink);
}

.back-button:hover { border-color: var(--ink); }

.detail-inner {
  display: flex;
  width: min(100%, 820px);
  margin: 26px auto 0;
  align-items: center;
  flex-direction: column;
}

.detail-inner h2 {
  margin: 22px 0 18px;
  font-size: clamp(25px, 2.3vw, 36px);
  line-height: 1.15;
  text-align: center;
  letter-spacing: -0.03em;
}

/* aspect-ratio and max-width are set inline from the video's real dimensions, so the
   player box is exactly the shape of the video and the height stays within 68vh. */
.detail-video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 6px;
  background: #f0f0f0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.share-button {
  gap: 10px;
  min-width: 260px;
  padding: 0 20px;
  border: 1.5px solid var(--red);
  color: var(--red);
}

.share-button:hover {
  color: #fff;
  background: var(--red);
}

.copy-status {
  min-height: 21px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.copy-status.visible { opacity: 1; }

.status {
  display: flex;
  width: min(620px, calc(100% - 56px));
  min-height: 180px;
  margin: 56px auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.status strong { color: var(--ink); font-size: 19px; }
.status small { font-size: 13px; }
.status code {
  padding: 2px 6px;
  border-radius: 3px;
  background: #f4f4f4;
  color: var(--ink);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .grid { columns: 3; }
}

@media (max-width: 760px) {
  .site-header { min-height: 66px; padding: 0 18px; }
  .brand-mark { width: 40px; height: 40px; font-size: 23px; }
  .gallery-content, .detail-view { padding: 32px 18px 60px; }
  .grid { columns: 2; column-gap: 16px; }
  .card { margin-bottom: 28px; }
  .category { margin-bottom: 52px; }
}

@media (max-width: 480px) {
  .site-header { gap: 12px; }
  .site-header h1 { font-size: 22px; }
  .grid { columns: 1; }
  .card h3 { white-space: normal; }
  .detail-inner { margin-top: 20px; }
  .share-button { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .play-mark, .copy-status { transition: none; }
}
