<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="theme-color" content="#000000">

    {% if seo_settings %}
    {% if seo_settings.search_console_id %}
    <meta name="google-site-verification" content="{{ seo_settings.search_console_id }}">
    {% endif %}
    <meta property="og:site_name" content="{{ seo_settings.og_site_name or site_name }}">
    {% endif %}

    {% block meta %}{% endblock %}
    <title>{% block title %}{{ site_name }}{% endblock %}</title>

    {% if site_json_ld %}{{ site_json_ld | safe }}{% endif %}

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="/css/theme.css">

    <style>
        /* Minimal Theme Overrides */
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            font-size: 17px;
            letter-spacing: -0.01em;
        }

        .site-header {
            padding: 3rem 0;
            border-bottom: none;
            background: transparent;
        }

        .site-header .container {
            max-width: 680px;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
        }

        .site-logo {
            font-size: 1.25rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            color: var(--color-text);
        }

        .site-nav {
            display: flex;
            gap: 2rem;
        }

        .site-nav a {
            font-size: 0.9rem;
            color: var(--color-text-muted);
            text-decoration: none;
            transition: color 0.2s;
            margin-left: 0;
        }

        .site-nav a:hover {
            color: var(--color-text);
        }

        .site-main {
            padding: 2rem 0 4rem;
        }

        .site-main .container {
            max-width: 680px;
        }

        /* No sidebar in minimal */
        .main-container {
            display: block;
        }

        .sidebar {
            display: none;
        }

        /* Typography */
        .post-header {
            text-align: center;
            margin-bottom: 3rem;
        }

        .post-header h1 {
            font-size: 2rem;
            font-weight: 600;
            letter-spacing: -0.03em;
            line-height: 1.3;
            margin-bottom: 1rem;
        }

        .post-meta {
            font-size: 0.9rem;
        }

        .post-content {
            font-size: 1.0625rem;
            line-height: 1.8;
        }

        .post-content p {
            margin-bottom: 1.5rem;
        }

        .post-content h2 {
            font-size: 1.5rem;
            font-weight: 600;
            margin-top: 3rem;
            margin-bottom: 1rem;
        }

        .post-content h3 {
            font-size: 1.25rem;
            font-weight: 600;
            margin-top: 2rem;
            margin-bottom: 0.75rem;
        }

        .post-content a {
            color: var(--color-text);
            text-decoration: underline;
            text-decoration-thickness: 1px;
            text-underline-offset: 2px;
        }

        .post-content blockquote {
            border-left: 2px solid var(--color-text);
            padding-left: 1.5rem;
            margin: 2rem 0;
            font-style: normal;
            color: var(--color-text);
        }

        .post-content pre {
            background: var(--color-surface);
            border-radius: 4px;
            padding: 1.25rem;
            font-size: 0.875rem;
            overflow-x: auto;
        }

        .post-content img {
            border-radius: 4px;
        }

        /* Post list */
        .posts-list {
            max-width: 680px;
        }

        .post-card {
            padding: 2rem 0;
            border-bottom: 1px solid var(--color-border);
        }

        .post-card:first-child {
            padding-top: 0;
        }

        .post-card h2 {
            font-size: 1.25rem;
            font-weight: 500;
            margin-bottom: 0.5rem;
        }

        .post-card h2 a {
            color: var(--color-text);
            text-decoration: none;
        }

        .post-card h2 a:hover {
            text-decoration: underline;
        }

        .post-card p {
            color: var(--color-text-muted);
            margin-bottom: 0.5rem;
        }

        /* Footer */
        .site-footer {
            padding: 3rem 0;
            border-top: none;
            background: transparent;
        }

        .site-footer .container {
            max-width: 680px;
        }

        .site-footer p {
            font-size: 0.875rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .site-header {
                padding: 2rem 0;
            }

            .site-nav {
                gap: 1.5rem;
            }

            .post-header h1 {
                font-size: 1.75rem;
            }
        }

        {% block styles %}{% endblock %}
    </style>
</head>
<body>
    <header class="site-header">
        {% block header %}
        <div class="container">
            <a href="/" class="site-logo">{{ site_name }}</a>
            <nav class="site-nav">
                {% if menus and menus.header %}
                    {% for item in menus.header %}
                    <a href="{{ item.url }}">{{ item.label }}</a>
                    {% endfor %}
                {% endif %}
            </nav>
        </div>
        {% endblock %}
    </header>

    <main class="site-main">
        <div class="container">
            {% block content %}{% endblock %}
        </div>
    </main>

    <footer class="site-footer">
        {% block footer %}
        <div class="container">
            <p>&copy; {{ current_year }} {{ site_name }}</p>
        </div>
        {% endblock %}
    </footer>

    {% block scripts %}{% endblock %}

    {% if seo_settings and seo_settings.ga4_id %}
    <script async src="https://www.googletagmanager.com/gtag/js?id={{ seo_settings.ga4_id }}"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', '{{ seo_settings.ga4_id }}');
    </script>
    {% endif %}
</body>
</html>
