/* articles.css — styles for /articles listing + /articles/:slug detail pages */
/* Standalone pages — NO dependency on home-v2.css or v2-shell */

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

:root {
  --sage: #4A5A50;
  --sage-light: #5E7A6A;
  --terracotta: #BD6338;
  --sand: #E8E3DC;
  --sand-dark: #D6C9BC;
  --earth: #8B6F47;
  --earth-light: #6B4B35;
  --white: #FFFFFF;
  --bg: #FAFAF8;
  --border: #E5DDD5;
  --text: #1A1A1A;
  --text-muted: rgba(26,26,26,0.55);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --bottomnav-h: 85px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Body — normal scroll, no v2-shell ───────────────────────────────────── */

.articles-body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}

/* ── Top bar — standalone (not v2-topbar) ────────────────────────────────── */

.articles-topbar {
  height: 58px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.articles-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.articles-logo-dot { color: var(--terracotta); }

.articles-topbar-actions { display: flex; gap: 8px; align-items: center; }
.articles-topbar-mascot { display: flex; align-items: center; }
.articles-topbar-mascot img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: transform 0.15s;
}

.articles-topbar-mascot:active img {
  transform: scale(0.9);
}

/* ── Bottom nav — fixed bar with home link, same height as spot pages ───── */

.articles-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottomnav-h);
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.articles-bottomnav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--sage);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.15s, transform 0.1s;
  padding: 8px 28px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.articles-bottomnav-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.articles-bottomnav-link:hover {
  color: var(--terracotta);
  background: rgba(74,90,80,0.06);
}

.articles-bottomnav-link:active {
  transform: scale(0.93);
  transition-duration: 0.05s;
}

/* ── Listing page ─────────────────────────────────────────────────────────── */

.articles-main {
  background: var(--bg);
  padding-bottom: 40px;
}

.articles-header {
  background: var(--sage);
  padding: 56px 24px 48px;
  color: var(--white);
}

.articles-header-inner {
  max-width: 900px;
  margin: 0 auto;
}

.articles-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  display: block;
  margin-bottom: 10px;
}

.articles-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.15;
}

.articles-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 36px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .articles-grid { grid-template-columns: 1fr; }
}

/* Article card — matches site card styling (border-radius, shadow) */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
}

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

.article-card:active {
  transform: scale(0.98);
  transition-duration: 0.05s;
}

.article-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
}

.article-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.article-card-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.article-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.article-card-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 6px;
}

.articles-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Back button — same style as spot detail ─────────────────────────────── */

.articles-back-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 24px 0;
}

.articles-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 10px 20px;
  background: var(--sage);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.articles-back-btn:hover {
  background: var(--sage-light);
}

.articles-back-btn:active {
  transform: scale(0.95);
  transition-duration: 0.05s;
}

/* ── Article detail page ─────────────────────────────────────────────────── */

.article-detail-main {
  background: var(--bg);
  padding-bottom: 40px;
}

.article-hero {
  width: 100%;
  height: 380px;
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
}

@media (max-width: 640px) {
  .article-hero { height: 240px; }
}

.article-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.article-meta-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.article-meta-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--terracotta);
  background: rgba(189,99,56,0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.article-meta-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 20px;
}

.article-intro {
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 32px;
  border-left: 3px solid var(--sage);
  padding-left: 18px;
  font-style: italic;
}

/* Article body — supports rich HTML from admin editor */
.article-body {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--text);
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.article-body p {
  margin: 0 0 16px;
}

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin: 0 0 16px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body strong {
  font-weight: 700;
}

.article-body em {
  font-style: italic;
  color: var(--sage);
}

.article-body blockquote {
  border-left: 4px solid var(--terracotta);
  padding-left: 18px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.article-body a {
  color: var(--sage);
  text-decoration: underline;
}

.article-body a:hover {
  color: var(--terracotta);
}

/* Admin editor special classes */
.article-body .article-tip-box,
.article-body .article-cta-box {
  background: rgba(74,90,80,0.07);
  border: 1px solid rgba(74,90,80,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
}

.article-body .article-tip-box strong,
.article-body .article-cta-box h2 {
  margin-top: 0;
}

.article-body .article-error-item {
  background: rgba(189,99,56,0.06);
  border: 1px solid rgba(189,99,56,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.article-body .article-error-item h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.article-category-icon {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--sage);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* ── Spots section ────────────────────────────────────────────────────────── */

.article-spots-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-spots-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 20px;
}

.article-spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.article-spot-card {
  display: flex;
  flex-direction: row;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.article-spot-img {
  width: 72px;
  height: 72px;
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
  flex-shrink: 0;
}

.article-spot-body {
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.article-spot-body strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.article-spot-body span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Desktop: left-align the nav link ──────────────────── */
@media (min-width: 768px) {
  .articles-bottomnav {
    justify-content: flex-start;
    padding-left: max(env(safe-area-inset-left), 20px);
  }
}

@media (max-width: 640px) {
  .article-container { padding: 24px 16px 0; }
  .article-spots-grid { grid-template-columns: 1fr; }
}