/* ─────────────────────────────────────────────────────────────
   Imad's Astrophotography Journal
   Old-fashioned simplicity (à la APOD) with a modern, dark gallery.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:        #0a0c10;
  --bg-soft:   #12151b;
  --card:      #151922;
  --fg:        #e9eaee;
  --muted:     #99a0ad;
  --line:      #232834;
  --accent:    #8ab4ff;
  --accent-dim:#5c7cc4;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1120px;
  --maxw-read: 760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: .3px;
  color: var(--fg);
}
.site-title:hover { text-decoration: none; color: #fff; }
.site-nav a {
  color: var(--muted);
  margin-left: 22px;
  font-size: .95rem;
}
.site-nav a:hover { color: var(--fg); text-decoration: none; }

/* ── Hero (latest capture) ──────────────────────────────────── */
.hero { text-align: center; margin-bottom: 64px; }
.hero-link { display: block; }
.hero-img {
  margin: 0 auto;
  max-height: 74vh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  transition: transform .35s ease;
}
.hero-link:hover .hero-img { transform: scale(1.008); }
.hero-caption { margin-top: 26px; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: .72rem;
  color: var(--accent-dim);
  margin: 0 0 6px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 12px;
}
.hero-title a { color: var(--fg); }
.hero-title a:hover { color: var(--accent); text-decoration: none; }
.hero-excerpt {
  max-width: var(--maxw-read);
  margin: 0 auto;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.2rem;
}

/* ── Gallery ────────────────────────────────────────────────── */
.gallery-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 0 0 28px;
  position: relative;
}
.gallery-heading::before,
.gallery-heading::after {
  content: "";
  display: inline-block;
  width: 46px;
  height: 1px;
  background: var(--line);
  vertical-align: middle;
  margin: 0 16px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, opacity .3s ease;
}
.card:hover .card-img { transform: scale(1.06); }
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  background: linear-gradient(to top, rgba(5,7,10,.85) 0%, rgba(5,7,10,.15) 55%, transparent 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.card:hover .card-overlay { opacity: 1; }
.card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #fff;
  line-height: 1.2;
}
.card-date { font-size: .78rem; color: var(--muted); margin-top: 3px; }

/* ── Entry page ─────────────────────────────────────────────── */
.entry { max-width: 960px; margin: 0 auto; }
.entry-figure { margin: 0 0 30px; text-align: center; }
.entry-img {
  margin: 0 auto;
  max-height: 82vh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.entry-head { text-align: center; margin-bottom: 34px; }
.entry-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.3rem;
  line-height: 1.15;
  margin: 0 0 8px;
}
.entry-meta {
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: .74rem;
  margin: 0;
}
.entry-body {
  max-width: var(--maxw-read);
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.75;
  color: #d7dae2;
}
.entry-body a { text-decoration: underline; }
.entry-body img { border-radius: 6px; margin: 24px auto; }
.entry-body h2, .entry-body h3 { font-family: var(--serif); font-weight: 600; }
.entry-body blockquote {
  border-left: 2px solid var(--accent-dim);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--muted);
  font-style: italic;
}

.entry-details {
  max-width: var(--maxw-read);
  margin: 40px auto 0;
  padding: 22px 26px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 22px;
  font-size: .95rem;
}
.entry-details dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: .72rem;
  align-self: center;
}
.entry-details dd { margin: 0; }

.entry-nav {
  max-width: var(--maxw-read);
  margin: 56px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: .9rem;
}
.entry-nav a { color: var(--muted); display: flex; flex-direction: column; }
.entry-nav a:hover { color: var(--fg); text-decoration: none; }
.entry-nav a span { color: var(--fg); font-family: var(--serif); font-size: 1.02rem; margin-top: 2px; }
.entry-nav .nav-next { text-align: right; align-items: flex-end; }
.entry-nav .nav-home { align-self: center; text-align: center; }

/* ── Generic page (About, etc.) ─────────────────────────────── */
.page { max-width: var(--maxw-read); margin: 0 auto; }
.page h1 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; }
.page-body { font-family: var(--serif); font-size: 1.2rem; line-height: 1.75; }
.page-body a { text-decoration: underline; }

/* ── Empty state ────────────────────────────────────────────── */
.empty { text-align: center; padding: 80px 0; }
.empty h1 { font-family: var(--serif); font-weight: 400; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 28px 24px 44px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}
.footer-social a { color: var(--muted); margin: 0 12px; font-size: .9rem; }
.footer-social a:hover { color: var(--fg); }
.footer-note { font-size: .82rem; margin: 14px 0 0; color: #6b7280; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero-title { font-size: 1.8rem; }
  .entry-title { font-size: 1.7rem; }
  .entry-body, .hero-excerpt { font-size: 1.12rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .site-header { margin-bottom: 28px; }
}
