/**
 * Commerce Engineering Guides — Index + Article Styles
 * Applies to both /guides (index) and /guides/{slug} (individual playbooks)
 *
 * Note: bootstrap-theme.css sets `h1-h6 { color: var(--bs-gray-900) }`
 * which overrides inherited color. All headings in dark sections MUST
 * have explicit color declarations.
 */

/* ============================================
   INDEX PAGE — Hero
   ============================================ */
.guides-index-hero {
    background: linear-gradient(135deg, var(--bs-primary-dark, #001a3d) 0%, var(--bs-primary, #002b5c) 100%);
    padding: 5rem 0 3.5rem;
    color: #f1f5f9;
}

.guides-index-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
}

.guides-index-hero .lead {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.8);
    max-width: 620px;
}

.guides-index-hero p {
    color: rgba(255,255,255,0.7);
    max-width: 640px;
}

/* Filter buttons */
.guides-filter {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.guides-filter-btn {
    padding: 0.4rem 1.1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.guides-filter-btn:hover,
.guides-filter-btn.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

/* ============================================
   INDEX PAGE — Card Grid
   ============================================ */
.guides-grid {
    padding: 3rem 0 4rem;
    background: #f8fafc;
}

.pillar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.pillar-section-label:first-child {
    margin-top: 0;
}

.guide-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s;
    height: 100%;
    position: relative;
}

.guide-card:hover {
    border-color: var(--bs-primary, #002b5c);
    box-shadow: 0 8px 24px rgba(0,43,92,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.guide-card .card-pillar { margin-bottom: 0.75rem; }

.guide-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.guide-card:hover .card-title { color: var(--bs-primary, #002b5c); }

.guide-card .card-hook {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: auto;
    padding-bottom: 1rem;
}

.guide-card .card-meta {
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.guide-card .card-arrow {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    transition: color 0.15s, transform 0.15s;
}

.guide-card:hover .card-arrow {
    color: var(--bs-primary, #002b5c);
    transform: translateX(3px);
}

/* ============================================
   Pillar Badge
   ============================================ */
.pillar-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
}

.pillar-badge.team {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.pillar-badge.technical {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Hero variants */
.guides-hero .pillar-badge.team {
    background: rgba(147, 197, 253, 0.15);
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.3);
}

.guides-hero .pillar-badge.technical {
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.25);
}

/* ============================================
   ARTICLE PAGE — Hero
   ============================================ */
.guides-hero {
    background: linear-gradient(135deg, var(--bs-primary-dark, #001a3d) 0%, var(--bs-primary, #002b5c) 60%, #003d80 100%);
    padding: 4rem 0 3.5rem;
    color: #f1f5f9;
}

.guides-hero .breadcrumb-nav {
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
}

.guides-hero .breadcrumb-nav a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.15s;
}

.guides-hero .breadcrumb-nav a:hover { color: #fff; }
.guides-hero .breadcrumb-nav .sep { color: rgba(255,255,255,0.3); margin: 0 0.4rem; }
.guides-hero .breadcrumb-nav .current { color: rgba(255,255,255,0.75); }

.guide-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.guide-meta .read-time {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
}

.guide-meta .pub-date {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
}

.guides-hero h1 {
    font-size: clamp(1.65rem, 3.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: #fff;
}

.guides-hero .subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.25rem;
    max-width: none;
}

.guides-hero .hook {
    font-size: 0.95rem;
    color: #93c5fd;
    font-style: italic;
    border-left: 3px solid rgba(147, 197, 253, 0.4);
    padding-left: 1rem;
    max-width: 640px;
}

/* ============================================
   ARTICLE PAGE — Body Layout
   ============================================ */
.guide-body {
    padding: 0;
    background: #fff;
}

.guide-article-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
}

/* Override global p max-width within guide content */
.guide-content p,
.guide-intro p {
    max-width: none;
}

/* Intro */
.guide-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.guide-intro p { margin-bottom: 1rem; }
.guide-intro p:last-child { margin-bottom: 0; }

/* Sections */
.guide-section {
    margin-bottom: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
}

.guide-section:first-child {
    border-top: none;
    padding-top: 0;
}

.guide-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.guide-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1rem;
}

.guide-section ul,
.guide-section ol {
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
}

.guide-section li {
    font-size: 1rem;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 0.5rem;
}

.guide-section li strong,
.guide-section p strong {
    color: #0f172a;
    font-weight: 600;
}

/* Callout */
.guide-section .callout {
    background: #f0f7ff;
    border-left: 4px solid var(--bs-primary, #002b5c);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1.15rem 1.35rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #1e3a5f;
}

.guide-section .callout strong {
    color: var(--bs-primary-dark, #001a3d);
}

.guide-section .callout a {
    color: var(--bs-primary, #002b5c);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-section .callout a:hover {
    color: var(--bs-primary-dark, #001a3d);
}

/* Tables */
.guide-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.guide-section table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.guide-section table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: top;
}

.guide-section table tr:last-child td { border-bottom: none; }

/* ============================================
   Checklist
   ============================================ */
.guide-checklist {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.75rem 2rem;
    margin: 2.5rem 0 1.5rem;
}

.guide-checklist h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-checklist h3 .bi {
    color: var(--bs-primary, #002b5c);
    font-size: 1.1rem;
}

.guide-checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 1;
}

.guide-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    border-bottom: 1px solid #e9eef5;
}

.guide-checklist li:last-child { border-bottom: none; }

.guide-checklist li::before {
    content: '\F26A'; /* bi-check2-square */
    font-family: 'bootstrap-icons';
    color: #94a3b8;
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ============================================
   Related Guides
   ============================================ */
.related-guides {
    padding: 3rem 0;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.related-guides h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.related-guide-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1.35rem;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 100%;
}

.related-guide-card:hover {
    border-color: var(--bs-primary, #002b5c);
    box-shadow: 0 4px 12px rgba(0,43,92,0.06);
    text-decoration: none;
}

.related-guide-card .card-pillar { margin-bottom: 0.5rem; }

.related-guide-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.related-guide-card:hover .card-title { color: var(--bs-primary, #002b5c); }

/* ============================================
   CTA
   ============================================ */
.guide-cta {
    background: var(--bs-primary, #002b5c);
    color: #fff;
    padding: 3.5rem 0;
    text-align: center;
}

.guide-cta h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.guide-cta p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    max-width: 560px;
    margin: 0 auto 1.75rem;
    max-width: none;
}

.guide-cta a[style] { color: #93c5fd !important; }
.guide-cta a[style]:hover { color: #bfdbfe !important; }

/* ============================================
   Author line (bottom of article)
   ============================================ */
.guide-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.88rem;
    color: #64748b;
}

.guide-author strong {
    color: #1e293b;
    font-weight: 600;
}

.guide-author a {
    color: var(--bs-primary, #002b5c);
    text-decoration: none;
}

.guide-author a:hover { text-decoration: underline; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .guides-index-hero { padding: 3.5rem 0 2.5rem; }
    .guides-hero { padding: 3rem 0 2.5rem; }
    .guide-article-wrap { padding: 2rem 1rem 1.5rem; }
    .guide-intro { font-size: 1rem; }
    .guide-section h2 { font-size: 1.2rem; }
    .guide-checklist { padding: 1.25rem; }
    .guide-checklist li { font-size: 0.85rem; }
    .related-guides { padding: 2rem 0; }
    .guide-cta { padding: 2.5rem 0; }
    .guide-cta h2 { font-size: 1.3rem; }
}

@media (min-width: 769px) {
    .guide-checklist ul {
        columns: 1;
    }
}
