/* ==========================================================================
   layout.css — Structure, grid, header, footer, responsive
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', Roboto, sans-serif;
    background: #fafafa;
    color: #1e1e2e;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #7c3aed; text-decoration: none; }
a:hover { color: #6d28d9; text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: #ffffff;
    padding: 0;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f43f7a, #7c3aed);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    position: relative;
}
.site-logo {
    font-size: 22px;
    font-weight: 900;
    color: #1e1e2e;
    letter-spacing: -0.5px;
}
.site-logo:hover { text-decoration: none; }
.site-logo span {
    background: linear-gradient(135deg, #f43f7a, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.site-nav { display: flex; gap: 20px; }
.site-nav a {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}
.site-nav a:hover, .site-nav a.active { color: #7c3aed; text-decoration: none; }

/* Main */
main { flex: 1; padding: 0 0 48px; }

/* Footer */
.site-footer {
    background: #f3f4f6;
    color: #6b7280;
    padding: 32px 0;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #6b7280; }
.footer-links a:hover { color: #7c3aed; }
.footer-affiliate { margin-top: 4px; opacity: 0.7; }
.footer-affiliate:hover { opacity: 1; }

/* Section */
.section { margin-bottom: 32px; }
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #f43f7a;
}

/* Card grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* Page container with top padding (non-home pages) */
.page-container { padding-top: 24px; }

/* Work detail layout */
.work-detail { display: grid; grid-template-columns: 45% 1fr; gap: 28px; }
.work-detail--comic { grid-template-columns: 30% 1fr; }

/* Related section */
.related-section { margin-bottom: 40px; }
.related-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #f43f7a;
}

/* Responsive */
@media (max-width: 768px) {
    .work-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .site-nav { gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; flex-shrink: 1; min-width: 0; }
    .site-footer .container { flex-direction: column; gap: 12px; text-align: center; }
    .work-detail, .work-detail--comic { grid-template-columns: 1fr; gap: 20px; }
    .work-main-img { max-width: 240px; }
    .work-hero { padding: 20px 0 36px; }
    .work-title-area h1 { font-size: 1.2rem; }
    .work-purchase-inner { flex-direction: column; align-items: stretch; gap: 16px; }
    .work-cta { justify-content: center; }
}
