/* ============================================
   GUIDE SINGLE TEMPLATE CSS
   Mobile-first, app-like design
   Matches platform-review-template.css patterns
   Used by: earn_money_guides, money_saving_guides,
            grow_money_guides, tracking guide
   ============================================ */

/* ============================================
   MOBILE HEADER
   Sticky blue bar with back button, title, share
   Hidden on desktop (901px+)
   ============================================ */

.guide-mobile-header {
    display: block;
    background: var(--pr-primary, #2C5282);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.guide-mobile-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-back-btn,
.guide-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s ease;
}

.guide-back-btn:hover,
.guide-share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.guide-mobile-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 901px) {
    .guide-mobile-header,
    .guide-mobile-summary {
        display: none;
    }
}

/* ============================================
   MOBILE SUMMARY
   Blue area below mobile header with key info
   Hidden on desktop (901px+)
   ============================================ */

.guide-mobile-summary {
    padding: 16px;
    background: var(--pr-primary, #2C5282);
    color: #fff;
}

.guide-mobile-summary-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.guide-mobile-summary-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-mobile-summary-info {
    flex: 1;
    min-width: 0;
}

.guide-mobile-summary-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.guide-mobile-summary-updated {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.guide-mobile-summary-intro {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   DESKTOP HERO
   Full-bleed blue section with breadcrumbs,
   title, subtitle, badges
   Hidden on mobile, shown from 901px+
   ============================================ */

.guide-hero {
    display: none;
    background: var(--pr-primary, #2C5282);
    color: #fff;
    padding: 48px 24px 100px;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

@media (min-width: 901px) {
    .guide-hero {
        display: block;
    }
}

.guide-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
}

/* Hero breadcrumbs */
.guide-hero .guide-breadcrumbs {
    font-size: 14px;
    margin-bottom: 16px;
    opacity: 1;
}

.guide-hero .guide-breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: 0.3s ease;
}

.guide-hero .guide-breadcrumbs a:hover {
    color: #fff;
    text-decoration: underline;
}

.guide-breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.5;
    color: #fff;
}

.guide-breadcrumb-current {
    color: rgba(255, 255, 255, 0.7);
}

/* Hero title */
.guide-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Hero subtitle */
.guide-hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 16px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero badges */
.guide-hero-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.guide-hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

/* ============================================
   SINGLE CONTAINER
   Max-width wrapper, overlaps hero on desktop
   ============================================ */

.guide-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    background: #fff;
}

@media (min-width: 901px) {
    .guide-container {
        margin-top: -60px;
        padding: 32px;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        position: relative;
        z-index: 10;
    }
}

/* ============================================
   DISCLOSURE
   Mobile: small link in mobile header area
   Desktop: absolute positioned in hero corner
   ============================================ */

/* Desktop disclosure - positioned in hero */
.guide-hero-disclosure {
    position: absolute;
    top: 16px;
    right: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.guide-hero-disclosure::before {
    content: 'i';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 0.65rem;
    font-style: italic;
}

.guide-hero-disclosure:hover {
    color: rgba(255, 255, 255, 0.9);
}

.guide-hero-disclosure:hover::before {
    border-color: rgba(255, 255, 255, 0.9);
}

/* Mobile disclosure - small link */
.guide-mobile-disclosure {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    white-space: nowrap;
    flex-shrink: 0;
}

.guide-mobile-disclosure:hover {
    color: #fff;
}

/* ============================================
   AUTHOR BYLINE (desktop only)
   Compact single-line below container top
   ============================================ */

.guide-byline {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.guide-byline-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-byline a {
    color: var(--pr-primary, #2C5282);
    text-decoration: none;
    font-weight: 500;
}

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

.guide-byline-sep {
    color: #cbd5e1;
}

@media (min-width: 901px) {
    .guide-byline {
        display: flex;
    }
}

/* ============================================
   CONTENT STYLES
   Typography for the_content() output
   ============================================ */

.guide-content {
    line-height: 1.8;
    color: #1a202c;
}

.guide-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: #1a202c;
    border-bottom: 3px solid var(--pr-primary, #2C5282);
    padding-bottom: 8px;
    scroll-margin-top: 16px;
}

.guide-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #1a202c;
}

.guide-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: #1a202c;
}

.guide-content p {
    margin: 0 0 16px;
}

.guide-content ul,
.guide-content ol {
    margin: 16px 0 16px 16px;
}

.guide-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.guide-content a {
    color: var(--pr-primary, #2C5282);
    text-decoration: none;
}

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

.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.guide-content blockquote {
    border-left: 4px solid var(--pr-primary, #2C5282);
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
}

.guide-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #334155;
}

.guide-content pre {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.guide-content pre code {
    background: none;
    padding: 0;
}

/* Tables (for megalist/comparison guides) */
.guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.guide-content th {
    background: var(--pr-primary, #2C5282);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.guide-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.guide-content tr:hover td {
    background: #f8fafc;
}

/* Callout boxes */
.guide-content .callout-tip {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

.guide-content .callout-warning {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

.guide-content .callout-info {
    background: #f0f7ff;
    border-left: 4px solid var(--pr-primary, #2C5282);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

/* ============================================
   DEVICE SELECTOR
   For tracking guide - choose your device
   ============================================ */

.guide-device-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.guide-device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a202c;
    transition: 0.3s ease;
}

.guide-device-card:hover {
    border-color: var(--pr-primary, #2C5282);
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.guide-device-icon {
    font-size: 1.5rem;
    color: var(--pr-primary, #2C5282);
    margin-bottom: 8px;
}

.guide-device-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
}

.guide-device-subtitle {
    font-size: 13px;
    color: #64748b;
}

@media (max-width: 600px) {
    .guide-device-selector {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .guide-device-card {
        flex-direction: row;
        gap: 12px;
        text-align: left;
        padding: 12px 16px;
    }

    .guide-device-icon {
        margin-bottom: 0;
    }
}

/* ============================================
   RELATED GUIDES
   Grid of related guide cards at bottom
   ============================================ */

.guide-related {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
}

.guide-related-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 16px;
}

.guide-related-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 600px) {
    .guide-related-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.guide-related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a202c;
    transition: 0.3s ease;
}

.guide-related-card:hover {
    border-color: var(--pr-primary, #2C5282);
    background: #f0f7ff;
    transform: translateY(-1px);
}

.guide-related-card-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.guide-related-card-info {
    flex: 1;
    min-width: 0;
}

.guide-related-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--pr-primary, #2C5282);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.guide-related-card-excerpt {
    font-size: 13px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

/* ============================================
   CROSS-LINKS
   Navigation cards at very bottom
   ============================================ */

.guide-cross-links {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
}

.guide-cross-links-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 16px;
    text-align: center;
}

.guide-cross-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .guide-cross-links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.guide-cross-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a202c;
    transition: 0.3s ease;
    text-align: center;
}

.guide-cross-link-card:hover {
    border-color: var(--pr-primary, #2C5282);
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.guide-cross-link-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pr-primary, #2C5282);
    border-radius: 8px;
}

.guide-cross-link-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    color: #fff;
}

.guide-cross-link-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}

.guide-cross-link-desc {
    font-size: 12px;
    color: #64748b;
}

/* ============================================
   SHARE MODAL
   ============================================ */

.guide-share-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.guide-share-modal.active {
    display: flex;
}

.guide-share-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.guide-share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.guide-share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.guide-share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.guide-share-modal-close:hover {
    color: #1a202c;
}

.guide-share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.guide-share-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a202c;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s ease;
    cursor: pointer;
    background: none;
}

.guide-share-option:hover {
    background: #f8fafc;
    border-color: var(--pr-primary, #2C5282);
}

.guide-share-option svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   KEY TAKEAWAYS BOX
   ============================================ */

.guide-key-takeaways {
    background: #f0f7ff;
    border-left: 4px solid var(--pr-primary, #2C5282);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 32px;
}

.guide-key-takeaways h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--pr-primary, #2C5282);
}

.guide-key-takeaways ul {
    margin: 0 0 0 16px;
    padding: 0;
}

.guide-key-takeaways li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE - Mobile adjustments
   ============================================ */

@media (max-width: 768px) {
    .guide-hero-title {
        font-size: 1.8rem;
    }

    .guide-hero-subtitle {
        font-size: 1rem;
    }

    .guide-container {
        padding: 16px 8px;
    }

    .guide-content h2 {
        font-size: 20px;
    }

    .guide-content h3 {
        font-size: 16px;
    }

    .guide-content table {
        font-size: 13px;
    }

    .guide-content th,
    .guide-content td {
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .guide-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
