/*
Theme Name: 3CA4R
Theme URI: https://3ca4r.org
Author: 3CA4R
Description: Custom WordPress theme for the 3CA4R website and blog.
Version: 1.0.0
Text Domain: threeca4r
*/

:root {
    --green: #367c45;
    --green-dark: #1f5630;
    --green-light: #eaf4ec;
    --gold: #d4a936;
    --gold-dark: #b78c1c;
    --ink: #202820;
    --text: #586158;
    --light: #f6f8f5;
    --white: #ffffff;
    --border: #dfe5de;
    --shadow: 0 15px 40px rgba(19, 46, 26, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

body.admin-bar .site-navigation {
    top: 32px;
}

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

a {
    color: var(--green);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--gold-dark);
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation */

.site-navigation {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    background: rgba(20, 27, 21, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-navigation__inner {
    display: flex;
    width: min(1140px, calc(100% - 40px));
    min-height: 76px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

.site-logo:hover,
.site-logo:focus {
    color: var(--gold);
}

.site-logo img {
    width: 48px;
    height: 52px;
    object-fit: contain;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 34px;
}

.primary-menu a {
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.primary-menu a:hover,
.primary-menu a:focus {
    color: var(--gold);
}

.menu-toggle {
    display: none;
    width: 44px;
    padding: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-toggle span:not(.screen-reader-text) {
    display: block;
    height: 2px;
    margin: 6px 0;
    background: var(--white);
}

/* Hero */

.hero {
    position: relative;
    display: grid;
    min-height: 760px;
    padding: 150px 20px 90px;
    background-image: url("assets/images/bg-main.png");
    background-position: center;
    background-size: cover;
    place-items: center;
    text-align: center;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            110deg,
            rgba(10, 20, 12, 0.84),
            rgba(22, 35, 24, 0.57)
        );
}

.hero__content {
    position: relative;
    z-index: 1;
    width: min(850px, 100%);
    color: var(--white);
}

.hero__eyebrow {
    margin: 0 0 16px;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: clamp(20px, 3vw, 32px);
    font-style: italic;
}

.hero h1 {
    margin-bottom: 22px;
    color: var(--white);
    font-size: clamp(45px, 7vw, 82px);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero__description {
    width: min(650px, 100%);
    margin: 0 auto 38px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
}

/* Buttons */

.button {
    display: inline-flex;
    min-height: 52px;
    padding: 13px 26px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus {
    transform: translateY(-2px);
}

.button--primary {
    background: var(--gold);
    color: var(--ink);
}

.button--primary:hover,
.button--primary:focus {
    background: var(--white);
    color: var(--ink);
}

.button--dark {
    background: var(--green-dark);
    color: var(--white);
}

.button--dark:hover,
.button--dark:focus {
    background: var(--gold);
    color: var(--ink);
}

/* Sections */

.section {
    padding: 100px 0;
}

.section--light {
    background: var(--light);
}

.section--green {
    background: var(--green-dark);
}

.section-heading {
    width: min(800px, 100%);
    margin: 0 auto 55px;
    text-align: center;
}

.section-heading > span,
.story__content > span {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-heading h2,
.story__content h2 {
    margin-bottom: 20px;
    font-size: clamp(32px, 5vw, 48px);
}

.section-heading p {
    margin: 10px 0;
    font-size: 17px;
}

/* Programs */

.program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.program-card {
    padding: 38px 26px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(20, 50, 27, 0.05);
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.program-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow);
}

.program-card__icon {
    display: grid;
    width: 70px;
    height: 70px;
    margin: 0 auto 22px;
    background: var(--green-light);
    border-radius: 50%;
    color: var(--green-dark);
    font-size: 30px;
    font-weight: 700;
    place-items: center;
}

.program-card h3 {
    margin-bottom: 13px;
    font-size: 18px;
}

.program-card p {
    margin: 0;
    font-size: 14px;
}

/* Empowering communities */

.story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.story__content h2 {
    color: var(--white);
}

.story__content p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
}

.story__image img {
    width: 100%;
    min-height: 440px;
    border-radius: 8px;
    box-shadow: 22px 22px 0 rgba(212, 169, 54, 0.85);
    object-fit: cover;
}

/* Blog cards */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.post-card {
    overflow: hidden;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.post-card__image {
    display: block;
    overflow: hidden;
}

.post-card__image img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card:hover .post-card__image img {
    transform: scale(1.04);
}

.post-card__content {
    padding: 28px;
}

.post-card__date {
    margin: 0 0 8px;
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.post-card h3 {
    margin-bottom: 12px;
    font-size: 22px;
}

.post-card h3 a {
    color: var(--ink);
}

.post-card h3 a:hover {
    color: var(--green);
}

.post-card__content > p:not(.post-card__date) {
    font-size: 15px;
}

.text-link {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-action {
    margin-top: 45px;
    text-align: center;
}

/* Contact */

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    width: min(900px, 100%);
    margin: auto;
}

.contact-card {
    padding: 34px;
    background: var(--light);
    border-left: 4px solid var(--gold);
    border-radius: 5px;
}

.contact-card h3 {
    margin-bottom: 18px;
}

.contact-card p {
    margin: 7px 0;
}

/* Footer */

.site-footer {
    padding: 55px 20px;
    background: #101410;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.site-footer__inner img {
    width: 105px;
    margin: 0 auto 20px;
}

.site-footer p {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Responsive */

@media (max-width: 900px) {
    .program-grid,
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .story {
        grid-template-columns: 1fr;
    }

    .story__image {
        width: min(650px, 100%);
    }
}

@media (max-width: 782px) {
    body.admin-bar .site-navigation {
        top: 46px;
    }
}

@media (max-width: 700px) {
    .site-navigation__inner {
        min-height: 68px;
    }

    .menu-toggle {
        display: block;
    }

    .primary-menu {
        position: absolute;
        top: 68px;
        right: 0;
        left: 0;
        display: none;
        padding: 20px;
        background: #151c16;
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }

    .primary-menu.is-open {
        display: flex;
    }

    .primary-menu a {
        padding: 12px 20px;
        text-align: center;
    }

    .hero {
        min-height: 670px;
    }

    .section {
        padding: 75px 0;
    }

    .program-grid,
    .post-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .story {
        gap: 40px;
    }

    .story__image img {
        min-height: 300px;
        box-shadow: 12px 12px 0 rgba(212, 169, 54, 0.85);
    }
}

/* Blog archive */

.page-banner {
    position: relative;
    display: grid;
    min-height: 440px;
    padding: 150px 0 80px;
    background-image: url("assets/images/bg-main.png");
    background-position: center;
    background-size: cover;
    place-items: center;
    text-align: center;
}

.page-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 29, 17, 0.82);
}

.page-banner__content {
    position: relative;
    z-index: 1;
}

.page-banner__content > span {
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.page-banner h1 {
    margin: 10px 0 16px;
    color: var(--white);
    font-size: clamp(42px, 6vw, 68px);
}

.page-banner p {
    width: min(650px, 100%);
    margin: auto;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-grid .post-card h2 {
    margin-bottom: 12px;
    font-size: 23px;
}

.blog-grid .post-card h2 a {
    color: var(--ink);
}

.blog-grid .post-card h2 a:hover {
    color: var(--green);
}

.pagination {
    margin-top: 50px;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination .page-numbers {
    display: grid;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    place-items: center;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
}

.empty-state {
    padding: 70px 20px;
    background: var(--white);
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .page-banner {
        min-height: 380px;
    }
}

/* Individual article */

.article-header {
    padding: 170px 0 90px;
    background:
        linear-gradient(rgba(14, 29, 17, 0.91), rgba(14, 29, 17, 0.91)),
        url("assets/images/bg-main.png") center/cover;
    text-align: center;
}

.article-header__content {
    width: min(900px, calc(100% - 40px));
}

.article-category {
    margin: 0 0 15px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.article-header h1 {
    margin-bottom: 22px;
    color: var(--white);
    font-size: clamp(38px, 6vw, 66px);
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 22px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.article-layout {
    width: min(900px, calc(100% - 40px));
    padding-top: 80px;
    padding-bottom: 100px;
}

.article-featured-image {
    margin: 0 0 45px;
}

.article-featured-image img {
    width: 100%;
    max-height: 560px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: cover;
}

.article-body {
    color: #3f493f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    line-height: 1.9;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 45px;
    margin-bottom: 18px;
    font-family: Arial, Helvetica, sans-serif;
}

.article-body h2 {
    font-size: 34px;
}

.article-body h3 {
    font-size: 27px;
}

.article-body p {
    margin-bottom: 26px;
}

.article-body img {
    border-radius: 6px;
}

.article-body blockquote {
    margin: 40px 0;
    padding: 12px 0 12px 30px;
    border-left: 5px solid var(--gold);
    color: var(--green-dark);
    font-size: 23px;
    font-style: italic;
}

.article-body iframe,
.article-body video,
.article-body .wp-block-embed {
    max-width: 100%;
}

.article-body .wp-block-embed__wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%;
}

.article-body .wp-block-embed__wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.article-tags {
    display: flex;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.article-tags a {
    padding: 5px 12px;
    background: var(--green-light);
    border-radius: 20px;
    font-size: 13px;
}

.post-navigation {
    display: grid;
    margin-top: 40px;
    padding: 25px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-navigation div:last-child {
    text-align: right;
}

.post-navigation a {
    font-weight: 700;
}

@media (max-width: 600px) {
    .article-header {
        padding-top: 140px;
        padding-bottom: 65px;
    }

    .article-meta {
        flex-direction: column;
        gap: 3px;
    }

    .article-layout {
        padding-top: 55px;
        padding-bottom: 70px;
    }

    .article-body {
        font-size: 17px;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-navigation div:last-child {
        text-align: left;
    }
}

/* Compact community-resilience section */

.section--green {
    padding: 70px 0;
}

.section--green .story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 55px;
    align-items: center;
}

.section--green .story__image {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
}

.section--green .story__content {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
}

.section--green .story__image img {
    width: 100%;
    height: 350px;
    min-height: 0;
    object-fit: cover;
}

.section--green .story__content h2 {
    margin-bottom: 16px;
}

.section--green .story__content p {
    margin: 0 0 14px;
}

@media (max-width: 900px) {
    .section--green {
        padding: 60px 0;
    }

    .section--green .story {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section--green .story__image {
        grid-column: 1;
        grid-row: 1;
    }

    .section--green .story__content {
        grid-column: 1;
        grid-row: 2;
    }

    .section--green .story__image img {
        height: 320px;
    }
}
