/* ==========================================
   Guide Me Brand — Base Styles
   Inspired by guide_me_city but adapted for
   timeline-centric brand deep-dive reading.
   ========================================== */

:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555;
  --border: #e0ddd8;
  --accent: #1a1a2e;
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Songti SC", "Source Han Serif CN", serif;

  /* Dimension colors (set per-brand in brand.html via inline vars) */
  --dim-1: #1a1a2e;
  --dim-2: #e94560;
  --dim-3: #0f3460;
  --dim-4: #16213e;
  --dim-5: #533483;
  --dim-6: #e07a5f;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
a:hover { opacity: 0.8; }

/* ======== Layout ======== */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ======== Header ======== */

.site-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
}

.site-title a { text-decoration: none; }
.site-title a:hover { opacity: 0.8; }

.site-nav a {
  font-size: 14px;
  text-decoration: none;
  color: var(--text-secondary);
  margin-left: 20px;
}
.site-nav a:hover { color: var(--text); }
.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.site-nav-icon {
  display: block;
  width: 18px;
  height: 17px;
  max-width: 18px;
  max-height: 17px;
  flex: 0 0 18px;
  overflow: hidden;
}
.site-nav-brand-name { font-weight: 600; }
.site-nav-ai-label {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ======== Brand Hero ======== */

.brand-hero {
  margin-bottom: 48px;
}

.brand-hero h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.brand-hero .tagline {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.brand-hero .intro {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ======== Timeline ======== */

.timeline-wrapper {
  position: relative;
  margin: 48px 0;
  padding-left: 32px;
}

.timeline-line {
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: block;
  position: relative;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.timeline-item:hover,
.timeline-item:focus-visible {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.timeline-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.timeline-item .meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.timeline-item .period {
  display: inline-block;
  background: var(--border);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.timeline-item h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 4px;
}

.timeline-item h3 a {
  text-decoration: none;
}

.timeline-item .summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-item .dimension-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ======== Dimension filter ======== */

.dimension-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 6px 16px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

/* ======== Topic Page ======== */

.topic-header {
  margin-bottom: 40px;
}

.topic-header .breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.topic-header .breadcrumb a {
  text-decoration: none;
}
.topic-header .breadcrumb a:hover { text-decoration: underline; }

.topic-header h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.topic-header .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-secondary);
}

.topic-dimension {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
}

.topic-content {
  max-width: 680px;
}

.topic-adjacent {
  max-width: 680px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.topic-adjacent-top {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.topic-adjacent-bottom { margin-bottom: 22px; }
.adjacent-link {
  display: block;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  line-height: 1.45;
  text-decoration: none;
}
.adjacent-link:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.adjacent-next { text-align: right; }
.adjacent-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.topic-content h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.topic-content h3 {
  font-size: 18px;
  margin: 24px 0 8px;
}

.topic-content p {
  margin-bottom: 16px;
  line-height: 1.85;
}

.topic-content figure,
.topic-content p:has(> img) {
  margin: 28px 0 10px;
  text-align: center;
}

.topic-content img {
  display: block;
  width: auto;
  max-width: min(100%, 560px);
  max-height: 520px;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

.topic-content figure figcaption,
.topic-content p:has(> em:only-child) {
  max-width: min(100%, 560px);
  margin: 8px auto 18px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

.topic-content blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  font-size: 14px;
}

.topic-content ul, .topic-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.topic-content li {
  margin-bottom: 8px;
}

.topic-content table {
  width: 100%;
  margin: 24px 0 28px;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 14px;
}

.topic-content th,
.topic-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.topic-content th {
  background: #f1eee9;
  font-weight: 600;
}


/* ======== Homepage (brand listing) ======== */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.brand-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.brand-card:hover,
.brand-card:focus-visible {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.brand-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.brand-card h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 8px;
}

.brand-card h2 a {
  text-decoration: none;
}

.brand-card .count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.brand-card .summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ======== Questions ======== */

.questions-section {
  max-width: 680px;
  margin: 48px 0 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.questions-section h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 16px;
}

.questions-section ol {
  padding-left: 20px;
}

.questions-section li {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.topic-foot-nav {
  max-width: 680px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.brand-footer,
.comments-section {
  max-width: 680px;
  margin: 56px 0 0;
}
.brand-footer-divider {
  width: 48px;
  height: 2px;
  margin-bottom: 18px;
  background: var(--accent);
}
.brand-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.brand-footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  display: block;
  width: 26px;
  height: 24px;
  max-width: 26px;
  max-height: 24px;
  color: var(--accent);
  flex: 0 0 26px;
  overflow: hidden;
}
.brand-footer-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.brand-footer-eyebrow { color: var(--text-secondary); font-size: 13px; }
.brand-footer-name { font-weight: 600; }
.brand-footer-cta { color: var(--text); font-size: 13.5px; }
.brand-footer-arrow { margin-left: 4px; }
.comments-section {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ======== Footer ======== */

.site-footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ======== Responsive ======== */

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .brand-hero h1 { font-size: 28px; }
  .topic-header h1 { font-size: 26px; }
  .topic-content { max-width: 100%; }
  .topic-adjacent { grid-template-columns: 1fr; }
  .adjacent-next { text-align: left; }
  .brand-footer-content { align-items: flex-start; flex-direction: column; }
  .timeline-wrapper { padding-left: 24px; }
  .brand-grid { grid-template-columns: 1fr; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}
