/**
 * PC Kompas Guides - Single Guide Page
 *
 * Single guide header, content, author box, and navigation
 */

/* ============================================================================
   GUIDE HEADER - HERO SECTION
   ============================================================================ */

.guide-header {
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

/* Hero Image - Full width, aspect ratio preserved */
.guide-header__image {
    aspect-ratio: 21/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: clamp(1.5rem, 2.5vw, 2rem);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.guide-header__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Category Badge - Positioned above title */
.guide-category-badge {
    display: inline-block;
    padding: clamp(0.375rem, 0.5vw, 0.5rem) clamp(0.75rem, 1.5vw, 1rem);
    background: var(--accent);
    color: #fff;
    font-size: clamp(0.625rem, 0.9vw, 0.75rem);
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
    transition: background-color 0.2s ease;
    display: inline-block;
}

.guide-category-badge:hover {
    background: var(--accent-hover);
}

.guide-category-badge:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Main Title - Large, bold, professional */
.guide-header h1 {
    font-size: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 clamp(1rem, 1.5vw, 1.5rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Meta Information - Author, Date, Reading Time, Difficulty */
.guide-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: center;
    padding: clamp(1rem, 1.5vw, 1.5rem) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: clamp(0.8125rem, 1.1vw + 0.15rem, 0.875rem);
    color: var(--text-secondary);
}

.guide-meta__author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guide-meta__avatar {
    width: clamp(36px, 5vw, 44px);
    height: clamp(36px, 5vw, 44px);
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.guide-meta__author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.guide-meta__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.guide-meta__icon {
    width: clamp(14px, 1.5vw, 16px);
    height: clamp(14px, 1.5vw, 16px);
    opacity: 0.6;
    flex-shrink: 0;
}

/* ============================================================================
   GUIDE CONTENT AREA - Gutenberg Block Styling
   ============================================================================ */

.guide-content {
    max-width: 100%;
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.125rem);
    line-height: 1.8;
    color: var(--text-primary);
}

/* Headings - Professional hierarchy */
.guide-content h2 {
    font-size: clamp(1.35rem, 2.2vw + 0.5rem, 1.85rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: clamp(2rem, 3vw, 2.75rem) 0 clamp(1rem, 1.5vw, 1.5rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Anchor link offset - ensures heading is visible below sticky header */
.guide-content h2[id],
.guide-content h3[id] {
    scroll-margin-top: 80px; /* Header (60px) + extra spacing (20px) */
}

/* Admin bar offset when logged in */
.admin-bar .guide-content h2[id],
.admin-bar .guide-content h3[id] {
    scroll-margin-top: 112px; /* Header (60px) + admin bar (32px) + spacing (20px) */
}

@media (max-width: 782px) {
    .admin-bar .guide-content h2[id],
    .admin-bar .guide-content h3[id] {
        scroll-margin-top: 126px; /* Header (60px) + mobile admin bar (46px) + spacing (20px) */
    }
}

.guide-content h3 {
    font-size: clamp(1.15rem, 1.7vw + 0.5rem, 1.4rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: clamp(1.5rem, 2vw, 2rem) 0 clamp(0.75rem, 1vw, 1rem);
    line-height: 1.3;
}

.guide-content h4 {
    font-size: clamp(1rem, 1.3vw + 0.5rem, 1.15rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: clamp(1.25rem, 1.5vw, 1.75rem) 0 clamp(0.625rem, 1vw, 0.875rem);
    line-height: 1.3;
}

/* Paragraphs - Comfortable spacing */
.guide-content p {
    margin: 0 0 clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.8;
}

/* Links - Visible but not distracting */
.guide-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.guide-content a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* Links in tables - slightly more subtle */
.guide-content table a {
    font-weight: 500;
}

/* Images - Full width with polish */
.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: clamp(1.5rem, 2.5vw, 2.5rem) 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.guide-content img:hover {
    box-shadow: var(--shadow-md);
}

/* Figure captions */
.guide-content figure {
    margin: clamp(1.5rem, 2.5vw, 2.5rem) 0;
}

.guide-content figcaption {
    font-size: clamp(0.8125rem, 1vw + 0.15rem, 0.875rem);
    color: var(--text-secondary);
    margin-top: clamp(0.5rem, 1vw, 0.75rem);
    font-style: italic;
    text-align: center;
}

/* Lists - Proper indentation and styling */
.guide-content ul,
.guide-content ol {
    margin: 0 0 clamp(1rem, 1.5vw, 1.25rem);
    padding-left: clamp(1.75rem, 2.5vw, 2.25rem);
}

.guide-content li {
    margin-bottom: clamp(0.625rem, 1vw, 0.875rem);
    line-height: 1.7;
}

.guide-content ul li::marker {
    color: var(--accent);
}

.guide-content ol li::marker {
    color: var(--accent);
    font-weight: 600;
}

/* Blockquotes - Elegant styling with accent border */
.guide-content blockquote {
    border-left: 4px solid var(--accent);
    padding: clamp(1rem, 1.5vw, 1.5rem) clamp(1rem, 1.5vw, 1.5rem);
    margin: clamp(1.5rem, 2vw, 2rem) 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.guide-content blockquote p {
    margin: 0;
    font-size: clamp(0.9375rem, 1.2vw + 0.5rem, 1.0625rem);
}

.guide-content blockquote p:last-child {
    margin: 0;
}

/* Code Blocks - Professional code styling */
.guide-content code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    border-radius: var(--radius-sm);
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

.guide-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: clamp(1rem, 1.5vw, 1.5rem);
    overflow-x: auto;
    margin: 0 0 clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

.guide-content pre code {
    background: none;
    padding: 0;
    font-size: 0.9em;
    color: var(--text-primary);
}

.guide-content pre::-webkit-scrollbar {
    height: 6px;
}

.guide-content pre::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.guide-content pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.guide-content pre::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Tables - Clean, professional styling */
.guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: clamp(1rem, 1.5vw, 1.25rem) 0;
    font-size: clamp(0.875rem, 1.1vw + 0.25rem, 1rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.guide-content table th {
    background: var(--bg-secondary);
    padding: clamp(0.75rem, 1vw, 1rem);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.guide-content table td {
    padding: clamp(0.75rem, 1vw, 1rem);
    border-bottom: 1px solid var(--border);
}

.guide-content table tbody tr:hover {
    background: var(--bg-secondary);
}

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