* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background-color: #4a8dbd; color: #333; line-height: 1.6; }
header { background: #fff; padding: 0px; text-align: center;}
nav { background: #000; padding: 10px; text-align: center; color: #fff; display: flex; justify-content: center; align-items: center; gap: 20px; }
nav a { color: #fff; text-decoration: none; font-size: 0.9em; }

.container { display: flex; width: 90%; max-width: 1200px; margin: 20px auto; gap: 20px; }
.main-content { flex: 3; background: #fff; padding: 20px; }
.sidebar { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.widget { background: #fff; padding: 15px; }
.article-item { border-bottom: 1px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }
.article-item img { max-width: 100%; height: auto; }
.footer { text-align: center; color: #fff; padding: 20px; font-size: 0.8em; }
.footer a {color: white}

.article-image-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.article-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* ___Base styles for the menu___ */
.navbar { background: #000; padding: 15px; color: #fff; }
.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-menu a { color: #fff; text-decoration: none;}
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; }

/* ___Hamburger style___ */
.hamburger { display: block; width: 25px; height: 3px; background: #fff; position: relative; transition: 0.3s; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 25px; height: 3px; background: #fff; left: 0; transition: 0.3s; }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* ___Cross-stitch animation___ */
.menu-toggle.active .hamburger { background: transparent; }
.menu-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.menu-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }


/* ___Author profile card___ */
.author-profile {
    background: #fff;
    padding: 35px;
    border: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.author-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.author-role {
    font-size: 0.8em;
    text-transform: uppercase;
    color: #4a8dbd; 
    letter-spacing: 0.5px;
    font-weight: bold;
}

.author-name {
    font-size: 1.8em;
    color: #1f2937;
    margin: 8px 0 10px 0;
}

.author-location {
    font-size: 0.9em;
    color: #6b7280;
}


.author-quote {
    background: #f9fafb;
    border-left: 4px solid #4a8dbd;
    padding: 15px 20px;
    margin: 0 0 25px 0;
    font-style: italic;
    color: #374151;
    font-size: 1.05em;
    line-height: 1.5;
}

/* ___Profile details___ */
.author-details .detail-item {
    margin-bottom: 20px;
}

.author-details .detail-label {
    display: block;
    font-size: 0.85em;
    text-transform: uppercase;
    color: #4b5563;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: bold;
}

.author-details p {
    font-size: 1em;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

/* ___Hard reset of any old table-of-contents columns___ */
.article-toc {
    display: block !important;
    float: none !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 20px !important;
    margin: 20px 0 35px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ___The heading must be strictly at the top, with no left indentation.___ */
.article-toc h3 {
    display: block !important;
    float: none !important;
    width: 100% !important;
    font-size: 0.95em !important;
    text-transform: uppercase !important;
    color: #4b5563 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    letter-spacing: 0.5px !important;
    text-align: left !important;
}

.article-toc ul {
    display: block !important;
    margin: 0 !important;
    padding-left: 20px !important;
    list-style-type: disc !important;
}

.article-toc li {
    margin-bottom: 8px !important;
    text-align: left !important;
}

.article-toc a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-size: 0.95em !important;
}

.article-toc a:hover {
    text-decoration: underline !important;
}
/* ___Subscription widget___ */
.newsletter-widget {
    background: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.newsletter-widget h3 {
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 6px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box; 
    font-size: 0.9em;
}

.newsletter-form button {
    width: 100%;
    padding: 10px;
    background-color: #4a8dbd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

.newsletter-form button:hover {
    background-color: #3b749d;
}

/* ___Slider widget wrapper___ */
.slider-widget {
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    /* ___Here, the carousel script will move the slides horizontally.___ */
    transition: transform 0.5s ease-in-out; 
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 220px; /* ___Fixed height based on widget proportions___ */
    object-fit: cover;
    display: block;
}

/* ___Semi-transparent dark overlay for the title, positioned over the bottom of the image.___ */
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 10px 12px;
    font-size: 0.9em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* ___Truncates a long title with an ellipsis.___ */
}

.carousel-slide a {
    text-decoration: none;
    color: inherit;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dots .dot.active {
    background-color: #333; /* ___The active point is darker___ */
}

/* ___Styles for the category selection widget___ */
.widget select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9em;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    
    /* ___We remove the standard system behavior of the arrow in some browser engines and add our own___ */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.svg%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234a8dbd%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
}

/* ___Effect on focus or hover___ */
.widget select:hover {
    border-color: #4a8dbd;
}

.widget select:focus {
    border-color: #4a8dbd;
    box-shadow: 0 0 0 2px rgba(74, 141, 189, 0.2);
}

.search-form {
    display: flex;
    align-items: center;
    background: #fff; 
    border-radius: 3px;
    padding: 2px;
}

.search-form input[type="text"] {
    padding: 6px 10px;
    border: none; 
    outline: none; 
    font-size: 0.9em;
    width: 140px; 
}

.search-form button {
    padding: 6px 12px;
    background-color: #4a8dbd; 
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 0 2px 2px 0;
    font-size: 0.9em;
    font-weight: bold;
}

.search-form button:hover {
    background-color: #3b749d;
}

/* Calendar styles */
.widget h3 {
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 6px;
}

/* ___Compact calendar table without days of the week___ */
.calendar-table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 3px; 
}

.calendar-table td { 
    text-align: center; 
    font-size: 0.85em;
    color: #666;
}

.calendar-table td a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto; 
    background-color: #f2f5f8;
    color: #222;
    text-decoration: none;
    border-radius: 50%; 
    transition: all 0.2s ease;
}

/* ___On hover — fill and color change___ */
.calendar-table td a:hover {
    background-color: #4a8dbd;
    color: #fff;
    font-weight: bold;
}

/* ___Article card: arranging the image on the left and the text on the right.___ */
.article-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border-bottom: 1px solid #ddd;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.article-img-wrap {
    flex: 0 0 220px; 
}

.article-cat-wrap {
    flex: 0 0 10px; 
    background: #d0cfcf;
}

/* ___We force the image itself to fit the container size.___ */
.article-item img {
    width: 100%;
    height: 200px; /* ___Fixed height for neatness, or auto___ */
    object-fit: cover; /* ___Crops the image according to aspect ratio while maintaining centering.___ */
    border-radius: 4px;
}

/* ___Right text column___ */
.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px; /* ___Spacing between text elements___ */
}

/* ___Fine-tuning the typography within the card___ */
.article-content h2 {
    font-size: 1.25em;
    line-height: 1.3;
}

.article-content h2 a {
    color: #0056b3;
    text-decoration: none;
}

.article-content h2 a:hover {
    text-decoration: underline;
}

.article-category a {
    font-size: 0.85em;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    font-weight: bold;
}

.article-meta {
    font-size: 0.85em;
    color: #888;
}

.article-desc {
    font-size: 0.95em;
    color: #444;
}

.article-more {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.9em;
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
}

.article-more:hover {
    text-decoration: underline;
}

/* ___Responsiveness for mobile devices and tablets___ */
@media screen and (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; 
        left: 0;
        background: #000;
        padding: 20px;
        z-index: 1000;
        text-align: center;
        gap: 15px;
    }
    .nav-menu.active { display: flex; }
    .search-form { width: 100%; margin-top: 15px; }

    /* ___Navigation: turning it into a column with margins___ */
    nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px 10px;
    }

    /* ___We stretch the search field to full width on mobile devices.___ */
    .search-form {
        width: 100%;
        max-width: 300px;
        margin-top: 5px;
    }

    .search-form input[type="text"] {
        width: 100%;
    }

    /* ___We move the content and sidebar container into a vertical stack___ */
    .container {
        flex-direction: column;
        width: 95%;
        margin: 10px auto;
        gap: 15px;
    }

    /* ___Article cards: image at the top, text at the bottom.___ */
    .article-item {
        flex-direction: column;
        gap: 15px;
    }

    .article-img-wrap {
        flex: 0 0 auto;
        width: 100%;
    }

    .article-item img {
        height: auto;
        max-height: 250px;
    }

    /* ___The sidebar expands to full width below the main content.___ */
    .sidebar {
        width: 100%;
    }
}
