/* ==========================================================================
   Core Styling for HowToDocument.com
   ========================================================================== */

:root {
    --primary: #1e293b;   /* Slate blue for authority */
    --accent: #2563eb;    /* Clean tech blue for links/actions */
    --text: #475569;      /* Refined grey for crisp paragraph reading */
    --title: #0f172a;     /* Deep dark slate for sharp headings */
    --bg: #f1f5f9;        /* Slightly deeper background to make white cards pop */
    --card-bg: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Header Section (Dynamic Image Blend)
   ========================================================================== */

header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.9)), 
                url('header-bg.jpg') center/cover no-repeat;
    color: white;
    padding: 5.5rem 1rem; 
    text-align: center;
    position: relative;
    border-bottom: 5px solid var(--accent); 
}

header h1 { 
    margin: 0; 
    font-size: 3rem; 
    font-weight: 800; 
    letter-spacing: -0.04em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header p { 
    margin: 1rem auto 0 auto; 
    opacity: 0.95; 
    font-size: 1.25rem; 
    max-width: 655px; 
    font-weight: 300;
}

/* ==========================================================================
   Layout & Component Grid
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 3.5rem auto;
    padding: 0 1.5rem;
}

h2 {
    color: var(--title);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* ==========================================================================
   Cards (Optimized for perfectly aligned buttons)
   ========================================================================== */

.card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* These lines perfectly align buttons to the bottom of every card */
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card h3 { 
    margin-top: 0; 
    margin-bottom: 0.75rem;
    color: var(--title); 
    font-size: 1.4rem;
    font-weight: 700;
}

.card p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* Action Buttons */
.btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.15s ease;
    
    /* Pushes the button down to stay uniform */
    margin-top: auto; 
}

.btn:hover { 
    background-color: #1d4ed8; 
}

/* ==========================================================================
   Global Footer
   ========================================================================== */

footer {
    text-align: center;
    padding: 2.5rem;
    margin-top: 6rem;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #64748b;
}