/* c-berg.com — one stylesheet for every page. */

@font-face {
  font-family: "Open Sans";
  src: url(/fonts/open-sans-latin-wght-normal.woff2) format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url(/fonts/open-sans-latin-wght-italic.woff2) format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url(/fonts/raleway-latin-wght-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f7f8;
  --text: rgb(70, 112, 127);
  --heading: #17252a;
  --accent: #f79007;
  --link: #03a9f4;
  --muted: #7d8f96;
  --line: #e8ecee;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 16px/1.6 "Open Sans", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 { color: var(--heading); line-height: 1.3; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--link); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1260px; margin: 0 auto; padding: 0 15px; }

/* ---------- Header ---------- */

.site-header {
  position: relative;
  color: #fff;
  background: rgb(53, 59, 62) url(/img/tapestry.jpg) 50.7% 74% / cover no-repeat;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.site-header > * { position: relative; }

.topbar { font-size: 14px; padding: 5px 0; background: rgba(255, 255, 255, 0.3); }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { text-decoration: underline; }
.topbar svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 2; flex: none; }

.site-nav { background: rgba(255, 255, 255, 0.2); }
.site-nav .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 82px; }
.site-name { color: #fff; text-decoration: none; font-size: 22px; }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 36px; }
.nav-links a {
  color: #fff;
  text-decoration: none;
  font: 500 14px/1 "Raleway", "Open Sans", sans-serif;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { border-bottom-color: #fff; }

/* Pinned menu bar: js/nav.js adds .nav-pinned to <body> once the bar would
   scroll away. The holder keeps the bar's space so the page doesn't jump. */
.nav-holder { min-height: 82px; }
.nav-pinned .site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.nav-pinned .site-name, .nav-pinned .nav-links a { color: var(--heading); }
.nav-pinned .nav-links a:hover, .nav-pinned .nav-links a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav-pinned .nav-toggle-label { color: var(--heading); border-color: rgba(23, 37, 42, 0.35); }

/* CSS-only mobile menu: a visually hidden checkbox toggles the links. */
.nav-toggle { display: none; } /* only used by the phone menu below */
.nav-toggle-label { display: none; }

.page-title { text-align: center; padding: 88px 15px 132px; }
.page-title h1 { color: #fff; font-weight: 300; font-size: clamp(2.1rem, 6vw, 3.25rem); margin: 0; }

/* ---------- Page bodies ---------- */

.prose { padding-top: 72px; padding-bottom: 72px; }
.prose p { margin-bottom: 1.5em; }

/* ---------- Shared pieces ---------- */

.card { background: #fff; border-radius: 3px; box-shadow: var(--shadow); }

.btn {
  display: inline-block;
  padding: 16px 30px;
  border: 0;
  border-radius: 50px;
  font: 600 14px/1 "Open Sans", Arial, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-light { background: #fff; color: var(--heading); }
.btn:hover { filter: brightness(1.07); }

.icon { display: block; width: 32px; height: 34px; fill: currentColor; }

.section { padding: 100px 0; }
.section-gray { background: var(--bg); }
.section-title { text-align: center; font-weight: 300; font-size: clamp(1.8rem, 4vw, 2.75rem); margin-bottom: 12px; }
.section-link { text-align: center; margin-bottom: 40px; }
.section-dark { position: relative; background: #1c1a1a url(/img/blog-bg.jpg) center / cover no-repeat; }
.section-dark > * { position: relative; }
.section-dark .section-title { color: #fff; margin-bottom: 40px; }

.post-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-card { background: #fff; border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.post-card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-card-body { padding: 20px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card-cat { color: var(--link); font-size: 13px; }
.post-card h3 { font-size: 18px; font-weight: 600; margin: 8px 0 6px; }
.post-card h3 a { color: var(--heading); text-decoration: none; }
.post-card h3 a:hover { color: var(--link); }
.post-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.post-card-excerpt { font-size: 14px; flex: 1; }
.read-more { font-size: 13px; font-weight: 600; color: var(--link); text-decoration: none; }
.read-more:hover { text-decoration: underline; }

/* ---------- Home ---------- */

.site-header--home { background-image: url(/img/hero.jpg); background-position: 55.5% 1.3%; }
.site-header--home::before { background: rgba(0, 0, 0, 0.65); }
.hero { text-align: center; padding: 215px 15px 255px; }
.hero h1 { color: #fff; font-weight: 700; font-size: clamp(2.1rem, 5vw, 3.75rem); margin: 0 0 4px; }
.hero-sub { color: #fff; font-size: clamp(1.5rem, 3vw, 2.5rem); margin: 0 0 32px; }
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; margin: 0; }

.roles { background: var(--bg); padding-bottom: 90px; }
.roles-card { position: relative; z-index: 1; margin-top: -50px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 0; }
.roles-card .role { padding: 46px 30px 30px; }
.roles-card .role + .role { border-left: 1px solid #ddd; }
.roles-card .role .icon { color: var(--accent); margin-bottom: 26px; }
.roles-card .role h5 { font-size: 18px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }
.roles-card .role p { margin: 0; }

.about { padding: 90px 0; }
.about-inner { display: flex; align-items: center; }
.about-panel { background: var(--bg); width: 70%; margin-left: 4%; padding: 120px 16% 120px 14%; font-size: 15px; line-height: 1.75; }
.about-panel h5 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.about-photo { width: 30%; margin-left: -6%; position: relative; box-shadow: var(--shadow); }

.cv-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.cv-card { flex: 1 1 calc(25% - 23px); text-align: center; padding: 40px 26px 30px; font-size: 14px; line-height: 1.55; }
.cv-card .icon { color: var(--heading); width: 40px; height: 42px; margin: 0 auto 18px; }
.cv-card h4::before { content: ""; display: block; width: 30px; height: 3px; background: var(--accent); margin: 0 auto 24px; }
.cv-card h4 { font-size: 19px; font-weight: 600; margin-bottom: 18px; }
.cv-card p { margin-bottom: 12px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
.tile img { width: 100%; aspect-ratio: 381 / 300; object-fit: cover; border-radius: 3px; transition: opacity 0.2s; }
.tile:hover img { opacity: 0.85; }

.contact { position: relative; padding: 105px 0; background: #111 url(/img/contact-bg.jpg) 53% 63.5% / cover no-repeat; }
.contact::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.contact > * { position: relative; }
.contact-card { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 30px; }
.contact-form label { display: block; font: 600 13px/1.4 "Raleway", "Open Sans", sans-serif; color: #555; margin-top: 18px; }
.contact-form label:first-of-type { margin-top: 0; }
.contact-form .req { color: #d0342c; }
.contact-form input, .contact-form textarea {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #333;
  padding: 12px 10px;
  font: inherit;
  color: var(--heading);
  background: transparent;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.field-note { text-align: right; font-size: 12px; color: var(--muted); margin: 6px 0 16px; }
.contact-form .btn { font: 600 12px/1 "Raleway", "Open Sans", sans-serif; letter-spacing: 1px; padding: 20px 30px; }

/* ---------- Posts and blog (card overlapping the title band) ---------- */

.page-title--card { padding-bottom: 150px; }
.post-wrap { position: relative; z-index: 1; margin-top: -90px; padding-bottom: 72px; }
main:has(> .post-wrap) { background: var(--bg); }
.content-card { background: #fff; border-radius: 3px; box-shadow: var(--shadow); margin: 0 auto; padding: 28px 32px 32px; }
.content-card.post { max-width: 704px; }
.content-card.blog-list { max-width: 1000px; }
.post-cards--two { grid-template-columns: repeat(2, 1fr); }
.blog-list .post-card { box-shadow: none; border: 1px solid var(--line); }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.post-cat { color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 600; }
.post-meta .sep { color: #c5ced2; }
/* Author and date wrap as one unit, so no line starts or ends with a separator. */
.post-byline { display: inline-flex; gap: 10px; white-space: nowrap; }

.post-body figure { margin: 0 0 16px; }
.post-body img { width: 100%; border-radius: 2px; }
.post-body p { margin: 0 0 24px; line-height: 1.7; }

.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.post-tags li { background: #f0f3f4; border-radius: 3px; padding: 2px 10px; font-size: 13px; color: var(--muted); }

.more-posts { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.more-posts h2 { text-align: center; font-weight: 300; font-size: 24px; margin-bottom: 18px; }
.more-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.more-cards .post-card { box-shadow: none; border: 1px solid var(--line); }
.all-posts {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
}
.all-posts:hover { background: var(--bg); }

/* ---------- CV ---------- */

.cv-page { padding-top: 72px; padding-bottom: 72px; }
.cab-cv { max-width: 720px; margin: 0 auto; font-size: 15px; }
.cab-cv .cv-name { font-size: 1.8em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 4px; color: var(--heading); }
.cab-cv .cv-header { text-align: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1.5px solid currentColor; }
.cab-cv .cv-header p { margin: 2px 0; font-size: 0.95em; opacity: 0.7; }
.cab-cv .cv-header a { color: inherit; }
.cab-cv h2 { font-size: 1.05em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid rgba(0, 0, 0, 0.3); padding-bottom: 3px; margin: 24px 0 10px; }
.cab-cv .row { display: flex; gap: 12px; margin-bottom: 10px; }
.cab-cv .dates { flex: 0 0 130px; font-size: 0.88em; opacity: 0.6; padding-top: 1px; }
.cab-cv .body { flex: 1; min-width: 0; }
.cab-cv .body strong { font-weight: 600; }
.cab-cv .sub, .cab-cv .role { padding-left: 1em; font-size: 0.93em; opacity: 0.7; }
.cab-cv .pub .body { text-indent: -1.5em; padding-left: 1.5em; }
.cab-cv .ref { margin-bottom: 10px; }
.cab-cv .ref a { color: inherit; }
.cab-cv .pdf-link { text-align: right; margin-bottom: 16px; }
.cab-cv .pdf-link a { font-size: 0.85em; color: inherit; opacity: 0.5; text-decoration: none; border-bottom: 1px solid; transition: opacity 0.2s; }
.cab-cv .pdf-link a:hover { opacity: 0.8; }

/* ---------- Footer ---------- */

.site-footer { text-align: center; padding: 40px 15px; background: #fff; }

/* ---------- Print (the CV PDF is printed from /cv/) ---------- */

@page { size: letter; margin: 0.6in 0.7in; }

@media print {
  body { font-size: 10pt; background: #fff; }
  .site-header, .site-footer, .pdf-link { display: none !important; }
  main.wrap { max-width: none; padding: 0; }
  .cab-cv { max-width: none; font-size: 10pt; }
  .cab-cv, .cab-cv * { color: #000 !important; }
  .cab-cv .cv-header { border-bottom-color: #000; }
  .cab-cv .row, .cab-cv .ref, .cab-cv .cv-header { break-inside: avoid; }
  .cab-cv h2 { break-after: avoid; }
}

/* ---------- Tablets ---------- */

@media (max-width: 1023px) {
  .roles-card { grid-template-columns: repeat(2, 1fr); }
  .roles-card .role:nth-child(3) { border-left: 0; }
  .roles-card .role:nth-child(n + 3) { border-top: 1px solid #ddd; }
  .cv-card { flex-basis: calc(50% - 15px); }
  .post-cards { grid-template-columns: repeat(2, 1fr); }
  .about-panel { padding: 80px 12% 80px 8%; }
}

@media (max-width: 600px) {
  .post-meta > .sep { display: none; }
  .post-byline { flex-basis: 100%; }
  .cab-cv .row { flex-direction: column; gap: 0; }
  .cab-cv .dates { flex: none; }
}

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

@media (max-width: 767px) {
  .topbar { display: none; }
  .hero { padding: 90px 15px 110px; }
  .roles { padding-bottom: 50px; }
  .roles-card { grid-template-columns: 1fr; padding: 0; }
  .roles-card .role { padding: 30px 24px; }
  .roles-card .role + .role { border-left: 0; border-top: 1px solid #ddd; }
  .about { padding: 50px 0; }
  .about-inner { flex-direction: column; }
  .about-panel { width: 100%; margin: 0; padding: 36px 24px 80px; }
  .about-photo { width: 80%; margin: -50px auto 0; }
  .section { padding: 56px 0; }
  .cv-card { flex-basis: 100%; }
  .post-cards, .tiles { grid-template-columns: 1fr; }
  .contact { padding: 50px 0; }
  .contact-card { grid-template-columns: 1fr; gap: 30px; padding: 24px; }
  .cv-page { padding-top: 40px; padding-bottom: 40px; }
  .page-title--card { padding-bottom: 96px; }
  .post-wrap { margin-top: -56px; padding-bottom: 40px; }
  .content-card { padding: 20px 18px 24px; }
  .more-cards { grid-template-columns: 1fr; }
  .site-nav .wrap { min-height: 64px; }
  .nav-holder { min-height: 64px; }
  .nav-toggle-label {
    display: block;
    cursor: pointer;
    font: 500 14px/1 "Raleway", "Open Sans", sans-serif;
    text-transform: uppercase;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 3px;
  }
  .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .nav-toggle:focus-visible + .nav-toggle-label { outline: 2px solid var(--accent); }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding: 8px 0 14px; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { display: inline-block; padding: 12px 0; }
  .page-title { padding: 48px 15px 64px; }
  .prose { padding-top: 40px; padding-bottom: 40px; }
}
