:root {
    --primary-color: #2a2a2a;
    --bg-color: #f5f6f8;
    --accent-color: #e8892e;
    --amazon-color: #f0c14b;
    --link-btn-color: #007bff;
    --muted: #5c5c5c;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius-card: 10px;
}

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.65;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: env(safe-area-inset-left, 0);
    top: env(safe-area-inset-top, 0);
}

header,
.site-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 14px 16px;
}

header h1,
header h1 a {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 1.55rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: white;
    text-decoration: none;
}

header h1 a {
    transition: opacity 0.15s ease;
}

header h1 a:hover {
    opacity: 0.9;
}

.hero {
    position: relative;
    width: 100%;
    max-height: 46vh;
    overflow: hidden;
    background: #1a1a1a;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

.hero-img {
    width: 100%;
    max-height: 46vh;
    object-fit: cover;
    opacity: 0.94;
}

.hero-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92%, 480px);
    text-align: center;
    z-index: 1;
}

.hero-kicker {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-text {
    margin: 0;
    color: white;
    font-size: clamp(1.25rem, 4.2vw, 1.5rem);
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

main {
    padding: 18px 16px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.home-main .article-section > h2 {
    margin-bottom: 6px;
}

h2 {
    font-size: 1.25rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.section-lead {
    margin: 0 0 18px;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
}

.article-card {
    background: white;
    padding: 16px;
    border-radius: var(--radius-card);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
    .article-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    }
}

.article-card:active {
    transform: scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
    .article-card {
        transition: none;
    }

    .article-card:hover,
    .article-card:active {
        transform: none;
    }

    .load-more-btn:not(:disabled):active {
        transform: none;
    }
}

.article-card h3 {
    margin: 0 0 6px 0;
    font-size: 1.08rem;
    line-height: 1.45;
}

.article-card a {
    text-decoration: none;
    color: var(--primary-color);
    display: block;
    outline: none;
}

.article-date {
    font-size: 0.8125rem;
    color: var(--muted);
    margin: 0;
}

.action-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    margin-top: 14px;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.action-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.load-more-btn:not(:disabled):active {
    transform: scale(0.985);
}

.back-btn {
    background-color: #6c757d;
    margin-top: 20px;
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0));
    margin-top: 28px;
}

.back-to-top-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 18px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.back-to-top-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.footer-info {
    text-align: center;
    font-size: 0.9rem;
}

.footer-info a {
    color: white;
    text-decoration: underline;
}

.post-title {
    margin-top: 0;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.post-body {
    margin-bottom: 30px;
    white-space: pre-wrap;
}

.generated-link {
    display: block;
    text-align: center;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.link-btn {
    background-color: var(--link-btn-color);
    color: white;
}

.amazon-btn {
    background-color: var(--amazon-color);
    border: 1px solid #a88734;
    color: #111;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.box-group {
    background: #eee;
    padding: 10px;
    border-radius: 5px;
}

.box-group h3 {
    font-size: 1rem;
    margin-top: 0;
}

.submit-btn {
    background-color: var(--accent-color);
    font-weight: bold;
}
