/*Theme colour*/
:root {
    --bg-color: #faf8f3;       /* Cream */
    --text-color: #3a4149;     /* Dark grey */
    --primary-color: #2c5f2d;  /* Dark green */
    --accent-color: #b8945f;   /* Gold */
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lora', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
}

/*All links to be the same as other text*/
a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

/*Header & Navigation*/
#nav_bar {
    background-color: white;
    padding: 16px 72px;
    border-bottom: 2px solid #b8945f;
}

#logo {
    color:#2c5f2d;
    font-family: "Playfair Display", serif;
    font-weight: bold;
    font-size: 18px;
    padding: 14px 16px;
}

#nav_bar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#nav_bar ul li {
    float: right;
}

#nav_bar ul li a {
    font-family: "Playfair Display", serif;
    display: block;
    color: #3a4149;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

#nav_bar ul li a:hover {
    color: #b8945f; 
    text-decoration: underline;
    font-weight: bold;
}

/*MetroPets*/
#logo {
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-right: auto; /*Pushes the logo to the side*/
    color:#2c5f2d;
    font-family: "Playfair Display";
        font-weight: bold;
        font-size: 18px;
    padding: 14px 16px;
}

/*Main content layout*/
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 5%;
}


.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

/*Shelter News & Success Stories*/
.page-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: #555;
}

/*Filters*/
.news-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;   
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active-filter {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.article-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-image-link img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    /*Push the read more button all the way down to the card*/
    flex-grow: 1;
}

.card-meta {
    display: flex;
    /*Leaving space between category and date*/
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-meta .category {
    color: var(--accent-color);
}

.card-meta .time-info {
    color: #888;
}

.card-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/*Story title turns green when mouse-over*/
.card-content h2 a {
    color: var(--text-color);
}

.card-content h2 a:hover {
    color: var(--primary-color);
}

.excerpt {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 2rem;
    flex-grow: 1; 
}

.read-more-btn {
    align-self: flex-start;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.read-more-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/*Full article view*/
.single-article-view {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out forwards;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    display: inline-block;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--accent-color);
}

.single-article-view h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.single-article-view img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

.single-article-view .full-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5rem;
}
/*The animation that makes the full content fade in*/
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/*Newsletter signup*/
.newsletter-signup {
    background-color: #fff;
    padding: 4rem 5%;
    text-align: center;
    border-top: 1px solid rgba(58, 65, 73, 0.1);
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-container h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.newsletter-container p {
    color: #555;
    margin-bottom: 2rem;
}

#newsletter-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#email-input {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 60%;
    max-width: 400px;
}

/*Border turns green when user starts typing*/
#email-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subscribe-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

#newsletter-feedback {
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 1.5rem; /*Prevents jumping when text appears*/
    margin: 0;
}

.feedback-success {
    color: #2c5f2d !important; /*Green*/
}

.feedback-error {
    color: #cc0000 !important; /*Red*/
}

/*Footer*/
#footer-content {
    background-color: #2c5f2d;
    color: #faf8f3;
    padding: 32px;
}

#copyright {
    text-align: center;
}

/*Responsive adjustments*/
@media (max-width: 900px) {
    #nav_bar ul {
        /*Tells the flexbox to stack all the links vertically*/
        flex-direction: column;
        gap: 1rem;
    }
    /*Make sure it won't bump into the links*/
    #logo {
        margin-left: 0;
        margin-top: 1rem;
    }
    /*Shrink font-size down*/
    .single-article-view h1 {
        font-size: 2rem;
    }
    #newsletter-form {
        flex-direction: column;
        align-items: center;
    }
    #email-input {
        width: 100%;
    }
    .subscribe-btn {
        width: 100%;
    }
}
