/* ============================================================
   robertkfoster.com — Shared Stylesheet
   ============================================================ */

/* ── Variables ── */
:root {
  --bg:         #163360;
  --bg-warm:    #102a50;
  --cream:      #e8e0d0;
  --cream-dim:  #a89f90;
  --gold:       #c8a96e;
  --gold-dim:   #7a6540;
  --rule:       rgba(200,169,110,0.25);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Libre Baskerville', Georgia, serif;

  --max-width:  860px;
  --pad-h:      2rem;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cream);
}

/* ── Navigation ── */
.site-nav {
  position: relative;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-warm);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.4rem var(--pad-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-home {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream);
  white-space: nowrap;
}

.nav-home:hover {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
  transition: color 0.2s ease;
}

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

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.is-open .nav-dropdown-toggle {
  color: var(--gold);
}

.dropdown-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  list-style: none;
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-dropdown-menu li:last-child a {
  border-bottom: none;
}

.nav-dropdown-menu li a:hover {
  color: var(--gold);
  background: rgba(200,169,110,0.07);
}

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--cream);
  transition: background 0.2s ease;
}

.nav-mobile-toggle:hover span {
  background: var(--gold);
}

/* Mobile menu */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem var(--pad-h) 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-warm);
  gap: 0;
}

.nav-mobile-menu.is-open {
  display: flex;
}

.nav-mobile-menu a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease;
}

.nav-mobile-menu a:last-child {
  border-bottom: none;
}

.nav-mobile-menu a:hover {
  color: var(--gold);
}

.nav-mobile-sub {
  padding-left: 1rem !important;
  font-size: 0.78rem !important;
}

/* ── Page header image ── */
.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.page-header-text {
  flex: 1;
  min-width: 0;
}

.page-header-image {
  flex-shrink: 0;
  width: auto;
  height: 222px;
  overflow: hidden;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header-image img {
  height: 222px;
  width: auto;
  display: block;
  object-fit: cover;
}

.page-header-image.is-circle {
  border-radius: 50%;
  width: 222px;
}

.page-header-image.is-circle img {
  width: 222px;
  border-radius: 50%;
  object-fit: cover;
}

.page-header-placeholder {
  color: var(--gold-dim);
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header-image {
    width: 100%;
    height: 180px;
    align-self: stretch;
  }

  .page-header-image img {
    width: 100%;
    height: 180px;
  }

  .page-header-image.is-circle {
    width: 180px;
    height: 180px;
    align-self: center;
    border-radius: 50%;
  }

  .page-header-image.is-circle img {
    width: 180px;
    height: 180px;
  }
}


.page-header {
  border-bottom: 1px solid var(--rule);
  padding: 4rem var(--pad-h) 3rem;
  animation: fade-up 0.6s ease both;
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.page-tagline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.04em;
}

/* ── Main content ── */
.page-content {
  flex: 1;
  padding: 3.5rem var(--pad-h) 5rem;
  animation: fade-up 0.6s ease 0.1s both;
}

.content-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Section labels */
.section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem var(--pad-h);
  margin-top: auto;
  background: var(--bg-warm);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--cream);
}

.footer-copy {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream);
}

/* ── Animations ── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  :root {
    --pad-h: 1.25rem;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 641px) {
  .nav-mobile-menu {
    display: none !important;
  }
}

/* ── Placeholder pages ── */
.page-placeholder {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.02em;
  padding-top: 1rem;
}

/* ── Card link component (reusable across site) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  color: inherit;
}

.card-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 8px 0 0 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1.3;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.82);
  margin-top: 0.6rem;
}

.card-arrow {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease, gap 0.2s ease;
}

.card-link:hover .card-arrow {
  color: #fff;
  gap: 0.65rem;
}

/* ── Card color variants ──────────────────────────────────
   Three tonal sets: dark (aiartwork), medium (home page),
   light (future use). Pick any class on a .card-link.
   ──────────────────────────────────────────────────────── */

/* Dark set */
.card-crimson    { background-color: #8a1a2a; }
.card-pine       { background-color: #1e5a3a; }
.card-sienna     { background-color: #8a3a1a; }
.card-cobalt     { background-color: #1a3a8a; }
.card-terracotta { background-color: #b04a32; }
.card-teal       { background-color: #27706a; }
.card-purple     { background-color: #5e3d80; }
.card-olive      { background-color: #7a6a20; }
.card-gold       { background-color: #8a6a20; }
.card-rose       { background-color: #903050; }
.card-forest     { background-color: #2a6040; }
.card-steel      { background-color: #2a5080; }
.card-indigo     { background-color: #3a2a7a; }
.card-brown      { background-color: #6a3a18; }
.card-slate      { background-color: #3a4a5a; }
.card-moss       { background-color: #4a5a2a; }

/* Medium set */
.card-rose-med      { background-color: #b84a68; }
.card-forest-med    { background-color: #2a7a50; }
.card-sienna-med    { background-color: #9a4a18; }
.card-cobalt-med    { background-color: #3a4a8a; }
.card-teal-med      { background-color: #2a6a7a; }
.card-purple-med    { background-color: #6a3a7a; }
.card-crimson-med   { background-color: #b83a4a; }
.card-pine-med      { background-color: #2a6a4a; }
.card-gold-med      { background-color: #8a6a2a; }
.card-indigo-med    { background-color: #4a3a8a; }
.card-terracotta-med{ background-color: #b85a3a; }
.card-slate-med     { background-color: #4a5a6a; }
.card-olive-med     { background-color: #6a6a2a; }
.card-brown-med     { background-color: #8a5a2a; }
.card-steel-med     { background-color: #3a5a7a; }
.card-moss-med      { background-color: #5a6a3a; }

/* Light set */
.card-rose-lt      { background-color: #c4607a; }
.card-forest-lt    { background-color: #3a8a6a; }
.card-sienna-lt    { background-color: #b06030; }
.card-cobalt-lt    { background-color: #4a5a9a; }
.card-teal-lt      { background-color: #3a7a8a; }
.card-purple-lt    { background-color: #7a4a8a; }
.card-crimson-lt   { background-color: #c05060; }
.card-pine-lt      { background-color: #3a7a5a; }
.card-gold-lt      { background-color: #9a7a3a; }
.card-indigo-lt    { background-color: #5a4a9a; }
.card-terracotta-lt{ background-color: #c06a4a; }
.card-slate-lt     { background-color: #5a6a7a; }
.card-olive-lt     { background-color: #7a7a3a; }
.card-brown-lt     { background-color: #9a6a3a; }
.card-steel-lt     { background-color: #4a6a8a; }
.card-moss-lt      { background-color: #6a7a4a; }

/* Footer name as home link */
a.footer-name {
  color: var(--cream);
  text-decoration: none;
  transition: color 0.2s ease;
}

a.footer-name:hover {
  color: var(--gold);
}

/* ── App link component ── */
.app-links {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: calc((var(--max-width) / 4) * 3 + 3rem);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.app-link-item {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.app-link-item:hover {
  border-color: var(--gold);
  background: rgba(255,255,255,0.07);
  color: inherit;
}

.app-link-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.app-link-icon::before {
  content: '🖥️';
}

.app-link-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-link-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.app-link-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.6;
}

.app-link-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
  min-width: 4.5rem;
}

/* App link category pills */
.app-link-category {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--cream);
  color: #1a1a1a;
}

.app-link-category-artwork {
  background-color: #f0a878;
}

.app-link-category-finance {
  background-color: #7ec8a0;
}

.app-link-category-philosophy {
  background-color: #b89ad0;
}

.app-link-category-computing {
  background-color: #7aaad0;
}

.app-link-category-project {
  background-color: #d08888;
}

.app-link-arrow {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.app-link-item:hover .app-link-arrow {
  color: var(--gold);
}

/* ── Lightbox ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 35, 0.95);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.visible {
  display: flex;
}

.lightbox-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 4rem;
  min-height: 0;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-footer {
  width: 100%;
  background: var(--bg-warm);
  border-top: 1px solid var(--rule);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.lightbox-info {
  flex: 1;
  min-width: 0;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  color: var(--cream);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.lightbox-caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--cream-dim);
  line-height: 1.5;
}

.lightbox-meta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lightbox-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--cream);
  font-size: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lightbox-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lightbox-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--cream);
  font-size: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
  z-index: 201;
}

.lightbox-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lightbox-counter {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--cream-dim);
  letter-spacing: 0.1em;
  min-width: 3rem;
  text-align: center;
}

@media (max-width: 640px) {
  .lightbox-image-wrap {
    padding: 1rem;
  }

  .lightbox-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .lightbox-nav {
    align-self: flex-end;
  }
}


.site-footer .footer-disclaimer {
  width: 100%;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display) !important;
  font-size: 0.68rem !important;
  font-weight: 300 !important;
  font-style: italic !important;
  letter-spacing: 0.03em;
  line-height: 1.7;
  color: var(--cream-dim) !important;
}