/* ============================================================
   Ognjen Sporin — Portfolio
   One stylesheet for the whole site.
   To change colors/fonts later, edit the values in :root below.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap');

:root {
  --bg: #f4f1ec;          /* warm off-white page background */
  --surface: #faf8f4;     /* slightly lighter cards/panels */
  --text: #2e2a25;        /* warm near-black */
  --text-soft: #6f675b;   /* muted brown-gray */
  --text-faint: #a89e8d;  /* faint warm gray for labels */
  --line: #e3ded4;        /* hairline borders */
  --accent: #2e2a25;      /* hover/active color for menu */
  --max-width: 1200px;
  --gap: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header / navigation ---------- */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 38px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand .name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
/* Subtitle — deliberately styled as a non-clickable descriptive label */
.brand .tagline {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  margin-top: 6px;
  text-transform: uppercase;
  cursor: default;
}

.main-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.main-nav a {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding-bottom: 4px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Mobile menu toggle ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Page wrapper ---------- */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 38px;
}

.page-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 24px;
}
/* breadcrumb for sub-pages, e.g. DnD Work › Ryoko's Guide */
.breadcrumb {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-faint); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 8px; }
.breadcrumb .here { color: var(--text); }

.gallery-intro {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}

.page-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 24px;
}

/* ---------- Gallery (masonry, left-to-right order, no crop) ---------- */
.gallery {
  position: relative;   /* JS positions the images absolutely inside this */
  opacity: 1;
  transition: opacity 0.35s ease;
}
/* while the masonry is being calculated, keep it invisible so the
   reader never sees the brief flash of full-size unpositioned images */
.gallery.laying-out { opacity: 0; }
.gallery.ready { opacity: 1; }
.gallery img {
  position: absolute;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  background: var(--surface);
  transition: opacity 0.2s;
}
.gallery img:hover { opacity: 0.85; }

.gallery-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}

/* ---------- Sub-section cards (category landing pages) ---------- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.section-grid.three { grid-template-columns: repeat(3, 1fr); }

.section-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #e8e3d9;
}
.section-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}
.section-card:hover img { transform: scale(1.04); }
.section-card .label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 20px;
  background: linear-gradient(transparent, rgba(40,34,28,0.78));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- About page ---------- */
.about-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}
.about-photo {
  width: 100%;
  border-radius: 6px;
  display: block;
  background: #e8e3d9;
}
.about-text h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.about-text .role {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.about-text h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 28px 0 10px;
}
.about-text p { margin-bottom: 14px; }
.about-text ul { list-style: none; }
.about-text li { margin-bottom: 8px; }
.about-text li .year { color: var(--text-faint); margin-right: 10px; }

/* ---------- Teaching / Contact ---------- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s, transform 0.2s;
}
.link-card:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}
.link-card .lc-thumb {
  flex: 0 0 auto;
  width: 120px;
  height: 84px;
  border-radius: 6px;
  object-fit: contain;     /* show the whole image, no cropping */
  background: transparent;
  display: block;
}
.link-card .lc-body { flex: 1 1 auto; }
.link-card .lc-title { font-size: 16px; font-weight: 500; }
.link-card .lc-sub { font-size: 13px; color: var(--text-soft); margin-top: 3px; }
.link-card .lc-arrow { font-size: 18px; color: var(--text-faint); flex: 0 0 auto; }

.contact-text { max-width: 560px; }
.contact-text a.email-link { border-bottom: 1px solid var(--text); }

/* ---------- Lightbox (click to enlarge) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30,26,22,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox .lb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 92vw;
  max-height: 92vh;
}
.lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 4px;
  cursor: default;
}
.lightbox .lb-caption {
  color: #f4f1ec;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 80vw;
  cursor: default;
}
.lightbox .lb-close {
  position: absolute;
  top: 22px; right: 28px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max-width);
  margin: 60px auto 0;
  padding: 28px 38px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
  }
  .main-nav.open { display: flex; }
  .gallery { column-count: 2; }
  .section-grid, .section-grid.three { grid-template-columns: 1fr; }
  .about-wrap { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { max-width: 220px; }
}

@media (max-width: 480px) {
  .gallery { column-count: 1; }
  .site-header { padding: 24px 22px 18px; }
  .page { padding: 26px 22px; }
}
