/*
Theme Name: Funsadom
Theme URI: https://funsadom.org
Author: FUNSADOM
Author URI: https://funsadom.org
Description: Tema de bloques para FUNSADOM — Fundación Santo Domingo en Marcha, Inc. Dirección "Sello Institucional": navy, rojo institucional y papel, con motivo de sello/roseta y estética de documento civil.
Version: 1.0.0
Requires at least: 6.4
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: funsadom
*/

/* ============ Root tokens ============ */
:root {
  --navy: #16385C;
  --red: #A32638;
  --red-deep: #841F30;
  --paper: #FAF9F5;
  --slate: #5C6B7A;
  --navy-08: rgba(22, 56, 92, 0.08);
  --navy-15: rgba(22, 56, 92, 0.15);
  --navy-30: rgba(22, 56, 92, 0.3);
  --red-10: rgba(163, 38, 56, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ============ Footer margin reset ============ */
.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* ============ Buttons ============ */
.wp-block-button__link {
  letter-spacing: 0.015em;
  transition: background-color 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
  background: var(--navy);
  color: var(--paper);
  transform: translateY(-2px);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:focus-visible {
  background: var(--red-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -10px rgba(163, 38, 56, 0.5);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:active {
  transform: translateY(0);
  box-shadow: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

/* ============ Layout helper ============ */
.wide-width {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--navy-15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.9rem;
  gap: 2rem;
  padding-block: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  color: var(--navy);
  margin: 0;
}

.main-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem 1.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-actions {
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .main-nav { order: 3; width: 100%; }
}

@media (max-width: 540px) {
  .header-actions .wp-block-button__link { padding: 0.8rem 1.3rem; font-size: 0.88rem; }
}

.brand-mark {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.brand-mark::before {
  inset: -11px;
  border: 1.4px dashed rgba(163, 38, 56, 0.55);
  animation: rotateSlow 80s linear infinite;
}
.brand-mark::after {
  inset: -2px;
  border: 1px dashed rgba(22, 56, 92, 0.4);
}

.brand-logo {
  margin: 0;
}

.brand-logo img {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand-sub {
  display: block;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-top: 0.15rem;
}

.main-nav a {
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  transition: color 0.2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 2px;
  background: var(--red);
  transition: left 0.25s ease, right 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--red);
}
.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  left: 0;
  right: 0;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.25rem, 8vw, 5.75rem);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2.35rem,
    var(--navy-08) 2.36rem,
    var(--navy-08) 2.4rem
  );
  background-position: top;
}

.hero::before {
  content: "";
  position: absolute;
  top: -16%;
  left: -12%;
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  max-width: 720px;
  max-height: 720px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at center, var(--navy) 0 4%, transparent 4%),
    radial-gradient(circle at center, transparent 29.4%, var(--red) 29.4% 30%, transparent 30%),
    radial-gradient(circle at center, transparent 40.4%, var(--navy) 40.4% 41%, transparent 41%),
    radial-gradient(circle at center, transparent 47.4%, var(--navy) 47.4% 48%, transparent 48%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.hero-copy {
  max-width: 560px;
}

.hero h1 {
  font-size: clamp(2.35rem, 4.1vw, 3.55rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}

.eyebrow-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.85rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
}

hr.eyebrow-rule.wp-block-separator {
  width: 68px;
  height: 2px;
  border: none;
  background-color: var(--red);
  opacity: 1;
  margin-top: 0.6rem;
  margin-bottom: 0;
}
.eyebrow-wrap hr.eyebrow-rule.wp-block-separator {
  margin-left: 0;
  margin-right: auto;
}
.page-title-hero hr.eyebrow-rule.wp-block-separator {
  margin-left: auto;
  margin-right: auto;
}

.page-title-hero {
  text-align: center;
}
.page-title-hero .wp-block-post-title {
  margin-top: 0.9rem;
  margin-bottom: 0;
}

.hero-sub {
  font-size: 1.08rem;
  line-height: 1.68;
  color: var(--slate);
  max-width: 50ch;
}

.hero-actions .wp-block-buttons {
  gap: 1rem;
}

.hero h1 em,
em.accent-red {
  font-style: italic;
  font-weight: 500;
  color: var(--red);
}

.hero-cert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--navy-15);
  font-size: 0.82rem;
  color: var(--slate);
}

.hero-cert p {
  margin: 0;
}
.hero-cert p + p::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 0.65rem;
  vertical-align: middle;
}

/* ---- Framed inset photo (reused across hero, historia, galería) ---- */
.hero-frame,
.cert-frame {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--navy);
  padding: 14px;
  animation: frameBreathe 7s ease-in-out infinite;
}

.hero-frame::before,
.hero-frame::after,
.cert-frame::before,
.cert-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.hero-frame::before,
.cert-frame::before {
  top: -7px;
  left: -7px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
}
.hero-frame::after,
.cert-frame::after {
  bottom: -7px;
  right: -7px;
  border-bottom: 2px solid var(--red);
  border-right: 2px solid var(--red);
}

.hero-photo img,
.cert-frame img {
  width: 100%;
  height: clamp(320px, 34vw, 460px);
  object-fit: cover;
  object-position: center 38%;
  border: 1px solid var(--red);
}

.cert-frame-sm img {
  height: 260px;
}

.cert-seal {
  margin: 0 0 1.5rem;
  opacity: 0.88;
}

.timeline {
  margin-top: 2rem;
}

.section-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--wp--preset--spacing--40, 3rem);
}
.section-intro hr.eyebrow-rule.wp-block-separator {
  margin-left: auto;
  margin-right: auto;
}
.section-intro h2 {
  margin: 0.7rem 0 0.6rem;
}
.section-intro p {
  color: var(--slate);
}

:root {
  --paper-tint: #F1EFE7;
}
.section-tint {
  background-color: var(--paper-tint);
}

.hero-caption {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: var(--slate);
}

/* ============ Cifras / trayectoria ============ */
.stats-band {
  border-top: 1px solid var(--navy-15);
  border-bottom: 1px solid var(--navy-15);
}

.stat-tile {
  text-align: center;
  padding: 1.5rem 1rem;
  border-left: 1px solid var(--navy-15);
}

.stat-tile:first-child {
  border-left: none;
}

.stat-number {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--red);
  line-height: 1;
  margin: 0 0 0.5rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
}

@media (max-width: 780px) {
  .stat-tile {
    border-left: none;
    border-top: 1px solid var(--navy-15);
  }
  .stat-tile:first-child {
    border-top: none;
  }
}

/* ============ Programas (equal cards) ============ */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.program-card {
  background: var(--paper);
  border: 1px solid var(--navy-15);
  border-top: 3px solid var(--red);
  padding: 2rem 1.6rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -24px rgba(22, 56, 92, 0.35);
  border-top-color: var(--navy);
}

.program-index {
  font-family: var(--wp--preset--font-family--display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.6rem;
}

/* ============ Historia / timeline ============ */
.timeline-item {
  position: relative;
  padding-left: 1.6rem;
  border-left: 2px solid var(--navy-15);
  padding-bottom: 1.85rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--red);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-year {
  font-family: var(--wp--preset--font-family--display);
  color: var(--red);
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.3rem;
}

/* ============ Galería ============ */
.gallery-frame {
  position: relative;
  border: 1px solid var(--navy);
  padding: 8px;
  background: var(--paper);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-frame:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 36px -20px rgba(22, 56, 92, 0.4);
}

.gallery-frame img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--red);
}

.gallery-frame {
  position: relative;
}
.gallery-frame::before,
.gallery-frame::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.gallery-frame::before {
  top: -5px;
  left: -5px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
}
.gallery-frame::after {
  bottom: -5px;
  right: -5px;
  border-bottom: 2px solid var(--red);
  border-right: 2px solid var(--red);
}

/* ============ CTA final / Donación ============ */
.donation-card {
  background: var(--paper);
  border: 1px solid var(--navy-15);
  border-left: 3px solid var(--red);
  padding: 1.85rem 2rem;
  color: var(--navy);
}

.donation-card p,
.donation-card li {
  color: var(--navy);
}

.donation-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  display: block;
  margin-bottom: 0.4rem;
}

.donation-value {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
}

.cta-final .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--paper);
  color: var(--paper);
}
.cta-final .wp-block-button.is-style-outline .wp-block-button__link:hover,
.cta-final .wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
  background: var(--paper);
  color: var(--navy);
}

.cta-final .wp-block-list {
  list-style: none;
  padding-left: 0;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--navy);
  color: var(--paper);
}

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

.site-footer a:hover {
  color: var(--red);
}

.footer-heading {
  font-family: var(--wp--preset--font-family--display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--paper);
  opacity: 0.8;
  margin-bottom: 0.9rem;
}

.footer-legal {
  border-top: 1px solid rgba(250, 249, 245, 0.15);
  font-size: 0.8rem;
  color: rgba(250, 249, 245, 0.65);
}

.footer-rosette {
  width: 34px;
  height: 34px;
  opacity: 0.55;
  margin: 0 0 1rem;
}

.site-footer .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--paper);
  color: var(--paper);
}
.site-footer .wp-block-button.is-style-outline .wp-block-button__link:hover,
.site-footer .wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
  background: var(--paper);
  color: var(--navy);
}

.site-footer .wp-block-list {
  padding-left: 0;
  list-style: none;
}

/* ============ Keyframes ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes frameBreathe {
  0%, 100% { box-shadow: 0 22px 50px -26px rgba(22, 56, 92, 0.35); }
  50% { box-shadow: 0 28px 60px -22px rgba(22, 56, 92, 0.45); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============ Entrance / scroll animation classes ============ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.9s ease-out both;
}

.fade-up-delay-1 { animation-delay: 0.1s; }
.fade-up-delay-2 { animation-delay: 0.25s; }
.fade-up-delay-3 { animation-delay: 0.4s; }
.fade-up-delay-4 { animation-delay: 0.55s; }

.fade-scale {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: fadeScale 1.05s ease-out 0.2s both;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}
.stagger-children.is-visible > * {
  animation: fadeUp 0.6s ease forwards;
}
.stagger-children.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children.is-visible > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-children.is-visible > *:nth-child(3) { animation-delay: 0.25s; }
.stagger-children.is-visible > *:nth-child(4) { animation-delay: 0.35s; }
.stagger-children.is-visible > *:nth-child(5) { animation-delay: 0.45s; }

.scale-unveil {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.scale-unveil.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-frame-wrap {
    order: -1;
    max-width: 560px;
    margin: 0 auto;
  }
  .hero-copy {
    max-width: 620px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .brand-sub { display: none; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-up,
  .fade-scale,
  .animate-on-scroll,
  .stagger-children > *,
  .scale-unveil,
  .rosette,
  .hero-frame,
  .cert-frame {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === Editor: keep animated content visible while editing === */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .fade-scale,
.editor-styles-wrapper .animate-on-scroll,
.editor-styles-wrapper .stagger-children > *,
.editor-styles-wrapper .scale-unveil {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* ================================================================
   Estilo Rotary International — homepage + shared header/footer
   New tokens/classes only. Does NOT alter the --navy/--red/--paper/
   --slate tokens or .hero/.program-card/.timeline-item/etc. classes
   that the 5 interior content pages (via templates/page.html) rely
   on — those stay exactly as they were, sharp corners and all.
   Entrance/scroll animation is reused as-is from the classes above
   (.fade-up, .fade-up-delay-*, .fade-scale, .animate-on-scroll,
   .stagger-children, .scale-unveil) — no new keyframes needed.
   ================================================================ */

:root {
  --rotary-primary: #013970;
  --rotary-gold: #F7A81B;
  --rotary-tertiary: #019FCB;
  --rotary-surface: #F9F9F9;
  --rotary-surface-alt: #F3F3F3;
  --rotary-ink: #1A1C1E;
  --rotary-ink-soft: #43474E;
  --rotary-primary-10: rgba(1, 57, 112, 0.1);
  --rotary-primary-15: rgba(1, 57, 112, 0.15);
  --rotary-border: #E0E2E6;
  --rotary-radius: 0.5rem;
  --rotary-radius-lg: 1rem;
}

.rotary-header,
.rotary-hero,
.rotary-stats-section,
.rotary-programas,
.rotary-historia,
.rotary-donate-section,
.rotary-footer,
.rotary-card,
.rotary-nav a,
.rotary-brand-name,
.rotary-brand-sub,
.rotary-eyebrow,
.rotary-hero-title,
.rotary-hero-sub,
.rotary-section-title,
.rotary-stat-number,
.rotary-stat-label,
.rotary-card-title,
.rotary-card-text,
.rotary-timeline-year,
.rotary-timeline-title,
.rotary-timeline-desc,
.rotary-donate-card,
.rotary-contact-card,
.rotary-footer-name,
.rotary-footer-sub,
.rotary-footer-copy,
.rotary-footer-legal,
.rotary-footer-links a,
.wp-block-button.rotary-btn-gold .wp-block-button__link,
.wp-block-button.rotary-btn-outline-gold .wp-block-button__link {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
}

/* ---- Buttons ---- */
.wp-block-button.rotary-btn-gold .wp-block-button__link {
  background: var(--rotary-gold);
  color: var(--rotary-primary);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border-radius: var(--rotary-radius);
  border: 2px solid var(--rotary-gold);
}
.wp-block-button.rotary-btn-gold .wp-block-button__link:hover,
.wp-block-button.rotary-btn-gold .wp-block-button__link:focus-visible {
  background: transparent;
  color: var(--rotary-gold);
  transform: translateY(-2px);
}

.wp-block-button.rotary-btn-outline-gold .wp-block-button__link {
  background: transparent;
  color: var(--rotary-gold);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border-radius: var(--rotary-radius);
  border: 2px solid var(--rotary-gold);
}
.wp-block-button.rotary-btn-outline-gold .wp-block-button__link:hover,
.wp-block-button.rotary-btn-outline-gold .wp-block-button__link:focus-visible {
  background: var(--rotary-gold);
  color: var(--rotary-primary);
  transform: translateY(-2px);
}

/* ---- Header ---- */
.rotary-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* Specificity note: these are compound (.rotary-header .rotary-header-inner etc.)
   on purpose. WordPress's own global-styles-inline-css ships tied-specificity
   rules for flex/constrained layout defaults (`:root :where(.is-layout-flex)`
   and `.is-layout-constrained > :where(...)`), and their cascade position
   relative to this theme's style.css is NOT constant — it moves depending on
   which block types are present on a given template, which flipped the winner
   of the tie between the homepage and interior pages. Compounding the selector
   here (matching the pattern already used by .rotary-cards.wp-block-columns
   etc. below) makes these rules win unconditionally, regardless of print order. */
.rotary-header .rotary-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1.5rem;
  padding-block: 0.9rem;
}
.rotary-header .rotary-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.rotary-brand-logo {
  margin: 0;
}
.rotary-brand-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}
.rotary-brand-full-logo {
  margin: 0;
}
.rotary-brand-full-logo img {
  height: 46px;
  width: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) {
  .rotary-brand-full-logo img { height: 36px; }
}
.rotary-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}
.rotary-brand-name {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--rotary-primary);
  margin: 0;
}
.rotary-brand-name a {
  color: inherit;
  text-decoration: none;
}
.rotary-brand-sub {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--rotary-ink-soft);
  margin: 0.2rem 0 0;
  white-space: nowrap;
}
.rotary-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rotary-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--rotary-ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.rotary-nav a:hover,
.rotary-nav a:focus-visible {
  color: var(--rotary-gold);
}
/* ---- Mobile hamburger menu toggle (hidden on desktop) ---- */
.rotary-menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--rotary-radius);
  cursor: pointer;
  flex-shrink: 0;
}
.rotary-menu-toggle:hover,
.rotary-menu-toggle:focus-visible {
  background: var(--rotary-primary-10);
}
.rotary-menu-toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--rotary-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.rotary-menu-toggle.is-open .rotary-menu-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.rotary-menu-toggle.is-open .rotary-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}
.rotary-menu-toggle.is-open .rotary-menu-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 860px) {
  .rotary-header .rotary-header-inner { flex-wrap: wrap; }
  .rotary-nav { order: 3; width: 100%; }
  .rotary-nav ul { justify-content: center; }

  /* Below this point the nav starts wrapping/becoming cramped — swap it
     (and the donate button) for a hamburger-triggered mobile panel. */
  .rotary-menu-toggle { display: flex; }
  .rotary-header .rotary-nav,
  .rotary-header .rotary-header-actions {
    display: none;
  }
  .rotary-header.is-menu-open .rotary-nav,
  .rotary-header.is-menu-open .rotary-header-actions {
    display: flex;
  }
  .rotary-header.is-menu-open .rotary-header-actions {
    order: 4;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--rotary-surface);
  }
  .rotary-header.is-menu-open .rotary-nav ul {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    gap: 0;
    background: var(--rotary-surface);
    border-top: 1px solid var(--rotary-border);
  }
  .rotary-header.is-menu-open .rotary-nav li {
    width: 100%;
  }
  .rotary-header.is-menu-open .rotary-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    color: var(--rotary-primary);
    border-bottom: 1px solid var(--rotary-border);
  }
  .rotary-header.is-menu-open .rotary-header-actions .wp-block-buttons {
    width: 100%;
    justify-content: center;
  }
  .rotary-header.is-menu-open .wp-block-button.rotary-btn-gold {
    width: 100%;
  }
  .rotary-header.is-menu-open .wp-block-button.rotary-btn-gold .wp-block-button__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }
}
@media (max-width: 480px) {
  .rotary-brand-sub { display: none; }
}

/* ---- Hero ---- */
.rotary-hero {
  background: var(--rotary-primary);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.rotary-hero-inner.wp-block-columns {
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.rotary-eyebrow-wrap { margin-bottom: 1.5rem; }
.rotary-eyebrow {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rotary-gold);
  margin: 0 0 0.6rem;
}
hr.rotary-eyebrow-rule.wp-block-separator {
  width: 64px;
  height: 3px;
  border: none;
  background-color: var(--rotary-gold);
  opacity: 1;
  margin: 0;
  border-radius: 2px;
}
.rotary-hero-title {
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 0 0 1.25rem;
}
.rotary-hero-sub {
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
  margin: 0 0 1.75rem;
}
.rotary-hero-actions.wp-block-buttons { gap: 1rem; }
.rotary-hero-frame {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 4px solid rgba(247, 168, 27, 0.2);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  max-width: 420px;
  margin-inline: auto;
}
.rotary-hero-frame .rotary-hero-photo {
  margin: 0;
}
.rotary-hero-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(1.25rem - 4px);
}

/* ---- Stats band ---- */
.rotary-stats-section {
  background: var(--rotary-surface);
  padding-block: clamp(2rem, 4vw, 3rem);
}
.rotary-stats-band {
  background: var(--rotary-surface-alt);
  border-radius: var(--rotary-radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.rotary-stats-grid.wp-block-columns { margin: 0; }
.rotary-stat-tile {
  text-align: center;
  padding-inline: 1rem;
  border-left: 1px solid var(--rotary-primary-15);
}
.rotary-stats-grid > .wp-block-column:first-child .rotary-stat-tile {
  border-left: none;
}
.rotary-stat-number {
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--rotary-primary);
  margin: 0 0 0.3rem;
}
.rotary-stat-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rotary-ink-soft);
  margin: 0;
}
@media (max-width: 780px) {
  .rotary-stat-tile {
    border-left: none;
    border-top: 1px solid var(--rotary-primary-15);
    padding-top: 1.25rem;
  }
  .rotary-stats-grid > .wp-block-column:first-child .rotary-stat-tile {
    border-top: none;
    padding-top: 0;
  }
}

/* ---- Section intro (Programas / Historia) ---- */
.rotary-section-intro { margin-bottom: 2.5rem; }
.rotary-section-intro.is-centered { text-align: center; }
hr.rotary-section-eyebrow-rule.wp-block-separator {
  width: 64px;
  height: 3px;
  border: none;
  background-color: var(--rotary-gold);
  opacity: 1;
  margin-top: 0.9rem;
  margin-bottom: 0;
  border-radius: 2px;
}
.rotary-section-intro.is-centered hr.rotary-section-eyebrow-rule.wp-block-separator {
  margin-inline: auto;
}
.rotary-section-title {
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  color: var(--rotary-primary);
  margin: 0;
}

/* ---- Programas cards ---- */
.rotary-programas {
  background: var(--rotary-surface);
  padding-block: clamp(3rem, 6vw, 5rem);
}
.rotary-cards.wp-block-columns { gap: 1.5rem; }
.rotary-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #FFFFFF;
  border: 1px solid var(--rotary-border);
  border-radius: var(--rotary-radius-lg);
  padding: 2.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.rotary-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -20px rgba(1, 57, 112, 0.25);
  border-color: var(--rotary-gold);
}
p.rotary-card-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--rotary-primary-10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.5rem;
  transition: background-color 0.3s ease;
}
.rotary-card:hover p.rotary-card-icon {
  background: rgba(247, 168, 27, 0.18);
}
.rotary-card-icon .material-symbols-outlined {
  font-size: 2.75rem;
  color: var(--rotary-primary);
  font-variation-settings: "FILL" 1;
}
.rotary-card-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--rotary-primary);
  margin: 0 0 0.6rem;
  transition: color 0.3s ease;
}
.rotary-card-title a {
  color: inherit;
  text-decoration: none;
}
.rotary-card:hover .rotary-card-title {
  color: var(--rotary-gold);
}
.rotary-card-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--rotary-ink-soft);
  margin: 0;
}

/* ---- Historia timeline ---- */
.rotary-historia {
  background: var(--rotary-surface-alt);
  border-top: 1px solid var(--rotary-border);
  border-bottom: 1px solid var(--rotary-border);
  padding-block: clamp(3rem, 6vw, 5rem);
}
.rotary-historia .wide-width { max-width: 800px; }
.rotary-timeline {
  position: relative;
  border-left: 2px solid var(--rotary-primary-15);
  margin-left: 0.75rem;
  padding-left: 2rem;
}
.rotary-timeline-item {
  position: relative;
  padding-bottom: 2.25rem;
}
.rotary-timeline-item:last-child { padding-bottom: 0; }
.rotary-timeline-item::before {
  content: "";
  position: absolute;
  left: -2.6rem;
  top: 0.3rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rotary-gold);
  box-shadow: 0 0 0 4px var(--rotary-surface-alt);
}
.rotary-timeline-year {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--rotary-primary);
  display: block;
  margin: 0 0 0.3rem;
}
.rotary-timeline-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--rotary-primary);
  margin: 0 0 0.35rem;
}
.rotary-timeline-desc {
  color: var(--rotary-ink-soft);
  margin: 0;
}
a.rotary-historia-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  color: var(--rotary-primary);
  text-decoration: none;
  border-bottom: 2px solid var(--rotary-gold);
  padding-bottom: 2px;
}
a.rotary-historia-link:hover {
  color: var(--rotary-tertiary);
}

/* ---- Donaciones / Contacto ---- */
.rotary-donate-section {
  background: var(--rotary-surface);
  padding-block: clamp(3rem, 6vw, 5rem);
}
.rotary-donate-grid.wp-block-columns { gap: 1.85rem; }
.rotary-donate-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--rotary-primary);
  color: #FFFFFF;
  border-radius: var(--rotary-radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: 0 20px 40px -20px rgba(1, 57, 112, 0.4);
}
.rotary-donate-card h2,
.rotary-donate-card h3 {
  color: #FFFFFF;
  font-weight: 800;
  margin: 0 0 1.25rem;
}
.rotary-donate-card p {
  color: rgba(255, 255, 255, 0.85);
}
.rotary-donate-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rotary-gold) !important;
  margin: 1rem 0 0.5rem;
}
.rotary-donate-value {
  display: inline-block;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--rotary-primary) !important;
  background: #FFFFFF;
  padding: 0.9rem 1.5rem;
  border-radius: var(--rotary-radius);
  margin: 0 0 1.5rem;
}
.rotary-contact-card {
  height: 100%;
  background: #FFFFFF;
  border: 2px solid var(--rotary-border);
  border-radius: var(--rotary-radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.rotary-contact-card h3 {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  color: var(--rotary-primary);
  border-bottom: 2px solid var(--rotary-border);
  padding-bottom: 1rem;
  margin: 0 0 1.5rem;
}
.rotary-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.rotary-contact-item:last-child { margin-bottom: 0; }
p.rotary-contact-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rotary-primary-10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.rotary-contact-icon .material-symbols-outlined {
  font-size: 1.4rem;
  color: var(--rotary-primary);
}
.rotary-contact-label {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rotary-ink-soft);
  margin: 0 0 0.25rem;
}
.rotary-contact-value {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  color: var(--rotary-primary);
  margin: 0;
}
.rotary-contact-value a {
  color: inherit;
  text-decoration: none;
}
.rotary-contact-value a:hover {
  color: var(--rotary-tertiary);
}

/* ---- Footer (Rotary) ---- */
.rotary-footer {
  background: var(--rotary-primary);
  color: #FFFFFF;
}
/* Compound selector for the same reason documented above the header rules:
   ties against WordPress's global-styles-inline-css flex/constrained defaults
   must resolve deterministically, not depend on stylesheet print order. */
.rotary-footer .rotary-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.rotary-footer-brand { max-width: 420px; }
.rotary-footer-logo { margin: 0 0 1rem; }
.rotary-footer-logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.rotary-footer-name {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--rotary-gold);
  margin: 0 0 0.3rem;
}
.rotary-footer-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 1rem;
}
.rotary-footer-brand p {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}
.rotary-footer-copy {
  margin: 0 0 0.4rem;
}
.rotary-footer-legal {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6) !important;
  margin: 0 0 1.25rem;
}
.rotary-footer-links {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.rotary-footer-links a {
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.rotary-footer-links a:hover {
  color: var(--rotary-gold);
}

@media (max-width: 980px) {
  .rotary-hero-inner.wp-block-columns {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .rotary-header-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ================================================================
   Rotary interior pages (Quiénes Somos, Historia, Contactos) —
   used by templates/page-rotary.html and by these 3 pages' content.
   Reuses the homepage's rotary-* component classes (.rotary-card,
   .rotary-cards, .rotary-donate-card, .rotary-contact-card,
   .rotary-contact-label/value, .rotary-stats-band/stat-tile/
   stat-number/stat-label, .rotary-section-intro/title, .rotary-
   eyebrow, .rotary-btn-gold, etc.) as-is. The handful below have no
   homepage equivalent to reuse.
   ================================================================ */

/* White title band for templates/page-rotary.html (not the navy
   full-bleed .rotary-hero — interior pages stay white/paper). */
.rotary-title-hero {
  background: #FFFFFF;
  padding-block: clamp(2.75rem, 6vw, 4rem);
}
.rotary-page-title.wp-block-post-title {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--rotary-primary);
  margin: 0.9rem 0 0;
}

/* Lead paragraph under a page title (was .hero-sub) */
.rotary-lead {
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1.68;
  color: var(--rotary-ink-soft);
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
}

/* Small muted caption under an inline content photo (was .hero-caption) */
.rotary-caption {
  margin: 0.85rem 0 0;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: var(--rotary-ink-soft);
}

/* Rounded, soft-shadowed frame for inline content photos
   (was .cert-frame / .cert-frame-sm), matching the rounded-lg +
   soft-shadow language of .rotary-card / .rotary-hero-frame. */
.rotary-content-photo {
  border-radius: var(--rotary-radius-lg);
  overflow: hidden;
  border: 1px solid var(--rotary-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.rotary-content-photo img {
  width: 100%;
  height: clamp(280px, 30vw, 420px);
  object-fit: cover;
  object-position: center 38%;
  margin: 0;
}
.rotary-content-photo.rotary-content-photo-sm img {
  height: 230px;
}

/* Small institutional seal/logo image inline in content (was .cert-seal) */
.rotary-seal {
  margin: 0 0 1.5rem;
  opacity: 0.85;
}

/* Secondary (outline) button in royal blue for use on white content
   pages, where .rotary-btn-outline-gold (built for the navy hero)
   would read low-contrast on white (was is-style-outline). */
.wp-block-button.rotary-btn-outline-primary .wp-block-button__link {
  background: transparent;
  color: var(--rotary-primary);
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border-radius: var(--rotary-radius);
  border: 2px solid var(--rotary-primary);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.wp-block-button.rotary-btn-outline-primary .wp-block-button__link:hover,
.wp-block-button.rotary-btn-outline-primary .wp-block-button__link:focus-visible {
  background: var(--rotary-primary);
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* Modifier: let .rotary-donate-card size to its own content instead of
   height:100% when it is not the sole element in its flex column (e.g.
   followed by an inline photo + caption in page content, unlike the
   homepage's donate-grid use where the card is the column's only child). */
.rotary-donate-card.rotary-card-auto-height {
  height: auto;
}

/* Keep plain paragraphs/lists inside a white .rotary-contact-card in
   the Rotary ink tone rather than the inherited Sello body color. */
.rotary-contact-card p,
.rotary-contact-card li {
  color: var(--rotary-ink-soft);
}
.rotary-contact-card a {
  color: var(--rotary-primary);
}
.rotary-contact-card a:hover {
  color: var(--rotary-tertiary);
}
