/*
Theme Name: COBOD Connect Block
Theme URI: https://connect.cobod.com/
Author: COBOD
Description: A standard WordPress block theme for the private COBOD Connect knowledge portal.
Version: 1.1.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: cobod-connect-block
*/

:root {
    --cobod-navy: #071e33;
    --cobod-navy-soft: #0d2c47;
    --cobod-blue: #0877e8;
    --cobod-blue-light: #50a9ff;
    --cobod-ink: #0b1f31;
    --cobod-muted: #607382;
    --cobod-line: #d7e2e9;
    --cobod-paper: #f4f7f9;
    --cobod-white: #fff;
    --cobod-shadow: 0 16px 38px rgba(0, 31, 56, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cobod-paper); color: var(--cobod-ink); }
a { text-underline-offset: .16em; }
.wp-site-blocks { min-height: 100vh; }

/* Header and footer remain ordinary editable Site Editor template parts. */
.cobod-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--cobod-line);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 5px 18px rgba(0, 31, 56, .05);
    backdrop-filter: blur(10px);
}
.admin-bar .cobod-site-header { top: 32px; }
.cobod-site-header .wp-block-site-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.cobod-site-header .wp-block-site-title a { text-decoration: none; }
.cobod-site-header .wp-block-navigation { font-size: .84rem; font-weight: 750; }
.cobod-site-header .wp-block-navigation-item__content { padding-block: .45rem; }
.cobod-site-header .wp-block-navigation-item__content:hover { color: var(--cobod-blue); }
.cobod-site-header .wp-block-loginout a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: .6rem 1rem;
    border-radius: 5px;
    background: var(--cobod-blue);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}
.cobod-site-footer { margin-top: 4rem; }
.cobod-site-footer a { color: #d7ebff; }
.cobod-site-footer .wp-block-site-title { font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.cobod-site-footer .wp-block-site-tagline { max-width: 560px; color: #b7cad9; }

/* Page and post presentation. */
.cobod-title-hero,
.cobod-article-hero,
.cobod-home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--cobod-navy);
}
.cobod-title-hero .wp-block-cover__image-background,
.cobod-article-hero .wp-block-cover__image-background,
.cobod-home-hero .wp-block-cover__image-background {
    filter: saturate(.82) contrast(1.06);
}
.cobod-title-hero .wp-block-cover__inner-container,
.cobod-article-hero .wp-block-cover__inner-container,
.cobod-home-hero .wp-block-cover__inner-container { position: relative; z-index: 1; }
.cobod-article-hero .taxonomy-category a {
    color: var(--cobod-blue-light);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-decoration: none;
    text-transform: uppercase;
}
.cobod-article-hero .wp-block-post-title { max-width: 850px; }
.cobod-article-hero .wp-block-post-excerpt { max-width: 720px; color: #c8d7e3; }
.cobod-article-shell { margin-top: -2rem; position: relative; z-index: 2; }
.cobod-article-shell > .wp-block-post-featured-image {
    overflow: hidden;
    margin: 0 0 1.25rem;
    border-radius: 10px;
    background: #e5edf3;
    box-shadow: var(--cobod-shadow);
}
.cobod-article-shell > .wp-block-post-featured-image img { width: 100%; max-height: 540px; object-fit: cover; }
.article-body,
.cobod-page-body {
    padding: clamp(1.4rem, 4vw, 2.45rem);
    border: 1px solid var(--cobod-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 31, 56, .06);
    font-size: 1rem;
    line-height: 1.72;
}
.article-body > :first-child,
.cobod-page-body > :first-child { margin-top: 0; }
.article-body img,
.article-body video,
.cobod-page-body img { max-width: 100%; height: auto; }
.article-body figcaption { color: var(--cobod-muted); font-size: .75rem; }
.article-body a { overflow-wrap: anywhere; }

/* Home hero and discovery cards. */
.home main { margin-top: 0; }
.home .wp-block-post-content { margin-top: 0; }
.home .cobod-home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(410px, 52vw, 560px);
    padding-block: clamp(3.6rem, 8vw, 5.4rem) !important;
    background: var(--cobod-navy) !important;
}
.home .cobod-home-hero h1 {
    max-width: 800px;
    margin-block: .8rem 1rem;
    font-size: clamp(2.7rem, 6vw, 4.3rem) !important;
    font-weight: 850;
    letter-spacing: -.04em;
    line-height: 1.03;
    color: #fff;
}
.home .cobod-home-hero p:first-child {
    color: var(--cobod-blue-light);
    font-size: .72rem !important;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.home .cobod-home-hero p:last-of-type { max-width: 680px; color: #d8e5ef; }
.home .wp-block-search { max-width: 680px; margin-top: 1.8rem; }
.home .wp-block-search__inside-wrapper,
.page-id-1410 .wp-block-search__inside-wrapper {
    overflow: hidden;
    padding: 7px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}
.home .wp-block-search__input,
.page-id-1410 .wp-block-search__input { border: 0; outline: 0; }
.home .wp-block-post-content > .wp-block-group:nth-child(2) {
    width: min(1220px, calc(100% - 48px));
    margin-inline: auto;
    padding-block: clamp(2.7rem, 6vw, 4.2rem) !important;
}

/* Query Loops are the normal WordPress article-card system. */
.home .wp-block-post-template,
.page-id-1410 .wp-block-post-template,
.cobod-card-query .wp-block-post-template {
    gap: 1.25rem;
}
.cobod-homepage-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}
.cobod-homepage-card-grid > .wp-block-query,
.cobod-homepage-card-grid > .wp-block-query > .wp-block-post-template {
    display: contents;
}
.cobod-homepage-card-grid > .wp-block-query > .wp-block-post-template > li {
    width: auto !important;
}
.home .wp-block-post-template > li,
.page-id-1410 .wp-block-post-template > li,
.cobod-card-query .wp-block-post-template > li {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cobod-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 31, 56, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home .wp-block-post-template > li:hover,
.page-id-1410 .wp-block-post-template > li:hover,
.cobod-card-query .wp-block-post-template > li:hover {
    transform: translateY(-3px);
    border-color: #91bfe5;
    box-shadow: var(--cobod-shadow);
}
.home .wp-block-post-template .wp-block-post-featured-image,
.page-id-1410 .wp-block-post-template .wp-block-post-featured-image,
.cobod-card-query .wp-block-post-template .wp-block-post-featured-image { margin: 0; background: #dce8ef; }
.home .wp-block-post-template .wp-block-post-featured-image img,
.page-id-1410 .wp-block-post-template .wp-block-post-featured-image img,
.cobod-card-query .wp-block-post-template .wp-block-post-featured-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.home .wp-block-post-template .wp-block-post-title,
.page-id-1410 .wp-block-post-template .wp-block-post-title,
.cobod-card-query .wp-block-post-template .wp-block-post-title { padding: 1.25rem 1.25rem 0; margin: 0; font-size: 1.15rem !important; line-height: 1.28; }
.home .wp-block-post-template .wp-block-post-title a,
.page-id-1410 .wp-block-post-template .wp-block-post-title a,
.cobod-card-query .wp-block-post-template .wp-block-post-title a { text-decoration: none; }
.home .wp-block-post-template .wp-block-post-excerpt,
.page-id-1410 .wp-block-post-template .wp-block-post-excerpt,
.cobod-card-query .wp-block-post-template .wp-block-post-excerpt { padding: 0 1.25rem 1.25rem; margin-top: .65rem; color: var(--cobod-muted); font-size: .83rem; line-height: 1.55; }
.home .wp-block-post-template .wp-block-post-excerpt__more-link,
.page-id-1410 .wp-block-post-template .wp-block-post-excerpt__more-link,
.cobod-card-query .wp-block-post-template .wp-block-post-excerpt__more-link { color: var(--cobod-blue); font-weight: 800; text-decoration: none; }

/* Library. */
.page-id-1410 .cobod-page-body { max-width: 1220px; }
.page-id-1410 .wp-block-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: 0;
    list-style: none;
}
.page-id-1410 .wp-block-categories-list li {
    padding: .55rem .75rem;
    border: 1px solid var(--cobod-line);
    border-radius: 999px;
    background: #f8fafb;
    color: #36566e;
    font-size: .78rem;
    font-weight: 750;
}
.page-id-1410 .wp-block-categories-list a { text-decoration: none; }

/* Core-block presentation styles available from the block editor. */
.is-style-cobod-card {
    padding: 1.35rem;
    border: 1px solid var(--cobod-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 31, 56, .06);
}
.is-style-cobod-panel {
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border-left: 5px solid var(--cobod-blue);
    border-radius: 7px;
    background: #eef7fd;
}
.is-style-cobod-stat {
    padding: 1rem;
    border: 1px solid #cddfea;
    border-radius: 7px;
    background: rgba(255,255,255,.84);
    text-align: center;
}
.is-style-cobod-framed {
    overflow: hidden;
    border: 1px solid var(--cobod-line);
    border-radius: 9px;
    background: #e7eef3;
    box-shadow: 0 12px 28px rgba(0, 31, 56, .1);
}

/* Converted legacy resource links remain ordinary core Paragraph blocks. */
.article-body p.cobod-card-link {
    margin-block: .55rem;
    border: 1px solid #d6e1e8;
    border-radius: 7px;
    background: #fafcfd;
    color: var(--cobod-muted);
    font-size: .75rem;
    line-height: 1.4;
    transition: background .16s ease, border-color .16s ease;
}
.article-body p.cobod-card-link:hover { border-color: #79b6eb; background: #f1f8fd; }
.article-body p.cobod-card-link a { display: inline-block; padding: .8rem .2rem .8rem .9rem; color: var(--cobod-ink); text-decoration: none; }
.article-body p.cobod-card-link strong { font-size: .8rem; }
.article-body .cobod-iframe { overflow: hidden; border: 1px solid var(--cobod-line); border-radius: 8px; }
.article-body .cobod-iframe iframe { display: block; width: 100%; border: 0; }

/* Galleries and media. */
.postid-297 .article-body > .wp-block-group:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.postid-297 .article-body > .wp-block-group:nth-child(2) > .wp-block-image {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--cobod-line);
    border-radius: 7px;
    background: #fff;
}
.postid-297 .article-body > .wp-block-group:nth-child(2) > .wp-block-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.postid-297 .article-body > .wp-block-group:nth-child(2) > .wp-block-image figcaption { padding: .55rem .7rem; margin: 0; }

/* Contact support stays editable as ordinary Columns/Image/Paragraph blocks. */
.postid-258 .article-body iframe { display: block; width: 100% !important; max-width: 420px; height: 600px !important; margin-inline: auto; }
.postid-258 .article-body .wp-block-columns { align-items: flex-start; gap: 2rem; }
.postid-258 .article-body > .wp-block-group:first-child .wp-block-image { margin-top: 0; }

/* Archive/search cards. */
.cobod-archive-shell { padding-block: clamp(2.5rem, 6vw, 4rem); }
.cobod-archive-shell .wp-block-query-pagination { margin-top: 2rem; }
.cobod-archive-shell .wp-block-query-pagination a { font-weight: 800; text-decoration: none; }

@media (max-width: 900px) {
    .admin-bar .cobod-site-header { top: 46px; }
    .cobod-site-header .wp-block-group.alignwide { gap: .75rem; }
    .home .wp-block-post-template,
    .page-id-1410 .wp-block-post-template,
    .cobod-card-query .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .cobod-homepage-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .postid-297 .article-body > .wp-block-group:nth-child(2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
    .cobod-site-header { position: relative; top: auto !important; }
    .cobod-site-header .wp-block-site-title { font-size: 1rem; }
    .cobod-site-header .wp-block-loginout a { min-height: 36px; padding: .5rem .72rem; }
    .home .wp-block-post-template,
    .page-id-1410 .wp-block-post-template,
    .cobod-card-query .wp-block-post-template,
    .postid-297 .article-body > .wp-block-group:nth-child(2) { grid-template-columns: 1fr !important; }
    .cobod-homepage-card-grid { grid-template-columns: 1fr; }
    .cobod-article-shell { margin-top: -1rem; }
    .article-body,
    .cobod-page-body { border-radius: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
