/*
Theme Name: Redeeming Self — Restoration Charity
Theme URI: https://redeemingself.altasme.com
Author: Altaventures
Description: A responsive charity theme for Redeeming Self — Restoration. Teaching journey "From Lost to Life", the SELF (spirit, soul, senses), outreach programs, native giving and volunteer forms. Deep emerald, warm gold and ivory with Cinzel and Source Sans 3.
Version: 1.0.0
Requires at least: 6.5
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: redeeming-self-restoration-charity
Tags: custom-menu, custom-logo, featured-images, block-styles, wide-blocks, translation-ready, accessibility-ready
*/

:root {
  --emerald-900: #052e23;
  --emerald-800: #0a4a39;
  --emerald-700: #0d5c47;
  --emerald-600: #13745a;
  --gold: #c9a227;
  --gold-light: #e8cb6f;
  --gold-dark: #7d6208;
  --ivory: #fbf7ea;
  --ivory-2: #f3ecd6;
  --ink: #1c2a24;
  --muted: #4d5c55;
  --line: rgba(10, 74, 57, .16);
  --radius: 14px;
  --shadow: 0 10px 28px rgba(5, 46, 35, .14);
  --font-head: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1140px;
  --narrow: 780px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--emerald-700); text-underline-offset: 3px; }
a:hover { color: var(--emerald-900); }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--emerald-800);
  line-height: 1.25;
  letter-spacing: .02em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

/* Visible keyboard focus: dark ring + gold halo, readable on light and dark backgrounds */
:focus-visible {
  outline: 3px solid var(--emerald-900);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--gold-light);
  border-radius: 4px;
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--gold); color: var(--emerald-900); padding: 10px 18px; font-weight: 700; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* Buttons (theme .btn and core Button block) */
.btn, .wp-block-button__link {
  display: inline-block; padding: 13px 28px; border-radius: 999px;
  background: var(--gold); color: var(--emerald-900); border: 2px solid var(--gold);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.3;
  text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, color .15s;
}
.btn:hover, .wp-block-button__link:hover { background: var(--gold-light); color: var(--emerald-900); transform: translateY(-2px); }
.btn--light, .is-style-outline > .wp-block-button__link {
  background: transparent; color: var(--emerald-800); border-color: var(--emerald-800);
}
.btn--light:hover, .is-style-outline > .wp-block-button__link:hover { background: var(--emerald-800); color: var(--ivory); }
.hero .btn--light { color: var(--ivory); border-color: var(--ivory); }
.hero .btn--light:hover { background: var(--ivory); color: var(--emerald-900); }
.wp-block-buttons { gap: 12px; margin: 1.4em 0; }
.wp-block-buttons.is-centered { justify-content: center; }

/* Header */
.site-header { background: var(--emerald-900); position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--gold); }
.header-inner { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ivory); margin-right: auto; }
.brand:hover { color: var(--gold-light); }
.brand img, .brand svg { width: 44px; height: 44px; flex: none; }
.brand__name { font-family: var(--font-head); font-size: 1.1rem; letter-spacing: .06em; line-height: 1.1; }
.brand__name small { display: block; font-family: var(--font-body); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); margin-top: 3px; }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; color: var(--ivory); text-decoration: none; padding: 9px 11px; border-radius: 8px; font-size: .95rem; font-weight: 600; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav .current_page_item > a { background: rgba(255,255,255,.12); color: var(--gold-light); }
.primary-nav .menu-give > a { background: var(--gold); color: var(--emerald-900); font-weight: 700; padding: 10px 18px; border-radius: 999px; margin-left: 8px; }
.primary-nav .menu-give > a:hover { background: var(--gold-light); color: var(--emerald-900); }
.primary-nav .menu-item-has-children { display: flex; align-items: center; }
.submenu-toggle { background: none; border: 0; color: var(--ivory); cursor: pointer; width: 28px; height: 36px; padding: 0; margin-left: -6px; border-radius: 6px; }
.submenu-toggle::before { content: ""; display: block; width: 8px; height: 8px; margin: 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.submenu-toggle[aria-expanded="true"]::before { transform: translateY(1px) rotate(-135deg); }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--emerald-800); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 8px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; z-index: 20; }
.primary-nav .sub-menu a { padding: 9px 14px; font-weight: 500; }
.primary-nav .menu-item-has-children { flex-wrap: wrap; }

.nav-toggle { display: none; background: transparent; color: var(--ivory); border: 2px solid var(--gold-light); border-radius: 8px; padding: 8px 14px; font: 700 .95rem var(--font-body); cursor: pointer; }
.header-give { display: none; }

@media (min-width: 1081px) {
  .primary-nav li:hover > .sub-menu,
  .primary-nav li:focus-within > .sub-menu,
  .primary-nav li.is-open > .sub-menu { display: flex; }
}

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .header-give { display: inline-block; padding: 9px 16px; font-size: .9rem; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--emerald-800); padding: 10px 20px 22px; max-height: calc(100vh - 80px); overflow-y: auto; box-shadow: var(--shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav a { padding: 13px 12px; }
  .primary-nav .menu-give { display: none; } /* the header Give button stays visible instead */
  .primary-nav .menu-item-has-children > a { flex: 1; }
  .submenu-toggle { width: 44px; height: 44px; margin: 0; }
  .primary-nav .sub-menu { position: static; display: none; width: 100%; background: rgba(0,0,0,.18); border: 0; box-shadow: none; margin: 0 0 6px; }
  .primary-nav li.is-open > .sub-menu { display: flex; }
}
@media (max-width: 520px) {
  .brand__name small { display: none; }
  .brand__name { font-size: .95rem; }
  .brand img, .brand svg { width: 38px; height: 38px; }
}

/* Hero */
.hero { background: radial-gradient(ellipse at 50% 0%, var(--emerald-700), var(--emerald-900) 70%); color: var(--ivory); text-align: center; padding: 64px 0 0; overflow: hidden; }
.hero h1 { color: var(--gold-light); font-size: clamp(1.7rem, 5vw, 3.3rem); letter-spacing: .06em; margin-bottom: .35em; }
.hero__subtitle { font-family: var(--font-head); font-size: clamp(1rem, 2.6vw, 1.55rem); letter-spacing: .22em; color: var(--ivory); margin: 0 0 1em; }
.hero__text { max-width: 640px; margin: 0 auto 1.6em; font-size: 1.15rem; color: #e6efe6; }
.hero .btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero-art { display: block; width: 100%; height: clamp(170px, 36vw, 430px); margin-top: 44px; }
.hero-art-img { display: block; width: 100%; max-height: 460px; object-fit: cover; margin-top: 44px; }

/* Sections and content */
.page-hero { background: linear-gradient(180deg, var(--emerald-800), var(--emerald-900)); color: var(--ivory); padding: 54px 0 44px; text-align: center; }
.page-hero h1 { color: var(--gold-light); margin: 0; }
.entry-content .kicker { color: var(--gold-dark); }
.kicker { display: block; font-family: var(--font-body); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; color: var(--gold-light); margin-bottom: .6em; }
.entry-content > * { max-width: var(--narrow); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide, .entry-content > .is-wide, .entry-content > .wp-block-columns, .entry-content > .wp-block-group.section { max-width: var(--wrap); }
.entry-content > .alignfull { max-width: none; }
.entry { padding: 48px 20px 72px; }
.entry-content > h2 { margin-top: 1.6em; }
.entry-content .wp-block-columns { gap: 22px; margin-block: 1.4em; }
.section-band { background: var(--ivory-2); }

.wp-block-group.section { padding: 56px 20px; max-width: none; }
.wp-block-group.section > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.wp-block-group.section.is-band { background: var(--ivory-2); }
.wp-block-group.section.is-dark { background: var(--emerald-800); color: var(--ivory); }
.wp-block-group.section.is-dark h2, .wp-block-group.section.is-dark h3 { color: var(--gold-light); }
.wp-block-group.section.is-dark a:not(.wp-block-button__link) { color: var(--gold-light); }
.section-intro { max-width: 680px !important; }
.section > h2, .section > .section-intro { text-align: center; }
.section > .section-intro { margin-bottom: 2em; }

.self-card { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--gold); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); height: 100%; }
.self-card, .program-card, .scripture-reading { color: var(--ink); }
.wp-block-group.section.is-dark .self-card h3 { color: var(--emerald-800); }
.wp-block-group.section.is-dark .self-card a { color: var(--emerald-700); }
.self-card h3 { margin-bottom: .4em; }
.self-card p:last-child { margin-bottom: 0; }
.card-link { font-weight: 700; }

.journey-steps { list-style: none; margin: 2em auto !important; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 6px; counter-reset: step; }
.journey-steps li { display: flex; align-items: center; margin: 0; }
.journey-steps li a { display: block; background: #fff; color: var(--emerald-800); border: 2px solid var(--emerald-700); border-radius: 999px; padding: 8px 18px; font-weight: 700; text-decoration: none; font-family: var(--font-head); font-size: .9rem; letter-spacing: .04em; }
.journey-steps li a:hover { background: var(--emerald-800); color: var(--ivory); }
.journey-steps li:not(:last-child)::after { content: "→"; color: var(--gold-dark); font-weight: 700; margin-left: 6px; }
.journey-steps li:last-child a { background: var(--gold); border-color: var(--gold); color: var(--emerald-900); }

/* Teaching pages */
.framework-box { background: var(--emerald-800); color: var(--ivory); border-left: 6px solid var(--gold); border-radius: var(--radius); padding: 22px 26px; margin-block: 1.4em; }
.framework-box p { margin: 0; font-family: var(--font-head); font-size: 1.1rem; letter-spacing: .03em; }
.framework-box strong { color: var(--gold-light); }
.scripture-reading { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-block: 1.6em; }
.scripture-reading h3 { margin-bottom: .4em; }
.scripture-reading ul { margin: 0; padding-left: 1.2em; }
.reflection { background: var(--ivory-2); border-left: 6px solid var(--gold); border-radius: var(--radius); padding: 22px 26px; margin-block: 1.6em; }
.reflection h3 { margin-bottom: .3em; }
.reflection p:last-child { margin: 0; font-size: 1.15rem; font-style: italic; }
.definitions { margin: 1.2em auto; padding-left: 0; list-style: none; }
.definitions li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.stage-nav { margin-top: 2.4em; }

/* Outreach program cards */
.program-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 0 22px; overflow: hidden; height: 100%; }
.program-card > *:not(.program-photo) { margin-left: 22px; margin-right: 22px; }
.program-photo { margin: 0 0 18px; min-height: 170px; background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900)); position: relative; }
.program-photo img { display: block; width: 100%; height: 190px; object-fit: cover; }
.program-photo img:not([src]) { display: none; }
.program-photo:not(:has(img[src]))::after { content: "Photo coming soon"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold-light); font-family: var(--font-head); letter-spacing: .08em; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; background: var(--ivory-2); color: var(--gold-dark); border: 1px solid var(--gold); }
.badge--active { background: var(--emerald-700); color: #fff; border-color: var(--emerald-700); }
.equal-access { background: var(--ivory-2); border: 1px dashed var(--emerald-700); border-radius: var(--radius); padding: 16px 22px; }

/* Posts / updates */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.post-card__img img { width: 100%; height: 190px; object-fit: cover; display: block; }
.post-card__body { padding: 20px 22px 24px; }
.post-card__body h3 { font-size: 1.1rem; }
.post-card__body h3 a { text-decoration: none; }
.post-meta { font-size: .85rem; color: var(--muted); margin-bottom: .6em; }
.empty-note { text-align: center; color: var(--muted); background: var(--ivory-2); padding: 26px; border-radius: var(--radius); }
.pagination { margin-top: 32px; text-align: center; }
.pagination .page-numbers { display: inline-block; padding: 6px 14px; margin: 2px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pagination .current { background: var(--emerald-800); color: #fff; }

/* Forms and giving */
.rsr-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-block: 1.4em; }
.rsr-form label, .rsr-give legend { display: block; font-weight: 700; margin-bottom: 4px; }
.rsr-form .req { color: #9b1c1c; }
.rsr-field { margin-bottom: 16px; }
.rsr-field input, .rsr-field select, .rsr-field textarea, .rsr-give__custom {
  width: 100%; font: inherit; padding: 11px 13px; border: 2px solid #9fb3aa; border-radius: 10px; background: #fff; color: var(--ink);
}
.rsr-field textarea { min-height: 120px; resize: vertical; }
.rsr-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsr-notice { border-radius: 10px; padding: 14px 18px; margin-bottom: 16px; font-weight: 600; }
.rsr-notice--ok { background: #e4f4e8; color: #0b4a2a; border: 1px solid #8fcea4; }
.rsr-notice--err { background: #fdeaea; color: #7a1414; border: 1px solid #e5a1a1; }
.rsr-notice--info { background: var(--ivory-2); border: 1px dashed var(--emerald-700); }
.rsr-give { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-block: 1.4em; }
.rsr-give fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.rsr-give__amounts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.rsr-give__amounts label { margin: 0; font-weight: 700; position: relative; }
.rsr-give__amounts input[type="radio"] { position: absolute; opacity: 0; }
.rsr-give__amounts span { display: block; padding: 11px 22px; border: 2px solid var(--emerald-700); border-radius: 999px; cursor: pointer; background: #fff; color: var(--emerald-800); }
.rsr-give__amounts input:checked + span { background: var(--emerald-800); color: #fff; }
.rsr-give__amounts input:focus-visible + span { outline: 3px solid var(--emerald-900); outline-offset: 2px; box-shadow: 0 0 0 6px var(--gold-light); }
.rsr-give__custom { max-width: 220px; margin-top: 10px; }
.rsr-give__monthly { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-bottom: 18px; }
.rsr-give__monthly input { width: 20px; height: 20px; accent-color: var(--emerald-700); }

/* Footer */
.site-footer { background: var(--emerald-900); color: #d7e5dc; padding: 54px 0 26px; border-top: 4px solid var(--gold); margin-top: 0; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-grid h2 { font-size: 1rem; color: var(--gold-light); letter-spacing: .12em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-tag { font-family: var(--font-head); color: var(--gold-light); letter-spacing: .16em; margin-top: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 34px; padding-top: 18px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

@media (max-width: 781px) {
  .wp-block-group.section { padding: 40px 16px; }
  .entry { padding: 36px 16px 56px; }
  .hero { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
