/* Look and feel modelled on the old hitmag WordPress theme + the custom CSS that was layered on it
   (navy #1b3366 nav/buttons, blue #2a669f accents, Lato body, Ubuntu UI labels, Open Sans title,
   boxed 1200px layout). Written from scratch; no hitmag code. */

:root {
    --navy: #1b3366;
    --blue: #2a669f;
    --blue-bright: #1e73be;
    --text: #404040;
    --heading: #222;
    --muted: #888;
    --rule: #ddd;
    --page-bg: #ddd;
    --topbar-bg: #ecf0f1;
    --code-bg: #eee;
    --font-body: "Lato", sans-serif;
    --font-ui: "Ubuntu", sans-serif;
    --font-title: "Open Sans", sans-serif;
}

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

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font: 16px/1.5 var(--font-body);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }

.icon { width: 1em; height: 1em; vertical-align: -0.125em; }

/* ---- Boxed page ---- */
.site {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    box-shadow: 0 0 2px #bbb;
}

/* ---- Top bar ---- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 40px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--rule);
    font: 700 13px/24px var(--font-ui);
    color: var(--text);
}
.topbar-social { display: flex; gap: 14px; }
.topbar-social a { color: var(--heading); font-size: 15px; display: inline-flex; }
.topbar-social a.linkedin { color: var(--blue-bright); }
.topbar-social a:hover { color: var(--blue); }

/* ---- Header ---- */
.site-branding { padding: 30px 55px; }
.site-title {
    margin: 0;
    font: 700 36px/1.3 var(--font-title);
}
.site-title a { color: var(--blue); }
.site-title a:hover { color: var(--navy); }
.site-tagline { margin: 4px 0 0; color: var(--muted); }

/* ---- Navigation ---- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: var(--navy);
    padding: 0 40px;
}
.main-nav ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.main-nav li a {
    display: block;
    padding: 12px 17px;
    color: #fff;
    font: 700 14px/20px var(--font-ui);
    text-transform: uppercase;
}
.main-nav li a:hover, .main-nav li.current a { background: var(--blue); color: #fff; }

/* Search toggle: <details>, so it works with no JavaScript (and a strict CSP). */
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search summary {
    list-style: none;
    cursor: pointer;
    color: #fff;
    font-size: 17px;
    padding: 10px 0 10px 15px;
    display: flex;
}
.nav-search summary::-webkit-details-marker { display: none; }
.nav-search form {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    display: flex;
    background: #fff;
    border: 1px solid var(--rule);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 8px;
}

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
    width: 240px;
    padding: 7px 10px;
    border: 1px solid var(--rule);
    font: 14px var(--font-body);
}
.search-form button, .button {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    border: 0;
    padding: 8px 14px;
    font: 700 12px/1.5 var(--font-ui);
    text-transform: uppercase;
    cursor: pointer;
}
.search-form button:hover, .button:hover { background: var(--blue); color: #fff; }

/* ---- Content + sidebar ---- */
.site-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    padding: 40px;
}

/* ---- Post grid (listing) ---- */
.archive-title {
    margin: 0 0 30px;
    font: 700 18px/1.3 var(--font-ui);
    text-transform: uppercase;
    color: var(--text);
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 50px 40px;
}
.cat-links {
    display: block;
    margin-bottom: 6px;
    font: 700 11px/1.2 var(--font-ui);
    text-transform: uppercase;
}
.cat-links a { color: var(--blue); }
.cat-links a:hover { color: var(--navy); }
.post-card .entry-title {
    margin: 0 0 6px;
    font: 700 21px/1.3 var(--font-body);
}
.entry-title a { color: var(--heading); }
.entry-title a:hover { color: var(--blue); }
.entry-meta { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--blue); }
.entry-meta .sep { margin: 0 4px; }
.entry-meta .author { color: #555; font-weight: 700; }
.post-card .entry-summary { margin: 0 0 18px; }

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    font-family: var(--font-ui);
    color: var(--muted);
}

/* ---- Single post ---- */
.single .entry-title {
    margin: 0 0 8px;
    font: 700 36px/1.2 var(--font-body);
    color: var(--heading);
}
.entry-content { line-height: 1.6; overflow-wrap: break-word; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--text); font-weight: 400; line-height: 1.3; }
.entry-content h2 { font-size: 32px; margin: 1.3em 0 0.6em; }
.entry-content h3 { font-size: 26px; margin: 1.2em 0 0.5em; }
.entry-content h4 { font-size: 21px; margin: 1.1em 0 0.5em; }
.entry-content a { text-decoration: none; }
.entry-content blockquote {
    margin: 1.5em 0;
    padding: 0 1.5em;
    border-left: 4px solid var(--blue);
    font-style: italic;
}
.entry-content img, .gallery img { max-width: 100%; height: auto; }
.post-image { margin: 1.5em 0; text-align: center; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 1.5em 0;
}
.gallery figure { margin: 0; }

code, pre { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 15px; }
:not(pre) > code { background: var(--code-bg); padding: 3px 4px; margin: 0 2px; }
pre.code {
    background: var(--code-bg);
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 20px;
    overflow-x: auto;
    line-height: 1.6;
}
pre.code.highlight { background: var(--code-bg); }

.entry-content iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 1.5em 0; border: 0; }

.entry-footer { margin-top: 30px; font-size: 14px; }
.tags-links a {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 10px;
    background: #f2f2f2;
    color: var(--text);
    font: 13px var(--font-ui);
}
.tags-links a:hover { background: var(--navy); color: #fff; }

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}
.post-navigation .label {
    display: block;
    font: 700 12px var(--font-ui);
    text-transform: uppercase;
    color: var(--muted);
}
.post-navigation .next { text-align: right; margin-left: auto; }
.post-navigation a { color: var(--heading); font-weight: 700; }
.post-navigation a:hover { color: var(--blue); }

/* ---- Sidebar widgets ---- */
.widget { margin-bottom: 40px; }
.widget-title {
    display: inline-block;
    margin: 0 0 20px;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--blue-bright);
    font: 700 18px/1.3 var(--font-ui);
    text-transform: uppercase;
    color: var(--text);
}
.widget ul { margin: 0; padding: 0 0 0 10px; list-style: none; }
.widget li { margin-bottom: 10px; }
.widget li a { color: var(--heading); }
.widget li a:hover { color: var(--blue); }
.widget .count { color: var(--muted); font-size: 13px; }
.widget .search-form input[type="search"] { width: 100%; }

/* ---- Footer ---- */
.site-footer { background: #333; color: #ddd; }
.site-info {
    background: #222;
    padding: 15px 40px;
    font-size: 14px;
    color: #ddd;
}
.site-info a { color: #fff; }

/* ---- Simple pages (search results, 404) ---- */
.search-results .post-card { margin-bottom: 35px; }

/* ---- Responsive ---- */
@media (max-width: 1240px) {
    .site { margin: 0 auto; }
}
@media (max-width: 960px) {
    .site-content { grid-template-columns: minmax(0, 1fr); padding: 30px 20px; }
    .topbar, .main-nav { padding-left: 20px; padding-right: 20px; }
    .site-branding { padding: 24px 20px; }
}
@media (max-width: 640px) {
    .posts-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .site-title { font-size: 28px; }
    .single .entry-title { font-size: 28px; }
    .search-form input[type="search"] { width: 180px; }
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
