/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
}

.topbar-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.topbar-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.topbar-search:focus {
  border-color: var(--accent);
  background: var(--bg);
}

.topbar-search::placeholder {
  color: var(--text-3);
}

/* ========== 3-COLUMN GRID ========== */
.page-grid {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--topbar-height));
  align-items: start;
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  background: var(--bg);
}

/* Collapsible sidebar groups */
.sidebar-group {
  border: none;
}

.sidebar-group summary {
  list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem 0.25rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}

.sidebar-category:hover {
  color: var(--text-2);
}

.sidebar-category-label {
  color: inherit;
  text-decoration: none;
  flex: 1;
}

.sidebar-category-label:hover {
  color: var(--text-2);
  text-decoration: none;
}

.sidebar-chevron {
  color: var(--text-3);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-group[open] .sidebar-chevron {
  transform: rotate(0deg);
}

.sidebar-group:not([open]) .sidebar-chevron {
  transform: rotate(-90deg);
}

.sidebar-subcategory-group {
  margin-top: 0.25rem;
}

.sidebar-subcategory {
  display: block;
  padding: 0.375rem 1rem 0.2rem 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.1s;
}

.sidebar-subcategory:hover {
  color: var(--text-2);
  text-decoration: none;
}

.sidebar-subcategory.active {
  color: var(--accent);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 1rem 6px 24px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--bg-soft);
  color: var(--accent);
  font-weight: 500;
  border-right: 2px solid var(--accent);
}

.sidebar-link.coming-soon {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.sidebar-link-emoji {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  padding: 2rem;
  min-width: 0;
}

/* ========== AD COLUMN ========== */
.ad-column {
  display: none; /* hidden until AdSense is configured */
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  border-left: 1px solid var(--border);
  padding: 1.25rem;
  background: var(--bg);
}

.ad-slot-1,
.ad-slot-2 {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.ad-slot-1 {
  width: 300px;
  height: 250px;
}

.ad-slot-2 {
  width: 300px;
  height: 600px;
  margin-top: 16px;
}

/* ========== FOOTER ========== */
.footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-3);
}

.footer-wordmark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 120px;
  color: var(--text-3);
  line-height: 1;
  height: 72px;
  overflow: hidden;
  user-select: none;
  opacity: 0.4;
}

/* ========== HOMEPAGE ========== */
.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1rem;
  color: var(--text-2);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.tool-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tool-card:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.tool-card-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.tool-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.tool-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.tool-card-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 2px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-3);
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-link {
  color: var(--text-2);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--text-3);
  margin: 0 6px;
}

.breadcrumb-current {
  color: var(--text-2);
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .ad-column {
    display: none;
  }

  .main-content {
    padding: 1.25rem;
  }

  .footer-wordmark {
    display: none;
  }
}
