/* =========================================
   全站基礎設定
========================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 40px 20px;
    background-image: url('../img/bg-texture.jpg'); 
    font-family: sans-serif;
}

/* =========================================
   Bento Grid 便當盒佈局 (魔法陣的核心)
========================================= */
.bento-container {
    max-width: 1200px;  /* 控制整體最大寬度 */
    margin: 0 auto;     /* 畫面置中 */
    display: grid;
    /* 依據您的視覺稿，將畫面切成 3 欄，比例約為 5 : 4 : 3 */
    grid-template-columns: 5fr 4fr 3fr; 
    gap: 24px;          /* 格子之間的呼吸空間 */
    
    /* 這裡完美還原您的設計稿拼圖邏輯！ */
    grid-template-areas:
        "books books web"
        "illustrator logo web"
        "illustrator life about";
}

/* 將每一個區塊對應到上面定義的代號 */
.item-books       { grid-area: books; }
.item-web         { grid-area: web; }
.item-illustrator { grid-area: illustrator; }
.item-logo        { grid-area: logo; display: flex; align-items: center; justify-content: center; }
.item-life        { grid-area: life; }
.item-about       { grid-area: about; }

/* =========================================
   個別格子的外觀設定
========================================= */
.bento-item {
    display: block;
    background-color: #ffffff;
    border-radius: 36px;       /* 您設計稿中的漂亮大圓角 */
    overflow: hidden;          /* 確保圖片被切成圓角 */
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* 微微的質感陰影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 滑鼠移上去的微浮動效果 */
.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* 中央 Logo 區塊取消圓角與背景 (因為它要浮在畫面上) */
.item-logo {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none; /* 讓滑鼠不會對它有互動效果 */
}

/* 圖片通用設定 */
.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 確保圖片不變形，完美填滿框框 */
    display: block;
}

/* Logo 圖片特別設定（不填滿） */
.item-logo .logo-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* =========================================
   Footer 底部版權與社群列
========================================= */
.site-footer {
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #777;
    border-top: 1px solid #FFF;
    padding-top: 24px;
	
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.social-links a:hover img {
    transform: scale(1.1); /* 社群 Icon 的懸停放大 */
}

/* =========================================
   手機版 RWD - 齊頭等比最終修正
========================================= */
@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }

    .bento-container {
        display: grid;
        grid-template-columns: 1fr 1fr; 
        grid-template-areas:
            "logo logo"
            "books books"      /* 出版圖書維持全寬 (1大) */
            "web illustrator"  /* 2小排列 */
            "life about";      /* 2小排列 */
        gap: 16px;
    }

    /* 觀景窗：固定每個格子的顯示區域 */
    .bento-item {
        position: relative !important;
        overflow: hidden !important; 
        border-radius: 24px;
        background-color: #FFF;
        height: 180px; /* 可以統一格子高度 */
    }

    .item-books { grid-area: books; height: 250px; }
    .item-web { grid-area: web; }
    .item-illustrator { grid-area: illustrator; }
    .item-life { grid-area: life; }
    .item-about { grid-area: about; }

    /* 核心魔法：強制所有圖片「物理縮放倍率」一致 */
    .bento-item img {
        /* 1. 關鍵：不管格子多寬，所有圖都強制以「螢幕全寬」縮放 */
        /* 這保證了圖片被縮小的比例完全相同，文字大小就會一模一樣 */
        width: calc(100vw - 32px) !important; 
        
        /* 2. 核心：禁止圖片自動縮小去適應小格子 */
        max-width: none !important; 
        height: auto !important;

        /* 3. 定位：強制釘死在左上角 (0,0) */
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        
        /* 移除任何自動位移的機制 */
        object-fit: none !important; 
        object-position: top left !important;
		

    }

    /* Logo 區塊獨立處理，不套用裁切邏輯 */
    .item-logo {
        height: auto!important;
		width: 100%;
        grid-area: logo;
        display: flex;
        justify-content: center ;
        padding-bottom: 20px;
        background: transparent !important;
        box-shadow: none !important;
		transform: scale(0.9); 
        transform-origin: top left;
    }
    .item-logo img {
        position: static !important;
        width: 300px !important;
        max-width: 100% !important;
    }
}
