/* ===== Peninsula News — Mobile-First Stylesheet ===== */

:root {
  --primary: #1B4D3E;
  --primary-light: #2d7a5f;
  --accent: #D97706;
  --bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --max-width: 720px;
  --nav-height: 56px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Navigation ===== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.nav-logo {
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

.logo-icon { font-size: 24px; }
.logo-accent { color: var(--accent); }

.nav-cities {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--primary);
  padding: 8px 16px 16px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-cities.open { display: flex; }

.nav-cities a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-cities a:hover,
.nav-cities a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.nav-menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ===== Hero ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

.hero-link {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: white;
  box-shadow: var(--shadow-lg);
}

.hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.hero-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}

.hero-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hero-category,
.card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--cat-color, #6b7280);
  color: white;
}

.hero-city,
.card-city {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--city-color, #666);
  color: white;
}

.hero-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.hero-excerpt {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
}

/* ===== Container & Section ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 32px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 16px;
}

.section-header h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  color: var(--primary);
}

.section-date {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== City Quick Links ===== */
.city-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.city-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  border-top: 3px solid var(--city-color, #666);
  transition: transform 0.2s, box-shadow 0.2s;
}

.city-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.city-quick-emoji { font-size: 24px; }
.city-quick-name { font-weight: 600; font-size: 14px; }
.city-quick-count { font-size: 12px; color: var(--text-secondary); }

/* ===== Article Cards ===== */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-card {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  width: 110px;
  min-height: 110px;
  flex-shrink: 0;
}

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

.card-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.card-time {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.card-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-source {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 4px;
}

/* ===== City Header ===== */
.city-header {
  background: linear-gradient(135deg, var(--city-color, #1B4D3E) 0%, color-mix(in srgb, var(--city-color, #1B4D3E) 60%, black) 100%);
  color: white;
  padding: 32px 16px;
  text-align: center;
}

.city-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.city-header-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.city-header h1 { font-family: 'Merriweather', Georgia, serif; font-size: 28px; margin-bottom: 4px; }
.city-header p { font-size: 14px; opacity: 0.85; }

/* ===== Category Tabs ===== */
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== Article Detail ===== */
.article-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

.article-breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.article-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.article-breadcrumb a:hover { text-decoration: underline; }

.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.article-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.article-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
  color: var(--text);
}

.article-image {
  margin: 0 -16px 24px;
}

.article-image img {
  width: 100%;
  height: auto;
  display: block;
}

.article-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.article-content p {
  margin-bottom: 16px;
}

.article-source {
  margin-top: 24px;
  padding: 16px;
  background: #F3F4F6;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-secondary);
}

.article-source a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.article-source a:hover { text-decoration: underline; }

/* ===== Article Nav ===== */
.article-nav {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: center;
}

.article-nav-link {
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-nav-link.prev,
.article-nav-link.next {
  color: var(--primary);
  background: #EDF7F3;
}

.article-nav-link.home {
  color: white;
  background: var(--primary);
}

.article-nav-link:hover { opacity: 0.85; }

/* ===== Footer ===== */
.site-footer {
  background: #1F2937;
  color: #D1D5DB;
  padding: 32px 16px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.footer-disclaimer {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 8px;
  line-height: 1.5;
}

.footer-disclaimer a { color: #93C5FD; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: #93C5FD;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover { text-decoration: underline; }

.footer-copy {
  font-size: 12px;
  color: #6B7280;
}

/* ===== Page Content (About) ===== */
.page-content {
  padding-top: 32px;
}

.page-content h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--primary);
}

.page-content h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 20px;
  margin: 24px 0 12px;
  color: var(--text);
}

.page-content p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.page-content ul {
  margin: 0 0 16px 24px;
  line-height: 1.7;
}

.page-content a { color: var(--primary); }

/* ===== Desktop ===== */
@media (min-width: 640px) {
  .nav-cities {
    display: flex;
    position: static;
    padding: 0;
    flex-direction: row;
    gap: 4px;
    box-shadow: none;
    background: transparent;
  }
  
  .nav-menu-btn { display: none; }
  
  .hero-img,
  .hero-placeholder { height: 360px; }
  
  .hero-title { font-size: 28px; }
  
  .card-image { width: 140px; min-height: 130px; }
  .card-title { font-size: 16px; }
  
  .article-title { font-size: 32px; }
  .article-image { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
}

@media (min-width: 900px) {
  :root { --max-width: 840px; }
}
