/* ==========================================================================
   Animals Farming — Homepage Styles
   Covers: Hero, Latest Posts + Sidebar, Diseases, Newsletter CTA
   ========================================================================== */

:root {
    --af-accent: #e94d67;
    --af-accent-dark: #d63f59;
    --af-black: #1a1a1a;
    --af-gray-900: #222222;
    --af-gray-700: #555555;
    --af-gray-500: #888888;
    --af-gray-200: #eeeeee;
    --af-gray-100: #f7f7f7;
    --af-white: #ffffff;
    --af-radius: 10px;
    --af-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    --af-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.10);
}

.hero-section *,
.latest-posts-section *,
.diseases-section *,
.newsletter-cta-section * {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ==========================================================================
   Shared section heading
   ========================================================================== */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-heading h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--af-black);
    margin: 0;
}

.view-all {
    color: var(--af-accent);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.view-all:hover {
    color: var(--af-accent-dark);
    text-decoration: underline;
}

/* ==========================================================================
   Hero Section (Featured post only)
   ========================================================================== */

.hero-section {
    padding: 36px 0 32px;
}

.hero-featured {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--af-white);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow);
    padding: 22px;
    max-width: 1160px;
}

/* Content comes first in markup and sits on the left; image is pushed right */
.hero-content {
    order: 1;
    flex: 1;
    max-width: none;
    margin-top: 0;
    min-width: 0;
}

.hero-image {
    order: 2;
    position: relative;
    display: block;
    flex: 0 0 340px;
    border-radius: calc(var(--af-radius) - 2px);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hero-image:hover img {
    transform: scale(1.03);
}

.hero-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--af-accent);
    color: var(--af-white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
}

.hero-category {
    color: var(--af-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 10px;
}

.hero-title a {
    color: var(--af-black);
    text-decoration: none;
}

.hero-title a:hover {
    color: var(--af-accent);
}

.hero-excerpt {
    color: var(--af-gray-700);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 14px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--af-gray-500);
    font-size: 13px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hero-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--af-gray-900);
    font-weight: 600;
}

.hero-author img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--af-black);
    color: var(--af-white);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.hero-button:hover {
    background: var(--af-accent);
    color: var(--af-white);
}

/* ==========================================================================
   Latest Posts Section (grid + sidebar)
   ========================================================================== */

.latest-posts-section {
    padding: 20px 0 48px;
}

.latest-posts-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.latest-posts-main {
    min-width: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--af-white);
    border-radius: var(--af-radius);
    overflow: hidden;
    box-shadow: var(--af-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
    box-shadow: var(--af-shadow-hover);
    transform: translateY(-3px);
}

.post-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 18px 18px 22px;
}

.post-card-category {
    color: var(--af-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    margin: 0 0 12px;
}

.post-card-title a {
    color: var(--af-black);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--af-accent);
}

.post-card-meta {
    display: flex;
    gap: 6px;
    color: var(--af-gray-500);
    font-size: 13px;
}

/* ==========================================================================
   Sidebar (Categories + Newsletter) — shared widget shell
   ========================================================================== */

.latest-posts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--af-gray-100);
    border-radius: var(--af-radius);
    padding: 26px 24px;
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--af-black);
    margin: 0 0 18px;
}

/* Category widget */

.category-widget {
    background: #fdeef0;
}

.category-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.category-list li + li {
    margin-top: 4px;
}

.category-list a {
    display: flex1;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.category-list li:last-child a {
    border-bottom: none;
}

.category-name {
    color: var(--af-gray-900);
    font-weight: 600;
    font-size: 14.5px;
}

.category-list a:hover .category-name {
    color: var(--af-accent);
}

.category-count {
    color: var(--af-gray-500);
    font-size: 13px;
}

.view-all-categories {
    display: inline-block;
    color: var(--af-accent);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.view-all-categories:hover {
    color: var(--af-accent-dark);
    text-decoration: underline;
}

/* Newsletter widget (sidebar version) */

.newsletter-widget {
    background: #eef0fb;
}

.newsletter-widget p {
    color: var(--af-gray-700);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px;
}

.sidebar-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-newsletter-form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--af-gray-200);
    border-radius: 6px;
    font-size: 14px;
    background: var(--af-white);
    box-sizing: border-box;
}

.sidebar-newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--af-accent);
}

.sidebar-newsletter-form button {
    background: var(--af-black);
    color: var(--af-white);
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-newsletter-form button:hover {
    background: var(--af-accent);
}

/* ==========================================================================
   Diseases Section
   ========================================================================== */

.diseases-section {
    padding: 20px 0 48px;
}

.diseases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.disease-card {
    background: var(--af-white);
    border-radius: var(--af-radius);
    overflow: hidden;
    box-shadow: var(--af-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.disease-card:hover {
    box-shadow: var(--af-shadow-hover);
    transform: translateY(-3px);
}

.disease-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.disease-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.disease-card:hover .disease-card-image img {
    transform: scale(1.05);
}

.disease-card-content {
    padding: 18px 18px 22px;
}

.disease-card-category {
    color: var(--af-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.disease-card-title {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    margin: 0 0 10px;
}

.disease-card-title a {
    color: var(--af-black);
    text-decoration: none;
}

.disease-card-title a:hover {
    color: var(--af-accent);
}

.disease-card-excerpt {
    color: var(--af-gray-700);
    font-size: 14px;
    line-height: 1.55;
}

/* ==========================================================================
   Newsletter CTA Banner
   ========================================================================== */

.newsletter-cta-section {
    padding: 10px 0 56px;
}

.newsletter-cta-box {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fdeef0;
    border-radius: var(--af-radius);
    padding: 32px 36px;
    flex-wrap: wrap;
}

.newsletter-cta-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: var(--af-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--af-white);
    font-size: 22px;
}

.newsletter-cta-icon .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.newsletter-cta-text {
    flex: 1;
    min-width: 220px;
}

.newsletter-cta-text h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--af-black);
    margin: 0 0 6px;
}

.newsletter-cta-text p {
    color: var(--af-gray-700);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;
    max-width: 480px;
}

.newsletter-cta-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.newsletter-cta-form input[type="email"] {
    padding: 13px 16px;
    border: 1px solid var(--af-gray-200);
    border-radius: 6px;
    font-size: 14px;
    min-width: 240px;
    background: var(--af-white);
}

.newsletter-cta-form input[type="email"]:focus {
    outline: none;
    border-color: var(--af-accent);
}

.newsletter-cta-form button {
    background: var(--af-accent);
    color: var(--af-white);
    border: none;
    padding: 13px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.newsletter-cta-form button:hover {
    background: var(--af-accent-dark);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* ---- Large tablets / small laptops (≤ 1024px) ---- */
@media (max-width: 1024px) {
    .container {
        padding: 0 18px;
    }

    .latest-posts-wrapper {
        grid-template-columns: 1fr 280px;
        gap: 28px;
    }

    .hero-featured {
        max-width: 100%;
    }
}

/* ---- Tablets (≤ 900px): sidebar drops below post grid ---- */
@media (max-width: 900px) {
    .latest-posts-wrapper {
        grid-template-columns: 1fr;
    }

    .latest-posts-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-widget {
        flex: 1 1 280px;
    }

    .posts-grid,
    .diseases-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-image {
        flex-basis: 260px;
    }

    .hero-title {
        font-size: 21px;
    }
}

/* ---- Small tablets / large phones (≤ 768px) ---- */
@media (max-width: 768px) {
    .hero-section {
        padding: 24px 0;
    }

    .hero-featured {
        flex-direction: column;
        padding: 16px;
        gap: 18px;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        flex-basis: auto;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .latest-posts-section,
    .diseases-section {
        padding: 16px 0 36px;
    }

    .section-heading {
        margin-bottom: 20px;
    }

    .section-heading h2 {
        font-size: 22px;
    }

    .latest-posts-sidebar {
        flex-direction: column;
    }

    .sidebar-widget {
        flex-basis: auto;
    }

    .newsletter-cta-box {
        padding: 26px;
    }
}

/* ---- Phones (≤ 640px) ---- */
@media (max-width: 640px) {
    .posts-grid,
    .diseases-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-excerpt {
        font-size: 13.5px;
    }

    .hero-meta {
        gap: 10px;
        font-size: 12px;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .newsletter-cta-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .newsletter-cta-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }

    .newsletter-cta-form {
        width: 100%;
        flex-direction: column;
    }

    .newsletter-cta-form input[type="email"] {
        flex: 1;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .newsletter-cta-form button {
        width: 100%;
    }
}

/* ---- Small phones (≤ 420px) ---- */
@media (max-width: 420px) {
    .container {
        padding: 0 14px;
    }

    .hero-featured {
        padding: 12px;
    }

    .hero-title {
        font-size: 19px;
    }

    .hero-button {
        width: 100%;
        justify-content: center;
    }

    .post-card-content,
    .disease-card-content {
        padding: 14px 14px 18px;
    }

    .post-card-title,
    .disease-card-title {
        font-size: 16px;
    }

    .sidebar-widget {
        padding: 20px 18px;
    }

    .sidebar-newsletter-form input[type="email"],
    .sidebar-newsletter-form button {
        font-size: 13.5px;
    }
}
