/*
Theme Name: Trame Familiari
Theme URI: https://tramefamiliari.it
Author: ChatGPT per Trame Familiari
Author URI: https://tramefamiliari.it
Description: Tema WordPress personalizzato per Trame Familiari - Costellazioni Familiari e Sistemiche. Layout homepage con hero, sezioni eventi, gruppo, FAQ e immagini modificabili dal Customizer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trame-familiari
Tags: custom-logo, custom-menu, featured-images, one-column, responsive-layout, editor-style, accessibility-ready
*/

:root {
  --tf-green: #1F5014;
  --tf-green-dark: #173c22;
  --tf-sage: #CBDDD1;
  --tf-sage-light: #E6EFE9;
  --tf-cream: #F7F3E8;
  --tf-cream-2: #FBF8F0;
  --tf-gold: #B89662;
  --tf-anthracite: #2F3B40;
  --tf-muted: #65716c;
  --tf-white: #fffefb;
  --tf-shadow: 0 18px 50px rgba(31, 80, 20, .12);
  --tf-shadow-soft: 0 10px 30px rgba(47, 59, 64, .10);
  --tf-radius-lg: 30px;
  --tf-radius: 20px;
  --tf-radius-sm: 12px;
  --tf-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--tf-anthracite);
  background: linear-gradient(180deg, var(--tf-cream-2), #fff 42%, var(--tf-cream));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.site-main a:not(.tf-button):not(.tf-card-link) { color: var(--tf-green); text-underline-offset: 4px; }
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.tf-container { max-width: var(--tf-container); margin: 0 auto; padding: 0 24px; }
.tf-small-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tf-green);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .78rem;
}
.tf-small-label::before,
.tf-small-label::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tf-gold));
}
.tf-section { padding: 76px 0; position: relative; }
.tf-section-title {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  color: var(--tf-green-dark);
  letter-spacing: -.035em;
}
.tf-section-intro {
  margin: 0 auto 36px;
  max-width: 760px;
  color: var(--tf-muted);
  font-size: 1.08rem;
}
.tf-center { text-align: center; }
.tf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1px solid var(--tf-green);
  color: var(--tf-green);
  text-decoration: none;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.tf-button:hover,
.tf-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--tf-shadow-soft);
}
.tf-button-primary {
  background: var(--tf-green);
  color: #fff;
}
.tf-button-primary:hover,
.tf-button-primary:focus-visible { background: var(--tf-green-dark); color: #fff; }
.tf-button-light { background: #fffaf3; color: var(--tf-green); border-color: rgba(31,80,20,.18); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 254, 251, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(31,80,20,.08);
}
.admin-bar .site-header { top: 32px; }
.tf-header-inner {
  max-width: var(--tf-container);
  min-height: 82px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-branding { display: flex; align-items: center; gap: 14px; min-width: 220px; }
.custom-logo-link img { width: auto; max-height: 58px; }
.tf-mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(31,80,20,.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tf-cream-2);
  color: var(--tf-green);
  flex: 0 0 auto;
}
.tf-mark svg { width: 32px; height: 32px; }
.site-title {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--tf-green-dark);
  text-decoration: none;
}
.site-description { display: block; margin-top: 4px; font-size: .82rem; color: var(--tf-muted); line-height: 1.2; }
.main-navigation { display: flex; align-items: center; gap: 18px; }
.menu-toggle { display: none; }
.primary-menu,
.primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; align-items: center; gap: 8px; }
.primary-menu a {
  display: inline-flex;
  padding: 10px 12px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 700;
  color: var(--tf-anthracite);
  border-radius: 999px;
}
.primary-menu a:hover,
.primary-menu a:focus-visible { background: var(--tf-sage-light); color: var(--tf-green-dark); }
.tf-header-cta { white-space: nowrap; }

/* Hero */
.tf-hero { padding: 40px 0 30px; overflow: hidden; }
.tf-hero-wrap {
  max-width: var(--tf-container);
  margin: 0 auto;
  padding: 0 24px;
}
.tf-hero-card {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  align-items: stretch;
  min-height: 560px;
  border-radius: 0 0 var(--tf-radius-lg) var(--tf-radius-lg);
  overflow: hidden;
  background: #fffaf3;
  box-shadow: var(--tf-shadow);
  position: relative;
}
.tf-hero-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 48%;
  opacity: .5;
  background-image:
    radial-gradient(circle at 5% 18%, rgba(184,150,98,.18), transparent 18%),
    radial-gradient(circle at 28% 92%, rgba(203,221,209,.9), transparent 20%);
  pointer-events: none;
}
.tf-hero-content { position: relative; z-index: 1; padding: clamp(36px, 6vw, 76px) clamp(28px, 5vw, 70px); align-self: center; }
.tf-hero h1 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.055em;
  color: var(--tf-green-dark);
}
.tf-hero-lead { margin: 0 0 28px; max-width: 600px; color: #43504a; font-size: clamp(1.05rem, 1.35vw, 1.25rem); }
.tf-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tf-hero-media {
  position: relative;
  min-height: 460px;
  background: var(--tf-sage-light);
}
.tf-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.tf-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,250,243,.96), rgba(255,250,243,.22) 34%, transparent 55%);
}
.tf-info-strip {
  position: relative;
  z-index: 2;
  max-width: 1050px;
  margin: -36px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid rgba(31,80,20,.08);
  box-shadow: var(--tf-shadow-soft);
  border-radius: 999px;
  overflow: hidden;
}
.tf-info-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 14px;
  font-weight: 800;
  color: var(--tf-anthracite);
}
.tf-info-item + .tf-info-item { border-left: 1px solid rgba(47,59,64,.1); }
.tf-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-cream);
  color: var(--tf-green);
  flex: 0 0 auto;
}
.tf-icon svg { width: 21px; height: 21px; }

/* About */
.tf-about { padding-top: 76px; }
.tf-about-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 54px;
  align-items: center;
}
.tf-about-text p { color: var(--tf-muted); margin: 0; }
.tf-about-visual {
  position: relative;
  min-height: 230px;
  border-radius: var(--tf-radius-lg);
  background: radial-gradient(circle, rgba(203,221,209,.9), rgba(203,221,209,.2) 55%, transparent 70%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tf-about-visual img { width: 100%; height: 300px; object-fit: cover; opacity: .92; }
.tf-thread-lines {
  position: absolute;
  inset: auto 0 16% 0;
  height: 90px;
  background: url('assets/images/threads.svg') center / cover no-repeat;
  opacity: .68;
  pointer-events: none;
}

/* Cards */
.tf-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tf-card {
  background: var(--tf-white);
  border: 1px solid rgba(31,80,20,.08);
  border-radius: var(--tf-radius);
  box-shadow: var(--tf-shadow-soft);
  padding: 28px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tf-card:hover { transform: translateY(-4px); box-shadow: var(--tf-shadow); }
.tf-card h3,
.tf-step h3,
.tf-event-card h3,
.tf-team-card h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; color: var(--tf-green-dark); line-height: 1.15; }
.tf-card p,
.tf-step p,
.tf-event-card p,
.tf-team-card p { margin: 0; color: var(--tf-muted); font-size: .98rem; }
.tf-card-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--tf-cream); color: var(--tf-green); display: grid; place-items: center; margin-bottom: 18px; border: 1px solid rgba(184,150,98,.28); }
.tf-card-icon svg { width: 42px; height: 42px; }

/* Process */
.tf-process { background: rgba(203,221,209,.18); }
.tf-process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.tf-step { text-align: center; position: relative; padding: 0 6px; }
.tf-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tf-green);
  color: #fff;
  font-weight: 900;
  margin: 0 auto 8px;
}
.tf-step-icon { width: 82px; height: 82px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--tf-cream); color: var(--tf-green); border: 1px solid rgba(184,150,98,.25); }
.tf-step-icon svg { width: 48px; height: 48px; }

/* Team */
.tf-team { background: linear-gradient(180deg, #fff, rgba(247,243,232,.7)); }
.tf-team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tf-team-card { background: #fff; border-radius: var(--tf-radius); overflow: hidden; border: 1px solid rgba(31,80,20,.08); box-shadow: var(--tf-shadow-soft); }
.tf-team-photo { aspect-ratio: 4/3; background: var(--tf-sage-light); overflow: hidden; }
.tf-team-photo img { width: 100%; height: 100%; object-fit: cover; }
.tf-team-content { padding: 24px; }
.tf-role { display: block; margin-bottom: 10px; color: var(--tf-gold); font-weight: 800; font-size: .93rem; }

/* Events */
.tf-events-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; margin-bottom: 30px; }
.tf-event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tf-event-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: var(--tf-radius);
  border: 1px solid rgba(31,80,20,.08);
  box-shadow: var(--tf-shadow-soft);
}
.tf-event-media { aspect-ratio: 16/9; overflow: hidden; background: var(--tf-sage-light); }
.tf-event-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tf-event-card:hover .tf-event-media img { transform: scale(1.04); }
.tf-event-content { padding: 24px; }
.tf-badge { position: absolute; top: 16px; left: 16px; width: 38px; height: 38px; border-radius: 50%; background: var(--tf-green); color: #fff; display: grid; place-items: center; font-weight: 900; box-shadow: var(--tf-shadow-soft); }
.tf-meta { display: grid; gap: 5px; margin-top: 14px; color: var(--tf-muted); font-size: .94rem; }
.tf-meta span { display: flex; align-items: center; gap: 8px; }

/* FAQ */
.tf-faq { background: rgba(203,221,209,.15); }
.tf-faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
details.tf-faq-item {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(31,80,20,.08);
  box-shadow: 0 8px 24px rgba(47, 59, 64, .06);
  padding: 0;
}
.tf-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 56px 20px 24px;
  position: relative;
  font-weight: 900;
  color: var(--tf-green-dark);
}
.tf-faq-item summary::-webkit-details-marker { display: none; }
.tf-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tf-sage-light);
  color: var(--tf-green);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}
.tf-faq-item[open] summary::after { content: "–"; }
.tf-faq-body { padding: 0 24px 22px; color: var(--tf-muted); }
.tf-faq-body p { margin: 0; }

/* CTA */
.tf-cta-box {
  background: radial-gradient(circle at 5% 20%, rgba(203,221,209,.24), transparent 25%), linear-gradient(135deg, var(--tf-green), var(--tf-green-dark));
  color: #fff;
  border-radius: var(--tf-radius-lg);
  padding: clamp(36px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.tf-cta-box::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  width: 210px;
  height: 180px;
  background: url('assets/images/leaves.svg') center / contain no-repeat;
  opacity: .22;
}
.tf-cta-box h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.tf-cta-box p { margin: 0; max-width: 700px; color: rgba(255,255,255,.83); }
.tf-cta-box .tf-button { position: relative; z-index: 1; }

/* Content pages */
.tf-content-wrap { max-width: 840px; margin: 0 auto; padding: 76px 24px; }
.tf-content-wrap h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.08; color: var(--tf-green-dark); letter-spacing: -.04em; }
.entry-content { color: var(--tf-anthracite); }
.entry-content img { border-radius: var(--tf-radius-sm); box-shadow: var(--tf-shadow-soft); }
.entry-content blockquote { border-left: 4px solid var(--tf-green); padding-left: 20px; margin-left: 0; color: var(--tf-muted); }
.post-card { background: #fff; border-radius: var(--tf-radius); padding: 28px; box-shadow: var(--tf-shadow-soft); margin-bottom: 24px; }
.post-card h2 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; color: var(--tf-green-dark); }

/* Footer */
.site-footer { background: var(--tf-green-dark); color: #fff; }
.tf-footer-inner { max-width: var(--tf-container); margin: 0 auto; padding: 42px 24px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.tf-footer-brand { display: flex; align-items: center; gap: 14px; }
.tf-footer-brand .tf-mark { background: transparent; border-color: rgba(255,255,255,.32); color: #fff; }
.tf-footer-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; display: block; }
.tf-footer-payoff { display: block; color: rgba(255,255,255,.72); font-size: .86rem; }
.tf-footer-menu { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.tf-footer-menu a { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 700; font-size: .95rem; }
.tf-footer-menu a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.tf-footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding: 18px 24px; text-align: center; color: rgba(255,255,255,.62); font-size: .9rem; }

@media (max-width: 1020px) {
  .tf-hero-card { grid-template-columns: 1fr; min-height: 0; }
  .tf-hero-media { min-height: 360px; order: -1; }
  .tf-hero-media::after { background: linear-gradient(180deg, transparent, rgba(255,250,243,.18)); }
  .tf-info-strip { grid-template-columns: repeat(2, 1fr); border-radius: var(--tf-radius); }
  .tf-info-item:nth-child(3) { border-left: 0; border-top: 1px solid rgba(47,59,64,.1); }
  .tf-info-item:nth-child(4) { border-top: 1px solid rgba(47,59,64,.1); }
  .tf-about-grid, .tf-cta-box { grid-template-columns: 1fr; }
  .tf-card-grid, .tf-team-grid, .tf-event-grid { grid-template-columns: 1fr 1fr; }
  .tf-process-grid { grid-template-columns: 1fr 1fr; }
  .tf-events-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .admin-bar .site-header { top: 46px; }
  .tf-header-inner { min-height: 74px; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(31,80,20,.18);
    background: #fff;
    color: var(--tf-green);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
  }
  .main-navigation { margin-left: auto; }
  .primary-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    background: #fff;
    box-shadow: var(--tf-shadow);
    border-radius: 18px;
    border: 1px solid rgba(31,80,20,.1);
    padding: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  .main-navigation.toggled .primary-menu { display: flex; }
  .primary-menu a { justify-content: center; }
  .tf-header-cta { display: none; }
  .site-branding { min-width: 0; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .tf-container, .tf-hero-wrap, .tf-header-inner { padding-left: 18px; padding-right: 18px; }
  .tf-section { padding: 54px 0; }
  .tf-hero { padding-top: 18px; }
  .tf-hero-content { padding: 32px 24px 42px; }
  .tf-hero-media { min-height: 280px; }
  .tf-info-strip, .tf-card-grid, .tf-team-grid, .tf-event-grid, .tf-process-grid, .tf-faq-grid { grid-template-columns: 1fr; }
  .tf-info-item + .tf-info-item { border-left: 0; border-top: 1px solid rgba(47,59,64,.1); }
  .tf-actions { align-items: stretch; }
  .tf-button { width: 100%; }
  .tf-card, .tf-event-content, .tf-team-content { padding: 22px; }
  .tf-footer-inner { grid-template-columns: 1fr; text-align: center; }
  .tf-footer-brand { justify-content: center; }
  .tf-footer-menu { justify-content: center; }
}