/**
 * EMLearn – Base Theme Styles
 *
 * Structural layout, typography, header, footer, and responsive grid.
 * Provides structural layout, typography, header, footer, and responsive grid.
 *
 * @package EMLearn
 */

/* ====================================================================
   Reset & Box Model
   ==================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: Calibri, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus {
    color: #005177;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.6em;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin: 0 0 1.2em;
}

ul, ol {
    margin: 0 0 1.2em;
    padding-left: 1.8em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

th, td {
    padding: 0.6em 0.8em;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* ====================================================================
   Layout Container
   ==================================================================== */

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

.emlearn-content-area {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
}

.emlearn-main {
    flex: 1;
    min-width: 0;
}

.emlearn-main--full {
    flex-basis: 100%;
}

.emlearn-main--fullbleed {
    width: 100%;
    max-width: none;
    padding: 0;
}

.emlearn-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
}

.emlearn-sidebar .widget {
    margin-bottom: 30px;
}

.emlearn-sidebar .widget-title {
    font-size: 1.05rem;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #0073aa;
}

/* ====================================================================
   Skip Link (a11y)
   ==================================================================== */

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    padding: 10px 18px;
    background: #0073aa;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    z-index: 100000;
    border-radius: 4px;
    outline: 2px solid #fff;
}

/* ====================================================================
   Header
   ==================================================================== */

.emlearn-header {
    background: #1a1a2e;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Push header below WP admin bar when logged in */
.admin-bar .emlearn-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .emlearn-header {
        top: 46px;
    }
}

.emlearn-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 20px;
}

.emlearn-header__branding a {
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.emlearn-header__branding img {
    max-height: 44px;
    width: auto;
}

/* ---- Navigation ---- */

.emlearn-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.emlearn-nav li {
    position: relative;
}

.emlearn-nav a {
    display: block;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.emlearn-nav a:hover,
.emlearn-nav a:focus,
.emlearn-nav .current-menu-item > a,
.emlearn-nav .current_page_item > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

/* Dropdown sub-menus */
.emlearn-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    z-index: 100;
}

.emlearn-nav li:hover > .sub-menu,
.emlearn-nav li:focus-within > .sub-menu {
    display: block;
}

.emlearn-nav .sub-menu a {
    color: #333;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 0;
}

.emlearn-nav .sub-menu a:hover,
.emlearn-nav .sub-menu a:focus {
    background: #f0f4f8;
    color: #0073aa;
}

/* Nested sub-menus */
.emlearn-nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* ---- Mobile Toggle ---- */

.emlearn-header__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.emlearn-header__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ====================================================================
   Footer
   ==================================================================== */

.emlearn-footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0 24px;
    margin-top: auto;
}

.emlearn-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.emlearn-footer a:hover {
    color: #fff;
}

.emlearn-footer__widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emlearn-footer__widgets .widget {
    flex: 1 1 220px;
}

.emlearn-footer__widgets .widget-title {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.8em;
}

.emlearn-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.emlearn-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
}

.emlearn-footer__copy {
    margin: 0;
    font-size: 0.85rem;
}

/* ====================================================================
   Posts & Pages
   ==================================================================== */

.emlearn-post {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.emlearn-post:last-child {
    border-bottom: none;
}

.emlearn-post__title {
    margin-bottom: 0.3em;
}

.emlearn-post__title a {
    color: #1a1a1a;
}

.emlearn-post__title a:hover {
    color: #0073aa;
    text-decoration: none;
}

.emlearn-post__meta {
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.emlearn-post__content {
    line-height: 1.7;
}

.emlearn-post__content img {
    border-radius: 4px;
}

.emlearn-post__thumbnail {
    margin-bottom: 1.5em;
}

.emlearn-post__thumbnail img {
    border-radius: 6px;
    width: 100%;
}

.emlearn-post__footer {
    margin-top: 1.5em;
    font-size: 0.9rem;
    color: #666;
}

.emlearn-post__tags a {
    display: inline-block;
    background: #f0f4f8;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    margin: 2px 4px 2px 0;
}

.emlearn-page-header {
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid #eee;
}

/* ---- Post Navigation ---- */

.post-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

/* ---- Pagination ---- */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
}

.page-numbers {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* ====================================================================
   Buttons
   ==================================================================== */

.emlearn-btn,
button,
input[type="submit"] {
    display: inline-block;
    padding: 10px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.emlearn-btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #005177;
    color: #fff;
    text-decoration: none;
}

.emlearn-btn:active,
button:active,
input[type="submit"]:active {
    transform: translateY(1px);
}

/* ====================================================================
   Forms (base)
   ==================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease;
    background: #fff;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

/* ====================================================================
   WordPress Core Alignment & Embeds
   ==================================================================== */

.alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 1.2em;
}

.wp-caption-text {
    font-size: 0.85rem;
    color: #666;
    padding-top: 6px;
}

.wp-block-image figcaption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-item {
    flex: 1 1 200px;
}

/* ====================================================================
   Screen Reader Text (a11y)
   ==================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

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

@media (max-width: 960px) {
    .emlearn-content-area {
        flex-direction: column;
    }

    .emlearn-sidebar {
        flex: 0 0 auto;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .emlearn-header__toggle {
        display: flex;
    }

    .emlearn-header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a2e;
        padding: 12px 20px 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }

    .emlearn-header__nav.is-open {
        display: block;
    }

    .emlearn-nav {
        flex-direction: column;
        gap: 2px;
    }

    .emlearn-nav a {
        padding: 10px 14px;
    }

    .emlearn-nav .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
        margin: 2px 0 2px 12px;
        display: none;
    }

    .emlearn-nav li:hover > .sub-menu,
    .emlearn-nav li.menu-item--open > .sub-menu {
        display: block;
    }

    .emlearn-nav .sub-menu a {
        color: rgba(255, 255, 255, 0.8);
    }

    .emlearn-nav .sub-menu .sub-menu {
        left: 0;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .emlearn-footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .emlearn-footer-nav {
        justify-content: center;
    }
}

/* =========================================================================
 * BLOB IMAGE EFFECT
 * Organic pebble shape — replaces Supreme Modules dsm_blob_image
 * ========================================================================= */

.emlearn-blob-img {
    border-radius: 60% 40% 45% 55% / 55% 60% 40% 45% !important;
    overflow: hidden !important;
    display: inline-block;
    object-fit: cover;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(4px 6px 12px rgba(0, 0, 0, 0.25));
    transition: border-radius 0.4s ease;
}

.emlearn-blob-img:hover {
    border-radius: 45% 55% 60% 40% / 40% 45% 55% 60% !important;
}

/* Blob shape variations — add as a second class e.g. "emlearn-blob-img blob-2" */
.blob-2 { border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
.blob-3 { border-radius: 50% 50% 40% 60% / 60% 50% 50% 40%; }
.blob-4 { border-radius: 70% 30% 50% 50% / 40% 70% 30% 60%; }

@media (min-width: 768px) {
    .emlearn-blob-img { max-width: 500px; }
}

@media (min-width: 1024px) {
    .emlearn-blob-img { max-width: 600px; }
}

/* =========================================================================
 * ICON LIST (converted from Supreme Modules dsm_icon_list)
 * ========================================================================= */

.emlearn-icon-list {
    list-style: disc;
    padding-left: 1.5em;
    margin: 1em 0;
}

.emlearn-icon-list li {
    margin-bottom: 0.4em;
    line-height: 1.5;
}
