/* Import legacy styles for inner content tables & specifics */
@import url('style.css');

/* ==========================================================================
   Modern CSS Reset & Variables
   ========================================================================== */
:root {
    --primary: #0076c8;
    --primary-light: #e6f3ff;
    --primary-hover: #005a9c;
    --text-main: #334155;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font-sans: 'Inter', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    
    --max-width: 1100px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-page);
    line-height: 1.6;
    background-image: none !important; /* Override legacy body background */
    text-align: left; /* Override legacy center */
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Override legacy div#boby_bg_top constraints */
#boby_bg_top {
    background: none !important;
}
center {
    text-align: left;
}

/* ==========================================================================
   Header & Navigation (Glassmorphism + Sticky)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 0;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    flex-shrink: 0;
}

.logo-img {
    /* Constrain the 900×40 gif so it never bursts out of the header */
    max-height: 44px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-nav .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    text-decoration: none !important;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    transition: all 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-main);
    width: 140px;
    font-family: var(--font-sans);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--primary-hover);
}

/* ==========================================================================
   Hero Banner
   ========================================================================== */
.hero-banner {
    max-width: var(--max-width);
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}

.hero-img {
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.hero-link:hover .hero-img {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumb-wrapper {
    max-width: var(--max-width);
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.breadcrumbs {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .current {
    font-weight: 500;
    color: var(--text-main);
}

/* ==========================================================================
   Main Layout (Grid)
   ========================================================================== */
.main-wrapper {
    max-width: var(--max-width);
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.main-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
    align-items: start;
}

.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

/* Reset legacy table structure inside content to flow naturally */
.legacy-content > table > tbody > tr > td {
    width: auto !important; /* Ignore the hardcoded 670px */
}

/* Styles for elements inside legacy content to look modern */
.legacy-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.legacy-content table img {
    border-radius: var(--radius-md);
    transition: transform 0.2s ease;
}

.legacy-content a:hover img {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */
.sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 90px; /* Offset for sticky header */
}

.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.widget-title {
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--primary-light);
    color: var(--primary-hover);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.widget-content {
    padding: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

.widget-content p {
    margin: 0 0 1rem;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.location-group {
    margin-bottom: 1rem;
}

.location-group:last-child {
    margin-bottom: 0;
}

.location-group strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.location-group p {
    margin: 0;
    color: var(--text-muted);
}

.banner-widget {
    background: transparent;
    border: none;
    box-shadow: none;
}

.hover-lift {
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.hover-lift img {
    border-radius: var(--radius-md);
    width: 100%;
}

.hover-lift:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
}

.mt-4 { margin-top: 1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #0f172a; /* Slate 900 */
    color: #94a3b8; /* Slate 400 */
    padding: 3rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #cbd5e1;
    text-decoration: none !important;
    font-weight: 500;
}

.footer-nav a:hover {
    color: #38bdf8; /* Sky 400 */
}

.copyright {
    text-align: center;
    font-size: 0.875rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 100;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
    color: white;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    /* Keep widgets stacked vertically at all times to avoid the truncation glitch */
    .sidebar-widgets {
        position: static;
        flex-direction: column;
    }
    
    .sidebar-widgets .widget {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .header-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav, .main-nav .nav-list {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .content-card {
        padding: 1.5rem;
    }
    
    .footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}
