/*
==========================================================
DIGITAL THINKING ARTICLE
Main stylesheet
==========================================================

Expected folder structure:

your-project/
│
├── index.html
├── style.css
└── images/
    └── digitalthinking.jpg

==========================================================
*/


/* ======================================================
   1. DESIGN VARIABLES
   ====================================================== */

/*
   Keeping colours and dimensions in variables makes it
   easier to change the design later.
*/

:root {

    /* Main colours */
    --black: #171513;
    --dark-brown: #30251f;
    --brown: #684d3b;

    /* Background colours */
    --cream: #f7f3ed;
    --light-cream: #fbf9f6;

    /* Text colours */
    --text: #302c28;
    --muted-text: #756d65;

    /* Borders */
    --border: #e3ddd5;

    /* Maximum widths */
    --content-width: 820px;
    --wide-width: 1120px;

    /* Fonts */
    /* Font used throughout the entire article */
    --body-font: "Times New Roman", Times, serif;
    --heading-font: "Times New Roman", Times, serif;
}


/* ======================================================
   2. BASIC RESET
   ====================================================== */

/*
   Browsers have their own default margins and padding.
   This reset gives us more predictable control.
*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* Smooth scrolling */

html {
    scroll-behavior: smooth;
}


/* ======================================================
   3. BODY
   ====================================================== */

body {

    /* Page background */
    background: var(--light-cream);

    /* Main text colour */
    color: var(--text);

    /* Body font */
    font-family: var(--body-font);

    /* Default text size */
    font-size: 17px;

    /* Space between lines */
    line-height: 1.85;

    /* Makes text rendering cleaner */
    -webkit-font-smoothing: antialiased;
}


/* ======================================================
   4. ARTICLE HEADER
   ====================================================== */

.article-header {

    /* Slightly different background for the header */
    background: var(--cream);

    /* Space underneath the header */
    padding-bottom: 70px;
}


/* ======================================================
   5. ARTICLE IMAGE
   ====================================================== */

/*
   The image can stretch across the wider article area
   while the actual text remains narrower.
*/

.article-image-wrapper {

    width: 100%;

    max-width: var(--wide-width);

    margin: 0 auto;
}


/*
   Main article image.

   object-fit: cover ensures the image fills the area
   without becoming distorted.
*/

.article-image {

    display: block;

    width: 100%;

    height: 500px;

    object-fit: cover;
}


/* ======================================================
   6. ARTICLE TITLE AREA
   ====================================================== */

.article-header-content {

    /*
       100% minus 40px prevents text from touching the
       edges on smaller screens.
    */
    width: min(100% - 40px, var(--content-width));

    /* Centre the content */
    margin: 55px auto 0;
}


/* Small category above title */

.article-category {

    margin-bottom: 18px;

    color: var(--brown);

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;

    line-height: 1.4;
}


/* ======================================================
   7. MAIN TITLE
   ====================================================== */

.article-header h1 {

    max-width: 780px;

    color: var(--black);

    font-family: var(--heading-font);

    /*
       clamp() allows the title to automatically resize
       depending on the screen width.
    */
    font-size: clamp(42px, 6vw, 72px);

    font-weight: 700;

    letter-spacing: -1.5px;

    line-height: 1.08;
}


/* Introductory text beneath title */

.article-intro {

    max-width: 700px;

    margin-top: 24px;

    color: var(--muted-text);

    font-size: 20px;

    line-height: 1.6;
}


/* ======================================================
   8. MAIN ARTICLE CONTAINER
   ====================================================== */

.article-container {

    /*
       Vertical and horizontal spacing around the article.
    */
    padding: 80px 20px 100px;
}


/*
   The actual article text is deliberately narrower than
   the cover image to make long-form reading comfortable.
*/

.article-content {

    width: 100%;

    max-width: var(--content-width);

    margin: 0 auto;
}


/* ======================================================
   9. PARAGRAPHS
   ====================================================== */

.article-content p {

    /* Space between paragraphs */
    margin-bottom: 28px;
}


/* ======================================================
   10. SECTION HEADINGS
   ====================================================== */

.article-content h2 {

    /*
       Large space before a new section.
       This visually separates major ideas.
    */
    margin: 65px 0 25px;

    color: var(--black);

    font-family: var(--heading-font);

    font-size: clamp(30px, 4vw, 42px);

    line-height: 1.2;
}


/* ======================================================
   11. EMPHASIZED TEXT
   ====================================================== */

.article-content em {

    color: var(--brown);
}


/* ======================================================
   12. BLOCKQUOTE / KEY MESSAGE
   ====================================================== */

/*
   This is used for the main takeaway of the article.
*/

.article-content blockquote {

    margin: 50px 0;

    /*
       Vertical line on the left of the quote.
    */
    padding: 30px 35px;

    border-left: 4px solid var(--brown);

    background: var(--cream);

    color: var(--dark-brown);

    font-family: var(--heading-font);

    font-size: 24px;

    font-style: italic;

    line-height: 1.55;
}


/* ======================================================
   13. ARTICLE SIGN-OFF
   ====================================================== */

.article-signoff {

    /*
       Separates the closing line from the main article.
    */
    margin-top: 55px;

    padding-top: 35px;

    border-top: 1px solid var(--border);

    color: var(--brown);

    font-family: var(--heading-font);

    font-size: 22px;
}


/* ======================================================
   14. FOOTER
   ====================================================== */

.article-footer {

    padding: 35px 20px;

    background: var(--black);

    color: #d8d1ca;

    text-align: center;

    font-size: 13px;

    letter-spacing: 0.3px;
}


/* ======================================================
   15. TABLET RESPONSIVE DESIGN
   ====================================================== */

/*
   These styles apply when the screen is 900px or
   narrower.
*/

@media (max-width: 900px) {

    /*
       The image uses the full available width.
    */

    .article-image-wrapper {
        width: 100%;
    }


    /*
       Reduce image height on smaller screens.
    */

    .article-image {
        height: 420px;
    }


    /*
       Reduce the space between the image and title.
    */

    .article-header-content {
        margin-top: 45px;
    }


    /*
       Reduce article top spacing.
    */

    .article-container {
        padding-top: 65px;
    }
}


/* ======================================================
   16. MOBILE RESPONSIVE DESIGN
   ====================================================== */

/*
   These styles apply to phones and very small screens.
*/

@media (max-width: 600px) {

    /* Slightly smaller body text */
    body {
        font-size: 16px;
        line-height: 1.8;
    }


    /* Reduce header spacing */
    .article-header {
        padding-bottom: 50px;
    }


    /* Reduce image height */
    .article-image {
        height: 280px;
    }


    /* Reduce title-area width */
    .article-header-content {

        width: min(100% - 30px, var(--content-width));

        margin-top: 35px;
    }


    /* Smaller category text */
    .article-category {

        font-size: 10px;

        letter-spacing: 1.5px;
    }


    /* Smaller mobile title */
    .article-header h1 {

        font-size: 42px;

        letter-spacing: -0.8px;
    }


    /* Smaller introduction */
    .article-intro {

        font-size: 18px;
    }


    /* Reduce article side spacing */
    .article-container {

        padding: 55px 15px 75px;
    }


    /* Smaller section headings */
    .article-content h2 {

        margin-top: 50px;

        font-size: 31px;
    }


    /* Smaller quote */
    .article-content blockquote {

        margin: 40px 0;

        padding: 25px 22px;

        font-size: 21px;
    }


    /* Smaller closing line */
    .article-signoff {

        font-size: 20px;
    }
}


/* ======================================================
   END OF STYLESHEET
   ====================================================== */