/* ==========================================================================
   News & Insights — modern blog redesign
   --------------------------------------------------------------------------
   Loaded ONLY on blog contexts (is_home / single post / post archives) via
   edge_child_enqueue_news_styles() in functions.php, after edge-style and
   edge-responsive so source order favours these rules. Uses the site's
   brand tokens (defined in style.css :root). The sidebar is already hidden
   site-wide by the .ark-fullwidth layout; this file styles the listing as a
   card grid and single posts as a focused reading column.
   ========================================================================== */

/* Belt-and-suspenders: keep the main column full width in blog contexts */
.blog #primary,
.archive #primary,
.single-post #primary { width: 100% !important; float: none !important; }
.blog #main,
.archive #main,
.single-post #main { max-width: none !important; width: 100% !important; margin: 0 !important; float: none !important; }

/* ==========================================================================
   LISTING (/news/ + post archives) — responsive card grid
   ========================================================================== */
.blog #main.site-main,
.archive #main.site-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    align-items: stretch;
}

/* Injected header (loop_start) spans the whole grid */
.ark-news-head {
    grid-column: 1 / -1;
    text-align: center;
    max-width: 720px;
    margin: 8px auto 12px;
    padding: 0 16px;
}
.ark-news-head__title {
    font-family: var(--ark-font) !important;
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    color: var(--ark-grey-900);
    margin: 0;
    padding: 0;
}
.ark-news-head__subtitle {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ark-grey-500);
    margin: 10px 0 0;
}
.ark-news-head__divider {
    width: 56px;
    height: 3px;
    background: var(--ark-green);
    border: 0;
    border-radius: 3px;
    margin: 18px auto 0;
}

/* Card = flex column so the Read More footer sits flush at the bottom */
.blog #main .post,
.archive #main .post {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0 !important;          /* grid gap owns the spacing */
    width: auto !important;
    float: none !important;
}

/* Featured image — uniform aspect ratio across the grid */
.blog .post-image-content,
.archive .post-image-content { margin: 0; }
.blog .post-featured-image,
.archive .post-featured-image { border-radius: 0; }
.blog .post-featured-image a,
.archive .post-featured-image a { display: block; line-height: 0; }
.blog .post-featured-image img,
.archive .post-featured-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

/* Card header / title / meta */
.blog .entry-header,
.archive .entry-header { padding: 20px 22px 0; }
.blog .entry-title,
.archive .entry-title {
    font-size: 1.2rem;
    line-height: 1.35;
    margin: 0;
    padding: 8px 0 6px;
}

/* Category pill (sits above the title in the markup) */
.blog .entry-header .cat-links a,
.archive .entry-header .cat-links a {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ark-green);
    background: var(--ark-green-light);
    padding: 3px 10px;
    border-radius: 999px;
}
.blog .entry-header .posted-on,
.archive .entry-header .posted-on { font-size: 12.5px; color: var(--ark-grey-500); }

/* Excerpt grows to fill, pushing the footer down */
.blog #main .entry-content,
.archive #main .entry-content {
    padding: 0 22px 14px;
    flex: 1 1 auto;
    color: var(--ark-grey-600);
}

/* Footer — keep the Read More, drop the author/comments clutter on cards */
.blog .entry-footer,
.archive .entry-footer {
    padding: 0 22px 22px;
    margin-top: auto;
    border: 0;
}
.blog .entry-footer .entry-meta,
.archive .entry-footer .entry-meta { display: none; }

/* Pagination */
.blog .pagination,
.archive .pagination {
    grid-column: 1 / -1;
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   SINGLE POST — focused, centered reading column
   ========================================================================== */
:root { --ark-read: 760px; }

/* Hero header (the title is rendered in .page-header by header.php) */
.single-post .page-header {
    max-width: var(--ark-read);
    margin: 8px auto 0;
    padding: 4px 20px 0;
    text-align: center;
    border: 0;
    display: flex;
    flex-direction: column-reverse;   /* breadcrumb above the title */
    gap: 14px;
}
.single-post .page-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0;
}
.single-post .breadcrumb {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ark-grey-400);
}

/* Strip the card chrome off the single article */
.single-post #main .post {
    background: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    box-shadow: none !important;
    transform: none !important;
}

/* Meta row (author · date) centered under the title */
.single-post .entry-header { padding: 0; }
.single-post .entry-header .entry-meta {
    max-width: var(--ark-read);
    margin: 14px auto 0;
    text-align: center;
    font-size: 13px;
    color: var(--ark-grey-500);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.single-post .entry-header .entry-meta i { color: var(--ark-green); margin-right: 5px; }

/* Featured image hero (enabled via edge_single_post_image = on) */
.single-post .post-image-content {
    max-width: 900px;
    margin: 22px auto 0;
    padding: 0 20px;
}
.single-post .post-featured-image {
    border-radius: var(--ark-radius-lg);
    overflow: hidden;
    box-shadow: var(--ark-shadow-md);
}
.single-post .post-featured-image img { display: block; width: 100%; height: auto; }
.single-post .post-featured-image:hover img { transform: none; }  /* no zoom on the article */

/* Reading column */
.single-post .entry-content {
    max-width: var(--ark-read);
    margin: 28px auto 0;
    padding: 0 20px;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--ark-grey-700);
}
.single-post .entry-content > *:first-child { margin-top: 0; }
.single-post .entry-content h2 { font-size: 1.6rem; margin: 1.7em 0 0.5em; }
.single-post .entry-content h3 { font-size: 1.3rem; margin: 1.5em 0 0.4em; }
.single-post .entry-content p { margin-bottom: 1.3em; }
.single-post .entry-content a { color: var(--ark-green); text-decoration: underline; text-underline-offset: 2px; }
.single-post .entry-content a:hover { color: var(--ark-green-dark); }

/* Replace the parent theme's serif drop cap (.post:first-child .entry-content
   p:first-child:first-letter — 80px Playfair with a border) with a clean modern
   lead-in. MUST target p:first-child::first-letter — the parent's exact
   pseudo-element; resetting .entry-content::first-letter (the old child-theme
   attempt) is a no-op when .entry-content's first child is a block <p>. */
.blog .entry-content p:first-child::first-letter,
.archive .entry-content p:first-child::first-letter,
.single-post .entry-content p:first-child::first-letter {
    float: none !important;
    display: inline !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    background: none !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Lead-in (standfirst) first paragraph */
.single-post .entry-content > p:first-child {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--ark-grey-800);
}

/* Lists */
.single-post .entry-content ul,
.single-post .entry-content ol { margin: 0 0 1.3em 1.25em; padding: 0; }
.single-post .entry-content li { margin-bottom: 0.5em; }

/* Images / figures inside the body */
.single-post .entry-content .wp-block-image { margin: 1.8em auto; }
.single-post .entry-content .wp-block-image img { border-radius: var(--ark-radius-lg); box-shadow: var(--ark-shadow-sm); }
.single-post .entry-content figcaption { text-align: center; font-size: 13px; color: var(--ark-grey-500); margin-top: 8px; }

/* Blockquote */
.single-post .entry-content blockquote {
    border-left: 3px solid var(--ark-green);
    background: var(--ark-grey-50);
    margin: 1.6em 0;
    padding: 14px 20px;
    border-radius: 0 var(--ark-radius) var(--ark-radius) 0;
}

/* CTA buttons (Gutenberg) — brand styled */
.single-post .entry-content .wp-block-buttons { margin: 1.9em 0; gap: 12px; flex-wrap: wrap; }
.single-post .entry-content .wp-block-button__link {
    font-family: var(--ark-font) !important;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    background-color: var(--ark-green);
    color: var(--ark-white);
    border: 2px solid var(--ark-green);
    border-radius: var(--ark-radius);
    padding: 12px 26px;
    text-decoration: none !important;
    transition: all var(--ark-transition);
}
.single-post .entry-content .wp-block-button__link:hover {
    background-color: var(--ark-green-dark);
    border-color: var(--ark-green-dark);
    color: var(--ark-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 187, 49, 0.3);
}
.single-post .entry-content .is-style-outline .wp-block-button__link {
    background: transparent;
    color: var(--ark-green);
}
.single-post .entry-content .is-style-outline .wp-block-button__link:hover {
    background: var(--ark-green);
    color: var(--ark-white);
}

/* Footer — category / tag pills, centered to the reading width */
.single-post .entry-footer {
    max-width: var(--ark-read);
    margin: 30px auto 0;
    padding: 22px 20px 0;
    border-top: 1px solid var(--ark-grey-200);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-size: 13px;
    color: var(--ark-grey-500);
}
.single-post .entry-footer .cat-links a,
.single-post .entry-footer .tag-links a {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ark-grey-700);
    background: var(--ark-grey-100);
    padding: 4px 12px;
    border-radius: 999px;
    transition: all var(--ark-transition);
}
.single-post .entry-footer .cat-links a:hover,
.single-post .entry-footer .tag-links a:hover { background: var(--ark-green-light); color: var(--ark-green-dark); }

/* Previous / next post navigation as cards */
.single-post .default-wp-page {
    max-width: var(--ark-read);
    margin: 36px auto 0;
    padding: 0 20px;
    list-style: none;
    display: flex;
    gap: 16px;
}
.single-post .default-wp-page li { flex: 1; margin: 0; }
.single-post .default-wp-page li.next { text-align: right; }
.single-post .default-wp-page a {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--ark-grey-200);
    border-radius: var(--ark-radius);
    color: var(--ark-grey-800);
    font-weight: 600;
    line-height: 1.4;
    transition: all var(--ark-transition);
}
.single-post .default-wp-page a:hover {
    border-color: var(--ark-green);
    color: var(--ark-green);
    box-shadow: var(--ark-shadow-sm);
}
.single-post .default-wp-page .meta-nav { color: var(--ark-grey-400); }

/* Comments block — keep it within the reading column */
.single-post #comments { max-width: var(--ark-read); margin: 40px auto 0; padding: 0 20px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 782px) {
    .single-post .page-title { font-size: 2rem; }
    .single-post .entry-content { font-size: 1rem; line-height: 1.75; }
    .single-post .entry-content > p:first-child { font-size: 1.1rem; }
    .ark-news-head__title { font-size: 1.85rem; }
}
@media (max-width: 600px) {
    .blog #main.site-main,
    .archive #main.site-main { grid-template-columns: 1fr; gap: 22px; }
    .single-post .default-wp-page { flex-direction: column; }
    .single-post .default-wp-page li.next { text-align: left; }
}
