/* =========================================================
   KAT6 INSIEME — design tokens
   Palette: Notte (ink) · Carta (paper) · Corallo · Salvia · Nebbia
   Tipografia: Fraunces (display) · Public Sans (testo) · IBM Plex Mono (dati)
   ========================================================= */

:root {
  --ink: #18223a;
  --ink-soft: #283356;
  --paper: #f3f1ed;
  --paper-deep: #e9e5dc;
  --coral: #e8704a;
  --coral-deep: #c8552f;
  --sage: #6b8f71;
  --fog: #c9c4bc;
  --white: #ffffff;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1100px;

  --shadow-card: 0 12px 30px -16px rgba(24, 34, 58, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
}

h2 {
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
}

h3 {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--coral);
  display: inline-block;
}

/* focus visibility — accessibility floor */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
}

.zebra-rule {
  height: 6px;
  width: 100%;
  background: repeating-linear-gradient(
    100deg,
    var(--white) 0 10px,
    var(--ink) 10px 14px,
    var(--white) 14px 26px,
    var(--ink) 26px 30px,
    var(--coral) 30px 40px,
    var(--ink) 40px 44px
  );
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--paper);
}

.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.nav-links {
  display: none;
  gap: 28px;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-toggle {
  background: none;
  border: 1px solid var(--fog);
  color: var(--paper);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0 22px 18px;
}

.nav-panel.is-open {
  display: flex;
}

.nav-panel a {
  text-decoration: none;
  color: var(--paper);
  padding: 10px 0;
  border-top: 1px solid rgba(243, 241, 237, 0.12);
  font-size: 1rem;
}

@media (min-width: 760px) {
  .nav-links {
    display: flex;
  }
  .nav-toggle {
    display: none;
  }
  .nav-panel {
    display: none !important;
  }
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 64px;
}

.hero-grid {
  display: grid;
  gap: 36px;
}

.hero-copy p {
  font-size: 1.08rem;
  color: rgba(243, 241, 237, 0.82);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--coral);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--coral-deep);
  color: var(--white);
}

.btn-ghost {
  border-color: rgba(243, 241, 237, 0.4);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--paper);
}

.btn-ghost-dark {
  border-color: var(--fog);
  color: var(--ink);
}

.btn-ghost-dark:hover {
  border-color: var(--ink);
}

.hero-helix {
  width: 100%;
  height: auto;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

/* =========================================================
   SECTIONS
   ========================================================= */

.section {
  padding: 64px 0;
}

.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-alt {
  background: var(--paper-deep);
}

.two-col {
  display: grid;
  gap: 24px;
}

@media (min-width: 760px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.gene-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--coral);
}

.gene-card:nth-of-type(2) {
  border-top-color: var(--sage);
}

.gene-card h3 {
  margin-bottom: 0.5em;
}

.gene-card .gene-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--sage);
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}

.disclaimer-note {
  background: var(--white);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.tag-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.92rem;
  border: 1px solid var(--paper-deep);
}

.tag-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 4px;
}

.research-block {
  display: grid;
  gap: 28px;
}

@media (min-width: 860px) {
  .research-block {
    grid-template-columns: 1fr 1fr;
  }
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.info-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-list svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--coral);
}

/* =========================================================
   NEWS / POSTS
   ========================================================= */

.posts-list {
  display: grid;
  gap: 18px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--coral-deep);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.post-card h3 {
  margin-bottom: 0.4em;
}

.post-card p {
  margin: 0;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.empty-state {
  background: var(--white);
  border: 1.5px dashed var(--fog);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.empty-state svg {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  color: var(--fog);
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  background: var(--ink);
  color: rgba(243, 241, 237, 0.75);
  padding: 40px 0 28px;
  font-size: 0.88rem;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-disclaimer {
  text-align: center;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--paper);
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   ADMIN PAGE
   ========================================================= */

.admin-shell {
  min-height: 100vh;
  background: var(--paper);
}

.admin-topbar {
  background: var(--ink);
  color: var(--paper);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar .logo {
  font-size: 1.1rem;
}

.btn-small {
  font-size: 0.85rem;
  padding: 8px 16px;
}

.login-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 36px 30px;
  width: 100%;
  max-width: 380px;
  border-top: 5px solid var(--coral);
}

.login-card .eyebrow {
  margin-bottom: 14px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--paper-deep);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-body);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--coral);
  background: var(--white);
}

.field-row {
  display: grid;
  gap: 14px;
}

@media (min-width: 480px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-error {
  color: var(--coral-deep);
  font-size: 0.88rem;
  margin-top: -8px;
  margin-bottom: 14px;
  min-height: 1.2em;
}

.admin-main {
  padding: 36px 0 60px;
}

.admin-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .admin-grid {
    grid-template-columns: 380px 1fr;
    align-items: start;
  }
}

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px;
}

.admin-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.admin-card .hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-row {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--paper-deep);
}

.post-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.post-row-head h3 {
  font-size: 1.05rem;
  margin: 0;
}

.post-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--white);
  border: 1px solid var(--paper-deep);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}







.post-card {
    display: flex;
    flex-direction: row; /* Affianca gli elementi */
    gap: 20px;           /* Spazio tra foto e testo */
    align-items: flex-start;
}

/* Solo su smartphone, torna a colonna */
@media (max-width: 600px) {
    .post-card {
        flex-direction: column;
    }
}

/* La foto a sinistra: dimensione fissa */
.post-card img {
    width: 200px;        /* Larghezza fissa su desktop */
    height: 150px;       /* Altezza fissa */
    object-fit: cover;   /* Taglia la foto senza deformarla */
    flex-shrink: 0;      /* Impedisce alla foto di rimpicciolirsi */
    border-radius: 8px;
}

/* Il contenuto a destra */
.post-content {
    flex: 1;             /* Occupa tutto lo spazio rimanente */
}






/* Container del form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.field { margin-bottom: 20px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #18223A;
}

.field input, .field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Public Sans', sans-serif;
    transition: border-color 0.3s;
}

.field input:focus, .field textarea:focus {
    border-color: #E8704A; /* Colore del tuo brand */
    outline: none;
}

/* Messaggio di successo elegante */
.success-message {
    text-align: center;
    padding: 40px;
    background: #fcfcfc;
    border: 2px solid #6B8F71;
    border-radius: 12px;
}

.success-message h3 { color: #6B8F71; margin-bottom: 10px; }