/* ==========================================================
   gigocabral.com — estilos base
   A grelha reproduz a do Pixieset (24 colunas desktop/tablet,
   8 colunas mobile) para as fotos ficarem nos mesmos sítios.
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: 16px; }
/* tema do Pixieset: letra base um pouco menor entre 768 e 1439px */
@media (min-width: 768px) and (max-width: 1439px) {
  html { font-size: clamp(14px, calc(11.71429px + 0.29762vw), 16px); }
}
body {
  margin: 0;
  padding: 0;
  background: #F8EDE0;
  /* valores base herdados do tema do Pixieset */
  color: #373737;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}
.mobile-page a {
  font-family: 'Epilogue', sans-serif;
  font-size: 0.9375rem;
  color: #007bff;
  text-decoration: none;
}
img { display: block; }
a { color: inherit; }

/* ---------- GRELHA ---------- */
main { container-type: inline-size; }

.block { background: #F8EDE0; }

.grid {
  --n: 24;
  --edge: 1.6cqw;
  --P: min(calc(100cqw - 2 * var(--edge)), 1500px);
  --g: calc(var(--P) / var(--n) / 4);
  --W: min(calc(var(--P) + 2 * var(--g)), 100cqw);
  --cw: calc((var(--W) - var(--g) * (var(--n) + 1)) / var(--n));
  --grid-row-height: calc(var(--cw) / 3 * 2);
  display: grid;
  grid-template-columns:
    minmax(calc(var(--edge) - var(--g)), 1fr)
    repeat(var(--n), var(--cw))
    minmax(calc(var(--edge) - var(--g)), 1fr);
  grid-template-rows: repeat(var(--rows), minmax(var(--grid-row-height), auto));
  gap: var(--g);
}

@media (min-width: 768px) and (max-width: 991px) {
  .grid { --edge: 40px; }
}

@media (max-width: 767px) {
  .grid {
    --n: 8;
    --edge: 20px;
    --grid-row-height: calc(var(--cw) / 3 * 2 + var(--g));
    /* linhas de texto do Pixieset em mobile */
    --P2: min(calc(375px - 30cqw - 40px), 1500px);
    --g2: calc(var(--P2) / 32);
    --grid-row-height-text: calc((var(--P2) - var(--g2) * 9) / 8 / 3 * 2);
    row-gap: 0;
  }
  .block.is-head .grid {
    --grid-row-height: calc(var(--cw) / 3 * 2);
    row-gap: var(--g);
  }
}

.el { position: relative; min-width: 10px; min-height: 10px; }
@media (max-width: 767px) {
  .el { margin-top: calc(var(--g) / 2); margin-bottom: calc(var(--g) / 2); }
  .el.m-hi { margin-top: 0; }
  .el.m-lo { margin-bottom: 0; }
}

/* ---------- IMAGENS ---------- */
.img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r, 0);
  overflow: hidden;
}
.img img {
  border-radius: var(--r, 0);
}
.img.fill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* "fit" = a foto inteira cabe na caixa (sem cortar) */
.img.fit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.img.lb { cursor: pointer; }

/* ---------- TEXTO ---------- */
.txt .text { width: 100%; }
.txt h1, .txt h2, .txt h3, .txt h4, .txt h5, .txt p { margin: 0; }
.txt h4 {
  font-family: 'Jomolhari', serif;
  font-weight: 400;
  line-height: 1.2em;
  letter-spacing: -0.02em;
  color: #F8EDE0;
}
/* tamanho como no tema do Pixieset: depende da orientação do ecrã */
@media (orientation: portrait) { .txt h4 { font-size: min(1.625rem, calc(1rem + 0.69vh)); } }
@media (orientation: landscape) { .txt h4 { font-size: min(1.625rem, calc(1rem + 0.69vw)); } }
@media (min-width: 1441px) { .txt h4 { font-size: 1.625rem; } }
.c-par { color: #161616; }

/* ==========================================================
   CABEÇALHO — código original do Gui (custom code do Pixieset)
   ========================================================== */

.custom-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  font-family: Arial, sans-serif;
  transition: opacity 0.3s ease;
}

.header-inner {
  width: 100%;
  background: #F8EDE0;
  border: 4px solid #000;
  padding: 25px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  position: relative;
}

.menu-left, .menu-right {
  display: flex;
  gap: 30px;
}

.menu a {
  text-decoration: none;
  color: #000;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 2.8px;
  text-transform: lowercase;
  font-weight: 500;
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu a:hover {
  opacity: 0.5;
  transform: translateY(-1px);
}

.logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo a { display: block; }

.logo img {
  height: 60px;
  width: auto;
  display: block;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 28px;
  height: 2px;
  background: #000;
}

.mobile-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #F8EDE0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 25px;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.mobile-page.active {
  opacity: 1;
  pointer-events: all;
}

.close-menu {
  position: absolute;
  top: 25px;
  right: 40px;
  cursor: pointer;
}

.page-hero {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 900;
  font-size: 14vw;
  color: #F8EDE0;
  text-transform: uppercase;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  animation: heroFade 1.2s ease forwards;
}

@keyframes heroFade {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
  .menu-left,
  .menu-right {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .header-inner {
    padding: 25px 18px;
  }
  .logo img {
    height: 45px;
  }
  .page-hero {
    top: 180px;
    font-size: clamp(40px, 16vw, 90px);
  }
}

/* ---------- LIGHTBOX (foto em ecrã inteiro) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #F8EDE0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 44px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.333s cubic-bezier(0.4, 0, 0.22, 1);
  cursor: zoom-out;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 6px;
  right: 25px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-close::before,
.lightbox-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: #000;
}
.lightbox-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
body.lb-open { overflow: hidden; }
body.lb-open .custom-header { opacity: 0; pointer-events: none; }
@media (max-width: 767px) {
  .lightbox { padding: 60px 0; }
}

/* Pixieset: em telemóveis (>375px) cada foto tem uma altura mínima
   proporcional ao número de linhas que ocupa */
@media (min-width: 375.1px) and (max-width: 767px) {
  .el-img { min-height: calc(var(--h) * (20.9375px + 10.4688px)); }
}
