/*
Theme Name: Jim Kubicek (McMaster)
Description: Industrial-catalog styling modeled on the McMaster-Carr website. Alternate theme for jimkubicek.com.
Version: 1.0.0
Text Domain: jims
*/

:root {
    /* McMaster-Carr palette */
    --green: #363;            /* headings, rules, masthead */
    --green-logo: #346734;
    --green-hover: #3c773c;
    --green-active: #1d591d;
    --green-tint: #edf2ed;

    --yellow: #ffe600;        /* selected nav item */
    --yellow-hover: #ffffb5;  /* nav hover */
    --yellow-button: #fed700;
    --yellow-button-hover: #fec914;

    --ink: #333;
    --ink-strong: #000;
    --ink-secondary: #666;
    --ink-muted: #888;
    --link: #069;
    --focus: #49d;

    --rule: #999;
    --rule-light: #ccc;
    --rule-faint: #eee;
    --panel: #f5f5f5;
    --background: #fff;

    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --arial: Arial, Helvetica, sans-serif;
    --condensed: "Futura-CondensedExtraBold", "Futura Condensed ExtraBold", "Futura-CondensedMedium", "Avenir Next Condensed", "Arial Narrow", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --nav-width: 195px;
}

/* ---------- Reset & base ---------- */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background: var(--background);
    color: var(--ink);
}

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: normal 12px/1.3 var(--arial);
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 1px solid var(--focus);
    outline-offset: 1px;
}

::selection {
    background: var(--yellow);
    color: var(--ink-strong);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ---------- Masthead ---------- */

.masthead {
    padding: 14px 20px 0;
    border-bottom: 1px solid var(--rule-light);
}

.masthead-top {
    display: flex;
    align-items: center;
    gap: 28px;
}

.masthead-logo {
    flex: 0 0 auto;
    font-family: var(--condensed);
    font-weight: 800;
    font-stretch: condensed;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--green-logo);
}

.masthead-logo:hover {
    text-decoration: none;
}

.masthead-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0;
}

.searchbar {
    width: 100%;
    height: 32px;
    padding: 2px 36px 0 7px;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: 13px var(--arial);
    -webkit-appearance: none;
    appearance: none;
}

.searchbar::placeholder {
    color: var(--ink-muted);
}

.searchbar::-webkit-search-cancel-button {
    display: none;
}

.searchbar-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.searchbar-button:hover {
    color: var(--ink);
}

.masthead-top-right {
    margin-left: auto;
    white-space: nowrap;
}

.masthead-top-right a {
    color: var(--ink-secondary);
    font-size: 12px;
}

.divider {
    display: inline-block;
    width: 1px;
    height: 7px;
    margin: 1px 12px;
    background: #878787;
}

.masthead-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 48px;
    margin: 0;
    padding: 12px 0 8px;
    list-style: none;
}

.masthead-nav li {
    margin: 0;
    white-space: nowrap;
}

.masthead-nav a {
    font-family: var(--condensed);
    font-weight: 700;
    font-stretch: condensed;
    font-size: 16px;
    text-transform: uppercase;
    color: var(--green);
}

.masthead-nav a[aria-current="page"],
.masthead-nav .current_page_item > a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* ---------- Shell: left catalog nav + main content ---------- */

.shell {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 140px);
}

.catalog-nav {
    position: sticky;
    top: 0;
    flex: 0 0 var(--nav-width);
    max-height: 100vh;
    overflow-y: auto;
    padding: 6px 5px 20px 0;
    border-right: 1px solid var(--rule-light);
    align-self: stretch;
}

.catalog-nav a {
    display: flex;
    justify-content: space-between;
    margin-left: 4px;
    padding: 4px 6px 2px 12px;
    border-left: 4px solid transparent;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 12px;
}

.catalog-nav a:hover {
    background: var(--yellow-hover);
    text-decoration: underline;
}

.catalog-nav a.is-selected {
    background: var(--yellow);
    color: var(--ink-strong);
    font-weight: bold;
    text-decoration: none;
}

.catalog-nav .count {
    color: var(--ink-muted);
    font-weight: normal;
    font-size: 11px;
}

.main-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 20px 40px;
}

/* ---------- Homepage catalog ---------- */

.catalog-intro {
    padding: 6px 0 14px;
}

.catalog-tagline {
    margin: 0;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink);
}

.catalog-hint {
    margin: 4px 0 0;
    color: var(--ink-muted);
    font-size: 11px;
}

.catg {
    margin-bottom: 10px;
    scroll-margin-top: 10px;
}

.catg h1,
.section-title,
.page-title {
    display: block;
    margin: 0 0 8px;
    padding-top: 2px;
    border-top: 1px solid var(--green);
    color: var(--green);
    font-family: var(--sans);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 0 36px;
}

.subcat {
    flex: 0 1 252px;
    padding-bottom: 14px;
}

.subcat h2 {
    margin: 0;
    padding: 0 0 5px 5px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: bold;
}

.subcat ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.subcat li {
    display: flex;
    gap: 6px;
    padding: 2px 5px;
    line-height: 1.25;
}

.subcat li:hover {
    background: var(--yellow-hover);
}

.subcat .day {
    flex: 0 0 16px;
    text-align: right;
    color: var(--ink-muted);
    font-size: 11px;
    padding-top: 1px;
}

.subcat a {
    color: var(--ink);
}

/* ---------- Single post / page ("product detail") ---------- */

.product-detail {
    max-width: 760px;
}

.product-crumbs {
    padding: 4px 0 10px;
    color: var(--ink-muted);
    font-size: 11px;
}

.product-crumbs a {
    color: var(--link);
}

.product-crumbs .sep {
    margin: 0 5px;
}

.product-header h1 {
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid var(--green);
    color: var(--green);
    font-family: var(--sans);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.product-meta {
    margin: 4px 0 18px;
    color: var(--ink-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Long-form reading text: same face as the catalog, a touch larger. */
.entry-content,
.fediverse-reactions,
.post-footer {
    font-family: var(--arial);
    font-size: 14px;
    line-height: 1.5;
}

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

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content dl {
    margin: 0 0 12px;
}

.entry-content ul,
.entry-content ol {
    padding-left: 22px;
}

.entry-content ul li {
    list-style: square;
}

.entry-content ol li {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 3px;
}

.entry-content li > ul,
.entry-content li > ol {
    margin: 3px 0 0;
}

.entry-content a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: rgba(0, 102, 153, 0.35);
    text-underline-offset: 2px;
}

.entry-content a:hover {
    background: var(--yellow-hover);
    text-decoration-color: var(--link);
}

.entry-content h2 {
    margin: 26px 0 8px;
    padding-top: 2px;
    border-top: 1px solid var(--green);
    color: var(--green);
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.entry-content h3 {
    margin: 20px 0 6px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: bold;
}

.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 16px 0 4px;
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.entry-content strong {
    color: var(--ink-strong);
}

.entry-content hr,
hr {
    height: 0;
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--rule-light);
}

/* Product-photo treatment: flat, white, hairline border. */
.entry-content img,
.entry-content video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 6px 0;
    border: 1px solid var(--rule-faint);
    background: #fff;
}

.entry-content figure {
    margin: 16px 0;
}

.entry-content figcaption,
.wp-element-caption {
    margin-top: 4px;
    color: var(--ink-secondary);
    font-size: 11px;
}

.entry-content audio {
    width: 100%;
}

.entry-content iframe {
    max-width: 100%;
}

blockquote {
    margin: 16px 0;
    padding: 8px 14px;
    border-left: 4px solid var(--yellow-button);
    background: var(--panel);
    color: var(--ink);
}

blockquote p:last-child {
    margin-bottom: 0;
}

code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--panel);
    border: 1px solid var(--rule-faint);
    padding: 0 3px;
}

pre {
    margin: 0 0 14px;
    padding: 10px 12px;
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--rule-light);
    border-left: 3px solid var(--green);
    font-size: 12.5px;
    line-height: 1.45;
    tab-size: 4;
}

pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    white-space: pre-wrap;
}

/* Spec tables */
.entry-content table {
    width: 100%;
    margin: 12px 0 16px;
    border-collapse: collapse;
    font-size: 12px;
}

.entry-content th {
    padding: 4px 8px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    font-weight: bold;
    text-align: left;
    vertical-align: bottom;
}

.entry-content td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--rule-faint);
    vertical-align: top;
}

.entry-content tbody tr:hover td {
    background: var(--yellow-hover);
}

/* ---------- Pager, fediverse, post footer ---------- */

.post-pager {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 760px;
    margin-top: 24px;
    padding-top: 6px;
    border-top: 1px solid var(--rule);
    font-size: 12px;
}

.post-pager a {
    color: var(--link);
}

.pager-next {
    text-align: right;
    margin-left: auto;
}

.fediverse-reactions {
    max-width: 760px;
    margin: 28px 0 0;
}

.fediverse-favorites {
    margin: 0 0 10px;
    color: var(--ink-secondary);
    font-size: 12px;
}

.fediverse-comment {
    padding: 10px 0;
    border-bottom: 1px solid var(--rule-faint);
    font-size: 13px;
}

.fediverse-comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.fediverse-comment-author a {
    color: var(--ink);
}

.fediverse-comment-meta {
    display: flex;
    flex-direction: column;
}

.fediverse-comment-date {
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: normal;
}

.fediverse-comment-date a {
    color: inherit;
}

img.fediverse-avatar {
    width: 28px;
    height: 28px;
    border: 1px solid var(--rule-faint);
}

.fediverse-comment-content {
    margin-top: 4px;
}

.fediverse-comment-content p {
    margin: 0 0 6px;
}

.fediverse-comment-content a {
    color: var(--link);
}

.fediverse-comment-content img {
    max-width: 100%;
    height: auto;
}

.post-footer {
    max-width: 760px;
    margin-top: 28px;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--rule-light);
    color: var(--ink-secondary);
    font-size: 12px;
}

.post-footer p {
    margin: 0 0 8px;
}

.post-url-box {
    display: flex;
    gap: 6px;
}

code.post-url {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    height: 26px;
    padding: 5px 7px;
    border: 1px solid var(--rule);
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
    overflow-x: auto;
}

.button-secondary {
    flex: 0 0 auto;
    padding: 3px 15px;
    border: 1px solid var(--yellow-button);
    border-radius: 0;
    background: var(--yellow-button);
    color: #000;
    font: 12px var(--arial);
    cursor: pointer;
}

.button-secondary:hover {
    border-color: var(--yellow-button-hover);
    background: var(--yellow-button-hover);
}

/* ---------- Archive / search / 404 ---------- */

.site-main .page-header {
    margin: 6px 0 10px;
}

.site-main .page-title span {
    color: var(--ink);
}

.site-main article {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule-faint);
}

.site-main .entry-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: bold;
}

.site-main .entry-title a {
    color: var(--link);
}

.site-main .entry-meta,
.site-main .entry-footer {
    color: var(--ink-muted);
    font-size: 11px;
}

.site-main .entry-meta a,
.site-main .entry-footer a {
    color: var(--ink-muted);
}

.site-main .entry-meta .byline,
.site-main .entry-footer > span {
    margin-left: 8px;
}

.site-main .entry-summary p {
    margin: 4px 0;
    font-size: 12px;
}

.site-main .updated:not(.published) {
    display: none;
}

.site-main .widget {
    margin: 14px 0;
}

.site-main .widget-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: bold;
}

.site-main .widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-main .widget li {
    padding: 2px 0;
}

.search-form .search-field {
    height: 26px;
    padding: 2px 6px;
    border: 1px solid var(--rule);
    font: 13px var(--arial);
}

.search-form .search-submit {
    height: 26px;
    padding: 0 12px;
    border: 1px solid var(--green);
    background: var(--green);
    color: #fff;
    font: 12px var(--arial);
    cursor: pointer;
}

.search-form .search-submit:hover {
    background: var(--green-hover);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
}

.nav-links a {
    color: var(--link);
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
    padding: 8px 20px;
    border-top: 1px solid var(--rule);
    color: #000;
    font-size: 11px;
}

.bottom-nav a {
    color: #000;
}

.bottom-nav .version {
    float: right;
    color: var(--ink-muted);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
    .masthead {
        padding: 10px 16px 0;
    }

    .masthead-top {
        flex-wrap: wrap;
        gap: 10px 16px;
    }

    .masthead-logo {
        font-size: 28px;
    }

    .masthead-top-right {
        order: 2;
    }

    .masthead-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .masthead-nav ul {
        gap: 0 24px;
    }

    .shell {
        flex-direction: column;
        min-height: 0;
    }

    .catalog-nav {
        position: static;
        flex: none;
        width: 100%;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        padding: 8px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--rule-light);
    }

    .catalog-nav a {
        margin: 0;
        padding: 3px 8px;
        border-left: 0;
    }

    .catalog-nav .count {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 5px 16px 30px;
    }

    .subcat {
        flex-basis: 100%;
    }

    .bottom-nav {
        padding: 8px 16px;
    }

    .bottom-nav .version {
        float: none;
        display: block;
        margin-top: 4px;
    }
}

@media print {
    .masthead-search,
    .masthead-top-right,
    .catalog-nav,
    .post-pager,
    .post-footer {
        display: none;
    }
}
