/*
 * SocioEducations Mobile News Portal
 * Inspired by modern education news websites.
 */

@media (max-width: 768px) {

    /* General layout */
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 15px;
        line-height: 1.65;
    }

    .site,
    .site-content,
    .content-area,
    .site-main,
    .inside-header,
    .inside-navigation,
    .inside-site-info {
        max-width: 100%;
        width: 100%;
    }

    .grid-container {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .site-content {
        padding-top: 12px;
        padding-bottom: 20px;
    }

    /* Header */
    .site-header {
        border-bottom: 3px solid #c90024;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .inside-header {
        padding: 13px 12px;
        text-align: center;
    }

    .site-branding {
        padding: 5px 0;
    }

    .site-title {
        margin: 0;
        font-size: 27px;
        line-height: 1.25;
        font-weight: 800;
    }

    .site-title a {
        color: #c90024;
    }

    .site-description {
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.5;
    }

    /* Mobile navigation */
    .main-navigation {
        background: #c90024;
    }

    .main-navigation .inside-navigation {
        padding: 0;
    }

    .main-navigation .menu-toggle {
        width: 100%;
        min-height: 46px;
        padding: 12px;
        text-align: left;
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
    }

    .main-navigation .menu-toggle:hover,
    .main-navigation .menu-toggle:focus {
        background: #a6001d;
        color: #ffffff;
    }

    .main-navigation .main-nav ul {
        background: #ffffff;
    }

    .main-navigation .main-nav ul li a {
        display: block;
        padding: 12px 15px;
        border-bottom: 1px solid #eeeeee;
        color: #222222;
        font-size: 14px;
    }

    .main-navigation .main-nav ul li.current-menu-item > a {
        background: #fff0f3;
        color: #c90024;
    }

    /* Optional topic strip: requires matching HTML/menu markup */
    .se-mobile-topics {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 12px;
        background: #ffffff;
        border-bottom: 1px solid #eeeeee;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .se-mobile-topics a {
        flex: 0 0 auto;
        padding: 6px 12px;
        border: 1px solid #e7b8c2;
        border-radius: 20px;
        background: #fff5f7;
        color: #b00020;
        font-size: 12px;
        font-weight: 700;
    }

    /* Optional latest-news strip */
    .se-latest-strip {
        display: flex;
        align-items: center;
        gap: 10px;
        overflow: hidden;
        padding: 10px 12px;
        background: #fff0f3;
        border-bottom: 1px solid #f2cbd3;
    }

    .se-latest-label {
        flex: 0 0 auto;
        padding: 4px 8px;
        border-radius: 3px;
        background: #c90024;
        color: #ffffff;
        font-size: 11px;
        font-weight: 800;
    }

    .se-latest-strip a {
        color: #252525;
        font-size: 13px;
        font-weight: 600;
    }

    /* Article and page cards */
    .content-area,
    .site-main {
        min-width: 0;
    }

    .inside-article,
    .page-header,
    .comments-area {
        margin-bottom: 14px;
        padding: 15px;
        border: 1px solid #e9e9e9;
        border-radius: 7px;
        background: #ffffff;
        box-shadow: 0 2px 7px rgba(0, 0, 0, 0.035);
    }

    .entry-title,
    .entry-title a {
        font-size: 23px;
        line-height: 1.4;
        font-weight: 800;
        overflow-wrap: anywhere;
    }

    .entry-header .entry-title {
        margin-bottom: 10px;
    }

    .entry-meta {
        font-size: 12px;
        line-height: 1.7;
    }

    .entry-summary,
    .entry-content {
        font-size: 15px;
        line-height: 1.8;
    }

    .entry-content h2 {
        margin-top: 25px;
        margin-bottom: 12px;
        padding-left: 10px;
        border-left: 4px solid #c90024;
        font-size: 21px;
        line-height: 1.4;
    }

    .entry-content h3 {
        margin-top: 20px;
        font-size: 18px;
        line-height: 1.45;
    }

    .entry-content img,
    .featured-image img,
    .post-image img {
        border-radius: 5px;
    }

    .entry-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
        white-space: normal;
    }

    .entry-content th,
    .entry-content td {
        padding: 9px;
        border: 1px solid #dddddd;
    }

    /* Standard post listing */
    .blog .inside-article,
    .archive .inside-article,
    .search .inside-article {
        display: block;
        margin-bottom: 12px;
        padding: 12px;
    }

    .blog .post-image,
    .archive .post-image,
    .search .post-image {
        margin-bottom: 10px;
    }

    .blog .entry-title,
    .archive .entry-title,
    .search .entry-title {
        margin-bottom: 7px;
        font-size: 18px;
        line-height: 1.45;
    }

    /* Optional custom homepage hero */
    .se-home-section {
        margin: 0 0 18px;
        padding: 14px;
        border: 1px solid #e9e9e9;
        border-radius: 7px;
        background: #ffffff;
    }

    .se-section-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 0 0 14px;
        padding-bottom: 9px;
        border-bottom: 2px solid #c90024;
        font-size: 19px;
        font-weight: 800;
    }

    .se-section-heading a {
        font-size: 12px;
        font-weight: 700;
    }

    .se-hero-story {
        margin-bottom: 14px;
    }

    .se-hero-story img {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 6px;
    }

    .se-hero-story h2 {
        margin: 10px 0 6px;
        font-size: 21px;
        line-height: 1.45;
        font-weight: 800;
    }

    .se-hero-story p {
        margin: 0;
        color: #666666;
        font-size: 13px;
    }

    /* Optional compact news list */
    .se-mobile-news-list {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .se-mobile-news-item {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid #eeeeee;
    }

    .se-mobile-news-item:last-child {
        border-bottom: 0;
    }

    .se-mobile-news-item img {
        flex: 0 0 100px;
        width: 100px;
        height: 72px;
        object-fit: cover;
        border-radius: 5px;
    }

    .se-mobile-news-item h3 {
        margin: 0 0 5px;
        font-size: 15px;
        line-height: 1.45;
        font-weight: 750;
    }

    .se-mobile-news-item .se-news-meta {
        color: #777777;
        font-size: 11px;
    }

    /* Sidebar and widgets */
    .sidebar .widget {
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid #e9e9e9;
        border-radius: 7px;
        background: #ffffff;
    }

    .widget-title {
        margin-bottom: 12px;
        padding-bottom: 9px;
        border-bottom: 2px solid #c90024;
        font-size: 17px;
        font-weight: 800;
    }

    .widget ul {
        margin-left: 0;
        list-style: none;
    }

    .widget li {
        padding: 9px 0;
        border-bottom: 1px solid #eeeeee;
    }

    .widget li:last-child {
        border-bottom: 0;
    }

    /* Search */
    .search-form {
        display: flex;
        width: 100%;
        gap: 5px;
    }

    .search-form label {
        flex: 1;
        min-width: 0;
    }

    .search-form .search-field {
        width: 100%;
        min-width: 0;
    }

    .search-form .search-submit {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    /* Pagination */
    .paging-navigation,
    .pagination {
        margin: 18px 0;
        text-align: center;
    }

    .paging-navigation .nav-links a,
    .pagination .page-numbers {
        display: inline-block;
        margin: 3px;
        padding: 7px 11px;
        border: 1px solid #dddddd;
        border-radius: 4px;
        background: #ffffff;
        color: #222222;
        font-size: 13px;
    }

    .paging-navigation .current,
    .pagination .current {
        background: #c90024;
        border-color: #c90024;
        color: #ffffff;
    }

    /* Footer */
    .site-footer {
        padding: 20px 0;
        background: #202124;
        color: #eeeeee;
    }

    .site-footer .inside-footer-widgets {
        padding: 0 12px;
    }

    .site-footer .widget {
        margin-bottom: 14px;
        padding: 12px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .site-footer .widget-title {
        color: #ffffff;
        border-bottom-color: #c90024;
    }

    .site-footer a {
        color: #ffffff;
    }

    .site-info {
        padding: 12px;
        font-size: 12px;
        text-align: center;
    }

    /* Images and embeds */
    iframe,
    video,
    embed,
    object {
        max-width: 100%;
    }

    /* Prevent long URLs from breaking the layout */
    .entry-content,
    .entry-summary,
    .inside-article {
        overflow-wrap: anywhere;
    }

    /* Accessibility */
    a:focus-visible,
    button:focus-visible,
    input:focus-visible {
        outline: 2px solid #c90024;
        outline-offset: 2px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .site-title {
        font-size: 23px;
    }

    .entry-title,
    .entry-title a {
        font-size: 21px;
    }

    .se-mobile-news-item img {
        flex-basis: 86px;
        width: 86px;
        height: 66px;
    }

    .se-mobile-news-item h3 {
        font-size: 14px;
    }
}

/* Desktop: keep mobile-only sections hidden unless needed */
@media (min-width: 769px) {
    .se-mobile-topics,
    .se-latest-strip {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}