/* Styles for the articles list page */

.article-list {
    margin-top: 20px;
}

.article-item {
    display: flex; /* Arrange image and content side-by-side */
    align-items: flex-start; /* Align items to the top */
    margin-bottom: 30px; /* Space between article items */
    padding: 20px;
    background-color: var(--faint-bg-color); /* Use a very light background */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.article-item:hover {
    background-color: var(--pale-bg-color); /* Change background on hover */
    box-shadow: 0 4px 10px var(--shadow-color-dark);
}

.article-item-image {
    width: 200px; /* Fixed small width for the image */
    height: 150px; /* Fixed height */
    object-fit: cover; /* Crop image nicely */
    margin-right: 20px;
    border-radius: 4px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.article-item-content {
    flex: 1; /* Allow content to take remaining space */
}

.article-item-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: var(--text-heading-color);
}

.article-item-lead {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .article-item {
        flex-direction: column; /* Stack image and text on small screens */
        align-items: center; /* Center items when stacked */
        text-align: center;
    }

    .article-item-image {
        width: 80%; /* Allow image to be wider */
        max-width: 360px; /* But not too wide */
        height: auto; /* Adjust height automatically */
        margin-right: 0;
        margin-bottom: 15px; /* Add space below image */
    }

    .article-item-content {
        width: 100%;
    }

    .article-item-title {
        font-size: 1.3rem;
    }

    .article-item-lead {
        font-size: 0.95rem;
    }
}

/* Individual Articles */

article {
    padding: 0 12px;
    background-color: var(--background-color) !important;
    border: none !important;
}

article h1 {
    margin-top: 18px;
    margin-bottom: 20px;
    font-size: 1.75rem;
    font-style: italic;
    text-align: center;
}

article h2 {
    margin-top: 16px;
    margin-bottom: 0 !important;
    font-size: 1.5rem;
}

article img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 4px;
}

article p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-color);
}

article ul, ol {
    margin: 0 0 12px 10px;
    padding: 0 20px;
    font-size: 1.1rem;
}

.references h2 {
    margin-top: 20px;
    font-size: larger;
    font-style: normal;
    color: var(--error-color);
}

/* Responsive adjustments */
@media screen and (max-width: 769px) {
    .in-content-image {
        max-width: 100%;
        width: 100%;
        padding: 12px 0;
    }
}

/* Supplement Tables */
.supplement-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    max-width: 100%;
    width: 100%; 
    display: block;
}

.supplement-table-heading {
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-heading-color);
    text-align: center;
}

.supplement-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--primary-color);
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-size: 0.95rem;
    table-layout: fixed; /* Helps control column widths */
}

.supplement-table thead {
    background-color: var(--primary-darker-color);
}

.supplement-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid var(--primary-darker-color);
}

/* Column width distribution */
.supplement-table th:nth-child(1),
.supplement-table td:nth-child(1) {
    width: 20%;
}

.supplement-table th:nth-child(2),
.supplement-table td:nth-child(2) {
    width: 45%;
}

.supplement-table th:nth-child(3),
.supplement-table td:nth-child(3) {
    width: 35%;
}

.supplement-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--primary-darker-color);
    vertical-align: top;
    word-wrap: break-word; /* Handles long words */
}

.supplement-table tr:last-child td {
    border-bottom: none;
}

/* Responsive styles for tables */
@media screen and (max-width: 767px) {
    .supplement-table {
        font-size: 0.85rem;
    }
    
    .supplement-table th,
    .supplement-table td {
        padding: 8px 10px;
    }
}
    
/* Card-like view for very small screens */
@media screen and (max-width: 480px) {
    .supplement-table thead {
        display: none; /* Hide headers */
    }
    
    .supplement-table, 
    .supplement-table tbody, 
    .supplement-table tr {
        display: block;
        width: 100%;
    }
    
    .supplement-table td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 15px 8px 50%;
        position: relative;
        border-bottom: 1px solid var(--primary-darker-color);
        min-height: 30px;
    }
    
    /* Override the column width settings for small screens */
    .supplement-table td:nth-child(1),
    .supplement-table td:nth-child(2),
    .supplement-table td:nth-child(3) {
        width: 100%;
    }
    
    .supplement-table tr {
        margin-bottom: 1rem;
        border-bottom: 2px solid var(--primary-darker-color);
    }
    
    .supplement-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
        color: var(--text-color);
    }
    
    .supplement-table td:nth-of-type(1)::before {
        content: "Combo";
    }
    
    .supplement-table td:nth-of-type(2)::before {
        content: "Why not?";
    }
    
    .supplement-table td:nth-of-type(3)::before {
        content: "Tip";
    }
}
