/* ============================================
   DARKROOM THEME
   Visual DNA transferred from HTML5UP Lens
   Dark palette, teal accent, sidebar philosophy,
   dense mosaic rhythm, geometric sans typography
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg-deep: #101010;
  --color-bg-panel: #ffffff;
  --color-bg-elevated: #181818;
  --color-bg-card: #1a1a1a;
  --color-accent: #00D3B7;
  --color-accent-dim: rgba(0, 211, 183, 0.15);
  --color-text-body: #aaaaaa;
  --color-text-heading: #e0e0e0;
  --color-text-muted: #666666;
  --color-text-on-panel: #555555;
  --color-border: rgba(255,255,255,0.08);
  --color-border-strong: rgba(255,255,255,0.15);
  --font-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 22rem;
  --transition-smooth: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-body);
  background-color: var(--color-bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.2);
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
}
a:hover { color: var(--color-accent); border-bottom-color: transparent; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-heading);
}

/* --- Skip Navigation --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: var(--color-bg-deep);
  padding: 0.5rem 1rem;
  z-index: 99999;
  font-size: 0.85rem;
  border: none;
}
.skip-nav:focus { top: 1rem; }

/* ===================================================
   LAYOUT: SIDEBAR + MAIN CONTENT
   Mirrors Lens's fixed sidebar + viewer split.
   Sidebar is navigation/branding panel on the right;
   main content scrolls on the left.
   =================================================== */

/* --- Sidebar (fixed right panel) --- */
.site-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg-panel);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: right;
  padding: 2.5rem 2rem 1.5rem 2rem;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}
.site-sidebar .sidebar-brand {
  margin-bottom: 1.5rem;
}
.site-sidebar .sidebar-brand .brand-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text-on-panel);
  line-height: 1.2;
  border: none;
}
.site-sidebar .sidebar-brand .brand-name:hover {
  color: var(--color-accent);
}
.site-sidebar .sidebar-tagline {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.5;
  margin-bottom: 2rem;
}
.site-sidebar nav a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--color-text-on-panel);
  border-bottom: none;
  transition: color var(--transition-smooth);
}
.site-sidebar nav a:hover {
  color: var(--color-accent);
}
.site-sidebar .sidebar-contact {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: #999;
}
.site-sidebar .sidebar-contact a {
  color: var(--color-text-on-panel);
  border-bottom: 1px dotted #ccc;
}
.site-sidebar .sidebar-contact a:hover {
  color: var(--color-accent);
  border-bottom-color: transparent;
}
.sidebar-copyright {
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 1rem;
}

/* --- Hamburger Toggle --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  width: 44px;
  height: 44px;
  background: rgba(16,16,16,0.85);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--transition-smooth);
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}
.sidebar-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-toggle.active span:nth-child(2) { opacity: 0; }
.sidebar-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Main Content Area --- */
.site-content {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
}

/* ===================================================
   HERO SECTION
   Full-width dark area with teal accent line,
   mirroring the dark viewer background of Lens
   =================================================== */
.hero {
  position: relative;
  padding: 6rem 4rem 5rem;
  background: var(--color-bg-deep);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-accent);
}
.hero-inner {
  max-width: 700px;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-body);
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-subtitle p { margin-bottom: 0.5rem; }
.hero-cta {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-size: 0.9rem;
  border-radius: 3px;
  transition: background var(--transition-smooth), color var(--transition-smooth);
  border-bottom: 1px solid var(--color-accent);
}
.hero-cta:hover {
  background: var(--color-accent);
  color: var(--color-bg-deep);
}

/* ===================================================
   TOPICS — Dense 2-column mosaic
   Mirrors Lens's thumbnail grid: compact, packed,
   with inset border highlights on hover
   =================================================== */
.topics-section {
  padding: 0;
  background: var(--color-bg-deep);
}
.topics-section .section-header {
  padding: 3rem 4rem 1.5rem;
}
.topics-section .section-header h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  font-weight: 400;
}
.topics-grid {
  display: flex;
  flex-wrap: wrap;
}
.topic-card {
  position: relative;
  width: 50%;
  padding: 2rem 2.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: background var(--transition-smooth);
  overflow: hidden;
}
.topic-card::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px var(--color-accent), inset 0 0 0 3px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  z-index: 1;
}
.topic-card:hover::before {
  opacity: 1;
}
.topic-card:hover {
  background: var(--color-bg-elevated);
}
.topic-card h3 {
  font-size: 1.1rem;
  color: var(--color-text-heading);
  margin-bottom: 0.6rem;
  font-weight: 400;
}
.topic-card .topic-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.topic-card .topic-desc p { margin-bottom: 0.4rem; }

/* ===================================================
   LATEST POSTS — 2-column grid echoing thumbnail grid
   =================================================== */
.posts-section {
  padding: 3.5rem 4rem;
  background: var(--color-bg-deep);
}
.posts-section .section-header {
  margin-bottom: 2rem;
}
.posts-section .section-header h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  font-weight: 400;
}
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.post-card {
  position: relative;
  background: var(--color-bg-card);
  overflow: hidden;
  transition: background var(--transition-smooth);
}
.post-card:hover {
  background: var(--color-bg-elevated);
}
.post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px var(--color-accent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}
.post-card:hover::after {
  opacity: 1;
}
.post-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.post-card-body {
  padding: 1.5rem 2rem 2rem;
}
.post-card-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.post-card-title {
  font-size: 1.15rem;
  color: var(--color-text-heading);
  margin-bottom: 0.6rem;
  font-weight: 400;
  line-height: 1.35;
}
.post-card-title a {
  border: none;
  color: inherit;
}
.post-card-title a:hover { color: var(--color-accent); }
.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.post-card-excerpt p { margin-bottom: 0.3rem; }

/* ===================================================
   FAQ — Minimalist expand/collapse
   Dark with accent borders, not accordion-style
   =================================================== */
.faq-section {
  padding: 3.5rem 4rem;
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}
.faq-section .section-header {
  margin-bottom: 2rem;
}
.faq-section .section-header h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  font-weight: 400;
}
.faq-list {
  max-width: 720px;
}
.faq-item {
  border-left: 2px solid var(--color-border-strong);
  padding: 0 0 0 1.5rem;
  margin-bottom: 2rem;
  transition: border-color var(--transition-smooth);
}
.faq-item:hover {
  border-left-color: var(--color-accent);
}
.faq-question {
  font-size: 1rem;
  color: var(--color-text-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.4;
}
.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-left: 1rem;
  flex-shrink: 0;
  transition: transform var(--transition-smooth), color var(--transition-smooth);
}
.faq-item.open .faq-question::after {
  content: '−';
  color: var(--color-accent);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.faq-answer p { margin-bottom: 0.5rem; }

/* ===================================================
   FOOTER (inside sidebar, but also standalone for
   non-sidebar pages)
   =================================================== */
.site-footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding: 3rem 4rem 2rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: 0.5rem;
}
.footer-nav a {
  display: inline-block;
  margin-right: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border: none;
}
.footer-nav a:hover { color: var(--color-accent); }
.footer-contact {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}
.footer-contact a {
  color: var(--color-text-body);
  border-bottom: 1px dotted rgba(255,255,255,0.2);
}
.footer-contact a:hover { color: var(--color-accent); border-bottom-color: transparent; }
.footer-copyright {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ===================================================
   PAGE TEMPLATE
   =================================================== */
.page-content {
  padding: 4rem;
  max-width: 780px;
}
.page-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
}
.page-content .content-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-body);
}
.page-content .content-body h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.8rem;
  color: var(--color-text-heading);
}
.page-content .content-body h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--color-text-heading);
}
.page-content .content-body p {
  margin-bottom: 1.2rem;
}
.page-content .content-body a {
  color: var(--color-accent);
  border-bottom: 1px dotted var(--color-accent);
}
.page-content .content-body a:hover {
  border-bottom-color: transparent;
}
.page-content .content-body ul,
.page-content .content-body ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
}
.page-content .content-body li {
  margin-bottom: 0.4rem;
  list-style: disc;
}
.page-content .content-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-muted);
}

/* ===================================================
   BLOG INDEX
   =================================================== */
.blog-header {
  padding: 4rem 4rem 2rem;
}
.blog-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 0 4rem 2rem;
}

/* --- Pagination --- */
.pagination {
  padding: 2rem 4rem 4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.6rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  transition: all var(--transition-smooth);
  border-bottom: 1px solid var(--color-border-strong);
}
.pagination a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.pagination .active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg-deep);
}

/* ===================================================
   POST PAGE
   =================================================== */
.post-hero {
  padding: 4rem;
  background: var(--color-bg-deep);
}
.post-hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  max-width: 720px;
  line-height: 1.2;
}
.post-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.post-cover-wrap {
  position: relative;
  max-height: 500px;
  overflow: hidden;
}
.post-cover-wrap img {
  width: 100%;
  object-fit: cover;
}
.post-cover-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, var(--color-bg-deep), transparent);
  pointer-events: none;
}
.post-excerpt {
  padding: 2rem 4rem 0;
  max-width: 780px;
  font-size: 1.05rem;
  color: var(--color-text-body);
  line-height: 1.7;
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  margin-left: 4rem;
  padding-left: 1.5rem;
}
.post-body {
  padding: 2.5rem 4rem 4rem;
  max-width: 780px;
}
.post-body .content-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-body);
}
.post-body .content-body h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.8rem;
  color: var(--color-text-heading);
}
.post-body .content-body h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--color-text-heading);
}
.post-body .content-body p { margin-bottom: 1.2rem; }
.post-body .content-body a {
  color: var(--color-accent);
  border-bottom: 1px dotted var(--color-accent);
}
.post-body .content-body a:hover { border-bottom-color: transparent; }
.post-body .content-body ul,
.post-body .content-body ol { margin: 0.8rem 0 1.2rem 1.5rem; }
.post-body .content-body li { margin-bottom: 0.4rem; list-style: disc; }
.post-body .content-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.post-body .content-body img {
  border-radius: 2px;
  margin: 1.5rem 0;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media screen and (max-width: 1280px) {
  :root { --sidebar-width: 19rem; }
  .hero { padding: 5rem 3rem 4rem; }
  .hero h1 { font-size: 2.3rem; }
  .topics-section .section-header,
  .posts-section,
  .faq-section,
  .site-footer { padding-left: 3rem; padding-right: 3rem; }
  .page-content,
  .blog-header,
  .post-hero,
  .post-body { padding-left: 3rem; padding-right: 3rem; }
  .blog-grid { padding-left: 3rem; padding-right: 3rem; }
  .pagination { padding-left: 3rem; padding-right: 3rem; }
  .post-excerpt { margin-left: 3rem; }
}

@media screen and (max-width: 980px) {
  .site-sidebar {
    transform: translateX(100%);
    background: rgba(255,255,255,0.97);
  }
  .site-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .site-content {
    margin-right: 0;
  }
  .topic-card { width: 50%; }
}

@media screen and (max-width: 768px) {
  .hero { padding: 4rem 2rem 3rem; }
  .hero h1 { font-size: 1.8rem; }
  .topic-card {
    width: 100%;
    padding: 1.5rem 2rem;
  }
  .posts-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .topics-section .section-header,
  .posts-section,
  .faq-section,
  .site-footer { padding-left: 2rem; padding-right: 2rem; }
  .page-content,
  .blog-header,
  .post-hero,
  .post-body { padding-left: 2rem; padding-right: 2rem; }
  .blog-grid { padding-left: 2rem; padding-right: 2rem; }
  .pagination { padding-left: 2rem; padding-right: 2rem; }
  .post-excerpt { margin-left: 2rem; padding-left: 1rem; }
  .footer-inner { flex-direction: column; }
}

@media screen and (max-width: 480px) {
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero h1 { font-size: 1.55rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .topics-section .section-header,
  .posts-section,
  .faq-section,
  .site-footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  .page-content,
  .blog-header,
  .post-hero,
  .post-body { padding-left: 1.5rem; padding-right: 1.5rem; }
  .blog-grid { padding-left: 1.5rem; padding-right: 1.5rem; }
  .pagination { padding-left: 1.5rem; padding-right: 1.5rem; }
  .post-excerpt { margin-left: 1.5rem; }
  .post-hero h1 { font-size: 1.6rem; }
  .post-card-body { padding: 1.2rem 1.5rem 1.5rem; }
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Body overlay when sidebar open on mobile --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}
.sidebar-overlay.active {
  display: block;
}
