@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Homepage sections: Publications, Latest News, Events
   Design ported from the staging theme (afforum_hub). Everything is scoped
   to .aff-home-sections so it cannot leak into the rest of the site.
   ========================================================================== */

.aff-home-sections {
  --affh-green: #549433;
  --affh-green-dark: #3a6823;
  --affh-green-deep: #162900;
  --affh-green-pale: #EAF1E0;
  --affh-green-pale-2: #F4F8EE;
  --affh-orange: #FCB913;
  --affh-ink: #1E2418;
  --affh-muted: #5C6B57;
  --affh-paper: #FFFFFF;
  --affh-paper-soft: #F6F8F3;
  --affh-border: #DFE6D6;
  --affh-shadow-hover: 0 16px 40px -16px rgba(45, 85, 14, 0.28);
  --affh-serif: 'Fraunces', Georgia, serif;
  --affh-sans: 'Inter', system-ui, -apple-system, sans-serif;

  font-family: var(--affh-sans);
  color: var(--affh-ink);
}

.aff-home-sections img {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.aff-home-sections .affh-section {
  padding: 72px 0;
}

.aff-home-sections .affh-section--soft {
  padding-top: 64px;
  background: var(--affh-paper-soft);
}

.aff-home-sections .affh-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Section heading
   -------------------------------------------------------------------------- */
.aff-home-sections .affh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.aff-home-sections .affh-head-text {
  flex: 1 1 auto;
  max-width: 820px;
  text-align: left;
}

.aff-home-sections .affh-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--affh-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.aff-home-sections .affh-head h2 {
  margin: 0 0 6px;
  font-family: var(--affh-serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--affh-ink);
}

.aff-home-sections .affh-sub {
  margin: 0;
  max-width: 60ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--affh-muted);
}

.aff-home-sections .affh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 8px 22px;
  border: 1.5px solid var(--affh-green);
  border-radius: 999px;
  background: var(--affh-paper);
  color: var(--affh-green);
  font-family: var(--affh-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.aff-home-sections .affh-btn:hover,
.aff-home-sections .affh-btn:focus {
  background: var(--affh-green);
  border-color: var(--affh-green);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(84, 148, 51, 0.28);
}

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */
.aff-home-sections .affh-pub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.aff-home-sections .affh-pub-card {
  padding: 16px;
  border: 1px solid var(--affh-border);
  border-radius: 16px;
  background: var(--affh-paper);
  transition: all 0.25s ease;
}

.aff-home-sections .affh-pub-card::after {
  content: "";
  display: table;
  clear: both;
}

.aff-home-sections .affh-pub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--affh-shadow-hover);
  border-color: rgba(76, 133, 0, 0.35);
}

.aff-home-sections .affh-pub-card .affh-thumb {
  float: left;
  width: 110px;
  height: 145px;
  margin: 0 16px 8px 0;
  padding: 4px;
  border: 1px solid #D8E2D0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
}

.aff-home-sections .affh-pub-card .affh-thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  object-fit: contain;
  display: block;
}

.aff-home-sections .affh-pub-card .affh-body {
  display: block;
}

.aff-home-sections .affh-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--affh-green-pale-2);
  color: var(--affh-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.aff-home-sections .affh-pub-card h3 {
  margin: 0 0 8px;
  font-family: var(--affh-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.38;
  color: #172D00;
}

.aff-home-sections .affh-pub-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.aff-home-sections .affh-pub-card h3 a:hover {
  color: var(--affh-green);
  text-decoration: none;
}

.aff-home-sections .affh-authors {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--affh-muted);
}

.aff-home-sections .affh-year {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px solid #DCE6D2;
  border-radius: 12px;
  background: #F1F6EA;
  color: #2D4D00;
  font-size: 12px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Latest News
   -------------------------------------------------------------------------- */
.aff-home-sections .affh-news-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
  align-items: stretch;
}

.aff-home-sections .affh-news-feature {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--affh-border);
  border-radius: 18px;
  background: var(--affh-paper);
  color: inherit;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s ease;
}

.aff-home-sections .affh-news-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--affh-shadow-hover);
  border-color: rgba(76, 133, 0, 0.35);
  text-decoration: none;
}

.aff-home-sections .affh-news-feature .affh-thumb {
  height: 220px;
  overflow: hidden;
}

.aff-home-sections .affh-news-feature .affh-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aff-home-sections .affh-news-feature .affh-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px;
}

.aff-home-sections .affh-friendly-date {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--affh-green-dark);
  font-size: 12.5px;
  font-weight: 700;
}

.aff-home-sections .affh-news-feature h3 {
  margin: 0 0 10px;
  font-family: var(--affh-serif);
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--affh-ink);
}

.aff-home-sections .affh-news-feature p {
  margin: 0 0 16px;
  color: var(--affh-muted);
  font-size: 14px;
  line-height: 1.6;
}

.aff-home-sections .affh-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  color: var(--affh-green);
  font-size: 13px;
  font-weight: 700;
}

.aff-home-sections .affh-news-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  height: 100%;
}

.aff-home-sections .affh-news-item {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--affh-border);
  border-radius: 14px;
  background: var(--affh-paper);
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.aff-home-sections .affh-news-item:hover {
  transform: translateX(4px);
  border-color: var(--affh-green);
  box-shadow: 0 6px 18px -6px rgba(30, 36, 24, 0.12);
  text-decoration: none;
}

.aff-home-sections .affh-news-thumb {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 10px;
  background: var(--affh-green-pale);
  overflow: hidden;
}

.aff-home-sections .affh-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aff-home-sections .affh-news-item-content {
  flex: 1;
  min-width: 0;
}

.aff-home-sections .affh-news-item h4 {
  margin: 0 0 4px;
  font-family: var(--affh-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--affh-ink);
}

.aff-home-sections .affh-meta {
  font-size: 11.5px;
  color: var(--affh-muted);
}

/* --------------------------------------------------------------------------
   Events
   -------------------------------------------------------------------------- */
.aff-home-sections .affh-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.aff-home-sections .affh-event-card {
  border: 1px solid var(--affh-border);
  border-radius: 16px;
  background: var(--affh-paper);
  overflow: hidden;
  transition: all 0.25s ease;
}

.aff-home-sections .affh-event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--affh-shadow-hover);
  border-color: rgba(76, 133, 0, 0.35);
}

.aff-home-sections .affh-event-card .affh-thumb {
  height: 130px;
  overflow: hidden;
}

.aff-home-sections .affh-event-card .affh-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aff-home-sections .affh-event-card .affh-body {
  padding: 16px 18px 20px;
}

.aff-home-sections .affh-date {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--affh-green);
  font-size: 12px;
  font-weight: 700;
}

.aff-home-sections .affh-event-card h3 {
  margin: 6px 0 8px;
  font-family: var(--affh-serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--affh-ink);
}

.aff-home-sections .affh-event-card h3 a {
  color: inherit;
  text-decoration: none;
}

.aff-home-sections .affh-event-card h3 a:hover {
  color: var(--affh-green);
  text-decoration: none;
}

.aff-home-sections .affh-loc {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--affh-muted);
  font-size: 12.5px;
}

.aff-home-sections .affh-ico {
  flex: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1040px) {
  .aff-home-sections .affh-pub-grid,
  .aff-home-sections .affh-news-grid,
  .aff-home-sections .affh-events-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .aff-home-sections .affh-section {
    padding: 48px 0;
  }

  .aff-home-sections .affh-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .aff-home-sections .affh-btn {
    margin-left: 0;
  }

  .aff-home-sections .affh-news-feature .affh-thumb {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .aff-home-sections .affh-pub-card .affh-thumb {
    float: none;
    width: 100%;
    height: 160px;
    margin: 0 0 12px;
  }
}
