/* Recriação do tema SpaceCollective (Cargo Collective) do site navis,
   com as mesmas cores, medidas e comportamento, adaptado para telas pequenas. */

@font-face { font-family: "Site Sans"; src: url(fonts/nunito-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Site Sans"; src: url(fonts/nunito-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Site Sans"; src: url(fonts/nunito-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Site Sans"; src: url(fonts/nunito-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #1a1a1a;
  --box: #000;
  --title: #cccccc;
  --text: #888888;
  --muted: #666666;
  --link: #0aaf86;
  --thumb-w: 220px;
  --thumb-h: 195px;
  --gap: 10px;
  --margin: 25px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--bg);
  font-family: "Site Sans", "museo-sans", sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
}

/* Cabeçalho e navegação */
.header_img { margin: var(--margin) 0 0 var(--margin); }
.header_img img { display: block; width: 394px; max-width: calc(100vw - 2 * var(--margin)); height: auto; }
.nav_container { margin: var(--margin) 0 0 var(--margin); line-height: 2.4; display: flex; flex-wrap: wrap; align-items: baseline; }
.page_link { padding: 0 14px 0 0; }
.page_link a { color: var(--link); font-size: 11px; text-decoration: none; }
.page_link a:hover { color: var(--title); }
.page_link a:active { color: #ffff66; }
.page_link.active a { color: var(--title); font-weight: 700; }
.view_tag_info { color: #999; font-size: 11px; padding: 0 14px 0 3px; }
.view_tag_info a { color: #999; }
.view_tag_info a:hover { color: var(--title); }

/* Grade */
#items_container { margin: var(--margin) var(--margin) var(--margin) var(--margin); }
#items {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--thumb-w));
  grid-auto-rows: var(--thumb-h);
  grid-auto-flow: row dense;
  gap: var(--gap);
}

.thumb {
  background: var(--box);
  border-radius: 5px;
  width: var(--thumb-w);
  height: var(--thumb-h);
  overflow: hidden;
  cursor: pointer;
}
.thumb[hidden] { display: none; }
.thumb_link { display: block; text-decoration: none; }
.cardimgcrop { height: 143px; padding: 9px 10px 0 10px; overflow: hidden; text-align: center; }
.cardimgcrop img { width: 200px; height: 134px; object-fit: cover; display: block; }
.thumb_title { color: var(--title); font-size: 11px; font-weight: 700; line-height: 15px; margin: 10px 10px 0 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb_tag { color: var(--muted); font-size: 11px; line-height: 15px; text-align: center; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb_tag a { color: var(--muted); text-decoration: none; }
.thumb_tag a + a::before { content: ", "; }
.thumb:hover { background: #fff; }
.thumb:hover .thumb_title .text { color: #000; }
.thumb_tag a:hover { color: #000; text-decoration: underline; }

/* Projeto aberto dentro da grade */
.project_feed_full {
  grid-column: span 3;
  background: var(--box);
  border-radius: 5px;
  padding: 20px;
  width: calc(3 * var(--thumb-w) + 2 * var(--gap));
  align-self: start;
  position: relative;
}
.project_header { position: absolute; top: 20px; right: 20px; width: 21px; height: 21px; overflow: hidden; z-index: 5; }
.project_header a { display: block; width: 21px; height: 21px; background: url(close.png) 0 0 / 21px 42px no-repeat; }
.project_header a:hover { background-position: 0 -21px; }
.project_title { color: var(--title); font-size: 22px; font-weight: 400; line-height: 1.5; margin: -8px 0 0 0; padding: 0 30px 12px 30px; text-align: center; text-transform: none; }
.project_content { color: var(--text); width: 100%; overflow: hidden; }
.project_content a { color: var(--link); text-decoration: underline; }
.project_content a:hover { color: #fff; }
.project_content img { max-width: 100%; height: auto; margin: 0 15px 15px 0; float: left; cursor: zoom-in; }
.project_content iframe { max-width: 100%; display: block; border: 0; }
.project_content::after { content: ""; display: block; clear: both; }
.project_footer { clear: both; color: var(--muted); font-size: 11px; padding: 30px 0 0 0; }
.footer_title_type { font-weight: 700; margin-right: 4px; }
.project_footer .tags a { color: #999; text-decoration: none; }
.project_footer .tags a:hover { color: var(--title); text-decoration: underline; }

/* Slideshow */
.slideshow_nav { color: var(--muted); font-size: 11px; padding-bottom: 10px; }
.slideshow_nav a, .slideshow_nav button { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.slideshow_nav a:hover, .slideshow_nav button:hover { color: #999; }
.slideshow_nav .fs_open { margin-left: 10px; padding-left: 16px; background: url(fullscreen_open.png) 0 50% no-repeat; }
.slideshow_wrapper { position: relative; margin: 0 0 15px 0; cursor: pointer; }
.slideshow_wrapper img { position: absolute; top: 0; left: 0; max-width: 100%; height: auto; opacity: 0; transition: opacity .6s ease; float: none; margin: 0; }
.slideshow_wrapper img.active { opacity: 1; position: relative; }
.slideshow_thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 8px; }
.slideshow_thumbs li { padding: 0 0 8px 0; }
.slideshow_thumbs button { display: block; padding: 1px; border: 1px solid transparent; background: none; cursor: pointer; }
.slideshow_thumbs button:hover, .slideshow_thumbs button.activeSlide { border-color: #ccc; }
.slideshow_thumbs img { display: block; height: 30px; width: auto; margin: 0; float: none; }

/* Tela cheia */
#fullscreen { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; align-items: center; justify-content: center; }
#fullscreen[hidden] { display: none; }
#fullscreen img { width: 96vw; height: 92vh; object-fit: contain; image-rendering: auto; }
#fullscreen button { position: absolute; background: none; border: 0; color: #999; font-size: 42px; line-height: 1; cursor: pointer; padding: 10px 16px; }
#fullscreen button:hover { color: #fff; }
.fs_close { top: 10px; right: 10px; }
.fs_prev { left: 0; top: 50%; transform: translateY(-50%); }
.fs_next { right: 0; top: 50%; transform: translateY(-50%); }
.fs_count { position: absolute; bottom: 14px; color: var(--muted); font-size: 11px; }

/* Telas médias: projeto ocupa a largura disponível */
@media (max-width: 760px) {
  :root { --margin: 16px; }
  #items { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: auto; }
  .thumb { width: auto; height: auto; padding-bottom: 10px; }
  .cardimgcrop { height: auto; padding: 8px 8px 0 8px; }
  .cardimgcrop img { width: 100%; height: auto; aspect-ratio: 200 / 134; }
  .thumb_title { margin: 8px 8px 0 8px; }
  .project_feed_full { grid-column: 1 / -1; width: auto; padding: 16px; }
  .project_header { top: 16px; right: 16px; }
  .project_title { font-size: 18px; margin: -4px 0 0 0; }
  .project_content img { float: none; display: block; margin: 0 0 12px 0; }
  .slideshow_wrapper img { max-height: 70vh; width: auto; left: 50%; transform: translateX(-50%); }
  .slideshow_wrapper img.active { position: relative; }
  #fullscreen .fs_prev, #fullscreen .fs_next { font-size: 34px; }
}
