/* =========================================================
   RIBio — Rede Integrada de Biossegurança (UFRJ)
   Folha de estilos principal
   ========================================================= */

:root{
  --ink:      #122748;
  --ink-soft: #45546b;
  --paper:    #ffffff;
  --paper-2:  #f4f6fa;
  --forest:   #5b287c;
  --forest-d: #122748;
  --sage:     #eee8f4;
  --clay:     #7750a0;
  --line:     rgba(18,39,72,0.14);

  --serif: "Iowan Old Style", "Baskerville", Georgia, serif;
  --sans:  "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1200px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

h1,h2,h3,h4{
  font-family: var(--serif);
  font-weight: 600;
  margin: 0 0 0.5em;
  line-height: 1.15;
  color: var(--ink);
}

h1{ font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 500; }
h2{ font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3{ font-size: 1.25rem; }

p{ margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

.btn{
  display:inline-flex;
  align-items:center;
  gap:.5em;
  border-radius: 999px;
  padding: 0.85em 1.6em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor:pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary{
  background: var(--forest);
  color: var(--paper);
}
.btn-primary:hover{ background: var(--forest-d); }
.btn-ghost{
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn-ghost:hover{ background: var(--forest); color: var(--paper); }
.btn-ghost.on-dark{ color: var(--paper); border-color: rgba(246,244,236,.5); }
.btn-ghost.on-dark:hover{ background: var(--paper); color: var(--forest-d); }

/* ---------- Header ---------- */
.site-header{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 24px;
}
.brand{ display:block; width:220px; height:72px; overflow:hidden; flex:0 0 220px; }
.brand img{ width:220px; height:220px; max-width:none; transform:translateY(-72px); }

.nav{
  display:flex;
  align-items:center;
  gap: clamp(10px, 1.7vw, 26px);
  flex-wrap: wrap;
}
.nav a{
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active{
  color: var(--forest);
  border-bottom-color: var(--forest);
}
.nav-toggle{
  display:none;
  background:none;
  border:none;
  cursor:pointer;
  padding: 6px;
}
.nav-toggle span{
  display:block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

@media (max-width: 860px){
  .nav-toggle{ display:block; }
  .nav{
    position:absolute;
    top: 100%;
    left:0; right:0;
    background: var(--paper);
    flex-direction: column;
    align-items:flex-start;
    gap: 4px;
    padding: 10px 28px 22px;
    border-bottom: 1px solid var(--line);
    display:none;
  }
  .nav.open{ display:flex; }
  .nav a{ width:100%; padding: 10px 0; }
}

/* ---------- Hero ---------- */
.hero{
  padding: 64px 0 80px;
  overflow:hidden;
}
.hero .wrap{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items:center;
}
.hero-figure{order:-1}
.hero h1{font-size:clamp(2.4rem,4.3vw,4.4rem)}
.hero .eyebrow-tag{
  display:inline-block;
  font-size:.8rem;
  color: var(--forest);
  background: var(--sage);
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 18px;
}
.hero p.lede{
  font-size: 1.15rem;
  color: var(--ink);
}
.hero-figure{
  position:relative;
}
.hero-figure img{
  width:100%;
  aspect-ratio: 4/4.4;
  object-fit: cover;
  border-radius: 160px 12px 160px 12px;
}
.hero-figure figcaption{
  position:absolute;
  left: -18px;
  bottom: -18px;
  background: var(--forest);
  color: var(--paper);
  font-size:.82rem;
  padding: 10px 16px;
  max-width: 220px;
  border-radius: 3px;
}
@media (max-width: 860px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .hero-figure{ order:-1; }
  .hero-figure figcaption{ left:12px; bottom:-14px; }
}

/* ---------- Page header (páginas internas) ---------- */
.page-head{
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.page-head p.lede{ font-size: 1.05rem; }

/* ---------- Ledger list (Nossa atuação) ---------- */
.section{ padding: 72px 0; }
.section-alt{ background: var(--paper-2); }

.ledger{
  border-top: 1px solid var(--line);
  margin-top: 28px;
}
.ledger-row{
  display:flex;
  align-items:baseline;
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row .mark{
  width: 8px; height:8px;
  border-radius:50%;
  background: var(--clay);
  flex: 0 0 auto;
  transform: translateY(-2px);
}
.ledger-row span.txt{
  font-size: 1.05rem;
  color: var(--ink);
}
.tagline{
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--forest);
}

/* ---------- Pillars (Ciência/Educação/Integração) ---------- */
.pillars{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}
.pillar{
  padding: 28px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pillar:last-child{ border-right:none; }
.pillar .glyph{ font-size: 1.6rem; margin-bottom: .4em; }
@media (max-width: 760px){
  .pillars{ grid-template-columns: 1fr; }
  .pillar{ border-right:none; }
}

/* ---------- Team grid ---------- */
.team-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px 26px;
  margin-top: 30px;
}
.team-card img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius: 3px;
  border-bottom: 3px solid var(--clay);
}
.team-card .role{
  font-size: .78rem;
  color: var(--forest);
  font-weight:600;
  margin-top: 12px;
}
.team-card h3{ margin: 2px 0 6px; font-size: 1.08rem; }
.team-card p{ font-size: .9rem; margin:0; }
@media (max-width: 940px){ .team-grid{ grid-template-columns: repeat(3,1fr);} }
@media (max-width: 680px){ .team-grid{ grid-template-columns: repeat(2,1fr); gap:26px 18px;} }

/* ---------- Project / card grid ---------- */
.card-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 30px;
}
.card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.card img{ width:100%; aspect-ratio: 4/3; object-fit: cover; }
.card .card-body{ padding: 20px 22px 24px; flex:1; display:flex; flex-direction:column; }
.card .card-body p{ font-size: .92rem; flex:1; }
.card .card-body .btn{ align-self:flex-start; margin-top: 10px; }
.odontologia-feature{display:flex;align-items:center;justify-content:space-between;gap:25px;margin-top:24px;padding:25px 28px;background:#eae4f1;border-radius:8px}
.odontologia-feature h3{margin:3px 0 5px}
.odontologia-feature p{margin:0;font-size:.9rem}
.odontologia-feature .btn{flex:none}
@media (max-width:640px){.odontologia-feature{display:block}.odontologia-feature .btn{margin-top:16px}}
@media (max-width: 940px){ .card-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 640px){ .card-grid{ grid-template-columns: 1fr;} }

/* ---------- Legislação list ---------- */
.leg-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 30px;
}
.leg-card{
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 24px;
  background: var(--paper);
}
.leg-card h3{ margin-bottom: .3em; }
.leg-card p{ font-size:.9rem; margin-bottom: 1.1em; }
@media (max-width: 860px){ .leg-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 560px){ .leg-grid{ grid-template-columns: 1fr;} }

/* ---------- Timeline (Próximos eventos) ---------- */
.timeline{
  margin-top: 34px;
  border-left: 2px solid var(--sage);
  padding-left: 32px;
}
.tl-item{ position:relative; padding-bottom: 46px; }
.tl-item:last-child{ padding-bottom:0; }
.tl-item::before{
  content:"";
  position:absolute;
  left: -38px; top: 4px;
  width: 12px; height:12px;
  border-radius:50%;
  background: var(--forest);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--sage);
}
.tl-date{
  display:inline-block;
  font-weight:700;
  color: var(--clay);
  font-size:.85rem;
  margin-bottom: 6px;
}
.tl-item .tl-media{
  margin-top: 14px;
  max-width: 420px;
}
.tl-item .tl-media img{ border-radius:4px; aspect-ratio:4/3; object-fit:cover; }

/* past events */
.past-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 40px;
  margin-top: 30px;
}
.past-item h3{ font-size: 1.1rem; }
.past-item img{ margin-top: 12px; border-radius:4px; aspect-ratio: 16/10; object-fit:cover; }
@media (max-width: 760px){ .past-grid{ grid-template-columns: 1fr;} }

/* ---------- Contact / "Vamos conversar" ---------- */
.contact-band{
  background: var(--forest-d);
  color: var(--paper);
  padding: 70px 0;
}
.contact-band h2{ color: var(--paper); }
.contact-band .wrap{
  display:grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items:start;
}
.contact-band p{ color: rgba(246,244,236,0.75); }

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.form-grid .full{ grid-column: 1/-1; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:.8rem; color: rgba(246,244,236,0.7); }
.field input, .field textarea{
  background: transparent;
  border:none;
  border-bottom: 1px solid rgba(246,244,236,0.4);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 8px 2px;
  outline:none;
}
.field input::placeholder, .field textarea::placeholder{ color: rgba(246,244,236,0.35); }
.field input:focus, .field textarea:focus{ border-bottom-color: var(--paper); }
textarea{ resize: vertical; min-height: 90px; }

.contact-band .btn-primary{ background: #fff; color: var(--forest-d); margin-top: 6px; }
.contact-band .btn-primary:hover{ background: #eee8f4; }

.form-note{ font-size:.85rem; margin-top:14px; color: rgba(246,244,236,0.6); display:none; }
.form-note.show{ display:block; }

@media (max-width: 860px){
  .contact-band .wrap{ grid-template-columns: 1fr; }
  .form-grid{ grid-template-columns: 1fr; }
}

/* Contact page details */
.contact-info{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap: 30px;
  margin: 30px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
}
.contact-info .label{ font-size:.78rem; text-transform: none; color: var(--forest); font-weight:700; margin-bottom:6px; }
@media (max-width: 760px){ .contact-info{ grid-template-columns:1fr; } }

/* ---------- Support logos ---------- */
.support{
  padding: 46px 0 60px;
  text-align:center;
}
.support .label{ font-size:.85rem; color: var(--ink-soft); margin-bottom: 22px; }
.support-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap: 34px;
}
.support-row img{
  height: 44px;
  width:auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity:.75;
  transition: filter .18s ease, opacity .18s ease;
}
.support-row img:hover{ filter:none; opacity:1; }

/* ---------- Footer ---------- */
.site-footer{
  border-top: 1px solid var(--line);
  padding: 30px 0;
  font-size:.85rem;
  color: var(--ink-soft);
}
.site-footer .wrap{
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap: 12px;
}

/* Conteúdo das páginas internas e catálogo */
.skip-link{position:absolute;left:12px;top:-60px;background:#fff;color:var(--ink);padding:10px 16px;z-index:100}
.skip-link:focus{top:8px}
:focus-visible{outline:3px solid #9a64c9;outline-offset:3px}
.intro-kicker{color:var(--forest);font-weight:700;letter-spacing:.09em;text-transform:uppercase;font-size:.78rem;margin-bottom:12px}
.page-head{background:linear-gradient(135deg,#fff 45%,#f0ecf7)}
.page-head h1{max-width:18ch}
.content-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:64px;align-items:start}
.content-layout article p{max-width:72ch}
.content-layout aside{background:var(--paper-2);padding:28px;border-radius:8px}
.content-layout aside a{display:inline-block;margin-top:12px}
.detail-list{display:grid;gap:16px;margin-top:26px}
.detail-list section{padding:22px 26px;background:#fff;border:1px solid var(--line);border-radius:8px}
.detail-list h3{font-size:1.1rem}
.detail-list p{margin-bottom:8px}
.detail-list a{color:var(--forest);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.breadcrumbs{font-size:.88rem;color:var(--ink-soft);margin-bottom:20px}
.breadcrumbs a{text-decoration:underline;text-underline-offset:3px}
.catalog-note{background:var(--sage);border-left:4px solid var(--forest);padding:18px 22px;margin:26px 0}
.catalog-note p{margin:0}
.product-price{font-size:1.25rem;font-weight:700;color:var(--forest);margin:4px 0 14px}
.card .card-body{gap:4px}
.card-grid .card:not(:has(img)) .card-body{min-height:230px}
.card .card-body h3{margin-bottom:4px}
.card .card-body .btn{margin-top:auto}
.legal-note{font-size:.88rem;max-width:75ch}
.hero-figure{margin:0}
.site-footer a{text-decoration:underline;text-underline-offset:3px}
@media (max-width: 860px){
  .content-layout{grid-template-columns:1fr;gap:28px}
  .brand{width:190px;height:64px;flex-basis:190px}
  .brand img{width:190px;height:190px;transform:translateY(-62px)}
  .hero{padding:32px 0 64px}
  .hero .wrap{gap:36px}
}
@media (max-width: 560px){
  .wrap{padding:0 20px}
  .section{padding:52px 0}
  .hero-figure img{aspect-ratio:4/3;border-radius:90px 8px 90px 8px}
  .team-grid{grid-template-columns:1fr 1fr;gap:24px 14px}
  .team-card p{font-size:.82rem}
  .support-row{gap:18px}
  .support-row img{max-width:90px;height:34px}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}

/* ---------- misc ---------- */
.section > .wrap > h2{ max-width: 46ch; }
.center{ text-align:center; }
.mt-0{ margin-top:0; }
