@charset "UTF-8";

/* --- 0. カラー変数の定義 --- */
:root {
    --theme-color: #00d2ff;
    --theme-glow: rgba(0, 210, 255, 0.8);
    --theme-bg: rgba(0, 210, 255, 0.1);
}

.theme-red {
    --theme-color: #ff4d4d;
    --theme-glow: rgba(255, 77, 77, 0.8);
    --theme-bg: rgba(255, 77, 77, 0.1);
}

.theme-white {
    --theme-color: #fff;             /* メインは真っ白 */
    --theme-glow: rgba(255, 255, 255, 0.5); /* 柔らかな白い光 */
    --theme-bg: rgba(255, 255, 255, 0.1);   /* ほのかな白の背景 */
}

.theme-green {
    --theme-color: #00ff9d;             /* 鮮やかなネオングリーン */
    --theme-glow: rgba(0, 255, 157, 0.8); /* 発光感のある光 */
    --theme-bg: rgba(0, 255, 157, 0.1);   /* ほのかな背景色 */
}

.theme-mint {
    --theme-color: #4ade80;             /* ミント系のグリーン */
    --theme-glow: rgba(74, 222, 128, 0.7);
    --theme-bg: rgba(74, 222, 128, 0.1);
}

/* --- 1. 全体レイアウト --- */
* {
    box-sizing: border-box; 
}

body, 
html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #1a1c23;
    color: #fff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

.site-wrapper {
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* --- 背景固定の共通設定 --- */
@media (max-width: 1250px) {
    .side-area { display: none; }
    .bg-fixed-back { width: 100%; }
}

.bg-fixed-back {
    width: 1000px;
    margin: 0 auto;
    background-image: url('../../esp32/img/esp32_back.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;

    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 5px; 

    display: flex; 
    flex-direction: column; 
    align-items: center;

    flex-shrink: 0;
}

.side-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    background-color: #1a1c23;
}

.side-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.side-text {
    writing-mode: vertical-rl;
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    color: var(--theme-color);
    opacity: 0.7;
}

.deco-line {
    width: 1px;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--theme-color), transparent);
    box-shadow: 0 0 10px var(--theme-color);
}

.site-title {
    font-family: 'Dancing Script', cursive;
    text-align: center;
    color: var(--theme-color);
    margin: 20px 0 5px 0;
    text-shadow: 0 0 15px var(--theme-glow);
}

.nav-container{
    display: flex;
    justify-content: center; /* ボタン2つを画面の中央に寄せる */
    gap: 20px;               /* ボタンとボタンの間の隙間 */
    margin: 20px;
    font-size: 1.2em;
    text-decoration: none;
}

.nav-container a:active {
    color: #ff4d4d; /* クリックした瞬間に赤くするなど */
}

.nav-btn {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 160px;
    padding: 0 22px;
    border: 1px solid var(--theme-color);
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.7);
    transition: 0.3s;
}

.nav-btn:hover {
    background: var(--theme-bg) !important;
    border-color: var(--theme-color) !important;
    box-shadow: 0 0 15px var(--theme-glow) !important;
    color: var(--theme-color);
    text-shadow: 0 0 10px var(--theme-glow);
    transform: translateY(-2px);
    text-decoration: none !important; /* 下線が出ないように念押し */
}

.nav-btn.disabled {
    opacity: 0.5;            /* 半透明にして無効感を出す */
    pointer-events: none;    /* クリックを物理的に無効化する */
    cursor: default;         /* カーソルをポインタにしない */
    filter: grayscale(1);    /* 必要であれば白黒にする */
}

.site-footer { 
    text-align: center; 
    margin: 10px; /* マイナスの値を入れると上に上がります */
    position: relative;
    z-index: 10;
}

.since-text {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--theme-color);
    opacity: 0.5;
    border-top: 1px solid var(--theme-bg);
    display: inline-block;
    padding-top: 10px;
}

/*--------------------------------------------------- */

.main-back {
    width: 100%; 
    max-width: 900px;
    padding: 10px 30px;
    border-radius: 20px;
    transition: 0.3s;
    background: rgba(0, 0, 0, 0.6); /* 背景を少し暗く */
    border: 1px solid var(--theme-bg);
}

.main-back p {
    font-size: 1.1rem; /* 16pxより一回り大きく */
    line-height: 1.4;   /* 行間を広げて読みやすく */
/*   margin-bottom: 1.0rem; */
}

.main-back h1 {
    font-size: 3rem;
    margin-top: 0;
    padding: 10px 0; /* 必要最低限の余白だけ残す */
}

.main-back h2 {
    border-left: 5px solid var(--theme-color);
    padding-left: 15px;
    margin-top: 50px;
    margin-bottom: 25px;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    padding-top: 10px;
    padding-bottom: 10px;
}

.main-back h2:first-of-type { 
    margin-top: 0; 
}

.main-back.glass-card {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    padding: 20px 40px;
    border-radius: 20px;
}

.main-back.wide { 
    grid-column: span 2; 
}

.main-back a:link {
    color: #00d4ff; /* 現在の水色 */
    text-decoration: none;
    border-bottom: 1px dashed #00d4ff;
}

.main-back a:visited {
    color: #d1c98a; /* 少し落ち着いたパープルなど（お好みの色で） */
    border-bottom-color: #d1c98a;
}

.main-back a:hover {
    color: var(--theme-color);
    border-bottom-style: solid;
    text-shadow: 0 0 10px var(--theme-glow);
}

.section-content p{
    text-indent: 1em;
}

.section-content h2{
    color: var(--theme-color);
}

strong {
    color: var(--theme-color);
    border-bottom: 1px solid var(--theme-color);
}

.fig-disp {
    width: auto; 
    height: 500px;
    object-fit: contain; 
    object-position: center;
    display: block;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.parag-all{
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
    padding: 5px; 
    align-items: center;
}

/* ぼかし効果の追加（グラスモーフィズム） */
.glass-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- フェードイン（開発の背景用） --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 1.0s ease-out forwards;
}

.visual-parts-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: auto;
    margin: 1em 2em;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 工事中エリアのスタイル --- */
.under-construction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh; /* 画面の高さの半分以上を確保 */
    text-align: center;
    padding: 40px 20px;
}

.uc-icon {
    font-size: 4rem;
    color: var(--theme-color); /* 既存の水色など */
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--theme-color));
    animation: pulse 2s infinite; /* 鼓動するように光らせる */
}

.uc-title {
    font-size: 2.5rem;
    letter-spacing: 0.2em;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.uc-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.6;
}

/* 読み込み中を演出するアニメーションバー */
.uc-loader {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.uc-loader::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--theme-color);
    animation: loading 2s infinite;
}

/* アニメーション定義 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/*-------------------------------------------------------------
            Code block
----------------------------------------------------------------*/
.code-block {
    background: #000;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 1.1rem;
    border: 1px solid #333;
    margin: 15px 0;
    overflow-x: auto;
    line-height: 1.2;
}

/* =============================================
   高機能コードブロック（スクロール・行番号固定）
   ============================================= */
.code-block-container {
    width: 100%;
    max-width: 850px;
    margin: 20px 0;
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden; /* 親枠からはみ出させない */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    justify-content: space-between; /* 左右に振り分け */
    align-items: center;
    padding: 10px 15px;
    background: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
}

.header-actions {
    display: flex;
    gap: 8px; /* ボタン同士の隙間 */
}

.download-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 4px 10px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #444;
    color: #fff;
    border-color: #888;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-name {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: bold;
}

.lang-tag {
    background: rgba(247, 146, 146, 0.1);
    color: #f79292;
    font-size: 1rem;
    padding: 2px 8px;
    border-radius: 4px;
/*    text-transform: uppercase; */
    letter-spacing: 0.5px;
    border: 1px solid rgba(247, 146, 146, 0.3);
}

.copy-btn, .download-btn {
    background: #3d3d3d;
    color: #ccc;
    border: none;
    padding: 5px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover, .download-btn:hover {
    background: #505050;
    color: #fff;
}

.code-body {
    display: block;
    height: 500px;
    overflow: auto; /* 横・縦両方のスクロールを許可 */
    position: relative;
    background: #1e1e1e;
    padding: 15px 0;
    
}

.line-row {
    display: flex;
    width: max-content; /* ★ここが重要：中身に合わせて横に伸びるようにする */
    min-width: 100%;
}

.ln {
    position: sticky;
    left: 0;
    z-index: 5;           /* ★コード(.lc)より上に配置 */
    background: #1e1e1e;  /* ★背後の文字を透かさない不透明な色 */
    
    min-width: 65px;
    padding: 0 15px;
    color: #555;
    text-align: right;
    font-family: 'Consolas', monospace;
    font-size: 18px;
    line-height: 1.1;
    user-select: none;
    border-right: 1px solid #333;
    flex-shrink: 0;       /* ★横に潰されないように固定 */
}

.lc {
    z-index: 1;           /* 番号より下の層にする */
    padding-left: 15px;
    color: #d4d4d4;
    font-family: 'Consolas', monospace;
    font-size: 18px;
    line-height: 1.1;
    white-space: pre;
    flex-grow: 1;
}

.line-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.code-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-body::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.code-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.code-body::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.line-row.highlight {
    /* 背景は透明にするか、指定しない */
    border-left: none; /* 左線は.lnに任せる */
}

.line-row.highlight .ln {
    background-color: #2a2a26; /* 不透明な暗い黄色系 */
    color: #f1c40f;
    z-index: 10;
    border-right: 1px solid #f1c40f;
    box-shadow: inset 4px 0 0 #f1c40f; /* 黄色のアクセント線 */
}

.line-row.highlight .lc {
    background-color: rgba(241, 196, 15, 0.1); /* ここで色を塗る */
    width: 100%;
}

/*-----------  table --------------------- */
.table-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 95%;
    max-width: 950px;
    margin: 5px auto;
}

.table-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.table-item h3 {
    font-size: 1.1rem;
    color: var(--theme-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--theme-bg);
    padding-bottom: 8px;
    text-align: center;
}

.table-item table {
    width: 100%;
    border-collapse: collapse;
}

.table-item th, .table-item td {
    padding: 5px;
    text-align: left;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-item th {
    color: #888;
    font-weight: normal;
}

