/* RESET CODE */

html {
    scroll-behavior: smooth;
}

:root {
    /* My Colours */
    --color-orange: #ff6b00;
    --color-dark: #1a1a1a;
    --color_light: #ffffff;

    /* spacing */
    --width-container: 1100px;
}

/* makes sure padding doesn't make boxes wider than we want */
* {
    box-sizing: border-box;
}

/* remove default margins */
body, ul, h1 {
    margin: 0;
    padding: 0;
}

/* default font */
body {
    font-family: sans-serif;
    color: var(--color-dark);
    line-height: 1.6;
}

/* remove bullets */
ul {
    list-style: none;
}

/* remove link underline */
a {
    text-decoration: none;
    color: inherit; /* uses parent colour */
}


/* ----UTILITIES---- */

.container {
    max-width: var(--width-container);
    margin: 0 auto; /* sets top/bottom to 0 and left/right to auto */
    padding: 0 1rem; /* adds space for mobile */
}

/* ----HEADER---- */

.site-header {
    padding: 1.5rem 0; /* vertical spacing */
    border-bottom: 1px solid #eee; /* light divider line */
    position: relative;
}

/*  use the .container inside the header for layout */

.site-header .container {
    display: flex;
    justify-content: space-between; /* pushes logo left, Nav right */
    align-items: center; /* aligns vertically */
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
}

/*  turn list into a row */
.site-nav ul {
    display: flex;
    gap: 2rem;
}

/* orange hover effect */
.site-nav a {
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--color-orange);
}

/* ----HERO SECTION---- */

.hero {
    padding: 4rem 0; /* roomy top/bottom */
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    max-width: 800px;
}

/* makes highlighted text orange */
.highlight {
color: var(--color-orange);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
}

/* ----BUTTONS---- */

.btn {
    display: inline-block; /* lets me add padding/margins */
    background-color: var(--color-dark);
    color: var(--color_light);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s;
}

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

/* ----WORK SECTION---- */

.work-section {
    padding: 4rem 0;
    background-color: #f9f9f9;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* GRID */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* This line creates columns that are at least 300px wide, 
       but stretch to fill space if available. */
    gap: 2rem;
}

/* ----CARD STYLING---- */

.project-card {
    background: var(--color_light);
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.2s;
}
/* card hover */
.project-card:hover {
    transform: translate(-1.5px);
    border-color: var(--color-orange);
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.text-link {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color-dark);
}

.text-link:hover {
    color: var(--color-orange);
}

/* ----BLOG SECTION---- */

.blog-section {
    padding: 4rem 0;
}

.blog-post {
    margin-bottom: 3rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

/* remove line from last item */
.blog-post:last-child {
    border-bottom: none;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.blog-date {
    color: #888;
    font-size: 0.9rem;
}

/* CODE SNIPPET - updated to work in conjunction with Prism (with some small tweaks)*/

.code-block {
    background-color: #1e1e1e !important;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem !important;
    overflow-x: auto;
    border-left: 4px solid var(--color-orange);
    margin-bottom: 20px;
}
/* forces smaller font size */
.code-block code, 
.code-block span {
    font-size: inherit !important;
}

/* syntax highlight */

/* CSS selectors or JS objects */
.code-selector, .code-obj {
    color: #dfa324;
}

/* CSS properties or JS variables */
.code-prop, .code-var {
    color: #4dc1ff;
}

/* Values, strings, or constants */
.code-val, .code-str {
    color: var(--color-orange);
}

/* Comments */
.code-comment {
    color: green;
    font-style: italic;
}

/* Keywords (const, let, function, etc.) */
.code-keyword {
    color: #ff7f50;
}

/* Methods or functions */
.code-method, .code-func {
    color: #1e90ff;
}

/* Code block styling THIS WAS A DUPLICATE! */
/* .code-block {
    background-color: #1e1e1e;
    padding: 1em;
    border-radius: 6px;
    display: block;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.95em;} */

/* ----FOOTER---- */

.site-footer {
    background-color: var(--color-dark);
    color: #ffff;
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-title {
    font-size: 2rem;
    margin-bottom: 1rem
}

.email-link {
   font-size: 1.2rem;
   color: var(--color-orange); 
   /* border-bottom: 1px solid var(--color-orange); */
   padding-bottom: 2px;
}

.email-link:hover {
    color: #fff;
    border-color: #fff;
}

.social-list {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-list a {
    color: #999;
    font-weight: bold;
    transition: color 0.2s;
}

.social-list a:hover {
    color: #fff;
}

.copyright {
    color: #555;
    font-size: 0.85rem;
    margin-top: 3rem;
}

/* ---- PROJECT PAGES */

.project-hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.project-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.project-tagline {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

.project-banner {
    width: 100%;
    height: 300px;
    background-color: #ddd;
    border-radius: 8px;
    margin-bottom: 3rem;
}

/* 2 columns - sidebar and story */
.project-layout {
    display: grid;
    grid-template-columns: 250px 1fr; /* Sidebar is 250px, Content takes the rest (1fr) */
    gap: 4rem;
    padding-bottom: 4rem;
}

/* sidebar style */
.sidebar-block {
    margin-bottom: 2rem;
}

.sidebar-block h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 1rem;
}

.tech-list li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1rem;
}
.tech-list li::before {
    content: "•";
    color: var(--color-orange);
    position: absolute;
    left: 0;
}

/* Story style */
.project-story h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.project-story p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* story image */
.image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #eee;
}

figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

/* ----RESPONSIVE FIX */
/* If screen is smaller than 768px (Tablet/Mobile) */
@media (max-width: 768px) {
    .project-layout {
    grid-template-columns: 1fr; /* Stacks in 1 column */
    gap: 2rem;
    }

    .project-banner {
        height: 200px; /* Smaller banner on phones */
    }
}

/* ----IMAGES---- */

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-bottom: 1rem;
}

/* Project hero banner */
.project-banner-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 3rem;
    display: block;
}

.project-story-img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Mobile Tweak */
@media (max-width: 768px) {
    .project-banner-img {
        height: 200px; /* Shorter on phones so it doesn't take up whole screen */
    }
}

/* button secondary action */
.btn-outline {
    background-color: transparent; /* See-through background */
    border: 2px solid var(--color-dark); /* Thick dark border */
    color: var(--color-dark);
}

.btn-outline:hover {
    background-color: transparent;
    border-color: var(--color-orange);
    color: var(--color-orange);
}

/* ----ABOUT---- */

.about-section {
    padding: 4rem 0;
    background-color: #fff;
}

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: #555;
    font-size: 1.1rem;
}

.about-skills h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* Skills pills */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skills-list li {
    background-color: #f4f4f4;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-dark);
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.skills-list li:hover {
    background-color: var(--color-orange);
    color: #fff;
    border-color: var(--color-orange);
    /* transform: translateY(-1px); */
}

/* ---- MOBILE RESPONSIVENESS ---- */
@media (max-width: 768px) {
    .about-layout {
        grid-template-columns: 1fr; /* Stack into 1 column on phones */
        gap: 2rem;
    }
}

/* ---- BLOG INDEX PAGE ---- */

.page-header {
    padding: 4rem 0 2rem;
    text-align: center;
    background-color: #f9f9f9; /* Slight grey background for the header area */
    margin-bottom: 3rem;
}

/* Fix alignment for BOTH Title and Subtitle on the Blog page */
.page-header .hero-title,
.page-header .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.blog-list-section {
    padding-bottom: 4rem;
    max-width: 800px; /* Keeps the reading line-length comfortable */
    margin: 0 auto;   /* Centres the whole section */
}

.blog-preview {
    margin-bottom: 3rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

.blog-preview:last-child {
    border-bottom: none;
}

.blog-preview h2 {
    font-size: 1.75rem;
    margin: 0.5rem 0 1rem;
}

.blog-preview h2 a {
    color: var(--color-dark);
    transition: color 0.2s;
}

.blog-preview h2 a:hover {
    color: var(--color-orange);
}

/* ---- MOBILE NAVIGATION ---- */

/* 1. Default State (Desktop): Hide the hamburger button */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-dark);
    margin: 5px 0;
    border-radius: 2px;
}

/* 2. Mobile State: Show button, hide menu */
@media (max-width: 768px) {
    
    .mobile-toggle {
        display: block; /* Show the button on phones */
    }

    .site-nav {
        display: none; /* Hide the links by default */
        position: absolute;
        top: 100%; /* Push it to the bottom of the header */
        left: 0;
        right: 0;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .site-nav ul {
        flex-direction: column; /* Stack links vertically */
        gap: 1.5rem;
        text-align: center;
    }

    /* 3. The "Open" State (We will toggle this class with JS) */
    .site-nav.is-open {
        display: block !important;
    }
}