:root {
  --ig-bg: #fafafa;
  --ig-surface: #ffffff;
  --ig-text: #262626;
  --ig-muted: #8e8e8e;
  --ig-border: #dbdbdb;
  --ig-accent: #0095f6;
  --ig-overlay: rgba(0, 0, 0, 0.35);
  --ig-max: 935px;
  --ig-gap: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ig-bg: #000000;
    --ig-surface: #121212;
    --ig-text: #f5f5f5;
    --ig-muted: #a8a8a8;
    --ig-border: #262626;
    --ig-overlay: rgba(0, 0, 0, 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ig-bg);
  color: var(--ig-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.ig-skip-link {
  position: absolute;
  left: -9999px;
}

.ig-skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ig-surface);
  border: 1px solid var(--ig-border);
  border-radius: 8px;
}

/* Topo fixo */
.ig-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ig-surface);
  border-bottom: 1px solid var(--ig-border);
}

.ig-header__inner {
  max-width: var(--ig-max);
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ig-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ig-brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  display: grid;
  place-items: center;
  color: #fff;
}

.ig-brand__name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-header__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ig-muted);
  font-size: 13px;
}

.ig-header__nav a:hover {
  color: var(--ig-text);
}

/* Perfil */
.ig-main {
  max-width: var(--ig-max);
  margin: 0 auto;
  padding: 0 16px 64px;
}

.ig-profile {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--ig-border);
  margin-bottom: 28px;
}

.ig-profile__avatar {
  width: 150px;
  height: 150px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 48px;
  font-weight: 600;
}

.ig-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-profile__title {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 16px;
}

.ig-profile__stats {
  list-style: none;
  display: flex;
  gap: 32px;
  padding: 0;
  margin: 0 0 16px;
}

.ig-profile__stats strong {
  font-weight: 600;
}

.ig-profile__bio {
  margin: 0;
  color: var(--ig-muted);
  max-width: 48ch;
}

/* Grade */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.ig-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ig-border);
  border-radius: 4px;
}

.ig-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ig-card:hover .ig-card__img,
.ig-card:focus-visible .ig-card__img {
  transform: scale(1.03);
}

.ig-card__overlay {
  position: absolute;
  inset: 0;
  background: var(--ig-overlay);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ig-card:hover .ig-card__overlay,
.ig-card:focus-visible .ig-card__overlay {
  opacity: 1;
}

.ig-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ig-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.ig-card:hover .ig-card__badge {
  opacity: 0;
}

/* Estados vazios e paginacao */
.ig-empty {
  text-align: center;
  padding: 80px 16px;
  color: var(--ig-muted);
}

.ig-empty h2 {
  color: var(--ig-text);
  font-weight: 400;
}

.ig-empty code {
  background: var(--ig-surface);
  border: 1px solid var(--ig-border);
  border-radius: 6px;
  padding: 2px 6px;
}

.ig-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.ig-pagination .page-numbers {
  padding: 6px 12px;
  border: 1px solid var(--ig-border);
  border-radius: 8px;
  color: var(--ig-muted);
}

.ig-pagination .page-numbers.current {
  color: var(--ig-text);
  border-color: var(--ig-text);
}

/* Pagina individual da foto */
.ig-post {
  background: var(--ig-surface);
  border: 1px solid var(--ig-border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
}

.ig-post__media {
  background: #000;
  display: grid;
  place-items: center;
  min-height: 0;
}

.ig-post__media img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.ig-post__side {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ig-border);
  min-width: 0;
}

.ig-post__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ig-border);
  font-weight: 600;
}

.ig-post__body {
  padding: 16px;
  flex: 1;
  overflow-wrap: break-word;
}

.ig-post__title {
  font-size: 16px;
  margin: 0 0 8px;
}

.ig-post__date {
  padding: 12px 16px;
  border-top: 1px solid var(--ig-border);
  color: var(--ig-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ig-post__tags {
  margin-top: 12px;
  color: var(--ig-accent);
}

.ig-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ig-border);
  overflow-x: auto;
}

.ig-thumbs button {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.ig-thumbs button[aria-current="true"] {
  border-color: var(--ig-accent);
}

.ig-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-back {
  display: inline-block;
  margin-top: 24px;
  color: var(--ig-muted);
}

.ig-back:hover {
  color: var(--ig-text);
}

/* Lightbox */
.ig-lightbox[hidden] {
  display: none;
}

.ig-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.9);
  display: grid;
  place-items: center;
  padding: 24px;
}

.ig-lightbox__figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.ig-lightbox__figure img {
  max-height: 78vh;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

.ig-lightbox__caption {
  color: #fff;
  text-align: center;
  max-width: 60ch;
}

.ig-lightbox__caption a {
  color: #fff;
  text-decoration: underline;
}

.ig-lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ig-lightbox button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ig-lightbox__close {
  top: 16px;
  right: 16px;
}

.ig-lightbox__prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.ig-lightbox__next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.ig-footer {
  max-width: var(--ig-max);
  margin: 0 auto;
  padding: 32px 16px 48px;
  color: var(--ig-muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 860px) {
  .ig-post {
    grid-template-columns: 1fr;
  }

  .ig-post__side {
    border-left: 0;
    border-top: 1px solid var(--ig-border);
  }
}

@media (max-width: 735px) {
  :root {
    --ig-gap: 3px;
  }

  .ig-main {
    padding: 0 0 48px;
  }

  .ig-profile {
    gap: 16px;
    padding: 20px 16px;
  }

  .ig-profile__avatar {
    width: 84px;
    height: 84px;
    font-size: 30px;
  }

  .ig-profile__stats {
    gap: 20px;
  }

  .ig-grid {
    gap: var(--ig-gap);
  }

  .ig-card {
    border-radius: 0;
  }

  .ig-pagination,
  .ig-back {
    margin-left: 16px;
    margin-right: 16px;
  }

  .ig-post {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

/* Comentários e páginas */
.ig-comments,
.ig-page {
  background: var(--ig-surface);
  border: 1px solid var(--ig-border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.ig-comments__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
}

.ig-comments__list,
.ig-comments__list .children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ig-comments__list .children {
  padding-left: 24px;
}

.ig-comments__list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--ig-border);
}

.ig-comments .comment-author img {
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.ig-comments .comment-meta {
  color: var(--ig-muted);
  font-size: 12px;
}

.ig-comments input[type="text"],
.ig-comments input[type="email"],
.ig-comments input[type="url"],
.ig-comments textarea,
.ig-page input,
.search-form input[type="search"] {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ig-border);
  border-radius: 8px;
  background: var(--ig-bg);
  color: var(--ig-text);
  font: inherit;
}

.ig-comments .submit,
.search-form button,
.search-form input[type="submit"] {
  background: var(--ig-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.ig-page {
  padding: 28px;
}

@media (max-width: 735px) {
  .ig-comments,
  .ig-page {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

@media (max-width: 420px) {
  .ig-footer__widgets {
    grid-template-columns: 1fr;
  }
}

.ig-brand .custom-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.ig-footer__widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin-bottom: 20px;
}

.ig-footer__widget {
  margin-bottom: 12px;
}

.ig-footer__widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ig-footer__widget li {
  margin: 2px 0;
}

/* O titulo vem do before_title no widget classico e de um <h2> no widget de bloco. */
.ig-footer__title,
.ig-footer__widget h2,
.ig-footer__widget h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ig-text);
  margin: 0 0 6px;
}

.ig-footer__widget .wp-block-group {
  margin: 0;
}

.ig-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
}
