/*
Theme Name: CSM Blog
Theme URI: https://college-schedule-maker.com/blog/
Description: College Schedule Maker blog child theme — matches the main site brand and guide layout.
Author: College Schedule Maker
Template: storefront
Version: 1.0.3
Text Domain: csm-blog
*/

:root {
  --csm-brand: #3d4a7a;
  --csm-brand-dark: #2f3a62;
  --csm-brand-soft: #eef0f8;
  --csm-accent: #4f6bed;
  --csm-border: #d8deea;
  --csm-bg: #eef1f7;
  --csm-text: #0f172a;
  --csm-muted: #475569;
}

/* —— Reset Storefront chrome clutter —— */
.storefront-primary-navigation,
.site-header-cart,
.site-search,
.storefront-handheld-footer-bar,
.widget_shopping_cart,
.site-branding .custom-logo-link + .site-title,
.site-header .widget,
#secondary .widget_shopping_cart {
  display: none !important;
}

body {
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(79, 107, 237, 0.1), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(61, 74, 122, 0.08), transparent 55%),
    var(--csm-bg);
  color: var(--csm-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  line-height: 1.55;
}

body.theme-csm-blog .site {
  max-width: none;
}

/* —— Header —— */
.csm-blog-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--csm-border);
}

.csm-blog-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
}

.csm-blog-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.csm-blog-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.csm-blog-logo img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.csm-blog-logo-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--csm-text);
  line-height: 1.2;
}

.csm-blog-logo-tag {
  display: none;
  font-size: 11px;
  color: var(--csm-muted);
}

@media (min-width: 640px) {
  .csm-blog-logo-tag {
    display: block;
  }
}

.csm-blog-nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .csm-blog-nav-desktop {
    display: flex;
  }
}

.csm-blog-nav-desktop a {
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
}

.csm-blog-nav-desktop a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.csm-blog-nav-desktop a[aria-current="page"] {
  background: var(--csm-brand-soft);
  color: var(--csm-brand);
  font-weight: 600;
}

.csm-blog-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .csm-blog-nav-toggle {
    display: none;
  }
}

.csm-blog-nav-drawer {
  display: none;
  width: 100%;
  border-top: 1px solid var(--csm-border);
  background: #fff;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.csm-blog-header-inner.is-open .csm-blog-nav-drawer {
  display: block;
}

.csm-blog-nav-drawer a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
}

.csm-blog-nav-drawer a:hover,
.csm-blog-nav-drawer a[aria-current="page"] {
  background: var(--csm-brand-soft);
  color: var(--csm-brand);
}

/* —— Shell —— */
.csm-blog-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.csm-blog-shell--wide {
  max-width: 1100px;
}

.csm-blog-hero-band {
  margin-bottom: 1.5rem;
}

.csm-blog-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--csm-brand);
}

.csm-blog-hero-band h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--csm-text);
}

.csm-blog-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--csm-muted);
  max-width: 40rem;
}

/* —— Cards (guide-style) —— */
.csm-blog-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .csm-blog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.csm-blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: 0.85rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.csm-blog-card:hover {
  border-color: rgba(61, 74, 122, 0.4);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.csm-blog-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  margin-bottom: 0.75rem;
}

.csm-blog-card-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--csm-brand-soft), #fff);
  color: var(--csm-brand);
  font-weight: 700;
  font-size: 0.85rem;
}

.csm-blog-card-title {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.35;
  margin: 0 0 0.35rem;
}

.csm-blog-card-desc {
  display: block;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.csm-blog-card-meta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* —— Single article —— */
.csm-blog-crumbs {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.csm-blog-crumbs a {
  color: var(--csm-brand);
  font-weight: 500;
  text-decoration: none;
}

.csm-blog-crumbs a:hover {
  text-decoration: underline;
}

.csm-blog-article {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1.15rem 1.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

@media (min-width: 640px) {
  .csm-blog-article {
    padding: 1.75rem 2rem 2.25rem;
  }
}

.csm-blog-article .entry-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.csm-blog-article .entry-meta {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.csm-blog-article .post-thumbnail {
  margin: 0 0 1.5rem;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.csm-blog-article .post-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
}

.csm-blog-article .entry-content {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
}

.csm-blog-article .entry-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.csm-blog-article .entry-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.csm-blog-article .entry-content p {
  margin: 0 0 1rem;
}

.csm-blog-article .entry-content a {
  color: var(--csm-accent);
  text-underline-offset: 2px;
}

.csm-blog-article .entry-content a.csm-btn-primary,
.csm-blog-article .entry-content a.csm-btn-ghost {
  text-decoration: none;
}

.csm-blog-article .entry-content ul,
.csm-blog-article .entry-content ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.csm-blog-article .entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.csm-blog-article .entry-content th,
.csm-blog-article .entry-content td {
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.csm-blog-article .entry-content th {
  background: var(--csm-brand-soft);
  color: var(--csm-brand-dark);
  font-weight: 650;
}

.csm-blog-article .entry-content tr:nth-child(even) td {
  background: #f8fafc;
}

/* —— Buttons / CTA —— */
.csm-btn-primary,
.csm-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 650;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.csm-btn-primary {
  background: var(--csm-brand);
  color: #fff !important;
  border: 0;
}

.csm-btn-primary:hover {
  background: var(--csm-brand-dark);
  color: #fff !important;
}

.csm-btn-ghost {
  background: #fff;
  color: var(--csm-brand) !important;
  border: 1px solid var(--csm-border);
}

.csm-btn-ghost:hover {
  background: var(--csm-brand-soft);
  color: var(--csm-brand-dark) !important;
}

.csm-blog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (max-width: 639px) {
  .csm-blog-actions {
    flex-direction: column;
  }

  .csm-blog-actions .csm-btn-primary,
  .csm-blog-actions .csm-btn-ghost {
    width: 100%;
  }
}

.csm-blog-cta {
  margin-top: 1.75rem;
  text-align: center;
  border: 1px solid rgba(61, 74, 122, 0.15);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(180deg, var(--csm-brand-soft) 0%, #ffffff 70%);
}

.csm-blog-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: #0f172a;
}

.csm-blog-cta p {
  margin: 0 auto 0.25rem;
  max-width: 32rem;
  color: var(--csm-muted);
  font-size: 0.95rem;
}

.csm-blog-cta .csm-blog-actions {
  justify-content: center;
}

.csm-blog-related {
  margin-top: 2rem;
}

.csm-blog-related h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

/* —— Footer —— */
.csm-blog-footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
}

.csm-blog-footer a {
  color: var(--csm-brand);
  text-decoration: none;
}

.csm-blog-footer a:hover {
  text-decoration: underline;
}

.csm-blog-footer p {
  margin: 0.35rem 0;
}

/* Hide default Storefront site header/footer when our chrome is used */
body.theme-csm-blog .site-header,
body.theme-csm-blog .site-footer,
body.theme-csm-blog #secondary {
  display: none !important;
}

body.theme-csm-blog #primary {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

body.theme-csm-blog .content-area {
  margin: 0 !important;
  width: 100% !important;
}

body.theme-csm-blog .site-content {
  padding: 0 !important;
  margin: 0 !important;
}

body.theme-csm-blog .col-full {
  max-width: none !important;
  padding: 0 !important;
}

/* —— Eyebrow category links (must not be escaped) —— */
.csm-blog-eyebrow a {
  color: var(--csm-brand);
  text-decoration: none;
  font-weight: 650;
}

.csm-blog-eyebrow a:hover {
  text-decoration: underline;
  color: var(--csm-accent);
}

.csm-blog-eyebrow-sep {
  color: #94a3b8;
  font-weight: 500;
}

/* —— Breadcrumbs —— */
.csm-blog-crumbs-sep {
  margin: 0 0.35rem;
  color: #94a3b8;
}

.csm-blog-crumbs-current {
  color: #64748b;
  display: inline-block;
  max-width: min(100%, 28rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* —— Card body —— */
.csm-blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

/* —— Article figures / captions —— */
.csm-blog-article .entry-content figure {
  margin: 1.5rem 0;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.csm-blog-article .entry-content figure img {
  display: block;
  width: 100%;
  height: auto;
}

.csm-blog-article .entry-content figcaption {
  font-size: 0.8125rem;
  color: #64748b;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  margin: 0;
}

.csm-blog-article .entry-content .csm-btn-primary,
.csm-blog-article .entry-content .csm-btn-ghost {
  margin: 0.25rem 0.35rem 0.25rem 0;
}

/* —— Pagination —— */
.csm-blog-pagination {
  display: flex;
  justify-content: center;
}

.csm-blog-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.csm-blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--csm-border);
  background: #fff;
  color: var(--csm-brand);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.csm-blog-pagination .page-numbers.current,
.csm-blog-pagination .page-numbers:hover {
  background: var(--csm-brand-soft);
  border-color: #c5cbe0;
}

/* —— Extra Storefront / Woo hide —— */
body.theme-csm-blog .storefront-handheld-footer-bar,
body.theme-csm-blog .site-search,
body.theme-csm-blog .storefront-breadcrumb,
body.theme-csm-blog .widget_product_search,
body.theme-csm-blog #comments {
  display: none !important;
}

/* Soften WP global purple presets if still injected */
body.theme-csm-blog {
  --wp-admin-theme-color: var(--csm-brand);
  --wp-block-synced-color: var(--csm-brand);
}
