/**
 * Clearwater shared pieces, used by several blocks. Values measured on the
 * live Divi site (clearwaterconservationrevival.com, 1440px): content rows
 * are 80% wide up to 1152px; headings are Noto Serif 400 #333 with an 80px x
 * 3px water-blue rule under them; body text is Open Sans 16px/2 #666; buttons
 * are water blue #8ddaec with slate #345171 text and a 10px radius.
 */

.ccr-row {
    width: 80%;
    max-width: 1152px;
    margin-inline: auto;
}

/* Section heading + the live site's short water-blue rule beneath it. */
.ccr-iconheading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 0;
}

.ccr-iconheading img {
    display: block;
    width: auto;
    height: 64px;
}

.ccr-iconheading__title {
    margin: 0;
    font-family: var(--font-heading, "Noto Serif", Georgia, "Times New Roman", serif);
    font-weight: 400;
    font-size: 45px;
    line-height: 1.25;
    color: #333333;
}

.ccr-iconheading__title::after,
.ccr-rule {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    margin: 36px auto 0;
    background: var(--ccr-accent, #8ddaec);
}

.ccr-iconheading--left { align-items: flex-start; }
.ccr-iconheading--left .ccr-iconheading__title::after { margin-left: 0; }

.ccr-iconheading__title--upper { text-transform: uppercase; }

.ccr-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 10px;
    background: var(--ccr-accent, #8ddaec);
    color: var(--primary, #345171);
    font-family: var(--font-paragraph, "Open Sans", ui-sans-serif, system-ui, sans-serif);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.3;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 0;
    transition: background-color 0.2s ease;
}

.ccr-btn:hover,
.ccr-btn:focus-visible { background: var(--secondary-hover, #6fcde3); color: var(--primary, #345171); }

.ccr-btn--pink { background: var(--ccr-accent, #8ddaec); }
.ccr-btn--sky { background: var(--ccr-sky, #d4ebf6); }

@media (max-width: 767px) {
    .ccr-iconheading img { height: 48px; }
    .ccr-iconheading__title { font-size: 32px; }
    .ccr-iconheading__title::after { margin-top: 24px; }
    .ccr-btn { font-size: 16px; }
}

/* Rich content inside blocks (WYSIWYG fields). Live Divi text modules:
   Open Sans 400 16px/2 #666; links #2b87da. */
.ccr-prose {
    font-family: var(--font-paragraph, "Open Sans", ui-sans-serif, system-ui, sans-serif);
    font-weight: 400;
    font-size: 16px;
    line-height: 2;
    color: var(--ccr-text, #666666);
}

.ccr-prose > :first-child { margin-top: 0; }
.ccr-prose > :last-child { margin-bottom: 0; }
.ccr-prose p { margin: 0 0 16px; }
.ccr-prose strong, .ccr-prose b { font-weight: 700; }

.ccr-prose h2,
.ccr-prose h3,
.ccr-prose h4 {
    margin: 0 0 12px;
    font-family: var(--font-heading, "Noto Serif", Georgia, "Times New Roman", serif);
    font-weight: 400;
    line-height: 1.3;
    color: #333333;
}

.ccr-prose h2 { font-size: 36px; }
.ccr-prose h3 { font-size: 26px; }
.ccr-prose h4 { font-size: 20px; }

.ccr-prose ul,
.ccr-prose ol { margin: 0 0 16px; padding-left: 1.2em; }
.ccr-prose ul { list-style: disc; }
.ccr-prose ol { list-style: decimal; }

.ccr-prose a { color: #2b87da; }
.ccr-prose a:hover { text-decoration: underline; }

.ccr-prose img { max-width: 100%; height: auto; }
.ccr-prose iframe { max-width: 100%; border: 0; }

.ccr-iconheading--large img { height: 65px; }

/* Offset "frame" behind photos (kept for Media Text's frame option). */
.ccr-frame { box-shadow: var(--ccr-frame-x, -28px) 28px 0 0 var(--ccr-frame-color, #8ddaec); }
.ccr-frame--right { --ccr-frame-x: 28px; }
.ccr-frame--navy { --ccr-frame-color: var(--ccr-ink, #151f33); }
.ccr-frame--sky { --ccr-frame-color: var(--ccr-sky, #d4ebf6); }
.ccr-frame--pink { --ccr-frame-color: var(--ccr-accent, #8ddaec); }

@media (max-width: 767px) {
    .ccr-prose h2 { font-size: 28px; }
    .ccr-frame { --ccr-frame-x: -14px; box-shadow: var(--ccr-frame-x) 14px 0 0 var(--ccr-frame-color, #8ddaec); }
    .ccr-frame--right { --ccr-frame-x: 14px; }
}

/* Section backgrounds offered by the inner-page blocks' "Background" select. */
.ccr-bg--white { background: var(--background, #ffffff); }
.ccr-bg--blush { background: var(--ccr-blush, #fff7f7); }
.ccr-bg--sand { background: var(--ccr-sand, #f6f0f0); }
.ccr-bg--grey { background: #f7f7f7; }
.ccr-bg--ice { background: linear-gradient(180deg, #ffffff 0%, #e6f6fc 50%, #ffffff 100%); }
.ccr-bg--navy { background: var(--ccr-ink, #151f33); }
.ccr-bg--pink { background: var(--ccr-accent, #8ddaec); }
.ccr-bg--navy .ccr-prose,
.ccr-bg--pink .ccr-prose,
.ccr-bg--navy .ccr-prose h2,
.ccr-bg--navy .ccr-prose h3,
.ccr-bg--navy .ccr-prose h4,
.ccr-bg--navy .ccr-iconheading__title { color: #ffffff; }

/* Section rhythm: Divi's 4% plus row padding, ~90px at 1440. */
.ccr-section { padding: 90px 0; }

@media (max-width: 767px) {
    .ccr-section { padding: 56px 0; }
}

/* Click-to-load YouTube (foundation_ccr_video()). */
.ccr-video { position: relative; aspect-ratio: 16 / 9; background: #000000; }
.ccr-video__poster { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: #000000; cursor: pointer; }
.ccr-video__poster img { width: 100%; height: 100%; object-fit: cover; }
.ccr-video__play { position: absolute; top: 50%; left: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: #ff0000; transition: transform 0.2s ease; }
.ccr-video__play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -9px 0 0 -6px; border-style: solid; border-width: 9px 0 9px 16px; border-color: transparent transparent transparent #ffffff; }
.ccr-video__poster:hover .ccr-video__play, .ccr-video__poster:focus-visible .ccr-video__play { transform: scale(1.08); }
.ccr-video__poster:focus-visible { outline: 3px solid var(--primary, #345171); outline-offset: 3px; }
.ccr-video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) { .ccr-video__play { transition: none; } }

/* Embedded Jotform forms (iframe; assets/js/jotform.js sets the height). */
.ccr-prose iframe.ccr-jotform { display: block; width: 100%; min-height: 600px; border: 0; }

/* Content images floated in the editor. */
.ccr-prose img.alignright { float: right; clear: right; max-width: 45%; margin: 6px 0 20px 30px; }
.ccr-prose img.alignleft { float: left; clear: left; max-width: 45%; margin: 6px 30px 20px 0; }
.ccr-prose::after { content: ""; display: table; clear: both; }

/* A button inside formatted text keeps button colours. */
.ccr-prose a.ccr-btn { color: var(--primary, #345171); }
.ccr-prose a.ccr-btn:hover { text-decoration: none; }

@media (max-width: 600px) {
    .ccr-prose img.alignright, .ccr-prose img.alignleft { float: none; max-width: 100%; margin: 0 0 20px; }
}

/* Embeds inside formatted text: YouTube and Google Maps iframes. */
.ccr-prose iframe.ccr-youtube { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.ccr-prose iframe[src*="google.com/maps"] { display: block; width: 100%; height: 420px; }

/* Media Text "boxed" text column (Contact): sand panel. */
.mediatext--boxed .mediatext-text { padding: 40px 22px; background: var(--ccr-sand, #f6f0f0); }

/* Blog list and single posts (home.php, single.php). */
.ccr-blog { padding: 60px 0 80px; }
.ccr-blog__inner { max-width: 900px; }
.ccr-blog__heading {
    margin: 0 0 32px;
    font-family: var(--font-heading, "Noto Serif", Georgia, serif);
    font-weight: 400;
    font-size: 40px;
    line-height: 1.15;
    color: var(--primary, #345171);
}
.ccr-blog__inner--single .ccr-blog__heading { margin-bottom: 8px; }
.ccr-blog__item { padding: 0 0 32px; margin: 0 0 32px; border-bottom: 1px solid #e6e6e6; }
.ccr-blog__item:last-of-type { border-bottom: 0; }
.ccr-blog__title {
    margin: 0 0 4px;
    font-family: var(--font-heading, "Noto Serif", Georgia, serif);
    font-weight: 500;
    font-size: 26px;
    line-height: 1.25;
    color: var(--primary, #345171);
}
.ccr-blog__title a:hover { color: var(--ccr-accent, #8ddaec); }
.ccr-blog__date { margin: 0 0 12px; font-size: 15px; color: #767676; }
.ccr-blog__inner--single .ccr-blog__date { margin-bottom: 32px; }
.ccr-blog__back { margin: 0 0 16px; font-size: 15px; }
.ccr-blog__back a { color: var(--ccr-accent, #8ddaec); }
@media (max-width: 767px) {
    .ccr-blog { padding: 40px 0 60px; }
    .ccr-blog__heading { font-size: 32px; }
}

/* Password-protected pages (Staff Portal): WordPress' password form in place of the page content. */
.post-password-form {
    width: 80%;
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 0;
    font-size: 19px;
    font-weight: 300;
    line-height: 1.72;
    color: var(--ccr-text, #666666);
}
.post-password-form p { margin: 0 0 16px; }
.post-password-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.post-password-form input[type="password"] { max-width: 360px; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: 3px; font-size: 17px; }
.post-password-form input[type="submit"] {
    padding: 6px 20px;
    border: 0;
    border-radius: 3px;
    background: var(--ccr-accent, #8ddaec);
    color: #ffffff;
    font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
    font-weight: 500;
    font-size: 20px;
    cursor: pointer;
}
.post-password-form input[type="submit"]:hover,
.post-password-form input[type="submit"]:focus-visible { opacity: 0.85; }

/* Wide tables scroll inside their block on phones instead of widening the page. */
@media (max-width: 767px) {
    .ccr-prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14px; }
}

/* In-page links (#about, #contact…) land below the sticky header. */
html { scroll-padding-top: 110px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Left-aligned section headings, as live (About, Services, Purchase, Contact). */
.mediatext-heading .ccr-iconheading,
.cardgrid-heading .ccr-iconheading,
.ccr-left .ccr-iconheading { align-items: flex-start; }
.mediatext-heading .ccr-iconheading__title::after,
.cardgrid-heading .ccr-iconheading__title::after,
.ccr-left .ccr-iconheading__title::after { margin-left: 0; }
.ccr-left .sectionheading-text { text-align: left; }
.mediatext .ccr-iconheading__title { font-size: 45px; }
.mediatext .ccr-iconheading__title::after { margin-top: 40px; }
@media (max-width: 767px) { .mediatext .ccr-iconheading__title { font-size: 32px; } }

/* Services: the live white → pale-blue → white wash runs behind the heading
   and the toggles as one band. */
.ccr-services-top { padding: 90px 0 60px; background: linear-gradient(180deg, #ffffff 0%, #eef8fc 100%); }
.ccr-services-top .sectionheading-text { margin-top: 12px; font-size: 18px; color: var(--primary, #345171); }
.ccr-services-top .sectionheading-text::after { content: ""; display: block; width: 80px; height: 3px; margin-top: 24px; background: var(--ccr-accent, #8ddaec); }
.ccr-services-top .ccr-iconheading__title::after { display: none; }
.ccr-services-top .sectionheading-text h4 { margin: 0; font-weight: 400; font-size: 18px; line-height: 1.5; }
.ccr-services-body { background: linear-gradient(180deg, #eef8fc 0%, #e6f6fc 50%, #ffffff 100%); }
@media (max-width: 767px) {
    .ccr-services-top { padding: 56px 0 32px; }
}

/* Projects: the misty-mountain photo fades into the navy band; title over
   the photo, a spaced-out uppercase project name, and a gold rule. */
.ccr-projects { position: relative; padding-top: 0; overflow: hidden; isolation: isolate; }
.richtext.ccr-projects .richtext-photo { opacity: 1; position: absolute; top: 0; left: 0; z-index: -2; width: 100%; height: 460px; object-fit: cover; object-position: 50% 20%; }
.ccr-projects::before { content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: -1; height: 461px; background: linear-gradient(180deg, rgba(21, 31, 51, 0) 30%, rgba(21, 31, 51, 0.55) 70%, var(--ccr-ink, #151f33) 100%); }
.ccr-projects .richtext-heading { padding: 250px 0 0; }
.ccr-projects .ccr-iconheading__title { font-size: 72px; color: #ffffff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.ccr-projects .ccr-iconheading__title::after { display: none; }
.ccr-projects .richtext-content { margin-top: 0; color: #ffffff; font-size: 15px; line-height: 2.1; }
.ccr-prose .ccr-spaced { margin: 0 0 48px; font-family: var(--font-paragraph, "Open Sans", ui-sans-serif, system-ui, sans-serif); font-weight: 600; font-size: 22px; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; color: #ffffff; }
.ccr-prose hr.ccr-rule { height: 3px; margin: 36px 0 0; border: 0; }
.ccr-prose hr.ccr-rule--gold { background: var(--ccr-yellow, #ffba5a); }
.ccr-projects + .gallery { padding-top: 32px; }
@media (max-width: 767px) {
    .richtext.ccr-projects .richtext-photo { height: 300px; }
    .ccr-projects::before { height: 301px; }
    .ccr-projects .richtext-heading { padding-top: 160px; }
    .ccr-projects .ccr-iconheading__title { font-size: 48px; }
    .ccr-prose .ccr-spaced { font-size: 16px; letter-spacing: 0.2em; margin-bottom: 32px; }
}

/* Purchase: the credits map links to the full drawing. */
.ccr-map { display: block; margin: 24px 0; border: 1px solid #333333; }
.ccr-map img { display: block; width: 100%; }
