/* ============================================
   FLYING SUMMERS BROTHERS
   Sky theme with blue accents
   ============================================ */

:root {
  --sky: #4a90c4;
  --sky-light: #7ab8e0;
  --sky-dark: #2c6a9e;
  --sky-pale: #d6e9f5;
  --white: #ffffff;
  --card-bg: #ffffff;
  --text: #2a2a2a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #ddd;
  --shadow: rgba(44, 80, 120, 0.12);
  --shadow-heavy: rgba(44, 80, 120, 0.2);
  --quote-bg: #f0f5fa;
  --radius: 6px;
  --max-width: 820px;
  --nav-height: 56px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--sky-pale);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sky background */
.sky-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 40% at 20% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 80% 20% at 70% 20%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse 100% 15% at 40% 55%, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse 60% 10% at 80% 45%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
    radial-gradient(ellipse 90% 12% at 15% 70%, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
    linear-gradient(180deg, #6baed6 0%, #9ecae1 30%, #c6dbef 55%, #deebf7 75%, #f0f6fb 100%);
}

a { color: var(--sky-dark); text-decoration: none; }
a:hover { color: var(--sky); }

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

/* ============================================
   Navbar
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(42, 42, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px var(--shadow);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: var(--nav-height);
}

.navbar-brand {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sky-light);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.navbar-brand:hover { color: var(--white); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: #ccc;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  background: rgba(42, 42, 42, 0.98);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  min-width: 180px;
  padding: 0.25rem 0;
  z-index: 101;
}

.nav-dropdown a {
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  border-radius: 0;
  white-space: nowrap;
}

.nav-links > li:hover > .nav-dropdown {
  display: block;
}

/* CSS-only hamburger menu */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; }

@media (max-width: 640px) {
  .nav-toggle-label {
    display: block;
    width: 28px;
    height: 20px;
    position: relative;
  }
  .nav-toggle-label::before,
  .nav-toggle-label::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ccc;
    transition: transform 0.2s;
  }
  .nav-toggle-label::before { top: 0; box-shadow: 0 9px 0 #ccc; }
  .nav-toggle-label::after { top: 18px; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(42, 42, 42, 0.98);
    flex-direction: column;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 12px var(--shadow);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    min-width: 0;
    padding-left: 1rem;
  }
  .nav-links > li:hover > .nav-dropdown { display: block; }
  .nav-toggle:checked ~ .nav-toggle-label::before {
    transform: rotate(45deg) translate(6px, 6px);
    box-shadow: none;
  }
  .nav-toggle:checked ~ .nav-toggle-label::after {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* ============================================
   Search dialog (CSS-only)
   ============================================ */
.search-toggle { display: none; }

.search-icon {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  color: #ccc;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.search-icon:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

.search-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
}

.search-dialog {
  display: none;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 201;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
}

.search-toggle:checked ~ .search-overlay { display: block; }
.search-toggle:checked ~ .search-dialog { display: block; }

.search-dialog h3 {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.search-dialog form {
  display: flex;
  gap: 0.5rem;
}

.search-dialog input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--sans);
}

.search-dialog button {
  padding: 0.5rem 1rem;
  background: var(--sky-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
}
.search-dialog button:hover { background: var(--sky); }

.search-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}
.search-close:hover { color: var(--text); }

/* ============================================
   Site banner — rotating masthead strip
   ============================================ */
.site-banner {
  max-width: var(--max-width);
  margin: 0 auto 1.5rem;
  padding: 1rem;
  padding-top: 0;
  background: rgba(42, 42, 42, 0.95);
}

.site-banner img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

/* ============================================
   Cards (shared)
   ============================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
}

/* ============================================
   Index layout — cards + sidebar
   ============================================ */
/* ============================================
   Blog index — card layout with header bands
   ============================================ */
.blog-index {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
}

.card-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: last baseline;
}

.card-header time {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem 0.15rem 0.75rem;
  text-align: right;
}

.card-header h2 {
  font-family: var(--sans);
  font-size: 1.2rem;
  line-height: 1.3;
  padding: 0.3rem 1.25rem 0.15rem;
  background: var(--text-muted);
}

.card-header h2 a { color: var(--white); }
.card-header h2 a:hover { color: var(--sky-pale); }

.card-image {
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 160px;
}

.card-body {
  padding: 0.75rem 0.5rem 0.5rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.post-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.post-categories a {
  font-size: 0.8rem;
  color: var(--sky-dark);
  background: var(--sky-pale);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}
.post-categories a:hover { background: var(--sky-light); color: var(--white); }

.excerpt {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 0.5rem;
}

.read-more {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sky-dark);
  align-self: flex-end;
}
.read-more:hover { color: var(--sky); }

@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; }
  .card-header { grid-template-columns: 1fr; }
  .card-header time { text-align: left; padding: 0.3rem 1.25rem 0.15rem; }
  .card-header h2 { background: var(--text-muted); }
  .card-image { max-height: 220px; }
}

/* ============================================
   Post page
   ============================================ */
main > .post {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2rem 2.5rem;
}

.post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.post-author {
  font-style: italic;
}

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

/* Center images */
.post-content figure {
  margin: 1.5rem auto;
  text-align: center;
}

.post-content figure img {
  border-radius: var(--radius);
  margin: 0 auto;
  cursor: pointer;
}

.post-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 0.4rem;
}

.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { text-decoration-color: var(--sky-light); }

.post-content > p > img:only-child,
.post-content > img {
  margin: 1.5rem auto;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Pull quotes / blockquotes */
.post-content blockquote {
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  max-width: 600px;
  background: var(--quote-bg);
  border-left: 3px solid var(--sky-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--sans);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

.post-content blockquote p { margin-bottom: 0.5rem; }
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content blockquote cite,
.post-content blockquote .attribution {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-style: normal;
  color: var(--text-muted);
}

/* ============================================
   Lightbox gallery (CSS-only with prev/next)
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox:target {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
  max-width: 600px;
}

.lightbox-title {
  position: fixed;
  top: 1rem;
  left: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  z-index: 301;
}
.lightbox-title:hover { color: #fff; }

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  line-height: 1;
  z-index: 301;
}
.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 1rem;
  z-index: 301;
  user-select: none;
}
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

.lightbox-counter {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.4rem;
}

/* Make images in post content clickable */
.post-content figure a,
.gallery a {
  text-decoration: none;
}

/* Galleries */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.gallery img {
  width: 240px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity 0.15s;
  cursor: pointer;
}
.gallery img:hover { opacity: 0.85; }

/* Video embeds */
.video-embed {
  margin: 1.5rem 0;
}
.video-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius);
}
.video-embed video {
  width: 100%;
  border-radius: var(--radius);
}

/* ============================================
   Comments (CSS-only dialog, sans-serif)
   ============================================ */
.comments-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.comments-toggle { display: none; }

.comments-toggle-label {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--sky-dark);
  cursor: pointer;
  text-decoration: none;
}
.comments-toggle-label:hover {
  text-decoration: underline;
}

.comments-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  cursor: pointer;
}

.comments-dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 600px);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  padding: 2rem;
  z-index: 201;
  font-family: var(--sans);
}

.comments-toggle:checked ~ .comments-overlay { display: block; }
.comments-toggle:checked ~ .comments-dialog { display: block; }

.comments-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}
.comments-close:hover { color: var(--text); }

.comments-dialog h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.comment {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #eee;
}
.comment:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.comment-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.comment-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================
   Post navigation
   ============================================ */
.post-nav {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--sky-dark);
  background: var(--card-bg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px var(--shadow);
  max-width: 45%;
  transition: box-shadow 0.15s;
}
.post-nav a:hover { box-shadow: 0 2px 12px var(--shadow-heavy); color: var(--sky); }

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

/* ============================================
   Page navigation (index pagination)
   ============================================ */
.page-nav {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-style: italic;
}

.page-nav .pn-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  padding: 0 1em;
}

.page-nav .pn-label {
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sky-dark);
  font-style: normal;
}

.page-nav a {
  color: var(--sky-dark);
  text-decoration: none;
}
.page-nav a:hover { text-decoration: underline; }

.page-nav .current {
  color: var(--text-muted);
}

.page-nav-top .pn-slot {
  flex-direction: column-reverse;
}

/* ============================================
   Footer
   ============================================ */
footer {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem 1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

footer a { color: rgba(255, 255, 255, 0.85); }
footer a:hover { color: #fff; }

/* ============================================
   Static pages
   ============================================ */
.page-content {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2rem 2.5rem;
}

.page-content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.3rem; }

.page-content figure { margin: 1.5rem auto; text-align: center; }
.page-content figure img { border-radius: var(--radius); margin: 0 auto; }
.page-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.4rem;
}

@media (max-width: 640px) {
  main > .post { padding: 1.25rem; margin: 1rem 0.5rem; }
  .post-header h1 { font-size: 1.5rem; }
  .page-content { padding: 1.25rem; margin: 1rem 0.5rem; }
  .site-banner img { max-height: 120px; object-fit: cover; }
  .post-content blockquote { margin: 1.25rem auto; padding: 1rem 1.25rem; font-size: 1.15rem; }
  .lightbox-prev { left: 0; font-size: 2rem; }
  .lightbox-next { right: 0; font-size: 2rem; }
}
