/* Project additions that preserve the foundation images in the expanded page. */
.funesvi-origin-art {
  width: min(100%, 940px);
  margin: 34px auto 8px;
  padding: 14px 18px;
  background: radial-gradient(ellipse at center, rgba(103, 139, 109, .2), rgba(216, 187, 123, .12) 48%, transparent 76%);
}

.funesvi-origin-art img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 10px 22px rgba(20, 59, 50, .12));
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at center, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 100% at center, #000 72%, transparent 100%);
}

@media (max-width: 700px) {
  .funesvi-origin-art {
    margin-top: 24px;
    padding: 8px 4px;
  }
}

/* Persistent header with the navigation inside a hamburger menu. */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 12px 5.5%;
  border-bottom: 1px solid #d9ddcf;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

header.site-header > .brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

header.site-header > .header-motto {
  grid-column: 2;
  grid-row: 1;
  max-width: 225px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.header-brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
}

.header-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

header.site-header > .theme-toggle {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle[aria-pressed="true"] { background: var(--gold); color: var(--deep); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-icon-moon { display: block; fill: currentColor; }
.theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle { color: #f3eee2; }
html[data-theme="dark"] .theme-toggle[aria-pressed="true"] { color: var(--deep); }

header.site-header > .menu {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

header.site-header > nav#main-nav {
  position: absolute;
  top: 100%;
  right: 5.5%;
  left: auto;
  z-index: 110;
  display: none;
  width: min(360px, calc(100vw - 32px));
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
  padding: 8px 18px;
  border: 1px solid #d9ddcf;
  border-radius: 4px;
  background: var(--cream);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
  font-size: 14px;
}

header.site-header > nav#main-nav.open { display: flex; }
header.site-header > nav#main-nav a { padding: 11px 4px; border-bottom: 1px solid rgba(120, 130, 110, .25); }
header.site-header > nav#main-nav a:last-child { border-bottom: 0; }
html[data-theme="dark"] header.site-header { border-color: #53614b; }
html[data-theme="dark"] header.site-header > .header-motto { color: #cbd4c9; }
html[data-theme="dark"] header.site-header > .menu { color: #f3eee2; }
html[data-theme="dark"] header.site-header > nav#main-nav { border-color: #53614b; background: #15241e; }

@media (max-width: 700px) {
  header.site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 9px 6%;
  }

  header.site-header > .brand { gap: 7px; font-size: 18px !important; }
  header.site-header > .brand small { font-size: 9px !important; letter-spacing: .3px !important; }
  header.site-header .header-brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  header.site-header > .header-motto { grid-column: 1 / -1; grid-row: 2; max-width: none; padding-top: 5px; border-top: 1px solid #d9ddcf; font-size: 10px; }
  html[data-theme="dark"] header.site-header > .header-motto { border-color: #53614b; }
  header.site-header > .theme-toggle,
  header.site-header > .menu { width: 38px; height: 38px; flex-basis: 38px; }
  header.site-header > .theme-toggle { grid-column: 2; grid-row: 1; }
  header.site-header > .menu { grid-column: 3; grid-row: 1; }
  header.site-header > nav#main-nav { right: 6%; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* Compact footer with four balanced columns. */
footer.site-footer {
  position: relative;
  padding: 22px 5.5% 12px;
  background: var(--deep);
  color: var(--cream);
}

footer.site-footer .back { display: grid; width: 36px; height: 36px; place-items: center; }

footer.site-footer .footer-nav {
  display: grid;
  grid-template-columns: minmax(145px, .9fr) minmax(330px, 1.7fr) minmax(145px, .9fr) minmax(190px, 1.1fr);
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 52px 0 0;
  border: 0;
  color: #d2d8cf;
  font-size: 12px;
}

footer.site-footer .footer-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, .18);
}

footer.site-footer .footer-column:first-child { padding-left: 0; border-left: 0; }
footer.site-footer .footer-column h2 { margin: 0 0 3px; color: var(--gold); font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
footer.site-footer .footer-column a { color: #d2d8cf; font-size: 11px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
footer.site-footer .footer-column a:hover,
footer.site-footer .footer-column a:focus-visible { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
footer.site-footer .footer-programs { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
footer.site-footer .footer-contact-column { padding-right: 4px; }

footer.site-footer .footer-back {
  position: absolute;
  top: 50%;
  right: max(5.5%, calc((100% - 1320px) / 2));
  z-index: 2;
  transform: translateY(-50%);
}

footer.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px 22px;
  max-width: 1320px;
  margin: 14px auto 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
  color: #b8c2b8;
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  footer.site-footer .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer.site-footer .footer-column:nth-child(2n) { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .18); }
  footer.site-footer .footer-column:nth-child(n + 3) { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18); }
}

@media (max-width: 560px) {
  footer.site-footer { padding: 18px 6% 12px; }
  footer.site-footer .footer-nav { grid-template-columns: minmax(0, 1fr); gap: 0; padding-right: 0; }
  footer.site-footer .footer-column,
  footer.site-footer .footer-column:nth-child(2n) { padding: 11px 0 0; border-left: 0; }
  footer.site-footer .footer-column + .footer-column { margin-top: 11px; border-top: 1px solid rgba(255, 255, 255, .18); }
  footer.site-footer .footer-programs { gap: 5px 12px; }
  footer.site-footer .footer-bottom { flex-direction: column; gap: 5px; }
  footer.site-footer .footer-back { position: static; margin: 10px 0 0 auto; transform: none; }
}

/* The main content behaves as one selected frame; the persistent header and footer stay outside it. */
html[data-section-frames="pending"] #contenido > :not(#inicio) { display: none !important; }
#contenido > [hidden] { display: none !important; }
#contenido.section-frame-changing { animation: section-frame-enter .28s ease-out both; }

@keyframes section-frame-enter {
  from { opacity: .35; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #contenido.section-frame-changing { animation: none; }
}

/* Soft corners for controls and the card-like items shown in lists and grids. */
:root {
  --funesvi-control-radius: 8px;
  --funesvi-card-radius: 12px;
}

button:not(.theme-toggle),
.button,
a.back {
  border-radius: var(--funesvi-control-radius);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  border-radius: var(--funesvi-control-radius);
}

.program-grid > .program-card,
.club-list > .club,
.faq-list > .faq-item,
.support-idea-grid > .support-idea,
.activity-grid > .activity-card,
.axes-grid > .axis,
.ally-grid > article,
.payment-grid > .payment-slot,
.bank-grid > .bank-slot,
.purpose-grid > article,
.iso-grid > article,
.method-timeline article,
.community-action-grid > .community-action,
.professional-hub-grid > article,
.belonging-ideas > article {
  border-radius: var(--funesvi-card-radius);
}

.club-list > .club {
  margin-top: 12px;
  padding: 20px 22px;
  border: 1px solid rgba(217, 223, 209, .2);
}

.activity-art { border-radius: var(--funesvi-card-radius); }

/* Keep the original logo artwork intact and make it more visible by scaling it up. */
header.site-header .header-brand-mark {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

header.site-header .header-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 4px rgba(10, 20, 15, .16));
}

@media (max-width: 700px) {
  header.site-header .header-brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}
