/*
 * sections.css - the section system: base block, height and background
 * modifiers, plus the section-level components used on the front page.
 */


/* --------------------------------------------------------------------------
   BASE STRUCTURAL BLOCK

   Deliberately a plain block. An earlier version was display:flex with
   align-items:center, which made every child shrink to its content width
   instead of filling the line. Anything whose width came from an absolutely
   positioned descendant - .cn-embed, holding only an inset:0 iframe -
   collapsed to zero and vanished. It also meant each child had to opt back
   out with its own width:100% and text-align:left, which is how those
   overrides accumulated further down this file.

   Sections that genuinely need vertical distribution add .cn-section--spread.
   -------------------------------------------------------------------------- */
.cn-section {
    box-sizing: border-box;
    width: 100%;
    padding: 40px 15%;
    text-align: center;
}

/* Distributes children down a full-height section. Pairs with .cn-height-full;
   on an auto-height section it does nothing useful. */
.cn-section--spread {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}

/* 15% of a phone screen leaves roughly 260px of usable width, which forces
   headings to wrap badly. Below 480px the padding becomes a fixed value. */
@media (max-width: 480px) {
    .cn-section {
        padding-inline: 24px;
    }
}

/* --- Height Modifiers --- */
/* Fills from below the header to the bottom of the screen. The bottom bar
   floats above; the padding keeps content clear of it. */
.cn-height-full {
    min-height: calc(100vh - var(--cn-scroll-pad-top));
    min-height: calc(100dvh - var(--cn-scroll-pad-top));
    padding-bottom: var(--cn-scroll-pad-bottom);
}


.cn-height-auto {
    min-height: auto;
}

/* --- Background Color Utilities --- */
.cn-bg-default {
    background-color: transparent;
    color: var(--cn-text-color);
}

.cn-bg-primary {
    background-color: var(--cn-primary-color);
    color: var(--cn-background-color);
}

.cn-bg-secondary {
    background-color: var(--cn-secondary-color);
    color: var(--cn-background-color);
}

.cn-bg-dark {
    background-color: var(--cn-black);
    color: var(--cn-off-white);
}

/* Brand gradient applied to one specific section */
.cn-bg-gradient {
    background: var(--cn-gradient-hero);
    color: var(--cn-text-color);
}

/* Lets the body's brand backdrop show through (this is what the hero uses) */
.cn-bg-brand {
    background: transparent;
    color: var(--cn-text-color);
}


.cn-bg-primary h1, .cn-bg-primary h2, .cn-bg-primary h3, .cn-bg-primary p,
.cn-bg-secondary h1, .cn-bg-secondary h2, .cn-bg-secondary h3, .cn-bg-secondary p,
.cn-bg-dark h1, .cn-bg-dark h2, .cn-bg-dark h3, .cn-bg-dark p {
    color: var(--cn-background-color);
}

/* --- Text Utilities --- */
/* The brand manual forbids justified text; the class is kept so templates
   already using it do not break, but it now aligns left. */
.cn-txt-justify p {
    text-align: left;
}

/* Long-form reading copy, left aligned against the centred section default. */
.cn-resource__body,
.cn-resource__body p {
    text-align: left;
}

/* ==========================================================================
   TESTIMONIALS (native horizontal scroll)
   ========================================================================== */
.cn-testimonials-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 20px 5vw 40px 5vw;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hides scrollbar in Firefox */
}

/* Hides scrollbar in WebKit browsers */
.cn-testimonials-container::-webkit-scrollbar {
    display: none; 
}

/* Adds space at the end of the scroll */
.cn-testimonials-container::after {
    content: '';
    flex: 0 0 5vw;
}

.cn-testimonial-card {
    flex: 0 0 85vw; 
    scroll-snap-align: center;
    background-color: var(--cn-surface-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--cn-shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.cn-testimonial-text {
    font-size: 16px !important;
    line-height: 1.6em;
    color: var(--cn-text-color);
    margin-bottom: 25px;
    font-style: italic;
}

.cn-testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(42, 46, 109, 0.1);
    padding-top: 20px;
}

.cn-testimonial-author img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

.cn-author-meta {
    display: flex;
    flex-direction: column;
}

.cn-author-name {
    font-family: var(--cn-primary-font);
    font-weight: bold;
    font-size: 16px;
    color: var(--cn-text-color);
}

.cn-author-country {
    font-family: var(--cn-primary-font);
    font-size: 14px;
    color: var(--cn-text-muted);
}

/* Desktop Adjustments */
@media (min-width: 769px) {
    .cn-testimonials-container {
        padding: 20px 15% 40px 15%;
        gap: 30px;
    }
    
    .cn-testimonial-card {
        flex: 0 0 350px;
        scroll-snap-align: start;
    }

    .cn-testimonials-container::after {
        flex: 0 0 15%;
    }
}

/* ==========================================================================
   WORKSHOP TEASER
   ========================================================================== */
.cn-lead {
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.5;
    margin-bottom: 10px;
}

.cn-promise-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: var(--cn-measure);
    margin: 20px auto 24px;
    text-align: left;
}

.cn-promise {
    padding: 20px 22px;
    border-radius: 16px;
    background-color: var(--cn-surface-color);
    box-shadow: var(--cn-shadow-soft);
}

.cn-promise-title {
    font-size: 18px !important;
    line-height: 1.3;
    margin: 0 0 6px;
    font-weight: 600;
}

.cn-promise-text {
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    max-width: none;
}

.cn-authority {
    font-size: 14px;
    line-height: 1.5;
    color: var(--cn-text-muted);
    max-width: 560px;
    margin: 0 auto 26px;
}

@media (min-width: 769px) {
    .cn-promise-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        max-width: 940px;
    }
}


/* Abstracted structure from single.php and home.php.
   The width:100% these used to carry is now the block default. */
.cn-post-header,
.cn-blog-header {
    margin-bottom: 30px;
    text-align: left;
}

.cn-post-meta {
    color: var(--cn-accent-color);
    font-size: 14px;
}
