/* =========================================================
   Capital Eye Consultants - Blog + Article Redesign
   Divi child theme styles
   ========================================================= */

:root {
    --cec-blue: #1f5fbf;
    --cec-blue-dark: #17447f;
    --cec-blue-soft: #edf4ff;
    --cec-green: #78a83b;
    --cec-green-soft: #f2f7ea;
    --cec-ink: #1f2d3d;
    --cec-text: #4d5d6c;
    --cec-muted: #6f7e8c;
    --cec-line: #e4eaf0;
    --cec-soft: #f5f8fb;
    --cec-white: #ffffff;
    --cec-shadow: 0 18px 45px rgba(29, 59, 94, 0.11);
    --cec-shadow-soft: 0 10px 30px rgba(29, 59, 94, 0.075);
    --cec-radius: 18px;
}

.cec-blog,
.cec-blog * {
    box-sizing: border-box;
}

.cec-blog {
    background: var(--cec-white);
    color: var(--cec-text);
}

.cec-container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

/* ---------- Shared typography ---------- */
.cec-blog h1,
.cec-blog h2,
.cec-blog h3,
.cec-blog h4 {
    color: var(--cec-ink);
    letter-spacing: -0.025em;
}

.cec-section-kicker,
.cec-cta-kicker,
.cec-feature-label {
    margin: 0 0 10px;
    color: var(--cec-green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.cec-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 2px solid var(--cec-blue);
    border-radius: 999px;
    background: var(--cec-blue);
    color: #fff !important;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.cec-button--compact {
    min-height: 44px;
    padding: 10px 19px;
}

.cec-button--outline {
    background: transparent;
    color: var(--cec-blue) !important;
}

.cec-button:hover,
.cec-button:focus-visible {
    background: var(--cec-blue-dark);
    border-color: var(--cec-blue-dark);
    color: #fff !important;
    transform: translateY(-1px);
}

.cec-text-link,
.cec-read-more,
.cec-back-link {
    color: var(--cec-blue) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.cec-text-link:hover,
.cec-read-more:hover,
.cec-back-link:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* =========================================================
   SINGLE POST
   ========================================================= */
.cec-article-hero {
    position: relative;
    overflow: hidden;
    padding: 74px 0 88px;
    background:
        radial-gradient(circle at 82% 14%, rgba(120, 168, 59, .15), transparent 24%),
        linear-gradient(135deg, #f7faff 0%, #eef5fc 100%);
    border-bottom: 1px solid var(--cec-line);
}

.cec-article-hero::after {
    content: "";
    position: absolute;
    right: -95px;
    bottom: -140px;
    width: 360px;
    height: 360px;
    border: 48px solid rgba(31, 95, 191, .055);
    border-radius: 50%;
    pointer-events: none;
}

.cec-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 980px;
    text-align: center;
}

.cec-eyebrow,
.cec-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--cec-muted);
    font-size: 14px;
}

.cec-category {
    color: var(--cec-blue) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.cec-category:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.cec-dot {
    color: var(--cec-green);
}

.cec-article-title {
    max-width: 920px;
    margin: 16px auto 18px;
    font-size: clamp(36px, 4.8vw, 62px);
    font-weight: 700;
    line-height: 1.08;
}

.cec-article-meta {
    font-size: 15px;
}

.cec-meta-divider {
    display: inline-block;
    width: 4px;
    height: 4px;
    flex: 0 0 4px;
    border-radius: 50%;
    background: var(--cec-green);
}

.cec-featured-wrap {
    position: relative;
    z-index: 2;
    max-width: 1040px;
    margin-top: -52px;
}

.cec-featured-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    border: 8px solid #fff;
    border-radius: 22px;
    box-shadow: var(--cec-shadow);
}

.cec-article-body-wrap {
    max-width: 850px;
    padding-top: 58px;
    padding-bottom: 76px;
}

.cec-article-content {
    color: var(--cec-text);
    font-size: 18px;
    line-height: 1.82;
}

.cec-article-content > *:first-child {
    margin-top: 0;
}

.cec-article-content p {
    margin: 0 0 1.45em;
}

.cec-article-content h2 {
    margin: 2.15em 0 .65em;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.2;
}

.cec-article-content h3 {
    margin: 1.9em 0 .55em;
    font-size: clamp(22px, 2.4vw, 27px);
    font-weight: 700;
    line-height: 1.28;
}

.cec-article-content h4 {
    margin: 1.5em 0 .45em;
    font-size: 20px;
}

.cec-article-content a:not(.cec-button) {
    color: var(--cec-blue);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.cec-article-content ul,
.cec-article-content ol {
    margin: 0 0 1.6em 1.25em;
}

.cec-article-content li {
    margin-bottom: .55em;
}

.cec-article-content blockquote {
    margin: 2em 0;
    padding: 22px 28px;
    border-left: 4px solid var(--cec-green);
    background: var(--cec-soft);
    color: var(--cec-ink);
    font-size: 1.05em;
}

.cec-article-content img:not(.cec-featured-image) {
    height: auto;
    border-radius: 12px;
}

.cec-article-content hr {
    margin: 48px 0;
    border: 0;
    border-top: 1px solid var(--cec-line);
}

.cec-post-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    margin-top: 58px;
    padding: 34px;
    border: 1px solid #dbe7f4;
    border-radius: var(--cec-radius);
    background: linear-gradient(135deg, #f7faff 0%, #eef6fb 100%);
}

.cec-post-cta h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.cec-post-cta p:not(.cec-cta-kicker) {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
}

/* ---------- Related posts ---------- */
.cec-related {
    padding: 70px 0 82px;
    border-top: 1px solid var(--cec-line);
    background: var(--cec-soft);
}

.cec-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.cec-section-heading h2 {
    margin: 0;
    font-size: 36px;
}

/* =========================================================
   BLOG ARCHIVE - MAIN BLOG PAGE
   ========================================================= */
.cec-archive-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--cec-line);
    background:
        radial-gradient(circle at 88% 18%, rgba(120, 168, 59, .15), transparent 22%),
        radial-gradient(circle at 10% 100%, rgba(31, 95, 191, .07), transparent 30%),
        linear-gradient(135deg, #f8fbff 0%, #eef5fc 100%);
}

.cec-archive-hero--main {
    padding: 68px 0 92px;
}

.cec-archive-hero--secondary {
    padding: 62px 0 66px;
}

.cec-archive-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    text-align: center;
}

.cec-archive-hero h1 {
    margin: 0 0 15px;
    font-size: clamp(42px, 5vw, 64px);
    line-height: 1.06;
}

.cec-archive-intro {
    max-width: 760px;
    margin: 0 auto;
    color: var(--cec-text);
    font-size: 18px;
    line-height: 1.7;
}

.cec-archive-description p {
    margin: 0;
}

/* ---------- Search ---------- */
.cec-blog-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(620px, 100%);
    margin: 28px auto 0;
    padding: 6px;
    border: 1px solid #d8e3ee;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 28px rgba(29, 59, 94, .07);
}

.cec-blog-search input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 17px;
    border: 0 !important;
    border-radius: 999px;
    outline: 0;
    background: transparent;
    box-shadow: none !important;
    color: var(--cec-ink);
    font-size: 15px;
}

.cec-blog-search input[type="search"]::placeholder {
    color: #8794a0;
}

.cec-blog-search button {
    min-width: 100px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--cec-blue);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: background .18s ease;
}

.cec-blog-search button:hover,
.cec-blog-search button:focus-visible {
    background: var(--cec-blue-dark);
}

/* ---------- Latest / featured article ---------- */
.cec-featured-section {
    position: relative;
    z-index: 2;
    margin-top: -58px;
    padding-bottom: 42px;
}

.cec-feature-card {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
    min-height: 410px;
    overflow: hidden;
    border: 1px solid var(--cec-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--cec-shadow);
}

.cec-feature-card-image {
    display: block;
    min-height: 410px;
    overflow: hidden;
    background: #eaf1f8;
}

.cec-feature-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 410px;
    object-fit: cover;
    transition: transform .4s ease;
}

.cec-feature-card:hover .cec-feature-card-image img {
    transform: scale(1.018);
}

.cec-feature-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 5vw, 58px);
}

.cec-feature-label {
    margin-bottom: 13px;
}

.cec-feature-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--cec-muted);
    font-size: 13px;
}

.cec-feature-card h2 {
    margin: 0 0 17px;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.14;
}

.cec-feature-card h2 a {
    color: var(--cec-ink) !important;
    text-decoration: none !important;
}

.cec-feature-card h2 a:hover {
    color: var(--cec-blue) !important;
}

.cec-feature-excerpt {
    margin: 0 0 25px;
    color: var(--cec-text);
    font-size: 16px;
    line-height: 1.72;
}

.cec-feature-card-content .cec-button {
    align-self: flex-start;
}

/* ---------- Topic navigation ---------- */
.cec-topic-bar {
    padding: 2px 0 16px;
}

.cec-topic-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.cec-topic-label {
    flex: 0 0 auto;
    color: var(--cec-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cec-topic-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.cec-topic-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid #dce6f0;
    border-radius: 999px;
    background: #fff;
    color: var(--cec-blue-dark) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.cec-topic-links a:hover,
.cec-topic-links a:focus-visible {
    border-color: #c9d9e9;
    background: var(--cec-blue-soft);
    transform: translateY(-1px);
}

/* ---------- Article grid ---------- */
.cec-archive-content {
    padding: 48px 0 84px;
}

.cec-archive-content--compact {
    padding-top: 34px;
}

.cec-section-heading--archive {
    margin-bottom: 26px;
}

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

.cec-post-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--cec-line);
    border-radius: var(--cec-radius);
    background: #fff;
    box-shadow: var(--cec-shadow-soft);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cec-post-card:hover {
    transform: translateY(-4px);
    border-color: #d3dfeb;
    box-shadow: 0 18px 42px rgba(29, 59, 94, .11);
}

.cec-card-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eaf1f8;
}

.cec-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.cec-post-card:hover .cec-card-image img {
    transform: scale(1.025);
}

.cec-image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 230px;
    padding: 20px;
    background: linear-gradient(135deg, #edf4fb, #f7fafc);
    color: var(--cec-blue-dark);
    font-weight: 700;
    text-align: center;
}

.cec-card-content {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 26px 26px 24px;
}

.cec-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 12px;
    margin-bottom: 12px;
    color: var(--cec-muted);
    font-size: 13px;
}

.cec-card-meta .cec-category {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--cec-blue-soft);
    font-size: 12px;
}

.cec-card-title,
.cec-post-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
}

.cec-card-title a,
.cec-post-card h3 a {
    color: var(--cec-ink) !important;
    text-decoration: none !important;
}

.cec-card-title a:hover,
.cec-post-card h3 a:hover {
    color: var(--cec-blue) !important;
}

.cec-card-content > p {
    margin: 0 0 22px;
    color: var(--cec-text);
    font-size: 15.5px;
    line-height: 1.67;
}

.cec-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--cec-line);
}

.cec-read-time {
    color: var(--cec-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ---------- Single-post related section uses same cards ---------- */
.cec-card-grid--related .cec-card-content {
    min-height: 260px;
}

/* ---------- Main archive empty / one-post state ---------- */
.cec-coming-soon {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    padding: 34px 38px;
    border: 1px solid var(--cec-line);
    border-radius: var(--cec-radius);
    background: var(--cec-soft);
}

.cec-coming-soon h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.cec-coming-soon p:not(.cec-section-kicker) {
    max-width: 760px;
    margin: 0;
    line-height: 1.65;
}

/* ---------- Bottom archive CTA ---------- */
.cec-archive-cta-section {
    padding: 0 0 84px;
}

.cec-wide-cta {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 34px;
    align-items: center;
    overflow: hidden;
    padding: 42px 46px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 0%, rgba(120, 168, 59, .15), transparent 28%),
        linear-gradient(135deg, #17447f 0%, #1f5fbf 100%);
    box-shadow: var(--cec-shadow);
}

.cec-wide-cta::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -135px;
    width: 270px;
    height: 270px;
    border: 36px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    pointer-events: none;
}

.cec-wide-cta h2,
.cec-wide-cta p {
    position: relative;
    z-index: 1;
    color: #fff;
}

.cec-wide-cta h2 {
    margin: 0 0 8px;
    font-size: clamp(27px, 3vw, 36px);
}

.cec-wide-cta p:not(.cec-cta-kicker) {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 1.65;
}

.cec-wide-cta .cec-cta-kicker {
    color: #cbe79d;
}

.cec-wide-cta .cec-button {
    position: relative;
    z-index: 1;
    border-color: #fff;
    background: #fff;
    color: var(--cec-blue-dark) !important;
}

.cec-wide-cta .cec-button:hover,
.cec-wide-cta .cec-button:focus-visible {
    border-color: #eef5fc;
    background: #eef5fc;
    color: var(--cec-blue-dark) !important;
}

/* ---------- Secondary archives and search ---------- */
.cec-secondary-archive .cec-archive-content {
    padding-top: 62px;
}

.cec-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 24px;
    font-size: 14px;
}

/* ---------- Pagination ---------- */
.cec-pagination {
    margin-top: 48px;
}

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

.cec-pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--cec-line);
    border-radius: 10px;
    background: #fff;
    color: var(--cec-blue);
    font-weight: 700;
    text-decoration: none;
}

.cec-pagination .page-numbers.current,
.cec-pagination .page-numbers:hover {
    border-color: var(--cec-blue);
    background: var(--cec-blue);
    color: #fff;
}

.cec-empty-state {
    padding: 52px;
    border: 1px solid var(--cec-line);
    border-radius: var(--cec-radius);
    background: var(--cec-soft);
    text-align: center;
}

.cec-empty-state h2 {
    margin-top: 0;
}

.cec-empty-state .cec-button {
    margin-top: 12px;
}

/* ---------- Focus visibility ---------- */
.cec-blog a:focus-visible,
.cec-blog button:focus-visible,
.cec-blog input:focus-visible {
    outline: 3px solid rgba(31, 95, 191, .28);
    outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .cec-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cec-feature-card {
        grid-template-columns: 1fr 1fr;
    }

    .cec-article-hero {
        padding: 62px 0 78px;
    }

    .cec-post-cta,
    .cec-wide-cta,
    .cec-coming-soon {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .cec-topic-bar-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .cec-topic-links {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .cec-feature-card {
        grid-template-columns: 1fr;
    }

    .cec-feature-card-image,
    .cec-feature-card-image img {
        min-height: 0;
    }

    .cec-feature-card-image {
        aspect-ratio: 16 / 10;
    }

    .cec-feature-card-content {
        padding: 30px 26px 34px;
    }
}

@media (max-width: 700px) {
    .cec-container {
        width: min(100% - 30px, 1180px);
    }

    .cec-card-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .cec-article-hero {
        padding: 46px 0 66px;
    }

    .cec-article-title {
        font-size: clamp(32px, 10vw, 45px);
    }

    .cec-article-meta {
        gap: 7px;
        font-size: 13px;
    }

    .cec-featured-wrap {
        margin-top: -36px;
    }

    .cec-featured-image {
        border-width: 5px;
        border-radius: 16px;
    }

    .cec-article-body-wrap {
        padding-top: 40px;
        padding-bottom: 58px;
    }

    .cec-article-content {
        font-size: 17px;
        line-height: 1.76;
    }

    .cec-post-cta {
        margin-top: 42px;
        padding: 26px 22px;
    }

    .cec-section-heading {
        align-items: start;
        flex-direction: column;
    }

    .cec-section-heading h2 {
        font-size: 31px;
    }

    .cec-archive-hero--main {
        padding: 52px 0 88px;
    }

    .cec-archive-hero--secondary {
        padding: 50px 0 52px;
    }

    .cec-archive-hero h1 {
        font-size: clamp(38px, 11vw, 50px);
    }

    .cec-archive-intro {
        font-size: 16px;
    }

    .cec-featured-section {
        margin-top: -45px;
        padding-bottom: 34px;
    }

    .cec-feature-card {
        border-radius: 18px;
    }

    .cec-blog-search {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 7px;
        border-radius: 18px;
    }

    .cec-blog-search input[type="search"],
    .cec-blog-search button {
        border-radius: 12px;
    }

    .cec-blog-search button {
        min-height: 44px;
    }

    .cec-topic-bar {
        padding-bottom: 8px;
    }

    .cec-archive-content,
    .cec-related {
        padding: 44px 0 58px;
    }

    .cec-coming-soon,
    .cec-wide-cta {
        padding: 30px 24px;
    }

    .cec-archive-cta-section {
        padding-bottom: 58px;
    }

    .cec-card-content {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cec-post-card,
    .cec-card-image img,
    .cec-feature-card-image img,
    .cec-button,
    .cec-topic-links a {
        transition: none;
    }
}
