/* ==========================================================================
   MonsterVerse - Main Stylesheet
   A beginner-friendly CSS file for learning web development
   ========================================================================== */

/* ==========================================================================
   0. WEB FONTS

   @font-face lets you use custom fonts on your website.
   The browser will download and use this font instead of system fonts.

   IMPORTANT: Make sure the font file path is correct!
   ========================================================================== */

@font-face {
    /* Name we'll use to reference this font in CSS */
    font-family: 'Inter Variable';

    /* Path to the font file (relative to this CSS file) */
    src: url('/fonts/inter-variable.woff2') format('woff2');

    /* Which font weights this file supports (100-900) */
    font-weight: 100 900;

    /* Normal vs italic */
    font-style: normal;

    /* How the font loads - 'swap' shows fallback text while loading */
    font-display: swap;
}


/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (VARIABLES)

   CSS variables let you define values once and reuse them throughout.
   This makes it easy to change colors or fonts in one place!

   Usage: var(--variable-name)
   Example: color: var(--color-primary);
   ========================================================================== */

:root {
    /* Font families - what typeface to use for text */
    --font-main: 'Inter Variable', system-ui, -apple-system, sans-serif;

    /* Colors - the main color palette for the site */
    --color-primary: rgb(1, 97, 239);      /* Main brand color (blue) */
    --color-secondary: rgb(1, 84, 207);    /* Darker blue for hover states */
    --color-accent: rgb(109, 40, 217);     /* Purple accent for highlights */

    /* Text colors */
    --color-text-heading: rgb(247, 248, 248);   /* Bright white for headings */
    --color-text-default: rgb(229, 236, 246);   /* Slightly muted white for body text */
    --color-text-muted: rgba(229, 236, 246, 0.66); /* Faded text for less important info */

    /* Background colors */
    --color-bg-page: rgb(3, 6, 32);        /* Dark blue page background */
    --color-bg-dark: rgb(15, 23, 42);      /* Slightly lighter dark for cards */

    /* Border colors */
    --color-border: rgb(51, 65, 85);       /* Subtle border for dark mode */

    /* Spacing - consistent spacing values (based on 4px grid) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */

    /* Border radius - for rounded corners */
    --radius-sm: 0.25rem; /* 4px - subtle rounding */
    --radius-md: 0.375rem; /* 6px - medium rounding */
    --radius-lg: 0.5rem;  /* 8px - more visible rounding */
    --radius-full: 9999px; /* Fully rounded (circles/pills) */

    /* Transitions - smooth animations */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 200ms ease-in-out;

    /* Layout - maximum widths for content */
    --max-width-content: 80rem; /* 1280px - main content area */
    --max-width-text: 65ch;     /* ~65 characters - optimal reading width */
}


/* ==========================================================================
   2. CSS RESET & BASE STYLES

   These rules create a consistent starting point across all browsers.
   Different browsers have different default styles - this normalizes them.
   ========================================================================== */

/* Box-sizing: border-box makes width/height include padding and border */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins and set base styles */
html {
    /* Smooth scrolling when clicking anchor links */
    scroll-behavior: smooth;
    /* Use 100% of viewport height */
    min-height: 100%;
}

body {
    /* Remove default margin */
    margin: 0;
    /* Set the base font */
    font-family: var(--font-main);
    /* Base font size (16px is browser default) */
    font-size: 1rem;
    /* Line height for readability (1.5 = 150% of font size) */
    line-height: 1.5;
    /* Dark mode colors */
    background-color: var(--color-bg-page);
    color: var(--color-text-default);
    /* Improve text rendering on Mac/iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Tighter letter spacing */
    letter-spacing: -0.025em;
}

/* Make images responsive by default */
img {
    max-width: 100%;
    height: auto;
    /* Remove gap below images */
    display: block;
}

/* Remove default link styling */
a {
    color: inherit;
    text-decoration: none;
}

/* Remove list styles */
ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Heading defaults */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-heading);
}


/* ==========================================================================
   3. LAYOUT UTILITIES

   Reusable classes for common layout patterns.
   These help structure the page without writing custom CSS each time.
   ========================================================================== */

/* Container - centers content with max-width and padding */
.container {
    width: 100%;
    max-width: var(--max-width-content);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* For tablet and up, add more side padding */
@media (min-width: 640px) {
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

/* Screen reader only - hides visually but keeps accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ==========================================================================
   4. HEADER & NAVIGATION

   The top bar of the site with logo and navigation links.
   Uses flexbox for layout - a modern CSS layout method.
   ========================================================================== */

/* Announcement bar - the thin bar at the very top */
.announcement-bar {
    display: none; /* Hidden by default */
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    padding: var(--space-2) var(--space-3);
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Show announcement bar on medium screens and up */
@media (min-width: 768px) {
    .announcement-bar {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: var(--space-1);
    }
}

.announcement-bar a {
    color: var(--color-text-muted);
    font-weight: 500;
}

.announcement-bar a:hover {
    text-decoration: underline;
}

/* Main header - sticky at top of page */
.header {
    position: sticky;
    top: 0;
    z-index: 40; /* Stay above other content */
    width: 100%;
    background-color: var(--color-bg-page);
}


/* Header content wrapper */
.header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-3);
}

/* On medium screens, center logo + nav together */
@media (min-width: 768px) {
    .header-content {
        justify-content: center;
        gap: var(--space-6);
        padding: var(--space-3) var(--space-6);
    }
}

/* Site logo/brand */
.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.25rem;
    }
}

.logo span {
    margin-left: var(--space-2);
    white-space: nowrap;
}

/* Mobile menu toggle button (hamburger icon) */
.menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-md);
}

/* Hide hamburger on larger screens */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

/* Hamburger icon styling */
.menu-icon {
    font-size: 1.5rem;
    color: white;
    line-height: 1;
}

/* Desktop navigation - hidden on mobile */
.main-nav {
    display: none;
    width: 100%;
}

/* Show desktop nav on medium screens */
@media (min-width: 768px) {
    .main-nav {
        display: flex;
        justify-content: center;
        width: auto;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION (Popover)

   Uses the HTML popover attribute - no JavaScript needed!
   The [popover] attribute automatically handles show/hide behavior.

   Key concepts:
   - popover: Hidden by default, click button to toggle
   - :popover-open: Styles applied when the popover is visible
   - ::backdrop: The overlay behind the popover
   ========================================================================== */

/* Base mobile nav styles - hidden by default */
.mobile-nav {
    /* Reset default popover styles */
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;

    /* Position in top-right corner */
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    left: auto;
    bottom: auto;

    /* Styling */
    background-color: var(--color-bg-dark);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    max-width: calc(100vw - 2rem);

    /* Animation */
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease,
                display 0.2s ease allow-discrete;
}

/* When popover is open */
.mobile-nav:popover-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Starting state for opening animation */
@starting-style {
    .mobile-nav:popover-open {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Dark backdrop when popover is open */
.mobile-nav::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-nav:popover-open::backdrop {
    opacity: 1;
}

/* Mobile nav links list */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: var(--space-2) 0;
}

/* Individual mobile nav link */
.mobile-nav-links a {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-default);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Hide mobile nav on larger screens (not needed) */
@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

/* Nav links list */
.nav-links {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .nav-links {
        flex-direction: row;
        justify-content: center;
        font-size: 0.9375rem;
    }
}

/* Individual nav link */
.nav-links a {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: white;
}


/* ==========================================================================
   5. HERO SECTION

   The large introductory area at the top of the homepage.
   Creates visual impact and tells visitors what the site is about.
   ========================================================================== */

.hero {
    position: relative;
    padding: var(--space-12) 0;
}

@media (min-width: 768px) {
    .hero {
        padding: var(--space-20) 0;
        /* Account for sticky header overlap */
        margin-top: -76px;
        padding-top: calc(76px + var(--space-20));
    }
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
    padding-bottom: var(--space-8);
}

@media (min-width: 768px) {
    .hero-content {
        padding-bottom: var(--space-16);
    }
}

/* Main headline */
.hero-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
    margin-bottom: var(--space-4);
    color: rgb(229, 231, 235);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

/* Accent text in title */
.hero-title .accent {
    color: var(--color-accent);
}

/* Subtitle/description */
.hero-description {
    max-width: 48rem;
    margin: 0 auto var(--space-6);
    font-size: 1.25rem;
    color: rgb(203, 213, 225);
}

/* Hero image */
.hero-image {
    position: relative;
    max-width: 64rem;
    margin: 0 auto;
}

.hero-image img {
    border-radius: var(--radius-md);
    margin: 0 auto;
    max-width: 1024px;
    max-height: 576px;
}


/* ==========================================================================
   6. STATS SECTION

   Displays numbers/statistics in an eye-catching way.
   Uses flexbox to arrange items in a row.
   ========================================================================== */

.stats-section {
    padding: var(--space-12) 0;
}

@media (min-width: 768px) {
    .stats-section {
        padding: var(--space-16) 0;
    }
}

@media (min-width: 1024px) {
    .stats-section {
        padding: var(--space-20) 0;
    }
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Individual stat item */
.stat-item {
    width: 100%;
    min-width: 220px;
    padding: var(--space-4);
    text-align: center;
}

/* On small screens, show 2 per row */
@media (min-width: 640px) {
    .stat-item {
        width: 50%;
    }
}

/* On medium screens, show with borders between */
@media (min-width: 768px) {
    .stat-item {
        width: 25%;
        border-right: 1px solid rgb(100, 116, 139);
    }

    .stat-item:last-child {
        border-right: none;
    }
}

/* The big number */
.stat-number {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-primary);
}

@media (min-width: 1024px) {
    .stat-number {
        font-size: 3rem;
    }
}

@media (min-width: 1280px) {
    .stat-number {
        font-size: 3.75rem;
    }
}

/* Label below the number */
.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(148, 163, 184);
}

@media (min-width: 1024px) {
    .stat-label {
        font-size: 1rem;
    }
}


/* ==========================================================================
   7. SECTION TITLE

   A centered heading used to introduce sections.
   ========================================================================== */

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: var(--space-8) 0 var(--space-4);
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.875rem;
    }
}


/* ==========================================================================
   8. FOOTER

   The bottom section of every page with links and copyright.
   Uses CSS Grid for multi-column layout.
   ========================================================================== */

.footer {
    position: relative;
    color: rgb(203, 213, 225);
}

.footer-content {
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .footer-content {
        padding: 0 var(--space-6);
    }
}

/* Footer grid layout */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-4);
    row-gap: var(--space-8);
    padding: var(--space-8) 0;
}

@media (min-width: 768px) {
    .footer-grid {
        padding: var(--space-12) 0;
    }
}

/* Footer brand/logo column */
.footer-brand {
    grid-column: span 12;
}

@media (min-width: 1024px) {
    .footer-brand {
        grid-column: span 4;
    }
}

.footer-brand a {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.footer-legal-links {
    display: flex;
    gap: var(--space-1);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-legal-links a {
    color: rgb(156, 163, 175);
    transition: color var(--transition-fast);
}

.footer-legal-links a:hover {
    color: rgb(107, 114, 128);
    text-decoration: underline;
}

/* Footer link columns */
.footer-column {
    grid-column: span 6;
}

@media (min-width: 768px) {
    .footer-column {
        grid-column: span 3;
    }
}

@media (min-width: 1024px) {
    .footer-column {
        grid-column: span 2;
    }
}

.footer-column-title {
    font-size: 1rem;
    font-weight: 500;
    color: rgb(209, 213, 219);
    margin-bottom: var(--space-2);
}

.footer-column ul {
    font-size: 0.875rem;
}

.footer-column li {
    margin-bottom: var(--space-2);
}

.footer-column a {
    color: rgb(156, 163, 175);
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: rgb(107, 114, 128);
    text-decoration: underline;
}

/* Footer bottom bar with copyright */
.footer-bottom {
    /* Full viewport width - breaks out of any container */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    border-top: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-4);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        padding: var(--space-4) var(--space-6);
    }
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-copyright a {
    color: rgb(37, 99, 235);
    text-decoration: underline;
}


/* ==========================================================================
   9. BUTTONS

   Clickable elements for actions. Buttons are styled to look tappable.
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: transparent;
    color: var(--color-text-default);
    cursor: pointer;
    transition: background-color var(--transition-fast),
                border-color var(--transition-fast);
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-secondary);
}


/* ==========================================================================
   10. CARDS

   Container elements for grouping related content.
   Used for monster cards, articles, etc.
   ========================================================================== */

.card {
    background-color: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-normal),
                box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-content {
    padding: var(--space-4);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.card-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}


/* ==========================================================================
   11. CONTENT PAGES (Monster detail pages, etc.)

   Styles for the main content area of article/detail pages.
   ========================================================================== */

.page-content {
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
}

@media (min-width: 640px) {
    .page-content {
        padding: var(--space-12) var(--space-6);
    }
}

/* Prose content - for readable text blocks */
.prose {
    max-width: var(--max-width-text);
    margin: 0 auto;
    color: var(--color-text-default);
}

.prose h1 {
    font-size: 2.25rem;
    margin-bottom: var(--space-4);
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

.prose p {
    margin-bottom: var(--space-4);
    line-height: 1.75;
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
}

.prose img {
    border-radius: var(--radius-md);
    margin: var(--space-6) 0;
}


/* ==========================================================================
   12. GRID LAYOUTS

   Responsive grids for displaying multiple items.
   ========================================================================== */

.grid {
    display: grid;
    gap: var(--space-6);
}

/* 2 columns on tablet, 3 on desktop */
.grid-cards {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==========================================================================
   13. UTILITY CLASSES

   Single-purpose classes for quick styling adjustments.
   Use sparingly - prefer semantic class names when possible.
   ========================================================================== */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text colors */
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }

/* Margin utilities */
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }

/* Hide elements */
.hidden { display: none; }

/* Body scroll lock for mobile menu */
body.menu-open {
    overflow: hidden;
}


/* ==========================================================================
   14. ARTICLE/MONSTER PAGE STYLES

   Styles for the monster detail pages with article content.
   ========================================================================== */

/* Article section wrapper */
.article-section,
section[class*="mx-auto"] {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
}

@media (min-width: 640px) {
    .article-section,
    section[class*="mx-auto"] {
        padding: var(--space-16) var(--space-6);
    }
}

@media (min-width: 1024px) {
    .article-section,
    section[class*="mx-auto"] {
        padding: var(--space-20) var(--space-6);
    }
}

/* Prose content - for article body text */
.prose,
div[class*="prose"] {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 var(--space-6);
    color: var(--color-text-default);
    font-size: 1.125rem;
    line-height: 1.75;
}

.prose h1,
div[class*="prose"] h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: rgb(203, 213, 225);
}

.prose h2,
div[class*="prose"] h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
    color: rgb(203, 213, 225);
}

.prose p,
div[class*="prose"] p {
    margin-bottom: var(--space-4);
}

.prose ol,
div[class*="prose"] ol {
    list-style: decimal;
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.prose li,
div[class*="prose"] li {
    margin-bottom: var(--space-2);
}

.prose strong,
div[class*="prose"] strong {
    font-weight: 600;
    color: var(--color-text-heading);
}

.prose a,
div[class*="prose"] a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Article header */
article header {
    max-width: 48rem;
    margin: 0 auto;
    text-align: left;
}

article header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    article header h1 {
        font-size: 3rem;
    }
}

/* Article meta info */
article header p {
    padding: 0 var(--space-4);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

/* Article featured image */
article header img {
    max-width: 900px;
    width: 100%;
    height: auto;
    margin: 0 auto var(--space-6);
    border-radius: var(--radius-md);
    background-color: rgb(51, 65, 85);
}

/* Tags list */
ul[class*="mr-5"],
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0 var(--space-6);
    max-width: 48rem;
    margin: var(--space-8) auto;
}

ul[class*="mr-5"] li,
.tags-list li {
    display: inline-block;
    background-color: rgb(51, 65, 85);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

ul[class*="mr-5"] a,
.tags-list a {
    color: rgb(203, 213, 225);
}

/* Share buttons container */
div[class*="align-middle"],
.share-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-6);
    max-width: 48rem;
    margin: var(--space-4) auto;
    color: var(--color-text-muted);
}

div[class*="align-middle"] button,
.share-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
}

div[class*="align-middle"] svg,
.share-buttons svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgb(100, 116, 139);
}

div[class*="align-middle"] svg:hover,
.share-buttons svg:hover {
    color: rgb(203, 213, 225);
}

/* Back to home button */
.btn-tertiary,
a[class*="btn-tertiary"] {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-default);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.btn-tertiary:hover,
a[class*="btn-tertiary"]:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Related posts section */
section[class*="relative not-prose"] {
    padding: var(--space-12) var(--space-4);
}

section[class*="relative not-prose"] h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

/* Related posts grid */
div[class*="grid"][class*="lg:grid-cols-4"] {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-8);
}

@media (min-width: 768px) {
    div[class*="grid"][class*="lg:grid-cols-4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    div[class*="grid"][class*="lg:grid-cols-4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Related post card */
div[class*="grid"][class*="lg:grid-cols-4"] article {
    margin-bottom: var(--space-6);
}

div[class*="grid"][class*="lg:grid-cols-4"] article img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    background-color: rgb(51, 65, 85);
}

div[class*="grid"][class*="lg:grid-cols-4"] article h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: rgb(203, 213, 225);
}

div[class*="grid"][class*="lg:grid-cols-4"] article h3 a {
    transition: color var(--transition-fast);
}

div[class*="grid"][class*="lg:grid-cols-4"] article h3 a:hover {
    color: var(--color-primary);
}

div[class*="grid"][class*="lg:grid-cols-4"] article p {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Category page grid */
div[class*="grid"][class*="lg:grid-cols-3"] {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 640px) {
    div[class*="grid"][class*="lg:grid-cols-3"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    div[class*="grid"][class*="lg:grid-cols-3"] {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==========================================================================
   15. RESPONSIVE BREAKPOINTS REFERENCE

   These are the screen widths where the layout changes:

   - Mobile: 0px - 639px (default styles)
   - Tablet: 640px - 767px (sm: prefix in comments)
   - Medium: 768px - 1023px (md: prefix in comments)
   - Desktop: 1024px - 1279px (lg: prefix in comments)
   - Large: 1280px+ (xl: prefix in comments)

   Tip: Always design mobile-first, then add @media queries for larger screens!
   ========================================================================== */


/* ==========================================================================
   10. CATEGORY GRID

   Grid layout for displaying monster cards on category pages.
   Shows 3 items per row on desktop, 2 on tablet, 1 on mobile.
   ========================================================================== */

.category-header {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: var(--space-2);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: 0 var(--space-4) var(--space-8);
}

@media (min-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 var(--space-6) var(--space-12);
    }
}

/* Monster card */
.monster-card {
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-bg-dark);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.monster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.monster-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.monster-card-content {
    padding: var(--space-4);
}

.monster-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-heading);
    margin-bottom: var(--space-2);
}

.monster-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.monster-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
}


/* ==========================================================================
   16. ARTICLE DETAIL PAGE (2-Column Layout)

   Split layout with sticky image on left, scrollable content on right.
   On mobile, stacks vertically with image on top.
   ========================================================================== */

.article-layout {
    display: flex;
    flex-direction: column;
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-4);
    gap: var(--space-6);
}

/* On desktop: 2-column layout */
@media (min-width: 1024px) {
    .article-layout {
        flex-direction: row;
        padding: var(--space-6);
        gap: var(--space-8);
        min-height: calc(100vh - 60px);
    }
}

/* Left column - Sticky image */
.article-image-column {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .article-image-column {
        position: sticky;
        top: 80px; /* Below header */
        width: 45%;
        max-width: 500px;
        height: fit-content;
        align-self: flex-start;
    }
}

.article-featured-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-dark);
}

/* Right column - Scrollable content */
.article-content-column {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

/* Article header */
.article-header {
    margin-bottom: var(--space-6);
}

.article-category {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.article-meta .article-category {
    margin-bottom: 0;
}

.article-meta span {
    color: var(--color-text-muted);
    opacity: 0.5;
}

.article-date {
    display: inline-block;
}

/* Conceptualizer attribution */
.article-conceptualizer {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.article-conceptualizer a {
    color: var(--color-primary);
    text-decoration: underline;
}

.article-conceptualizer a:hover {
    color: var(--color-secondary);
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--color-text-heading);
}

@media (min-width: 768px) {
    .article-title {
        font-size: 2.5rem;
    }
}

.article-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Article tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.article-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: 0.875rem;
    background-color: rgb(51, 65, 85);
    color: rgb(203, 213, 225);
    border-radius: var(--radius-sm);
}

/* Article body content */
.article-body {
    color: var(--color-text-default);
    line-height: 1.75;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
    color: var(--color-text-heading);
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body p {
    margin-bottom: var(--space-4);
}

.article-body ol,
.article-body ul {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

.article-body ol {
    list-style: decimal;
}

.article-body ul {
    list-style: disc;
}

.article-body li {
    margin-bottom: var(--space-2);
}

.article-body strong {
    font-weight: 600;
    color: var(--color-text-heading);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-default);
}


/* ==========================================================================
   17. SKIP TO CONTENT (Accessibility)

   A hidden link that appears when focused, allowing keyboard users to
   skip navigation and jump directly to main content.
   ========================================================================== */

.skip-to-content {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 9999;
    padding: var(--space-3) var(--space-4);
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: var(--space-4);
}


/* ==========================================================================
   18. PRINT STYLES

   Styles that apply when the page is printed.
   Makes the page more readable on paper by:
   - Using black text on white background
   - Removing unnecessary elements (nav, footer)
   - Expanding links to show URLs
   ========================================================================== */

@media print {
    /* Reset to light mode for printing */
    :root {
        --color-text-heading: #000;
        --color-text-default: #333;
        --color-text-muted: #666;
        --color-bg-page: #fff;
        --color-bg-dark: #f5f5f5;
    }

    /* Basic resets */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Hide non-essential elements */
    .header,
    .footer,
    .announcement-bar,
    .menu-toggle,
    .mobile-nav,
    .skip-to-content,
    .back-link {
        display: none !important;
    }

    /* Remove shadows and backgrounds */
    .monster-card,
    .card {
        box-shadow: none;
        background: white;
        border: 1px solid #ddd;
    }

    /* Make links show their URLs */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* Don't show URL for internal links */
    a[href^="/"]:after,
    a[href^="#"]:after {
        content: "";
    }

    /* Ensure images don't break across pages */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* Avoid breaking inside these elements */
    h1, h2, h3, h4, h5, h6,
    .monster-card,
    .article-header {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    /* Start main content on new page if needed */
    main {
        page-break-before: auto;
    }

    /* Article layout adjustments for print */
    .article-layout {
        display: block;
    }

    .article-image-column {
        position: static;
        width: 100%;
        max-width: 400px;
        margin: 0 auto var(--space-4);
    }

    .article-featured-image {
        max-width: 100%;
        height: auto;
    }
}
