/* External Resources */

@import url('https://fonts.googleapis.com/css?family=Merriweather&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap');

/* Reset Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography */

h1,h2,h3,h4,h5,h6 {
    text-align: center;
    font-family: 'Merriweather', sans-serif;
    color: #444;
    margin-bottom: 10px;
}

p {
    line-height: 1.5em;
    margin: 10px 0;
}

img {
    max-width: 100%;
}

/* Buttons */

.btn {
    display: block;
    width: fit-content;
    padding: 10px 15px;
    background: #2266cc;
    color: #fff;
    text-decoration: none;
    transition: .3s;
    display: block;
    width: fit-content;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #2299ff;
    transition: .3s;
}

/* Form, Input */

input[type=text],
input[type=password] {
    padding: 10px 15px;
    outline: none;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #444;
}

/* Messages */

.msg {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
}

.msg-success {
    color: #008000;
}

.msg-error {
    color: #ff0000;
}

/* Layout */

body {
    font-family: 'Roboto', sans-serif;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
}

header {
    background: #333;
    color: #fff;
    line-height: 40px;
    font-family: 'Roboto Condensed', sans-serif;
}

main {
    background: #eee;
}

footer {
    background: #333;
    color: #fff;
    line-height: 30px;
    font-family: 'Roboto Condensed', sans-serif;
}

footer h1,h2,h3,h4,h5,h6 {
    text-align: left;
}

/* Top Navigation */

nav {
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}

nav a {
    color: #fff;
    text-decoration: none;
}

nav a span {
    color: #22ccff;
}

nav #logo {
    font-size: 1.4em;
    display: block;
}

nav .toggle,
nav [id^=sub] {
    display: none;
}

nav ul {
    display: flex;
    list-style: none;
    background: #333;
}

nav ul li {
    position: relative;
    transition: .3s;
}

nav ul li a {
    padding: 0 10px;
    white-space: nowrap;
    display: block;
    justify-content: space-between;
}

nav ul li ul {
    flex-direction: column;
    position: absolute;
    display: none;
}

nav ul li ul li ul {
    top: 0;
    left: 100%;
}

nav ul li:hover > ul {
    display: flex;
}

nav ul li:hover {
    background: #777;
    transition: .3s;
}

nav ul li a::after {
    font-family: 'FontAwesome';
    content: '\f078';
    padding-left: 10px;
    font-size: 0.8em;
    color: #22ccff;
}

nav ul li ul li a::after {
    content: '\f054';
}

nav ul li a:only-child::after {
    content: '';
}

/* Container */

.container {
    width: 80%;
    margin: 20px auto;
}

/* TOP SECTION */

.top-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin: 20px auto 20px;
    width: 100%;
    max-width: 1200px;
}

.slider-wrapper {
    flex: 0 0 600px;
    display: flex;
    flex-direction: column;
}

.slider-container {
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 400px;
}

.dots-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.links-container {
    flex-grow: 1;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.links-container h3 {
    margin-bottom: 10px;
    color: #444;
}

.popular-links {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

.thumbnail {
    width: 70px;
    height: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.popular-links li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
    flex-wrap: wrap;
}

.popular-links li img {
    width: 100px;
    height: 60px;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
}

.popular-links li:last-child {
    border-bottom: none;
}

.popular-links li a {
    flex: 1; 
    margin-right: 10px; 
    white-space: normal;
    text-decoration: none;
    color: #2266cc;
}

.popular-links li a:hover {
    text-decoration: underline;
}

.popular-links-eye-icon,
.popular-links-like-icon {
    margin-right: 5px;
    font-size: 20.8px;
    color: #666;
}

.popular-links-view-count,
.popular-links-like-count {
    margin-left: auto;
    color: #666;
    font-size: 1em;
    display: flex;
    align-items: center;
}

.popular-links-view-count {
    margin-right: 10px;
}

.slider {
    display: flex;
    transition: transform 0.4s ease-in-out;
    position: relative;
    height: 100%;
}

.slide {
    width: 100%;
    height: 100%;
    min-width: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.5s ease-in-out;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 70%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    padding: 20px;
}

.slide .post-title {
    color: white;
    font-size: 1.5em;
    margin: 0;
    text-align: left;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.dot {
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s
}

.dot.active {
    background-color: rgba(255, 255, 255, 1);
}

.links-container {
    width: 30%;
}

.links-container h3 {
    margin-bottom: 10px;
}

.popular-links {
    list-style: none;
    padding: 0;
}

.popular-links li {
    margin-bottom: 10px;
}

.popular-links li a {
    text-decoration: none;
    color: #2266cc;
}

.popular-links li a:hover {
    text-decoration: underline;
}

/* MAIN CONTENT AREA */

/* Card Container */
.cards {
    display: grid;                     
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;                        
    margin: 20px auto;                   
    max-width: 1200px;
}

.card {
    background: #fff;
    border: 1px solid #d7d7d7;
    box-shadow: 0 0 10px 0 #e1e1e1;
    position: relative;  
    display: flex;
    flex-direction: column;
    height: 500px;
}

.image-container {
    position: relative;  
    width: 100%;        
    height: 0;
    padding-bottom: 60%; /* Aspect ratio: (height/width) * 100 = (60/100)*100 */
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-container .eye-icon {
    margin-right: 5px;
    font-size: 24px;
}

.image-container .view-count {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 16px;
    background: rgba(128, 128, 128, 0.5);
    padding-left: 5px;
    padding-right: 5px;
    left: 0;
}

.image-container .like-count {
    position: absolute;
    top: 10px;
    right: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    background: rgba(128, 128, 128, 0.5);
    padding-left: 5px;
    padding-right: 5px;
}

.image-container .like-link {
    text-decoration: none; /* Remove underline from the link */
}

.image-container .like-icon {
    margin-right: 5px;
    font-size: 24px;
    color: white; /* Always white */
}

.image-container .like-icon.has-likes {
    color: red; /* Heart icon is red if the user has liked it */
}

.image-container .like-number {
    color: white; /* Count text is always white */
}

.card-content {
    padding: 20px;
    height: 204px;
    overflow: hidden;
}

.card-content h2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    color: #2266cc;
    font-size: 1.2em;
    line-height: 1.5em;
    margin-bottom: 5px;
}

.card-content p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    line-height: 1.5em;
    max-height: 9em;
    -webkit-line-clamp: 6;
}

.read-more {
    padding: 10px 20px;
    text-align: center;
}

.read-more .btn {
    background: #2266cc;
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    transition: background 0.3s;
}

.read-more .btn:hover {
    background: #2299ff;
}

.card-meta {
    position: absolute; 
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Footer */

.footer {
    max-width: 100%;
    width: 100%;
    background: #2266cc;
}


.footer .footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 60px 60px 0 60px;
}

.footer .footer-col {
    margin-bottom: 20px;

}

.footer-row .footer-col h4 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
}

.footer-col .links li {
    list-style: none;
}

.footer-col .links li a {
    text-decoration: none;
    color: #fff;
}

.footer-col .links li a:hover {
    color: #fff;
}

.footer-col p {
    margin: 20px 0;
    color: #fff;
    max-width: 300px;
}

.footer-col form {
    display: flex;
    gap: 5px;
}

.footer-col input {
    height: 40px;
    border-radius: 6px;
    background: none;
    width: 100%;
    outline: none;
    border: 1px solid #7489C6 ;
    caret-color: #fff;
    color: #fff;
    padding-left: 10px;
}

.footer-col input::placeholder {
    color: #ccc;
}

.footer-col form button {
    background: #fff;
    outline: none;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s ease;
}

.footer-col form button:hover {
    background: #cecccc;
}

.footer-col .icons {
    display: flex;
    margin-top: 30px;
    gap: 30px;
    cursor: pointer;
}

.footer-col .icons i {
    color: #fff;
}
  
.footer-col .icons i:hover  {
    color: #fff;
}

footer span {
    color: #22ccff;
}

.footer-bottom {
    text-align: center;
}

@media all and (max-width:768px) {

    /* Top Nav (mob) */
    
    nav {
        width: 100%;
        flex-wrap: wrap;
    }

    nav #logo {
        flex-basis: 50%;
        padding-left: 10px;
    }

    nav #hamburger {
        flex-basis: 50%;
        text-align: right;
        padding-right: 10px;
        font-size: 1.4em;
    }

    nav .toggle {
        display: block;
    }

    nav .toggle + a {
        display: none;
    }

    nav [id^=sub]:checked + ul {
        display: flex;
    }

    nav ul {
        flex-direction: column;
        flex-basis: 100%;
        background: #444;
        display: none;
    }

    nav ul label,
    nav ul li a {
        padding-left: 20px;
        background: #555;
        border-bottom: 1px dashed #999;
    }

    nav ul li ul label,
    nav ul li ul li a {
        padding-left: 40px;
        background: #666;
    }

    nav ul li ul li ul label,
    nav ul li ul li ul li a {
        padding-left: 60px;
        background: #777;
    }

    nav ul li ul {
        position: static;
    }

    nav ul li:hover > ul {
        display: none;
    }

    nav ul label::after {
        font-family: 'FontAwesome';
        content: '\2b';
        padding-left: 8px;
        font-size: 0.8em;
        color: #22ccff;
    }

    nav #icon {
        transition: .3s;
        margin-right: 10px;
        font-size: 1.5em;
    }

    nav .fa-bars {
        transform: rotate(0deg);
    }

    nav .fa-times {
        transform: rotate(90deg);
    }

    /* Container */

    .container {
        width: 100%;
    }
}

@media (max-width: 768px) {

    .top-section {
        flex-direction: column;
        align-items: center;
    }

    .slider-container {
        max-width: 100%;
    }
    .slider-wrapper {
        flex: 0 0 100%;
    }

    .links-container {
        width: 100%;
    }
}

@media (max-width: 1200px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .footer {
        transform: none;
        width: 100%;
        border-radius: 0;
    }

    .footer .footer-row {
        flex-direction: column;
    }

    .footer-col form {
        display: block;
    }

    .footer-col form :where(input, button) {
        width: 100%;
    }

    .footer-col form button {
        margin: 10px 0 0 0;
    }
}

/* Single Post */

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.author-date {
    display: flex;
    align-items: center;
}

.view-count-single-post {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.eye-icon {
    margin-right: 5px;
    font-size: 20px;
}

h1 {
    font-family: 'Merriweather', sans-serif;
    color: #2266cc;
}

.post-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.post-image img {
    max-width: 100%;
    height: auto;
}

.post-body {
    margin-top: 20px;
}

.comments-section {
    margin-top: 30px;
    border-top: 1px solid #d7d7d7;
    padding-top: 20px;
}

.comments-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 10px;
}

.comment-form {
    margin-top: 20px;
    border-top: 1px solid #d7d7d7;
    padding-top: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}

.comment-form button {
    background: #2266cc;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background
}

.comment-form button:hover {
    background: #2299ff;
}

.sidebar h3 {
    font-family: 'Merriweather', sans-serif;
    margin-bottom: 15px;
    color: #444;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #2266cc;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: #333;
    color: #fff;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    z-index: 1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.dropdown-content a:hover {
    background-color: #555;
}

.dropdown-content img {
    width: 16px;
    height: auto;
}

.dropdown-content a::after {
    content: none;
}

.sidebar ul li a:hover {
    text-decoration: underline;
}

/* Login */

.login form {
    background: #fff;
    border: 1px solid #d7d7d7;
    box-shadow: 0 0 10px 0 #e1e1e1;
    width: fit-content;
    padding: 20px;
    margin: 0 auto;
}

/* Single Post */

.single-post {
    display: flex;
    gap: 20px;
}

.post-content {
    flex: 3;
    background: #fff;
    padding: 20px;
    border: 1px solid #d7d7d7;
    box-shadow: 0 0 10px 0 #e1e1e1;
}

.sidebar {
    flex: 1;
    background: #f5f5f5;
    padding: 20px;
}

/* Language Switcher Specific Adjustments */
nav ul li.language-switcher {
    display: block !important;
}

nav ul li.language-switcher .toggle {
    display: block;
    padding: 0 10px;
    cursor: pointer;
}

nav ul li.language-switcher ul {
    /* Ensure the dropdown aligns correctly */
    top: 100%;
    left: 0;
}

nav ul li.language-switcher ul li {
    /* Ensure consistent padding and hover effects */
    padding: 0;
}

nav ul li.language-switcher ul li a {
    /* Ensure consistent link styling */
    padding: 0 10px;
    color: #fff;
}

nav ul li.language-switcher ul li a:hover {
    /* Ensure consistent hover effects */
    background: #777;
}

.post-image {
    width: 100%;
    margin: 0 auto;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.comments-section {
    margin-top: 2rem;
}

.comments-list {
    list-style: none;
    padding: 0;
}

.comment {
    display: flex;
    margin-bottom: 1.5rem;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-header strong {
    font-weight: bold;
}

.comment-time {
    font-size: 0.875rem;
    color: #666;
}

.comment p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.comment-actions {
    margin-top: 0.5rem;
}

.comment-actions a {
    color: #4267B2;
    text-decoration: none;
    margin-right: 1rem;
    font-size: 0.875rem;
}

.comment-actions a:hover {
    text-decoration: underline;
}

.replies-list {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1rem;
    border-left: 2px solid #ddd;
}

.comment-form {
    margin-top: 2rem;
}

.comment-form h3 {
    margin-bottom: 1rem;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-form textarea {
    height: 100px;
    resize: vertical;
}

.comment-form button {
    background-color: #4267B2;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.comment-form button:hover {
    background-color: #365899;
}

.comment-form input[type="text"],
.comment-form textarea,
.reply-form input[type="text"],
.reply-form textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block; /* Stack fields vertically */
}

.comment-form textarea,
.reply-form textarea {
    height: 100px;
    resize: vertical;
}

.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover:not(.active) {
    background-color: #f1f1f1;
}

.language-switcher {
    display: flex;
    align-items: baseline;
}

.language-link {
    display: flex;
    align-items: baseline;
}

.flag {
    width: 20px;
    height: auto;
    margin-right: 5px;
    transform: translateY(3px);
}

/* Search */

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 32px;
    margin: 4px 0;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: white;
    position: relative;
    z-index: 10;
}

.search-field {
    position: absolute;
    right: 0;
    width: 0;
    height: 32px;
    opacity: 0;
    overflow: hidden;
    transition: width 0.4s ease-in-out, opacity 0.3s ease-in-out;
    background: #444;
    padding: 0 8px;
    border: 1px solid #777;
    border-radius: 5px 0 0 5px;
    display: flex;
    align-items: center;
}

.search-field input {
    flex: 1;
    height: 100%;
    line-height: 32px;
    border: none;
    outline: none;
    color: white;
    background: #444;
}

.search-field button {
    padding: 5px 10px;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 3px;
}

.search-container.active .search-field {
    width: 220px;
    opacity: 1;
    right: 0;
}

@media (max-width: 768px) {
    .single-post {
        flex-direction: column; /* Stack elements vertically */
    }

    .post-content {
        order: 1; /* Ensure main content comes first */
    }

    .sidebar {
        order: 2; /* Ensure sidebar comes after main content */
        margin-top: 20px; /* Add some spacing between the main content and sidebar */
    }
}