/* Portuguese Citizenship by Descent */
:root {
  --ink: #122016;
  --accent: #006600;
  --accent-dark: #004400;
  --bg: #f6f3ed;
  --paper: #fffdfa;
  --muted: #5f6366;
  --line: #ded8cf;
  --soft: #eee8df;
  --shadow: 0 18px 55px rgba(22, 27, 29, .08);
  --photo-position: center 52%;
  --story-position: center 50%;
  --font-h: "Newsreader", Georgia, serif;
  --font-b: "Source Sans 3", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-b);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1rem;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-underline-offset: .18em; }
button, input, textarea { font: inherit; }
.wrap { width: min(1160px, calc(100% - 2.5rem)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 250, .96);
  border-bottom: 1px solid rgba(95, 99, 102, .16);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  max-width: 19rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(22, 27, 29, .08));
  transition: transform .18s ease;
}
.brand:hover .brand-logo { transform: translateY(-1px); }
.brand-name { display: block; }
.nav-links { display: flex; gap: 1.3rem; align-items: center; }
.nav-links a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -.42rem;
  height: 1px;
  background: var(--accent);
  transition: right .18s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { right: 0; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: .45rem .82rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.nav-cta:hover { color: #fff; background: var(--ink); }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: .94rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-dark); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn:focus-visible, .nav-toggle:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(1.4rem, 4vw, 4.2rem);
  padding: clamp(2.4rem, 7vw, 5.7rem) 0 3.8rem;
  align-items: center;
}
.hero-copy { padding: 1rem 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
}
h1, h2, h3 {
  font-family: var(--font-h);
  line-height: 1.12;
  letter-spacing: -.03em;
}
h1 { max-width: 15ch; margin: 0 0 1rem; font-size: clamp(2.45rem, 5vw, 4.65rem); }
h2 { margin: 0 0 1rem; font-size: clamp(1.7rem, 3vw, 2.55rem); }
h3 { margin: 0 0 .7rem; font-size: 1.22rem; }
.lead { max-width: 55ch; margin: 0 0 1.6rem; color: var(--muted); font-size: 1.15rem; }
.hero-visual {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 42% 4% 36% 5% / 12% 5% 16% 6%;
  background: var(--soft);
  box-shadow: var(--shadow);
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-position);
}
.hero-visual .panel {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  max-width: 23rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255,253,250,.92);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.hero-visual strong { display: block; font-family: var(--font-h); font-size: 1.16rem; }
.hero-visual span { color: var(--muted); font-size: .88rem; }
.portfolio-sections { counter-reset: section; }
.content-section { counter-increment: section; }
.section { padding: clamp(3.4rem, 7vw, 6rem) 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }
.section-heading > * { margin-bottom: 0; }
.grid-3, .grid-2 { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin-top: 0; }
.card p { margin: 0 0 1rem; color: var(--muted); }
.card-number {
  display: block;
  margin-bottom: 1.6rem;
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.card-media { padding: 0; }
.card-media-copy { padding: 1.25rem 1.3rem 1.4rem; }
.card-media .feature-img { margin: 0; border-radius: 0; }
.muted { color: var(--muted); }
.prose { max-width: 72ch; }
.prose p, .prose li { margin: 0 0 1rem; }
.prose ul { padding-left: 1.2rem; }
.prose h3 { margin: 1.6rem 0 .65rem; font-size: 1.15rem; }
.expanded-sections { counter-reset: expanded-section; }
.expanded-sections .content-section { counter-increment: expanded-section; }
.expanded-sections .content-inner { position: relative; }
.expanded-sections .content-inner::before {
  content: counter(expanded-section, decimal-leading-zero);
  display: block;
  margin-bottom: .65rem;
  color: var(--accent-dark);
  font-family: var(--font-b);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
}
.expanded-sections .prose ul {
  display: grid;
  gap: .55rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.expanded-sections .prose li {
  position: relative;
  margin: 0;
  padding-left: 1.35rem;
}
.expanded-sections .prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .48rem;
  height: .48rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.detail-hero { padding-bottom: 2.5rem; }
.detail-hero .story-split { align-items: stretch; }
.detail-hero-copy { align-self: center; }
.detail-hero .editorial-photo { min-height: 360px; }
.page-summary {
  margin: 1rem 0 0;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--accent);
  background: var(--soft);
}
.page-summary strong { display: block; margin-bottom: .3rem; font-family: var(--font-h); }
.page-summary p { margin: 0; color: var(--muted); }
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.process-card { padding: 1.3rem; border-top: 3px solid var(--accent); background: var(--paper); }
.process-card span { color: var(--accent-dark); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.process-card h3 { margin: .4rem 0 .55rem; font-size: 1.08rem; }
.process-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.policy-meta { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; margin-top: 1rem; color: var(--muted); font-size: .88rem; }
.policy-meta span { padding-right: 1.2rem; border-right: 1px solid var(--line); }
.policy-meta span:last-child { border-right: 0; }
.contact-note { margin-top: 1rem; color: var(--muted); font-size: .85rem; }
.page-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1rem; }
.page-hero > h1 { max-width: 18ch; margin-bottom: .75rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 1.5rem; align-items: start; }
.photo-frame { margin: 0; }
.editorial-photo, .feature-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: var(--photo-position);
  border-radius: 20px;
  background: var(--soft);
}
.story-photo { object-position: var(--story-position); }
.photo-frame figcaption {
  margin-top: .55rem;
  color: var(--muted);
  font-size: .76rem;
}
.photo-frame figcaption a { color: inherit; }
.story-split { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.story-split .editorial-photo { min-height: 420px; object-position: var(--photo-position); }
.story-split .story-photo { object-position: var(--story-position); }
.story-copy { max-width: 62ch; }
.grid-3 .card-media:nth-child(2) .feature-img { object-position: 35% center; }
.grid-3 .card-media:nth-child(3) .feature-img { object-position: 70% center; }
.cta-band {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border-radius: 26px 8px 26px 8px;
  color: #fff;
  background: var(--accent-dark);
}
.cta-band p { margin: .4rem 0 0; color: rgba(255,255,255,.82); }
.cta-band .btn-primary { background: #fff; color: var(--accent-dark); }
.cta-band .btn-primary:hover { background: var(--bg); }
.site-footer {
  margin-top: 4rem;
  padding: 3.5rem 0 2rem;
  color: rgba(255,255,255,.84);
  background: var(--ink);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.8rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer h4 { margin: 0 0 .8rem; font-family: var(--font-h); }
.footer-brand { display: inline-flex; align-items: center; gap: .75rem; margin-bottom: .8rem; }
.footer-brand img { width: 52px; height: 52px; object-fit: contain; }
.footer-brand h4 { margin: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 .45rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.62);
  font-size: .82rem;
}
.footer-bottom a { color: inherit; text-decoration: underline; }
.breadcrumbs { margin-bottom: 1.1rem; color: var(--muted); font-size: .84rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}
.post-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.post-meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.post-layout {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 720px) minmax(220px, 260px);
  grid-template-areas: "toc article cta";
  justify-content: center;
  gap: clamp(1.1rem, 2.4vw, 2rem);
  align-items: start;
}
.toc, .post-cta {
  position: sticky;
  top: 82px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.toc { grid-area: toc; max-height: calc(100vh - 104px); overflow: auto; }
.toc-header { padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--line); }
.toc-header span { display: block; margin-bottom: .2rem; color: var(--accent-dark); font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.toc h2 { margin: 0; font-family: var(--font-b); font-size: .98rem; }
.toc-links { counter-reset: toc-link; padding: .65rem; }
.toc a {
  counter-increment: toc-link;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .35rem;
  padding: .52rem .55rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .83rem;
  line-height: 1.35;
}
.toc a::before { content: counter(toc-link, decimal-leading-zero); color: var(--accent); font-size: .68rem; font-weight: 700; }
.toc a:hover { color: var(--ink); background: var(--soft); }
.toc a.active { color: var(--accent-dark); font-weight: 700; background: var(--soft); }
.post-article { grid-area: article; padding: clamp(1.25rem, 3vw, 2.4rem); }
.post-article > section { scroll-margin-top: 90px; }
.post-article > section + section { margin-top: 2.4rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.post-article h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
.post-cta {
  grid-area: cta;
  overflow: hidden;
  border-top: 5px solid var(--accent);
  color: var(--ink);
  background: var(--soft);
  box-shadow: 0 12px 30px rgba(22, 27, 29, .06);
}
.post-cta-inner { padding: 1.25rem; }
.post-cta .eyebrow { color: var(--accent); }
.post-cta h2 { margin: .25rem 0 .65rem; color: var(--ink); font-size: 1.28rem; }
.post-cta p { color: var(--muted); font-size: .9rem; }
.post-cta ul { margin: 1rem 0; padding: 0; list-style: none; }
.post-cta li { position: relative; margin: .55rem 0; padding-left: 1.1rem; color: var(--ink); font-size: .82rem; }
.post-cta li::before { content: ""; position: absolute; left: 0; top: .5em; width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent); }
.post-cta .btn { width: 100%; margin-top: .35rem; background: var(--accent-dark); color: #fff; }
.post-cta .btn:hover { background: var(--ink); }
.post-cta-contact { display: block; margin-top: .8rem; color: var(--accent-dark); text-align: center; font-size: .76rem; }
.article-photo { margin: 1.6rem 0 1.2rem; }
.article-photo .feature-img { aspect-ratio: 2 / 1; }
.form { display: grid; gap: .9rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: .82rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.form textarea { min-height: 145px; resize: vertical; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .hero-visual { min-height: 440px; }
  .post-layout { grid-template-columns: 1fr; grid-template-areas: "toc" "article" "cta"; }
  .toc, .post-cta { position: static; }
  .toc { max-height: none; }
  .toc-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 1.5rem, 680px); }
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    position: fixed;
    inset: 64px 0 0;
    padding: 2rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .95rem .25rem; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-links a::after { display: none; }
  .nav-links .nav-cta { margin-top: 1rem; justify-content: center; border: 1px solid var(--ink); }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero-copy { padding: 0; }
  h1 { font-size: clamp(2.4rem, 12vw, 3.8rem); }
  .hero-visual { min-height: 390px; border-radius: 32% 4% 26% 4% / 10% 4% 12% 4%; }
  .grid-2, .grid-3, .split, .story-split, .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
  .section-heading { align-items: start; flex-direction: column; gap: .5rem; }
  .story-split .editorial-photo { min-height: 320px; }
  .process-grid { grid-template-columns: 1fr; }
  .toc-links { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .cta-band .btn { width: auto; }
}
@media (max-width: 420px) {
  .brand { gap: .55rem; max-width: 15rem; font-size: .82rem; }
  .brand-logo { width: 38px; height: 38px; flex-basis: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Portugal: azulejo tile composition */
.design-azulejo .hero { grid-template-columns: .92fr 1.08fr; }
.design-azulejo .hero-copy { padding: 2.6rem; border: 8px double var(--accent-dark); background: var(--paper); }
.design-azulejo .hero-visual { border-radius: 2px; }
.design-azulejo .portfolio-sections { width: min(1160px, calc(100% - 2.5rem)); margin: 0 auto; padding: 4rem 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.2rem; }
.design-azulejo .content-section { padding: 0; border: 0; background: transparent; }
.design-azulejo .content-section .content-inner { width: auto; height: 100%; padding: 2.2rem; border: 7px double var(--accent); background: #fff; }
.design-azulejo .content-section-1 { grid-column: 1 / -1; }
.design-azulejo .content-section-1 .content-inner { grid-template-columns: .85fr 1.15fr; }
.design-azulejo .content-section h2 { color: var(--accent-dark); }
.design-azulejo .content-section h2::after { content: ""; display: block; width: 46px; height: 8px; margin-top: .8rem; border: 2px solid var(--accent); box-shadow: 8px 8px 0 rgba(0,102,0,.16); }
.design-azulejo .card { border: 5px double var(--accent); border-radius: 2px; }
.design-azulejo .page-hero .story-split { padding: 1.2rem; border: 7px double var(--accent); }

@media (max-width: 760px) {
  body[class*="design-"] .hero { grid-template-columns: 1fr; gap: 1.25rem; text-align: left; }
  body[class*="design-"] .hero-copy { max-width: none; margin: 0; padding: 1.5rem; }
  body[class*="design-"] .hero-copy h1,
  body[class*="design-"] .hero-copy .lead { margin-left: 0; margin-right: 0; }
  body[class*="design-"] .hero-visual { min-height: 390px; border-radius: 18px; box-shadow: none; }
  body[class*="design-"] .portfolio-sections { display: block; width: auto; margin: 0; padding: 1.5rem 0; }
  body[class*="design-"] .content-section,
  body[class*="design-"] .content-section:nth-child(even),
  body[class*="design-"] .content-section:nth-child(odd) {
    width: auto;
    margin: 0;
    padding: 1rem 0;
    transform: none;
  }
  body[class*="design-"] .content-section::before,
  body[class*="design-"] .content-section::after { display: none; }
  body[class*="design-"] .content-section .content-inner,
  body[class*="design-"] .content-section:nth-child(even) .content-inner,
  body[class*="design-"] .content-section:nth-child(odd) .content-inner {
    display: grid;
    width: min(100% - 1.5rem, 680px);
    max-width: none;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: left;
  }
  body[class*="design-"] .content-section h2,
  body[class*="design-"] .content-section .prose {
    grid-column: 1;
    grid-row: auto;
    margin-left: 0;
    margin-right: 0;
  }
  body[class*="design-"] .content-section-1 .content-inner { grid-template-columns: 1fr; }
}
