/* =====================================================
   Joyce Hansen Portfolio — Shared Styles
   Implements Portfolio Style Guide tokens
   ===================================================== */

/* ---------- Color tokens ---------- */
:root {
  --white: #ffffff;
  --platinum: #c2c2c2;
  --brightgray: #f8f8f8;
  --lightgray: #e9e9e9;
  --charcoal: #333333;
  --brand: #3f1634;
  --darkbrand: #25041c;
  --teal: #1d7397;
  --darkteal: #09455f;
  --blue: #2C5087;

  /* Status colors */
  --success-base: #4C9E00;
  --success-tint: #EBF5DC;
  --success-dark: #2E5010;
  --error-base: #C0391A;
  --error-tint: #FCEEE8;
  --error-dark: #6B1E0C;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--darkbrand);
  background-image: url("../img/herringbone.png");
  background-repeat: repeat;
  color: var(--white);
  font-family: "Zilla Slab", Georgia, serif;
  font-weight: 300;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

/* ---------- Headings ---------- */

/* H1 — Zilla Slab display, sentence case */
body h1 {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 2.25em;
  font-weight: 300;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0;
}
@media (min-width: 768px) {
  body h1 { font-size: 3.5em; }
}

/* H2 & H3 — Lato, uppercase, tracked */
h2 {
  font-family: "Lato", Verdana, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.0625em;
  line-height: 1.3;
  margin: 0;
}

h3 {
  font-family: "Zilla Slab", Georgia, serif;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
}

h2 {
  font-size: 1.25em;
  font-weight: 400;
  color: var(--brand);
  margin-top: 2rem;
}
@media (min-width: 768px) {
  h2 { font-size: 1.125em; }
}

h3 {
  font-size: 1.75em;
  font-weight: 400;
  line-height: 1.4;
  color: var(--brand);
  margin: 1rem 0 0.5rem;
}

/* ---------- Body text ---------- */
p {
  font-family: "Zilla Slab", Georgia, serif;
  font-weight: 300;
  line-height: 1.54;
  color: var(--charcoal);
  font-size: 1.375em;
  margin: 0 0 1rem;
}
@media (min-width: 768px) {
  p { font-size: 1.25em; }
}

/* On dark backgrounds, body text should remain readable */
.on-dark p,
.on-dark li {
  color: var(--platinum);
}

/* Restore charcoal on light-background sections */
.bkgd-light p,
.bkgd-light li {
  color: var(--charcoal);
}

.intro-para {
  font-size: 1.5em;
  line-height: 1.54;
}
@media (min-width: 768px) {
  .intro-para { font-size: 1.5em; }
}

/* ---------- Type variants ---------- */
.subhead {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 1em;
  font-weight: 300;
  text-transform: none;
  color: var(--white);
  letter-spacing: 0;
  line-height: 1.4;
}
@media (min-width: 768px) {
  .subhead { font-size: 1.25em; }
}

.eyebrow {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 1.25em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--white);
  margin: 0 0 0.75rem;
}
@media (min-width: 768px) {
  .eyebrow { font-size: 1.125em; }
}

.hero {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.25em;
  font-weight: 300;
  font-style: italic;
  color: var(--platinum);
}

.emphasis {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.625em;
  font-weight: 300;
  color: var(--charcoal);
}

.small {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.375em;
  font-weight: 300;
  color: var(--charcoal);
}
@media (min-width: 768px) {
  .small { font-size: 1.125em; }
}

.footer-text {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1em;
  color: var(--platinum);
}

.back {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
}

/* ---------- Links ---------- */
a { color: var(--teal); text-decoration: none; }
p a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
p a:visited, p a:hover { color: var(--darkteal); }

.portfolio a { color: var(--teal); text-decoration: underline; }
.portfolio a:hover { color: var(--brand); }

.back a { color: inherit; text-decoration: none; }
.back a:hover { text-decoration: underline; }

/* ---------- Lists ---------- */
ul.content {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.375em;
  color: var(--charcoal);
  list-style: disc;
  padding-left: 2rem;
  margin: 0 0 1.5rem;
}
ul.content li { margin-bottom: 0.5rem; }
@media (min-width: 768px) {
  ul.content { font-size: 1.25em; }
}

.on-dark ul.content { color: var(--platinum); }

/* ---------- Backgrounds ---------- */
.bkgd-light {
  background-color: var(--brightgray);
  background-image: none;
  width: 100%;
}

/* ---------- Navigation ---------- */
.navbar {
  background-color: var(--darkbrand);
  background-image: url("../img/herringbone.png");
  background-repeat: repeat;
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .navbar-inner { padding: 1rem 2rem; }
}

.navbar .logo {
  display: inline-flex;
  align-items: center;
}
.navbar .logo img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a,
.nav-links button {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--platinum);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--white);
  text-decoration: underline;
}
.nav-links a.active {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.nav-hamburger {
  display: none;
  background: none;
  border: 0;
  color: var(--platinum);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.nav-hamburger:hover { color: var(--white); }
.nav-hamburger svg { width: 28px; height: 28px; }

/* Mobile */
@media (max-width: 767px) {
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 1.75rem;
    background-color: var(--darkbrand);
    display: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: inline-flex; align-items: center; }
}


/* ---------- Sections / layout ---------- */
.section {
  padding: 2.8rem 0 3.5rem;
}
@media (min-width: 768px) {
  .section { padding: 4rem 0 5rem; }
}

.section--compact {
  padding: 1.96rem 0 2.45rem;
}
@media (min-width: 768px) {
  .section--compact { padding: 2.8rem 0 3.5rem; }
}

.section--tighter {
  padding-top: 2.24rem;
}
@media (min-width: 768px) {
  .section--tighter { padding-top: 3.2rem; }
}

.section--tighter h2,
.section--compact h2 {
  margin-bottom: 1.2rem;
}
@media (min-width: 768px) {
  .section--tighter h2,
  .section--compact h2 { margin-bottom: 1.5rem; }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 768px) {
  .container { padding: 0 2rem; }
}

/* Hero (dark) */
.hero-section {
  padding: 2.8rem 0 2.4rem;
}
@media (min-width: 768px) {
  .hero-section { padding: 4.2rem 0 3.6rem; }
}

.hero-section .eyebrow {
  margin-bottom: 1.125rem;
}

/* ---------- Buttons / CTA ---------- */
.btn {
  display: inline-block;
  font-family: "Lato", Verdana, sans-serif;
  font-size: 0.85em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--white);
  background-color: var(--brand);
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--brand);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:hover, .btn:focus {
  background-color: var(--darkbrand);
  border-color: var(--darkbrand);
  color: var(--white);
}

/* ---------- Case study card grid (home) ---------- */
.case-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .case-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Case study card component ----------
   A preview card for a case study. The whole card is clickable via a
   stretched link on the "View case study" anchor, so any content
   (image, copy) can sit above it without needing its own link.
   Usage:
     <article class="case-card">
       <h3>Title</h3>
       <p class="small">Summary copy…</p>
       <img src="..." alt="..." />   (optional)
       <a class="case-card-link" href="...">View case study</a>
     </article>
   Cards in a .case-card-grid row stretch to equal height, and the
   link's margin-top: auto keeps it pinned to the bottom-left. */
.case-card {
  position: relative;
  background-color: var(--white);
  border: 1px solid var(--lightgray);
  border-radius: 8px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.case-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.case-card h3 {
  color: var(--brand);
  margin: 0;
}
.case-card p { margin: 0; }
.case-card .eyebrow { color: var(--brand); margin-bottom: 0; }
.case-card p a {
  position: relative;
  z-index: 1;
}
.case-card ul {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.375em;
  font-weight: 300;
  color: var(--charcoal);
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0;
}
.case-card ul li { margin-bottom: 0.4rem; }
.case-card ul li:last-child { margin-bottom: 0; }
.case-card ul li::marker { font-size: 0.8em; }
@media (min-width: 768px) {
  .case-card ul { font-size: 1.125em; }
}

.case-card-link {
  align-self: flex-start;
  margin-top: auto;
  font-family: "Lato", Verdana, sans-serif;
  font-size: 1em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--brand);
  text-decoration: none;
}
.case-card-link::before {
  content: "";
  position: absolute;
  inset: 0;
}
.case-card-link::after {
  content: " →";
}
.case-card-link:hover {
  color: var(--teal);
  text-decoration: underline;
}

/* ---------- Profile image (about) ---------- */
.profile {
  width: 100%;
  max-width: 208px;
  border-radius: 50%;
  margin: 0 auto;
  display: block;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: 1fr 260px;
    gap: 3rem;
    align-items: start;
  }
}

/* ---------- Forms (contact) ---------- */
.form-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 75%;
  margin: 0;
}

.form-row {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-grid label {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 0.875em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--charcoal);
  display: block;
  margin-bottom: 0.4rem;
}

.form-grid input,
.form-grid textarea {
  width: 100%;
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.375em;
  font-weight: 300;
  color: var(--charcoal);
  background-color: var(--white);
  border: 1px solid var(--platinum);
  border-radius: 0.375rem;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-grid input:focus,
.form-grid textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29, 115, 151, 0.15);
}

.form-grid input.invalid,
.form-grid textarea.invalid {
  border-color: var(--error-base);
}
.form-grid input.invalid:focus,
.form-grid textarea.invalid:focus {
  border-color: var(--error-base);
  box-shadow: 0 0 0 3px rgba(192, 57, 26, 0.15);
}

.form-grid textarea { min-height: 160px; resize: vertical; }
@media (min-width: 768px) {
  .form-grid input, .form-grid textarea { font-size: 1.25em; }
}

.field-error {
  display: none;
  margin-top: 0.4rem;
  color: var(--error-dark);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1em;
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
}
.field-error.show { display: block; }

/* Banner component — used for form success/error messaging.
   Text size matches .form-grid input/textarea values so the two read as one system. */
.banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 75%;
  margin: 0 0 2.25rem;
  border-radius: 0.375rem;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 1.375em;
  font-weight: 300;
  line-height: 1.54;
  letter-spacing: 0;
}
.banner.show { display: flex; }
.banner p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
@media (min-width: 768px) {
  .banner { font-size: 1.25em; }
}

.banner--success {
  background-color: var(--success-tint);
  border: 1px solid var(--success-base);
  color: var(--success-dark);
  padding-right: 0.75rem;
}

.banner--error {
  background-color: var(--error-tint);
  border: 1px solid var(--error-base);
  color: var(--error-dark);
}

.banner-dismiss {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.banner--success .banner-dismiss:hover,
.banner--success .banner-dismiss:focus-visible {
  background-color: rgba(46, 80, 16, 0.1);
}
.banner-dismiss svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---------- Link list component ----------
   Stacked list of arrow-suffixed text links (e.g. profile/resource links).
   Usage:
     <nav class="link-list" aria-label="...">
       <a href="...">Label</a>
       <a href="...">Label</a>
     </nav>
   Spacing around the component is contextual — set via a selector scoped
   to where it's placed (below), rather than baked into the component itself. */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Home: sits below the case study grid */
.case-card-grid + .link-list {
  margin-top: 4rem;
}

/* About: sits below the profile image in the right rail */
.about-layout .link-list {
  margin-top: 2rem;
  margin-left: 1rem;
}
.link-list a {
  font-family: "Lato", Verdana, sans-serif;
  font-size: 1em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
  color: var(--charcoal);
  text-decoration: none;
}
.link-list a::after {
  content: " →";
}
.link-list a:hover {
  color: var(--teal);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem 0;
  color: var(--platinum);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}
.site-footer a {
  color: var(--platinum);
  text-decoration: none;
  font-family: "Lato", Verdana, sans-serif;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
}
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}
.site-footer .footer-meta {
  font-family: "Zilla Slab", Georgia, serif;
  font-size: 0.95em;
  color: var(--platinum);
}

@media (min-width: 768px) {
  .site-footer .footer-inner { padding: 0 2rem; }
  .site-footer .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.muted { color: var(--platinum); }
