@charset "UTF-8";

/* =========================================================
   pwa_lecture.css
   九星気学講座 PWA版
   ※ Web版 lecture.css のクラス名をできるだけ維持
========================================================= */

/* =========================
   講座ページ全体
========================= */

.lecture-container {
    max-width: 860px;
    margin: calc(60px + env(safe-area-inset-top)) auto 0;
    padding: 18px 14px calc(92px + env(safe-area-inset-bottom));
    line-height: 1.9;
    color: #222;
    background:
        radial-gradient(circle at top left, rgba(255, 246, 220, 0.9), transparent 34%),
        linear-gradient(180deg, #fffdf7 0%, #fffaf0 100%);
}

.lecture-container p,
.lecture-container li {
    color: #2a2a2a;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.lecture-container p {
    margin: 0 0 15px;
}

.lecture-container a {
    color: #356ac3;
    text-decoration: none;
    font-weight: 700;
}

.lecture-container a:hover,
.lecture-container a:focus {
    text-decoration: underline;
}

/* PWA画面ではタップしやすさを優先 */
.lecture-container a {
    -webkit-tap-highlight-color: rgba(53, 106, 195, 0.15);
}


/* =========================
   ヒーロー
========================= */

.lecture-hero {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 8px 0 24px;
    padding: 22px 18px;
    background: linear-gradient(135deg, #fffef9 0%, #f7fbff 100%);
    border: 1px solid rgba(216, 201, 121, 0.75);
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(75, 61, 25, 0.08);
}

.lecture-hero__text {
    flex: 1 1 320px;
    min-width: 0;
}

.lecture-hero__text h1 {
    font-size: clamp(1.55rem, 5vw, 2rem);
    line-height: 1.45;
    margin: 0 0 14px;
    color: #274c77;
    letter-spacing: 0.03em;
}

.lecture-hero__text p {
    margin: 0 0 13px;
    font-size: 1.02rem;
}

.lecture-hero__text strong {
    color: #7a4b00;
    background: linear-gradient(transparent 62%, rgba(255, 223, 128, 0.55) 62%);
}

.lecture-hero__image {
    flex: 0 0 190px;
    text-align: center;
    margin: 0 auto;
}

.lecture-hero__image img {
    width: 100%;
    max-width: 210px;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    display: block;
}


/* =========================
   章の導入ボックス
========================= */

.lecture-intro-box {
    margin: 22px 0 26px;
    padding: 20px 18px;
    background: rgba(247, 251, 255, 0.96);
    border: 1px solid #b8d0ec;
    border-left: 6px solid #5d8edc;
    border-radius: 18px;
    box-shadow: 0 5px 16px rgba(39, 76, 119, 0.06);
}

.lecture-intro-box p:last-child {
    margin-bottom: 0;
}


/* =========================
   目次
========================= */

.lecture-toc {
    margin: 26px 0 30px;
    padding: 20px 18px;
    background: rgba(255, 254, 249, 0.98);
    border: 1px solid #d8c979;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(95, 75, 20, 0.07);
}

.lecture-toc h2 {
    margin-top: 0;
}

.lecture-toc ul {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.lecture-toc li {
    margin: 0 0 10px;
    padding: 0;
}

.lecture-toc li a {
    display: block;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #eadf9a;
    border-radius: 14px;
    color: #274c77;
    line-height: 1.55;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
}

.lecture-toc li a::after {
    content: "›";
    float: right;
    color: #9b7d21;
    font-weight: 900;
}

.lecture-toc li a:hover,
.lecture-toc li a:focus {
    text-decoration: none;
    background: #fff9df;
    transform: translateY(-1px);
}


/* =========================
   セクション共通
========================= */

.lecture-section {
    margin-top: 28px;
    padding: 22px 18px;
    background: rgba(255, 254, 249, 0.98);
    border: 1px solid #d8c979;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(95, 75, 20, 0.07);
}

.lecture-section h2,
.lecture-toc h2 {
    position: relative;
    margin: 0 0 18px;
    padding: 7px 0 9px 14px;
    font-size: clamp(1.22rem, 4.2vw, 1.48rem);
    font-weight: 800;
    color: #274c77;
    border-left: 7px solid #4f7fd6;
    line-height: 1.45;
    letter-spacing: 0.02em;
}

.lecture-section h2::after,
.lecture-toc h2::after {
    content: "";
    display: block;
    width: 86px;
    height: 3px;
    margin-top: 9px;
    background: linear-gradient(to right, #4f7fd6, #d8c979);
    border-radius: 999px;
}

.lecture-section p:last-child {
    margin-bottom: 0;
}

.lecture-section ul {
    margin: 16px 0 18px 1.2em;
    padding: 0;
}

.lecture-section li {
    margin-bottom: 8px;
}


/* =========================
   講座ページ h3
========================= */

.lecture-container h3 {
    font-size: 1.08rem;
    margin: 24px 0 10px;
    padding: 8px 12px;
    border-left: 5px solid #5b6dd8;
    background: #f7f9ff;
    color: #2c3e50;
    font-weight: 800;
    border-radius: 8px;
}

.lecture-container h3::after {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(to right, #5b6dd8, transparent);
    margin-top: 6px;
    width: 110px;
}


/* =========================
   画像
========================= */

.lecture-image {
    float: right;
    width: 210px;
    max-width: 40%;
    margin: 2px 0 16px 20px;
    text-align: center;
}

.lecture-image img {
    width: 100%;
    max-width: 210px;
    border-radius: 16px;
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.11);
    display: block;
}

.lecture-section::after {
    content: "";
    display: block;
    clear: both;
}


/* =========================
   補足ボックス
========================= */

.lecture-note,
.lecture-point,
.lecture-caution {
    margin: 20px 0;
    padding: 17px 16px;
    border-radius: 17px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.035);
}

.lecture-note {
    background: #f7fbff;
    border: 1px solid #c8daef;
    border-left: 6px solid #6c99cf;
}

.lecture-point {
    background: #fffdf4;
    border: 1px solid #e3d68d;
    border-left: 6px solid #c8a936;
}

.lecture-caution {
    background: #fff8f6;
    border: 1px solid #ebc3b8;
    border-left: 6px solid #d48776;
}

.lecture-note p,
.lecture-point p,
.lecture-caution p {
    margin-bottom: 0;
}

.lecture-note strong,
.lecture-point strong,
.lecture-caution strong {
    color: #274c77;
}


/* =========================
   ナビゲーション
========================= */

.lecture-nav {
    margin-top: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lecture-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #356ac3 0%, #4f7fd6 100%);
    color: #fff !important;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(53, 106, 195, 0.24);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lecture-nav a:hover,
.lecture-nav a:focus {
    opacity: 0.94;
    transform: translateY(-1px);
    text-decoration: none;
}

.lecture-nav .next {
    margin-left: auto;
}


/* =========================
   講座ページの表
========================= */

.lecture-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 22px;
    border-radius: 14px;
}

.lecture-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
    background: #fff;
    border: 1px solid #cfd8e6;
}

.lecture-table th,
.lecture-table td {
    border: 1px solid #d7dfe9;
    padding: 10px 11px;
    vertical-align: top;
    text-align: left;
    line-height: 1.7;
    word-break: break-word;
}

.lecture-table th {
    background: #f5f8fc;
    color: #274c77;
    font-weight: 800;
}

.lecture-table td {
    background: #fff;
}

.lecture-table td:first-child {
    font-weight: 800;
    color: #2c3e50;
    background: #fbfcfe;
}


/* =========================
   tools メニュー用
========================= */

.tool-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.tool-card {
    background: #fff;
    border-radius: 18px;
    padding: 17px 16px 15px;
    margin-bottom: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.06);
    border: 1px solid #e5ebf3;
}

.tool-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.12rem;
}

.tool-card p {
    margin-bottom: 0;
}

.tool-links {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-links .tool-main,
.tool-links .tool-main:link,
.tool-links .tool-main:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    background: #4f46e5;
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid #4338ca;
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.18);
    line-height: 1.2;
}

.tool-links .tool-main:hover,
.tool-links .tool-main:focus {
    background: #4338ca;
    color: #ffffff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.tool-links .tool-sub,
.tool-links .tool-sub:link,
.tool-links .tool-sub:visited {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: #4f46e5 !important;
    font-size: 0.96rem;
    font-weight: 800;
    text-decoration: none;
    padding: 8px 2px;
    line-height: 1.2;
}

.tool-links .tool-sub:hover,
.tool-links .tool-sub:focus {
    text-decoration: underline;
}

.tool-card.paid {
    border-left: 6px solid #f39c12;
}


/* =========================
   PWA向けの読みやすさ微調整
========================= */

.lecture-container strong {
    font-weight: 800;
}

.lecture-container em {
    font-style: normal;
    color: #7a4b00;
    font-weight: 700;
}

.lecture-section > p:first-of-type {
    margin-top: 2px;
}


/* =========================
   レスポンシブ
========================= */

@media (max-width: 768px) {

    .lecture-container {
        padding: 16px 12px calc(92px + env(safe-area-inset-bottom));
        line-height: 1.88;
    }

    .lecture-container p,
    .lecture-container li {
        font-size: 0.98rem;
    }

    .lecture-hero {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .lecture-hero__text {
        flex-basis: 100%;
    }

    .lecture-hero__text h1 {
        font-size: 1.55rem;
    }

    .lecture-hero__image {
        flex-basis: 100%;
    }

    .lecture-hero__image img {
        max-width: 230px;
        margin: 0 auto;
    }

    .lecture-section,
    .lecture-toc,
    .lecture-intro-box {
        padding: 19px 16px;
    }

    .lecture-section h2,
    .lecture-toc h2 {
        font-size: 1.22rem;
        padding-left: 13px;
        border-left-width: 6px;
    }

    .lecture-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 18px 0 21px;
    }

    .lecture-image img {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    .lecture-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .lecture-nav a,
    .lecture-nav .next {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .lecture-container h3 {
        font-size: 1.04rem;
        margin: 22px 0 8px;
    }

    .lecture-table {
        min-width: 560px;
    }

    .lecture-table th,
    .lecture-table td {
        padding: 9px 10px;
        font-size: 0.94rem;
    }

    .tool-card {
        padding: 16px 14px 14px;
    }

    .tool-links {
        gap: 9px;
    }

    .tool-links .tool-main,
    .tool-links .tool-main:link,
    .tool-links .tool-main:visited {
        width: 100%;
        text-align: center;
    }

    .tool-links .tool-sub,
    .tool-links .tool-sub:link,
    .tool-links .tool-sub:visited {
        width: 100%;
    }
}

@media (max-width: 430px) {

    .lecture-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .lecture-hero,
    .lecture-section,
    .lecture-toc,
    .lecture-intro-box {
        border-radius: 18px;
    }

    .lecture-toc li a {
        padding: 11px 12px;
        font-size: 0.96rem;
    }

    .lecture-note,
    .lecture-point,
    .lecture-caution {
        padding: 15px 14px;
    }
}