/* ============================================================
   MÉMO MELEC
   CSS principal
============================================================ */

.memo-page {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 60px;
    color: #0f172a;
}

/* ============================================================
   HERO
============================================================ */

.memo-hero {
    position: relative;
    min-height: 430px;
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    align-items: center;
    overflow: hidden;
    border-radius: 32px;
    padding: 55px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(59,130,246,.4), transparent 32%),
        linear-gradient(135deg, #020617, #172554 55%, #1d4ed8);
    box-shadow: 0 25px 65px rgba(15,23,42,.25);
}

.memo-hero-content {
    position: relative;
    z-index: 5;
}

.memo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(12px);
    font-size: .84rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.memo-hero h1 {
    margin: 0;
    font-size: clamp(3rem, 7vw, 5.8rem);
    line-height: .9;
    letter-spacing: -4px;
    font-weight: 950;
}

.memo-hero h1 strong {
    display: block;
    color: #60a5fa;
}

.memo-hero-subtitle {
    max-width: 650px;
    margin: 25px 0;
    color: rgba(255,255,255,.84);
    font-size: 1.12rem;
    line-height: 1.7;
}

/* ============================================================
   SEARCH
============================================================ */

.memo-search-wrap {
    position: relative;
    max-width: 680px;
}

.memo-search {
    width: 100%;
    height: 62px;
    border: 0;
    outline: 0;
    border-radius: 18px;
    padding: 0 54px;
    font-size: 1rem;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0,0,0,.2);
}

.memo-search:focus {
    box-shadow:
        0 0 0 4px rgba(96,165,250,.35),
        0 15px 35px rgba(0,0,0,.25);
}

.memo-search-icon {
    position: absolute;
    left: 19px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    z-index: 2;
}

.memo-search-clear {
    display: none;
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    background: #f1f5f9;
    color: #475569;
}

.memo-search-clear.is-visible {
    display: block;
}

.memo-search-results {
    display: none;
    max-width: 680px;
    margin-top: 8px;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 45px rgba(0,0,0,.25);
}

.memo-search-results.is-visible {
    display: block;
}

.memo-search-result {
    display: grid;
    grid-template-columns: 44px 1fr 20px;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    color: #0f172a;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
}

.memo-search-result:hover {
    background: #f8fafc;
    text-decoration: none;
}

.memo-search-result-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #eff6ff;
    font-size: 1.2rem;
}

.memo-search-result strong {
    display: block;
}

.memo-search-result small {
    display: block;
    margin-top: 2px;
    color: #64748b;
}

.memo-search-empty {
    padding: 18px;
    color: #475569;
}

/* ============================================================
   HERO STATS
============================================================ */

.memo-hero-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 25px;
}

.memo-hero-stat strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 950;
}

.memo-hero-stat span {
    color: rgba(255,255,255,.62);
    font-size: .78rem;
}

.memo-stat-separator {
    width: 1px;
    height: 35px;
    background: rgba(255,255,255,.2);
}

/* ============================================================
   HERO DECORATION
============================================================ */

.memo-hero-decoration {
    position: relative;
    height: 100%;
    min-height: 320px;
}

.memo-electric-symbol {
    position: absolute;
    width: 190px;
    height: 190px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow:
        0 0 80px rgba(59,130,246,.35),
        inset 0 0 45px rgba(255,255,255,.08);
    animation: memoPulse 4s ease-in-out infinite;
}

.memo-electric-symbol span {
    font-size: 6rem;
    font-weight: 950;
    color: #93c5fd;
}

.memo-floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(14px);
    box-shadow: 0 15px 35px rgba(0,0,0,.2);
    font-weight: 900;
    animation: memoFloat 5s ease-in-out infinite;
}

.memo-floating-card-1 {
    top: 8%;
    left: 5%;
}

.memo-floating-card-2 {
    right: 2%;
    top: 35%;
    animation-delay: -1.4s;
}

.memo-floating-card-3 {
    bottom: 8%;
    left: 15%;
    animation-delay: -2.7s;
}

@keyframes memoPulse {
    0%,100% {
        transform: translate(-50%,-50%) scale(1);
    }
    50% {
        transform: translate(-50%,-50%) scale(1.05);
    }
}

@keyframes memoFloat {
    0%,100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================================
   SECTIONS
============================================================ */

.memo-section {
    margin-top: 55px;
}

.memo-section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 22px;
}

.memo-section-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: #2563eb;
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.memo-section h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    letter-spacing: -1px;
    font-weight: 950;
}

.memo-section-count {
    padding: 8px 13px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
}

/* ============================================================
   INTRO
============================================================ */

.memo-intro {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 30px;
    align-items: center;
}

.memo-intro p {
    max-width: 750px;
    color: #64748b;
    line-height: 1.75;
    font-size: 1.04rem;
}

.memo-intro-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 22px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15,23,42,.07);
}

.memo-intro-icon {
    font-size: 2rem;
}

.memo-intro-card strong {
    display: block;
    margin-bottom: 5px;
}

.memo-intro-card p {
    margin: 0;
    font-size: .9rem;
}

/* ============================================================
   CATEGORY GRID
============================================================ */

.memo-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.memo-category-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-height: 145px;
    padding: 20px;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
    color: #0f172a;
    text-decoration: none;
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.memo-category-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--memo-category-color);
}

.memo-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(15,23,42,.12);
    border-color: var(--memo-category-color);
    text-decoration: none;
}

.memo-category-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: color-mix(
        in srgb,
        var(--memo-category-color) 10%,
        white
    );
    font-size: 1.55rem;
}

.memo-category-content {
    padding-right: 18px;
}

.memo-category-content h3 {
    margin: 2px 0 7px;
    font-size: 1.05rem;
    font-weight: 950;
}

.memo-category-content p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
    font-size: .86rem;
}

.memo-category-arrow {
    position: absolute;
    right: 17px;
    bottom: 15px;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--memo-category-color);
}

/* ============================================================
   NOTIONS
============================================================ */

.memo-featured-section {
    padding: 32px;
    border-radius: 30px;
    background: #f8fafc;
}

.memo-notion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.memo-notion-card {
    display: flex;
    flex-direction: column;
    min-height: 205px;
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 9px 25px rgba(15,23,42,.05);
    color: #0f172a;
    text-decoration: none;
    transition:
        transform .22s ease,
        box-shadow .22s ease;
}

.memo-notion-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(15,23,42,.11);
    text-decoration: none;
}

.memo-notion-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 17px;
}

.memo-notion-category,
.memo-notion-level {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 900;
}

.memo-notion-category {
    color: var(--memo-notion-color, #2563eb);
    background: #eff6ff;
}

.memo-notion-level {
    background: #f1f5f9;
    color: #64748b;
}

.memo-notion-card h3 {
    margin: 0 0 8px;
    font-size: 1.18rem;
    font-weight: 950;
}

.memo-notion-card p {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.5;
}

.memo-notion-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 17px;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 800;
}

.memo-notion-arrow {
    color: #2563eb;
    font-size: 1.2rem;
}

/* ============================================================
   EMPTY / ERROR
============================================================ */

.memo-empty {
    padding: 45px 20px;
    text-align: center;
    border-radius: 22px;
    background: #fff;
    border: 1px dashed #cbd5e1;
}

.memo-empty > span {
    display: block;
    font-size: 2.6rem;
    margin-bottom: 10px;
}

.memo-empty strong {
    display: block;
    font-size: 1.1rem;
}

.memo-empty p {
    margin: 7px 0 0;
    color: #64748b;
}

.memo-error {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 18px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================================
   BOTTOM BANNER
============================================================ */

.memo-bottom-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 55px;
    padding: 25px;
    border-radius: 25px;
    color: #fff;
    background: linear-gradient(135deg,#1d4ed8,#2563eb);
    box-shadow: 0 20px 45px rgba(37,99,235,.22);
}

.memo-bottom-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    border-radius: 17px;
    background: rgba(255,255,255,.14);
    font-size: 1.8rem;
}

.memo-bottom-banner h2 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.memo-bottom-banner p {
    margin: 0;
    color: rgba(255,255,255,.8);
}

.memo-bottom-button {
    margin-left: auto;
    border: 0;
    border-radius: 14px;
    padding: 12px 17px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 950;
    cursor: pointer;
}

/* ============================================================
   CATEGORY HERO
============================================================ */

.memo-category-hero {
    position: relative;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 25px;
    align-items: center;
    padding: 35px;
    border-radius: 30px;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            var(--memo-category-color),
            #0f172a
        );
    box-shadow: 0 22px 55px rgba(15,23,42,.2);
}

.memo-category-hero .memo-back,
.memo-notion-hero .memo-back {
    position: absolute;
    top: 20px;
    left: 25px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-weight: 800;
}

.memo-category-hero-icon {
    width: 100px;
    height: 100px;
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.2);
    font-size: 3.5rem;
}

.memo-category-hero h1 {
    margin: 5px 0 10px;
    font-size: clamp(2rem,5vw,3.5rem);
    font-weight: 950;
}

.memo-category-hero p {
    max-width: 700px;
    margin: 0;
    color: rgba(255,255,255,.84);
    line-height: 1.6;
}

/* ============================================================
   NOTION HERO
============================================================ */

.memo-notion-hero {
    position: relative;
    padding: 75px 45px 45px;
    border-radius: 30px;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            var(--memo-category-color),
            #0f172a
        );
    box-shadow: 0 22px 55px rgba(15,23,42,.2);
}

.memo-notion-hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(255,255,255,.14);
    font-size: 2.5rem;
}

.memo-notion-hero-category {
    font-size: .8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .75;
}

.memo-notion-hero h1 {
    margin: 10px 0;
    font-size: clamp(2.2rem,6vw,4.2rem);
    font-weight: 950;
}

.memo-notion-hero p {
    max-width: 750px;
    margin: 0 auto;
    color: rgba(255,255,255,.84);
    line-height: 1.6;
    font-size: 1.05rem;
}

.memo-notion-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.memo-notion-meta span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .78rem;
    font-weight: 900;
}

/* ============================================================
   NOTION CONTENT
============================================================ */

.memo-notion-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 30px;
    margin-top: 35px;
    align-items: start;
}

.memo-notion-content {
    padding: 35px;
    border-radius: 25px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
    line-height: 1.75;
}

.memo-notion-content h2 {
    margin: 35px 0 12px;
    font-size: 1.65rem;
    font-weight: 950;
}

.memo-notion-content h2:first-child {
    margin-top: 0;
}

.memo-notion-content h3 {
    margin-top: 25px;
    font-weight: 900;
}

.memo-notion-content p {
    color: #475569;
}

.memo-notion-content ul,
.memo-notion-content ol {
    padding-left: 25px;
}

.memo-notion-content li {
    margin-bottom: 7px;
}

.memo-notion-content strong {
    color: #0f172a;
}

.memo-notion-content .memo-box {
    margin: 22px 0;
    padding: 20px;
    border-radius: 18px;
    background: #eff6ff;
    border-left: 5px solid #2563eb;
}

.memo-notion-content .memo-warning {
    margin: 22px 0;
    padding: 20px;
    border-radius: 18px;
    background: #fff7ed;
    border-left: 5px solid #f97316;
}

.memo-notion-content .memo-formula {
    margin: 25px 0;
    padding: 25px;
    text-align: center;
    border-radius: 20px;
    background: #0f172a;
    color: #fff;
    font-size: 1.7rem;
    font-weight: 950;
}

/* ============================================================
   SIDEBAR
============================================================ */

.memo-notion-sidebar {
    display: grid;
    gap: 15px;
    position: sticky;
    top: 20px;
}

.memo-sidebar-card {
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(15,23,42,.05);
}

.memo-sidebar-title {
    margin-bottom: 9px;
    font-weight: 950;
}

.memo-sidebar-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
    font-size: .88rem;
}

.memo-quiz-card {
    background: linear-gradient(135deg,#eff6ff,#fff);
}

.memo-quiz-button {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    min-height: 44px;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
}

.memo-quiz-button:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ============================================================
   RELATED
============================================================ */

.memo-related-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
}

.memo-related-card {
    position: relative;
    display: block;
    padding: 18px;
    min-height: 125px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
}

.memo-related-card:hover {
    border-color: #2563eb;
    text-decoration: none;
}

.memo-related-card strong {
    display: block;
    padding-right: 20px;
}

.memo-related-card span {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.4;
}

.memo-related-card b {
    position: absolute;
    right: 15px;
    bottom: 12px;
    color: #2563eb;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1000px) {

    .memo-hero {
        grid-template-columns: 1fr;
        padding: 40px;
    }

    .memo-hero-decoration {
        display: none;
    }

    .memo-category-grid,
    .memo-notion-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .memo-intro {
        grid-template-columns: 1fr;
    }

    .memo-related-grid {
        grid-template-columns: repeat(2,1fr);
    }

}

@media (max-width: 700px) {

    .memo-page {
        width: min(100% - 20px, 1200px);
        padding-top: 15px;
    }

    .memo-hero {
        padding: 30px 22px;
        border-radius: 24px;
        min-height: auto;
    }

    .memo-hero h1 {
        font-size: 3.4rem;
        letter-spacing: -2px;
    }

    .memo-hero-subtitle {
        font-size: 1rem;
    }

    .memo-search {
        height: 56px;
        font-size: .88rem;
    }

    .memo-category-grid,
    .memo-notion-grid,
    .memo-related-grid {
        grid-template-columns: 1fr;
    }

    .memo-featured-section {
        padding: 20px;
    }

    .memo-category-hero {
        grid-template-columns: 1fr;
        padding: 65px 22px 25px;
    }

    .memo-category-hero-icon {
        margin-top: 10px;
    }

    .memo-notion-hero {
        padding: 75px 22px 30px;
    }

    .memo-notion-layout {
        grid-template-columns: 1fr;
    }

    .memo-notion-sidebar {
        position: static;
    }

    .memo-notion-content {
        padding: 22px;
    }

    .memo-bottom-banner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .memo-bottom-button {
        width: 100%;
        margin-left: 0;
    }

}

@media (max-width: 450px) {

    .memo-hero h1 {
        font-size: 2.9rem;
    }

    .memo-hero-stats {
        gap: 10px;
    }

    .memo-stat-separator {
        height: 28px;
    }

    .memo-category-card {
        min-height: 125px;
    }

}