/*
Theme Name: Jumpstart Success Stories Theme
Theme URI: https://jumpstartenglish.education/success-stories
Author: Jumpstart English
Description: Custom theme for Success Stories with restricted admin and specific designs.
Version: 1.1.0
*/

:root {
    --primary: #00a8e8;
    --primary-dark: #0077b6;
    --primary-light: #e0f2f1;
    --accent: #ffcc00;
    --bg-base: #f8fbff;
    --text-main: #2c3e50;
    --text-strong: #1a252f;
    --text-light: #7f8c8d;
    --white: #FFFFFF;
    --header-height: 80px;
    --radius-md: 20px;
    --container-max: 1300px;
}

/* Basic Styles */
html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-base);
    -webkit-font-smoothing: antialiased;
}

body.home {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    /* Scroll hijacking for home page */
}

/* Highlighter Style for Strong tags */
strong,
.highlighter {
    background: linear-gradient(transparent 60%, rgba(255, 204, 0, 0.7) 60%);
    font-weight: 700;
    padding: 0 2px;
}

/* --- Header --- */
header {
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

header.is-hero {
    background: transparent;
}

header.is-hero nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header.is-showcase {
    background: transparent;
}

header.is-showcase nav {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s ease;
}

header.is-showcase .logo {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 255, 255, 0.4);
}

header.is-showcase:hover {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 168, 232, 0.05);
}

header.is-showcase:hover nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header.is-standard,
body:not(.home) header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 168, 232, 0.05);
}

header.is-standard nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
}

.logo {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.5s ease;
}

header nav {
    display: flex;
    gap: 25px;
}

header nav a {
    font-weight: 400;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.3s;
}

header nav a:hover {
    color: var(--primary);
}

/* --- Mobile Overlay UI --- */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--white);
    z-index: 2000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mobile-overlay a {
    font-size: 1.1rem;
    font-weight: 400;
    text-decoration: none;
    color: var(--text-main);
    transition: 0.3s;
}

.mobile-overlay a:hover {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    z-index: 1100;
    width: 44px;
    height: 44px;
    margin-right: -10px;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: 0.3s;
}

.close-menu {
    position: absolute;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    z-index: 2100;
    margin-right: -10px;
}

.close-menu::before,
.close-menu::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.close-menu::before {
    transform: rotate(45deg);
}

.close-menu::after {
    transform: rotate(-45deg);
}

/* --- Scroll Container (Home) --- */
#scroll-container {
    height: 100%;
    width: 100%;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    will-change: transform;
}

/* Specific Section Styles for Home Scroll */
body.home section,
body.home footer.scroll-footer {
    height: 100dvh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- Hero --- */
.hero {
    background: linear-gradient(180deg, #eef9ff 0%, #ffffff 100%);
    text-align: center;
}

.hero-content {
    opacity: 0;
    transform: scale(0.98);
    transition: all 1.2s ease-out;
    padding: var(--header-height) 24px 0;
    max-width: 900px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

section.active .hero-content {
    opacity: 1;
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 1;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3.8rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    line-height: 1.25;
}

/* --- Story Slides --- */
.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: transform 3s cubic-bezier(0.1, 1, 0.3, 1);
}

section.active .slide-bg {
    transform: scale(1.05);
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
}

.slide-content {
    position: relative;
    z-index: 3;
    width: 90%;
    max-width: 1300px;
    display: flex;
    height: 100%;
    align-items: flex-end;
    padding-bottom: 10vh;
}

.pos-right .slide-content {
    justify-content: flex-end;
}

.pos-left .slide-content {
    justify-content: flex-start;
}

.content-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 50px 40px 40px;
    border-radius: var(--radius-md);
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out 0.2s;
    box-sizing: border-box;
}

section.active .content-card {
    opacity: 1;
    transform: translateY(0);
}

.slide-num {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: clamp(6rem, 15vw, 10rem);
    font-weight: 900;
    color: var(--primary);
    opacity: 0.12;
    line-height: 1;
    font-family: 'Montserrat', sans-serif;
    pointer-events: none;
    z-index: 0;
}

.card-inner-content {
    position: relative;
    z-index: 2;
}

.status-badge {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 168, 232, 0.2);
}

.slide-title {
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.5;
    color: var(--text-strong);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.content-card p {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 20px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.btn-read {
    display: inline-block;
    padding: 14px 40px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    transition: 0.3s;
    box-shadow: 0 10px 25px rgba(0, 168, 232, 0.2);
}

.btn-read:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* --- Carousel --- */
.carousel-section {
    background: #fff;
    flex-direction: column;
    padding-top: var(--header-height);
}

.carousel-header {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: 1s ease-out;
    width: 90%;
}

section.active .carousel-header {
    opacity: 1;
    transform: translateY(0);
}

.carousel-track-container {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    display: flex;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    width: fit-content;
    animation: autoScroll 45s linear infinite;
    will-change: transform;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-set {
    display: flex;
    gap: 30px;
    padding-right: 30px;
}

@keyframes autoScroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-33.3333%, 0, 0);
    }
}

.carousel-card {
    width: clamp(260px, 70vw, 320px);
    background: var(--bg-base);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.carousel-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 168, 232, 0.1);
}

.card-img {
    height: 180px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.card-info {
    padding: 25px;
}

.card-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.5;
}

/* --- Final Page Footer (Home) --- */
body.home footer,
footer.scroll-footer {
    background: #fff;
    flex-direction: column;
    padding: 0;
    color: var(--text-main);
    border-top: 1px solid rgba(0, 168, 232, 0.1);
    justify-content: flex-start !important;
    align-items: stretch !important;
    height: 100vh;
    display: flex;
    box-sizing: border-box;
}

.footer-header-spacer {
    height: var(--header-height);
    flex-shrink: 0;
}

.footer-cta-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 40px 24px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.footer-cta-area h2 {
    font-size: clamp(1.6rem, 6vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text-strong);
    line-height: 1.35;
    max-width: 800px;
}

.btn-cta-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: white;
    padding: clamp(16px, 4vw, 22px) clamp(40px, 10vw, 65px);
    border-radius: 100px;
    font-weight: 400;
    text-decoration: none;
    font-size: clamp(1rem, 3vw, 1.2rem);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0, 168, 232, 0.25);
}

.footer-bottom-grid {
    flex-shrink: 0;
    width: 90%;
    max-width: 1300px;
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 40px;
    padding: 40px 0 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

/* --- Standard Footer (Single/Others) --- */
body:not(.home) footer {
    background: var(--white);
    color: var(--text-main);
    padding: 0;
    border-top: 1px solid rgba(0, 168, 232, 0.1);
}

body:not(.home) .footer-cta-area {
    padding: 100px 24px;
}

body:not(.home) .footer-bottom-grid {
    padding: 60px 0 40px;
}


.footer-brand .logo {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: inline-block;
}

.footer-brand p {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.7;
    max-width: 400px;
}

.footer-col-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 10px;
}

.footer-links-list a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: 0.3s;
    font-weight: 400;
}

.footer-links-list a:hover {
    color: var(--primary);
}

.copyright {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    padding-top: 30px;
    opacity: 0.7;
}


/* --- Article / Single Page Styles --- */
.page-wrapper {
    margin-top: var(--header-height);
    padding: 60px 0;
}

.container {
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 50px;
}

.article-main {
    background: var(--white);
    padding: 50px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.category-badge {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 168, 232, 0.15);
}

.article-title {
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 25px 0;
    line-height: 1.35;
    color: var(--text-strong);
}

.meta-info {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 35px;
    border-bottom: 1px solid #f0f4f8;
    padding-bottom: 15px;
}

.hero-img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 40px;
}

.article-main h2 {
    font-size: 1.6rem;
    font-weight: 800;
    border-left: 6px solid var(--primary);
    padding-left: 20px;
    margin: 60px 0 30px;
    color: var(--text-strong);
}

/* Chat Bubbles */
.chat-block {
    display: flex;
    margin-bottom: 40px;
    align-items: flex-start;
}

.chat-block.student,
.chat-block.chat-left {
    flex-direction: row;
}

.chat-block.staff,
.chat-block.chat-right {
    flex-direction: row-reverse;
}

.chat-avatar {
    flex-shrink: 0;
    width: 70px;
    text-align: center;
    margin: 0 15px;
}

.chat-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.chat-name {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 6px;
    color: var(--text-light);
    display: block;
}

.chat-bubble {
    position: relative;
    padding: 22px 28px;
    border-radius: var(--radius-md);
    max-width: 80%;
    font-size: 0.98rem;
    line-height: 1.75;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
}

.chat-block.student .chat-bubble,
.chat-block.chat-left .chat-bubble {
    background-color: #f0f7ff;
    margin-left: 20px;
    color: var(--text-main);
}

.chat-block.staff .chat-bubble,
.chat-block.chat-right .chat-bubble {
    background-color: var(--white);
    border: 1px solid #eef2f6;
    margin-right: 20px;
}

/* Sidebar */
aside {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 1025px) {
    .sidebar-widget {
        position: -webkit-sticky;
        position: sticky;
        top: calc(var(--header-height) + 40px);
        z-index: 10;
    }
}

.sidebar-widget {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.widget-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    text-transform: uppercase;
}

.story-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.story-list li {
    margin-bottom: 25px;
}

.story-list a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    gap: 15px;
    transition: 0.3s;
    align-items: center;
}

.story-list a:hover {
    color: var(--primary);
}

.story-list img {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.story-list span {
    line-height: 1.5;
}

/* --- Responsive Queries --- */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        gap: 40px;
        width: 92%;
    }

    aside {
        order: 2;
        padding: 0;
    }

    .article-main {
        order: 1;
        border-radius: var(--radius-md);
    }

    .sidebar-widget {
        position: static;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    header .logo {
        font-size: 1.8rem;
    }

    header nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .close-menu {
        top: 13px;
        right: 5%;
    }

    /* Home Slide Adjustments */
    .slide-content {
        justify-content: center !important;
        align-items: center;
        padding-bottom: 0;
        width: 100%;
    }

    .content-card {
        max-width: 88%;
        text-align: center;
        padding: 40px 24px;
        background: rgba(255, 255, 255, 0.75);
    }

    .footer-nav {
        display: none;
    }

    .footer-bottom-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding: 30px 0 20px;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    /* Single Page Adjustments */
    .page-wrapper {
        padding: 25px 0;
    }

    .article-main {
        padding: 35px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    }

    .sidebar-widget {
        padding: 35px 20px;
    }

    .article-title {
        font-size: 1.7rem;
    }

    .chat-avatar {
        width: 60px;
    }

    .chat-avatar img {
        width: 50px;
        height: 50px;
    }

    .chat-bubble {
        max-width: 88%;
        padding: 16px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.1rem;
    }

    .footer-cta-area h2 {
        font-size: 1.7rem;
    }

    .btn-cta-large {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .article-main {
        padding: 30px 16px;
    }

    .sidebar-widget {
        padding: 30px 16px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-main h2 {
        font-size: 1.35rem;
        margin: 40px 0 20px;
        padding-left: 15px;
    }

    .hero-img {
        height: 220px;
        margin-bottom: 25px;
    }

    .chat-avatar {
        width: 50px;
    }

    .chat-bubble {
        padding: 14px 18px;
    }
}