/* PANO220 - Medium.com Inspired Design System */
/* Focused on typography, readability, and flow */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&family=Inter:wght@400;500;600;700&family=Spline+Sans+Mono:wght@400&display=swap');

:root {
  --bg-white: #ffffff;
  --text-primary: #242424;
  --text-secondary: #757575;
  --accent-green: #03a87c; /* Medium's signature green */
  --border-light: #f0f0f0;
  
  --font-serif: 'Merriweather', 'Georgia', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Spline Sans Mono', monospace;
  
  --content-width: 680px; /* The Golden Standard for reading */
  --wide-width: 1000px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }

/* Prevent layout shift from scrollbar appearing/disappearing */
html {
  scrollbar-gutter: stable;
}

body {
  background: var(--bg-white);
  color: #1a1a1a;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--text-primary); text-decoration: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2); transition: box-shadow 0.2s; }
a:hover { box-shadow: inset 0 -2px 0 var(--text-primary); }

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

/* Typography */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; margin-top: 2rem; }
h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; margin-top: 3rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { 
  margin-bottom: 2rem; 
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Layout */
.container { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; box-sizing:border-box; }
.wide-container { max-width: var(--wide-width); margin: 0 auto; padding: 0 24px; }

/* Navigation - Minimal & Sticky */
header { 
  position: sticky; top: 0; background: rgba(255,255,255,0.98); 
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent; 
  padding: 1.5rem 0; z-index: 100; transition: border-color 0.3s;
}
header.scrolled { border-bottom: 1px solid var(--border-light); }

/* Body typography – Merriweather is now the default serif */


nav { display: flex; justify-content: space-between; align-items: center; max-width: var(--wide-width); margin: 0 auto; padding: 0 24px; }
.logo a { font-family: var(--font-sans); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; box-shadow: none; }

.nav-links { display: flex; gap: 1.5rem; list-style: none; align-items: center; width: 100%; }
.nav-links a { font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); box-shadow: none; display: block; padding: 0.5rem 0; text-align: center; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--text-primary); }

/* Hero / Article Header */
.article-header { padding: 4rem 0 2rem; text-align: center; max-width: 100%; overflow: hidden; }
.article-header h1 { max-width: 100%; margin: 0 auto; }
.article-meta { font-family: var(--font-sans); font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; }
.author-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eee; }

/* Images – classic National Geographic look (border removed) */
.feature-image {
  width: 100%;
  max-width: 100%;
  margin: 2rem auto;
  /* border removed – now handled by page perimeter */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@media (max-width: 1200px) {
  .feature-image { margin: 2rem 0; width: 100%; }
}

/* Thick yellow border around the page perimeter */
body {
  border: 12px solid #ffd700;
  box-sizing: border-box; /* ensure border is included in layout */
}


/* Grid for Galleries – refined thumbnails */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gallery-item img {
  width: 100%;
  max-width: 250px;
  margin: 0 auto 0.5rem auto;
  object-fit: contain;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
}


.gallery-item h3 { margin: 0; font-size: 1.25rem; }
.gallery-item p { font-family: var(--font-sans); font-size: 1rem; color: var(--text-secondary); margin: 0.5rem 0 0; }

/* Footer - Clean */
footer { border-top: 1px solid var(--border-light); margin-top: 6rem; padding: 3rem 0; text-align: center; }
/* Subtle parchment texture for the page background */
body {
  background: #faf8f0 url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMTJMMTIgMEwwIDEyVjB6IiBmaWxsPSIjZGRkZGRkIiBvcGFjaXR5PSIwLjAyIi8+Cjwvc3ZnPg==') repeat;
  background-size: cover;
  margin: 0;
  overflow-x: hidden;
  border: 12px solid #ffd700;
  box-sizing: border-box;
}

footer p { font-family: var(--font-sans); font-size: 0.9rem; color: var(--text-secondary); margin: 0; }
footer a { font-family: var(--font-sans); margin: 0 1rem; font-size: 0.9rem; box-shadow: none; }
footer a:hover { color: var(--accent-green); }

/* Buttons */
.btn { 
  display: inline-block; background: var(--text-primary); color: white; 
  padding: 0.75rem 1.5rem; font-family: var(--font-sans); font-weight: 600; 
  font-size: 0.9rem; border-radius: 99px; box-shadow: none; margin-top: 1rem;
  transition: background 0.3s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent-green); transform: translateY(-2px); }

/* Clap Button - Medium.com style */
.clap-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 3rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
}
.clap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--text-secondary);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.4rem;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}
.clap-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  transform: scale(1.05);
}
.clap-btn.clapped {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
  transform: scale(1.15);
}
.clap-count {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.clap-count.clap-animate {
  transform: scale(1.3);
  color: var(--accent-green);
}


/* Responsive */
@media (max-width: 768px) {
  /* existing rules... (unchanged) */
}
/* Added mobile tweaks for diary layout */
@media (max-width: 768px) {
  .diary-header { padding: 1rem; font-size: 1.5rem; }
  .diary-content { padding: 0 1rem; }
}
@media (max-width: 480px) {
  .diary-header { font-size: 1.2rem; padding: 0.8rem; }
}
@media (max-width: 768px) {
  body { font-size: 18px; line-height: 1.6; }
  h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.2; text-align: center; }
  h2 { font-size: 1.4rem; text-align: center; }
  .container { padding: 0 20px; }
  header { padding: 1rem 0; } 
  nav { padding: 0 20px; }
  
  /* Grid & Images */
  .gallery-grid { grid-template-columns: 1fr; gap: 2rem; }
  .feature-image { margin: 1.5rem 0; width: 100%; }
  
  /* Typography */
  .drop-cap::first-letter { font-size: 3rem; padding-right: 0.5rem; }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  h1 { font-size: clamp(1.5rem, 7vw, 2rem); line-height: 1.15; }
  .article-header { padding: 2rem 0 1rem; }
  .btn { width: 100%; text-align: center; }
}

/* Diary layout base styles */
.diary-header {
  padding: 1.5rem;
  font-size: 2rem;
  font-family: 'Merriweather', var(--font-serif), serif;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1rem;
}
.diary-content {
  padding: 1rem 2rem;
  line-height: 1.7;
  font-family: 'Merriweather', var(--font-serif), serif;
  color: var(--text-primary);
}

/* Drop Cap for that Magazine feel */
.drop-cap::first-letter {
  float: left; font-size: 3.5rem; line-height: 0.8; font-weight: 700;
  padding-right: 0.75rem; padding-top: 0.1rem; font-family: var(--font-serif);
}
