/* Colourbill custom styles — v2.5 */

/* ============================================================
   Sticky Header — branding scrolls away, nav stays
   ============================================================ */

header#masthead {
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Hide branding once scrolled; keep nav/hamburger visible */
header#masthead.shrunk > .content-wrap {
    display: none;
}

header#masthead.shrunk {
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    background: #000 !important;   /* ensure transparent logo areas show black, not white */
}

/* Anchor offset — JS overrides this dynamically once scroll state is known */
#color-technology,
#blog {
    scroll-margin-top: 60px;
}

/* ============================================================
   Mobile menu: hamburger icon, no "Menu" text, compact panel
   ============================================================ */

/* Replace "Menu" text with ☰ icon — keep original padding/layout intact */
.super-menu .toggle-mobile-menu,
.smenu-hide.toggle-mobile-menu {
    font-size: 0 !important;
}
.super-menu .toggle-mobile-menu::before,
.smenu-hide.toggle-mobile-menu::before {
    content: "☰";
    font-size: 22px;
    display: inline-block;
    position: static;    /* Override theme's position:absolute that pushes icon below bar */
    line-height: inherit;
    font-family: inherit;
}

/* Prevent page from shifting right / jumping to top when mobile menu opens.
   Theme default translates #page by 70% and sets position:fixed, which loses
   scroll position on close. Override to keep the page stationary. */
.mobile-menu-active #page {
    position: static !important;
    transform: none !important;
    right: auto !important;
}

/* Hide duplicate ☰ inside the slide-in panel — the one in .super-menu stays put */
#smobile-menu .smenu-hide.toggle-mobile-menu {
    display: none !important;
}

/* Narrow the slide-in menu panel to fit content */
#smobile-menu {
    width: auto !important;
}
#smobile-menu .content-wrap,
#smobile-menu .primary-menu ul {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}
#smobile-menu.show .main-navigation {
    width: auto !important;
    float: none !important;
    min-width: 120px;
}
#smobile-menu.show .main-navigation ul li {
    width: auto !important;
}
#smobile-menu.show .main-navigation ul li a {
    white-space: nowrap;
}

/* ============================================================
   Logos (injected via JS)
   ============================================================ */

/* All logo variants hidden by default; shown selectively below */
.cb-logo--banner,
.cb-logo--shrunk,
.cb-logo--mobile {
    display: none;
}

/* ── Desktop banner logo ── */
@media screen and (min-width: 1024px) {
    /* Flex row: [logo][site title + tagline], centred as a pair in the banner */
    header#masthead > .content-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    /* .site-branding has width:100% in the theme; override so it only takes
       its natural width inside the flex row, keeping logo tight against text */
    header#masthead > .content-wrap .site-branding {
        width: auto !important;
        margin: 0 !important;
        text-align: left;
    }
    .cb-logo--banner {
        display: block;
        /* height matched dynamically by JS to .site-branding height */
        height: auto;
        width: auto;
        max-width: 200px;
        object-fit: contain;
        flex-shrink: 0;
    }
}

/* ── Shrunk-header logo (desktop, black nav bar only) ── */
@media screen and (min-width: 1024px) {
    header#masthead.shrunk {
        display: flex;
        align-items: center;
    }
    header#masthead.shrunk .cb-logo--shrunk {
        display: block;
        height: 42px;
        width: auto;
        max-width: 180px;
        object-fit: contain;
        padding: 4px 14px;
        flex-shrink: 0;
        /* White bg removed via JS canvas; CSS filter is fallback only */
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    /* Nav fills remaining space so items can be right-justified */
    header#masthead.shrunk nav#primary-site-navigation {
        flex: 1;
    }
}

/* ── Right-justify nav items on desktop ── */
@media screen and (min-width: 1024px) {
    nav#primary-site-navigation > .content-wrap {
        text-align: right;
    }
    nav#primary-site-navigation .center-main-menu {
        display: flex;
        justify-content: flex-end;
    }
}

/* ── Mobile super-menu bar ── */
@media screen and (max-width: 1023px) {
    /* Relative container so ☰ can be absolutely positioned at right edge */
    .super-menu {
        position: relative;
    }
    .super-menu-inner {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 0 16px;
        display: flex;
        align-items: center;
        min-height: 44px;  /* keeps bar visible when ☰ is position:absolute (out of flow) */
    }
    /* ☰ pinned to right edge via absolute positioning — bypasses theme flex/width conflicts */
    .super-menu .toggle-mobile-menu {
        position: absolute !important;
        right: 16px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        margin: 0 !important;
        left: auto !important;
    }
    /* Mobile logo: hidden while banner visible; transparent-bg served by PHP/GD */
    .cb-logo--mobile {
        display: none;
        height: 26px;
        width: auto;
        max-width: 120px;
        object-fit: contain;
        flex-shrink: 0;
    }
    /* Show only once banner has scrolled away (.shrunk state) */
    header#masthead.shrunk .cb-logo--mobile {
        display: block !important;
    }
    /* Slide-in panel: open from RIGHT side, positioned below the sticky bar.
       Top is set dynamically by JS to header.offsetHeight. */
    #smobile-menu {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }
    #smobile-menu.show {
        left: auto !important;
        transform: translateX(0) !important;
    }
}

/* ============================================================
   Mobile menu: shorten "Color Technology" to "Color"
   ============================================================ */

@media screen and (max-width: 1023px) {
    li.menu-color-technology > a {
        font-size: 0 !important;
        letter-spacing: 0;
    }
    li.menu-color-technology > a::after {
        content: "Color";
        font-size: 14px;
        letter-spacing: normal;
    }
}

/* Post-specific image sizing */
.postid-68 .featured-thumbnail img {
    width: 33%;
    height: auto;
}

/* ============================================================
   Homepage Bio Card
   ============================================================ */

.fp-bio-section {
    margin-bottom: 0;
}

.fp-bio-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: #fff;
    border: 1px solid #c4d0e0;
    border-left: 4px solid #5a6e8c;
    padding: 24px;
    margin-bottom: 44px;
    border-radius: 3px;
}

.fp-bio-card__photo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 25%;
    border: 2px solid #c4d0e0;
}

.fp-bio-card__name {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0 0 4px;
    color: #2c3e5a;
}

.fp-bio-card__role {
    font-size: 0.82em;
    color: #5a6e8c;
    margin: 0 0 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.fp-bio-card__text {
    font-size: 0.92em;
    color: #444;
    line-height: 1.6;
    margin: 0 0 14px;
}

.fp-bio-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.fp-bio-card__link {
    font-size: 0.88em;
    color: #2c3e5a !important;
    text-decoration: none !important;
    border-bottom: 1px solid #5a6e8c;
    padding-bottom: 1px;
}

.fp-bio-card__link:hover {
    color: #5a6e8c !important;
}

.fp-bio-card__contact {
    font-size: 0.88em;
    background: #2c3e5a;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: background 0.2s;
}

.fp-bio-card__contact:hover {
    background: #5a6e8c;
}

@media screen and (max-width: 600px) {
    .fp-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .fp-bio-card__links {
        justify-content: center;
    }
}

/* ============================================================
   Contact Modal
   ============================================================ */

#cb-contact-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#cb-contact-modal[hidden] {
    display: none;
}

#cb-contact-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

#cb-contact-dialog {
    position: relative;
    background: #fff;
    border-radius: 4px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

#cb-contact-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 4px;
}

#cb-contact-close:hover {
    color: #2c3e5a;
}

#cb-contact-title {
    margin: 0 0 2px;
    font-size: 1.1em;
    color: #2c3e5a;
}

.cb-contact-subtitle {
    font-size: 0.85em;
    color: #888;
    margin: 0 0 18px;
}

#cb-contact-form label {
    display: block;
    font-size: 0.88em;
    font-weight: 700;
    color: #2c3e5a;
    margin-bottom: 4px;
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#cb-contact-form input,
#cb-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c4d0e0;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 0.92em;
    font-family: inherit;
    color: #222;
}

#cb-contact-form input:focus,
#cb-contact-form textarea:focus {
    outline: 2px solid #5a6e8c;
    border-color: #5a6e8c;
}

#cb-contact-submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    background: #2c3e5a;
    color: #fff;
    border: none;
    padding: 10px 0;
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
}

#cb-contact-submit:hover:not(:disabled) {
    background: #5a6e8c;
}

#cb-contact-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

#cb-contact-status {
    font-size: 0.88em;
    margin-top: 10px;
    min-height: 1.4em;
}

.cb-contact-ok  { color: #2a7a3b; }
.cb-contact-err { color: #b00020; }

/* ============================================================
   Front Page Sections
   ============================================================ */

.fp-section {
    width: 100%;
    box-sizing: border-box;
}

.fp-section-heading {
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 3px solid #000;
    padding-bottom: 10px;
    margin: 0 0 28px;
}

/* Color Technology: distinct boxed section */
.fp-section-colortech {
    background: #eef2f7;
    border: 2px solid #5a6e8c;
    border-radius: 4px;
    padding: 28px 28px 32px;
    margin-bottom: 44px;
    box-shadow: 0 2px 8px rgba(44, 62, 90, 0.08);
}

.fp-section-heading--colortech {
    border-bottom-color: #5a6e8c;
    color: #2c3e5a;
}

/* Blog section */
.fp-section-blog {
    padding-top: 4px;
}

/* chardata app card */
.fp-app-card {
    background: #fff;
    border: 1px solid #c4d0e0;
    border-left: 4px solid #5a6e8c;
    padding: 20px 22px;
    margin-bottom: 28px;
    border-radius: 3px;
}

.fp-app-card__title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2c3e5a;
}

.fp-app-card__desc {
    font-size: 0.92em;
    color: #444;
    margin: 0 0 14px;
    line-height: 1.6;
}

.fp-app-card__link {
    display: inline-block;
    background: #2c3e5a;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 18px;
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 2px;
    transition: background 0.2s;
}

.fp-app-card__link:hover {
    background: #5a6e8c;
}

.fp-app-card__repo {
    display: inline-block;
    margin-left: 12px;
    font-size: 0.88em;
    color: #2c3e5a !important;
    text-decoration: none !important;
    border-bottom: 1px solid #5a6e8c;
    padding-bottom: 1px;
}

.fp-app-card__repo:hover {
    color: #5a6e8c !important;
}

.fp-no-posts {
    color: #666;
    font-style: italic;
}

/* ============================================================
   chardata Release Notes Card
   ============================================================ */

.fp-release-card {
    background: #fff;
    border: 1px solid #c4d0e0;
    border-left: 4px solid #2c3e5a;
    padding: 20px 22px;
    margin-bottom: 28px;
    border-radius: 3px;
}

.fp-release-card__title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2c3e5a;
}

/* Each release is a <details> element; summary = one-line header */
.fp-release-item {
    padding: 10px 0;
    border-top: 1px solid #e0e6ef;
}

.fp-release-item:first-child {
    border-top: none;
}

/* Latest release: lightly shaded */
.fp-release-item--latest {
    background: #f4f7fb;
    border: 1px solid #d0daea;
    border-top: 1px solid #d0daea;
    border-radius: 3px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.fp-release-item__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    padding: 2px 0;
    user-select: none;
}

.fp-release-item__summary::-webkit-details-marker { display: none; }

.fp-release-item__summary::before {
    content: "▶";
    font-size: 0.65em;
    color: #5a6e8c;
    margin-right: 2px;
    flex-shrink: 0;
    align-self: center;
}

details[open] > .fp-release-item__summary::before {
    content: "▼";
}

.fp-release-item__body,
.fp-release-item__link {
    margin-top: 10px;
}

.fp-release-item__tag {
    font-size: 0.82em;
    font-weight: 700;
    background: #2c3e5a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.04em;
}

.fp-release-item__date {
    font-size: 0.82em;
    color: #666;
}

.fp-release-item__name {
    font-size: 0.88em;
    color: #2c3e5a;
    font-weight: 600;
}

.fp-release-item__body {
    font-size: 0.88em;
    color: #444;
    line-height: 1.6;
    margin-bottom: 10px;
}

.fp-release-item__body p {
    margin: 0 0 6px;
}

.fp-release-item__body ul {
    margin: 0 0 6px;
    padding-left: 1.4em;
}

.fp-release-item__body li {
    margin-bottom: 3px;
}

.fp-release-item__body code {
    background: #eef2f7;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.95em;
}

.fp-release-item__link {
    font-size: 0.82em;
    color: #2c3e5a !important;
    text-decoration: none !important;
    border-bottom: 1px solid #5a6e8c;
    padding-bottom: 1px;
}

.fp-release-item__link:hover {
    color: #5a6e8c !important;
}

/* "Older releases" collapsible */
.fp-release-older {
    margin-top: 8px;
}

.fp-release-older__toggle {
    font-size: 0.85em;
    color: #2c3e5a;
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
    user-select: none;
}

.fp-release-older__toggle::-webkit-details-marker {
    display: none;
}

.fp-release-older__toggle::before {
    content: "▶ ";
    font-size: 0.75em;
}

details[open] .fp-release-older__toggle::before {
    content: "▼ ";
}
