/* Estilo inspirado em casais.pt, minimalista e moderno */

:root {
  --primary: #0a1733; /* azul profundo */
  --accent: #811717;
  --text: #1b1e23;
  --muted: #6b7280;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 80%;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #d8d8d8;
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #eef0f3;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.brand-logo {
  height: 55px;
  display: grid;
  place-items: center;
}
.brand-logo img {
  max-height: 56px;
  width: auto;
  display: block;
}
.menu {
  display: flex;
  gap: 24px;
  align-items: center;
}
.menu a {
  position: relative;
  color: var(--text);
  font-weight: 600;
  padding: 10px 2px;
}
.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
.menu a:hover::after,
.menu a.active::after,
.menu a.hovering::after {
  width: 100%;
}
.menu a:hover,
.menu a.active {
  color: var(--primary);
}

/* Pormenor de construção (faixa preto/amarelo) */
.construction-stripes {
  height: 4px;
  background: repeating-linear-gradient(
    135deg,
    #facc15 0 12px,
    #1f2937 12px 24px
  );
  border-bottom: 1px solid #eef0f3;
}

/* Mobile navbar */
.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.hamburger span::before {
  position: absolute;
  top: -6px;
}
.hamburger span::after {
  position: absolute;
  top: 6px;
}
.nav-toggle {
  display: none;
}

@media (max-width: 860px) {
  .hamburger {
    display: inline-flex;
  }
  .menu {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    display: grid;
    gap: 0;
    padding: 8px 24px 16px;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.2s ease;
  }
  .menu a {
    padding: 12px 0;
    border-bottom: 1px solid #f1f2f5;
  }
  .menu a:last-child {
    border-bottom: 0;
  }
  .nav-toggle:checked ~ .hamburger {
    border-color: var(--primary);
  }
  .nav-toggle:checked ~ .menu {
    transform: scaleY(1);
  }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding: 64px 0;
  align-items: center;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--primary);
}
.hero p {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 24px;
}
.hero .cta {
  display: flex;
  gap: 12px;
}

/* Hero fullscreen slider */
.hero-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.hero-slide .content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  padding: 0 24px;
}
.hero-slide .content h1 {
  color: #fff;
  font-size: 52px;
  line-height: 1.05;
}
.hero-slide .content p {
  color: #e5e7eb;
  font-size: 18px;
}
.hero-slide .content .cta .btn {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.hero-slide .content .cta .btn:hover {
  background: #ffffff;
  color: var(--primary);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(10, 23, 51, 0.25);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Secções */
section {
  padding: 56px 0;
}
.section-title {
  font-size: 28px;
  color: var(--primary);
  margin: 0 0 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Cartões de obra */
.obra-card {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.obra-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.obra-thumb {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
}
.obra-body {
  padding: 16px;
}
.obra-title {
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
}
.obra-meta {
  color: var(--muted);
  font-size: 14px;
}

/* Cartões de áreas de atuação */
.feature-card {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.feature-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.feature-body {
  padding: 16px;
}
.feature-body h3 {
  margin: 0 0 6px;
  color: var(--primary);
}
.feature-body p {
  margin: 0;
  color: var(--muted);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fadeIn 0.25s ease;
}
.lightbox {
  position: relative;
  width: min(96vw, 1100px);
  max-height: 90vh;
  background: transparent;
}
.lightbox-img {
  max-height: 80vh;
  width: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}
.lightbox-close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  font-size: 22px;
  cursor: pointer;
}
.lightbox-arrow.prev {
  left: 8px;
}
.lightbox-arrow.next {
  right: 8px;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.6s ease;
}
.reveal.show {
  opacity: 1;
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Contactos */
.contact-card {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 24px;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.form-group {
  display: grid;
  gap: 8px;
}
label {
  font-weight: 600;
  color: var(--primary);
}
input,
textarea {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 23, 51, 0.12);
}

/* Contact hero */
.contact-hero {
  position: relative;
  width: 100%;
  height: 48vh;
  min-height: 320px;
  background-size: cover;
  background-position: center;
}
.contact-hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.55));
}
.contact-hero .content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  padding: 0 24px;
}
.contact-hero .content h1 {
  color: #fff;
  font-size: 44px;
  margin: 0;
}
.contact-hero .content p {
  color: #e5e7eb;
  margin-top: 8px;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid #eef0f3;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}
footer.site-footer .container {
  max-width: 80%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Responsivo */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .nav {
    height: 64px;
  }
}

/* Obra detalhe */
.obra-hero {
  position: relative;
  width: 100%;
  height: 74vh;
  min-height: 420px;
  background-size: cover;
  background-position: center;
}
.obra-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.55));
  display: flex;
  align-items: end;
  padding-bottom: 32px;
}
.obra-hero h1 {
  color: #fff;
  font-size: 42px;
  margin: 0 0 6px;
}
.obra-hero-meta {
  color: #e5e7eb;
  margin-bottom: 8px;
}
.obra-hero .scroll-down {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 28px;
  text-decoration: none;
  animation: bounce 1.4s infinite;
}
@keyframes bounce {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -6px);
  }
}

/* Centro e titulo maior (usado no Portefólio) */
.obra-hero-center .obra-hero-overlay {
  align-items: center;
  padding-bottom: 0;
}
.obra-hero-center .obra-hero-overlay .container {
  text-align: center;
}
.obra-hero-center h1 {
  font-size: 64px;
  line-height: 1.05;
}
@media (max-width: 640px) {
  .obra-hero-center h1 {
    font-size: 40px;
  }
}

.gallery-grid {
  column-count: 3;
  column-gap: 12px;
  -webkit-column-count: 3;
  -webkit-column-gap: 12px;
  -moz-column-count: 3;
  -moz-column-gap: 12px;
}
.gallery-grid img {
  width: 100%;
  margin: 0 0 12px;
  border-radius: 10px;
  border: 1px solid #eef0f3;
  transition: transform 0.2s ease;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
}
.gallery-grid img:hover {
  transform: scale(1.02);
  cursor: zoom-in;
}

.obra-details .details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.detail-card {
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 16px;
}
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #eef0f3;
}
.detail-row:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .obra-details .details-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    column-count: 2;
    -webkit-column-count: 2;
    -moz-column-count: 2;
  }
}
@media (max-width: 640px) {
  .gallery-grid {
    column-count: 1;
    -webkit-column-count: 1;
    -moz-column-count: 1;
  }
}

.portfolio-hero {
  padding: 48px 0 8px;
}
.portfolio-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.portfolio-strip img {
  height: 92px;
  width: auto;
  border-radius: 10px;
  border: 1px solid #eef0f3;
  flex: 0 0 auto;
  object-fit: cover;
}
@media (max-width: 640px) {
  .portfolio-strip img {
    height: 72px;
  }
}

/* Admin layout */
body.admin {
  background: #f9fafb;
}
.admin-bar {
  background: var(--primary);
  color: #fff;
}
.admin-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.admin-bar a {
  color: #fff;
  opacity: 0.9;
}
.admin-bar a:hover {
  opacity: 1;
}
.admin-main {
  padding: 24px 0 48px;
}
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-actions {
  display: flex;
  gap: 8px;
}
.admin-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.admin-list {
  display: grid;
  gap: 12px;
}
.obra-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  overflow: hidden;
}
.obra-row-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/9;
}
.obra-row-body {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 6px;
}
.obra-row-title {
  font-weight: 700;
  color: var(--primary);
}
.obra-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .obra-row {
    grid-template-columns: 1fr;
  }
  .obra-row-thumb {
    aspect-ratio: 16/10;
  }
}
.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 600;
}
.flash-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.flash-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.stack-16 > * + * {
  margin-top: 16px;
}
.stack-24 > * + * {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .admin-page-header {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
}
