/* ============================================
   Flying Behr — Main Stylesheet
   Warm, minimal, editorial
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;1,400&family=Source+Sans+3:wght@300;400;500&display=swap');

/* --- Variables --- */
:root {
  --bg:         #f7f4ef;
  --bg-alt:     #f0ece4;
  --text:       #1a1814;
  --text-light: #6b6560;
  --accent:     #8b6f47;
  --border:     #e0d9ce;
  --max-width:  680px;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Source Sans 3', system-ui, sans-serif;
}

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

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2rem 1.5rem;
  max-width: calc(var(--max-width) + 4rem);
  margin: 0 auto;
  width: 100%;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
  transition: color 0.15s ease;
}

.site-title:hover {
  color: var(--accent);
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
}

/* --- Main Content --- */
.site-main {
  flex: 1;
  max-width: calc(var(--max-width) + 4rem);
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

/* --- Post List (Home) --- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-preview {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.post-preview:first-child {
  padding-top: 0;
}

.post-thumbnail {
  display: block;
  flex-shrink: 0;
}

.post-thumbnail img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 2px;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.post-thumbnail:hover img {
  opacity: 1;
}

.post-preview-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-preview-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}

.post-preview-title a {
  color: var(--text);
  transition: color 0.15s ease;
}

.post-preview-title a:hover {
  color: var(--accent);
}

.post-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.03em;
  display: block;
}

.post-teaser {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.55;
  margin-top: 0.25rem;
}

/* Post preview without image */
.post-preview:not(:has(.post-thumbnail)) {
  grid-template-columns: 1fr;
}

/* --- Individual Post --- */
.post {
  max-width: var(--max-width);
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.post-hero {
  margin: 0 -2rem 2.5rem;
}

.post-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.post-content {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.post-content p { margin-bottom: 1.4rem; }

.post-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
}

.post-content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}

.post-content img {
  width: 100%;
  margin: 2rem 0;
  border-radius: 2px;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-style: italic;
}

/* --- Post Navigation --- */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-light);
  gap: 1rem;
}

.post-nav a {
  color: var(--text-light);
  transition: color 0.15s ease;
}

.post-nav a:hover {
  color: var(--text);
}

.post-nav-next {
  margin-left: auto;
}

/* --- Page (About etc.) --- */
.page-content {
  max-width: var(--max-width);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
}

.page-content h1 {
  font-size: 1.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.page-content p { margin-bottom: 1.4rem; }

.page-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Footer --- */
.site-footer {
  max-width: calc(var(--max-width) + 4rem);
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-light);
}

.site-footer a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html { font-size: 17px; }

  .site-header { padding: 1.5rem 1.25rem 1.25rem; }
  .site-main { padding: 2rem 1.25rem; }
  .site-footer { padding: 1.5rem 1.25rem 2rem; }

  .post-preview {
    grid-template-columns: 90px 1fr;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .post-thumbnail img {
    width: 90px;
    height: 68px;
  }

  .post-hero {
    margin: 0 -1.25rem 2rem;
  }

  .post-title { font-size: 1.5rem; }
}

/* --- Photo Grid --- */
.photo-grid {
  display: grid;
  gap: 0.4rem;
  margin: 2rem 0;
}

.photo-grid.halves {
  grid-template-columns: 1fr 1fr;
}

.photo-grid.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

.photo-grid img {
  width: 100%;
  height: auto;
  object-fit: unset;
  margin: 0;
  border-radius: 2px;
}

/* --- Lightbox --- */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
  overflow: hidden;
  touch-action: none;
}

#lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  margin: 0;
}

/* --- Custom Cursor --- */
* { cursor: none !important; }

#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease;
  z-index: 99999;
}

#cursor.cursor-grow {
  width: 18px;
  height: 18px;
  background: var(--text);
  outline: 2px solid white;
  outline-offset: 2px;
}