/* ISYS1001 Assessment 2 - Final Styles */
/* Student Note: I moved all CSS to this external file to fix the 
   "Inline CSS" issue mentioned in my Assessment 1 feedback.
*/

:root {
    /* Using variables for consistent coloring */
    --primary-color: #0b57d0;     
    --primary-hover: #0842a0;
    --secondary-bg: #f0fdf4;      
    --border-color: #d1fadf;
    --text-color: #333;
    --bg-gray: #f9fafb;
    --card-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Accessibility: Skip Link (ULO4) */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 10px;
    z-index: 100;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
}
.skip-link:focus {
    top: 0;
}

/* --- Header & Navigation --- */
.header {
    background: var(--bg-gray);
    border-bottom: 1px solid #e6e6e6;
    padding: 1rem 0;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 45px; height: 45px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.brand-text h1 { margin: 0; font-size: 1.4rem; color: #222; }
.brand-text p { margin: 0; font-size: 0.9rem; color: #666; }

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: background 0.2s;
    font-weight: 500;
}

nav a:hover, nav a.active {
    background: #e8f0fe;
    border-color: #c7dafc;
}

.cms-link {
    background-color: #e67e22 !important;
    color: white !important;
}

/* --- Main Content Areas --- */
main {
    flex: 1;
    padding: 30px 0;
}

.section {
    margin-bottom: 40px;
}

.section h2, .section h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h2 { margin-top: 0; color: #166534; }

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.btn:hover {
    background-color: var(--primary-hover);
}

/* --- Layout: CSS Grid (Mobile First) --- */
.grid {
    display: grid;
    gap: 25px;
    grid-template-columns: 1fr; /* Default: Single column for mobile */
}

/* Desktop Styles (Media Query) */
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    
    .header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    nav ul { margin-top: 0; }
    
    .hero { text-align: left; }

    /* Requirement: Mix Layout implementation */
    /* Allows the last card to span full width */
    .card-featured {
        grid-column: 1 / -1; 
        display: flex;
        align-items: center;
        gap: 25px;
    }
    
    .card-featured img {
        max-width: 40%;
        margin-bottom: 0;
        height: auto;
        object-fit: cover;
    }
}

/* Card Styling */
.card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--card-radius);
    padding: 20px;
    /* Soft shadow for better UX */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.08);
}

.card h3, .card h4 {
    margin-top: 0;
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

/* Code block styling for webdev1.html */
pre, code {
    background: #f4f4f4;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}
pre { padding: 15px; overflow-x: auto; }

/* Form Styles */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}
button {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}
button:hover { background: var(--primary-hover); }

/* Footer */
footer {
    background: var(--bg-gray);
    border-top: 1px solid #e6e6e6;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}