/*
Theme Name: My 911 Story 2.0 (Dark Premium)
Theme URI: https://example.com/my-911-story
Author: Shinya
Author URI: https://example.com
Description: A premium, dark, editorial theme. Heavy atmosphere with bold typography and cinematic imagery.
Version: 2.0.0
License: GPLv2 or later
Text Domain: my-911-story
*/

/* ---------------------------------------------------
   1. Reset & Variables
   --------------------------------------------------- */
:root {
    /* Colors - Heavy, Dark & Premium */
    --color-bg: #121212;
    /* Deep matte black background */
    --color-panel: #1E1E1E;
    /* Slightly lighter panel background */
    --color-text: #E0E0E0;
    /* Off-white text for readability */
    --color-heading: #FFFFFF;
    /* Pure white for headings */
    --color-accent: #C0392B;
    /* Deep Red (Tail light red) */
    --color-border: #333333;
    /* Subtle dark borders */
    --color-meta: #999999;
    /* Muted grey for meta info */

    /* Typography */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Noto Serif JP', serif;
    --font-ui: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1440px;

    /* Animation */
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-serif);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.8;
    font-size: 16px;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------
   2. Typography
   --------------------------------------------------- */
h1 {
    font-size: clamp(2rem, 8vw, 4rem);
}

h2 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 5vw, 2rem);
}

h4 {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sans);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--color-heading);
}

a {
    color: var(--color-heading);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-accent);
    opacity: 1;
}

/* ---------------------------------------------------
   3. Layout Utility
   --------------------------------------------------- */
.container {
    width: 94%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 2rem;
}

/* ---------------------------------------------------
   4. Header & Navigation
   --------------------------------------------------- */
.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--color-bg);
}

.site-header .container {
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .site-header .container {
        padding: 1.5rem 0;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

header h1 a {
    font-family: var(--font-sans);
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-heading);
    white-space: nowrap;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.primary-menu li a {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    opacity: 0.8;
}

.primary-menu li a:hover {
    color: var(--color-accent);
    opacity: 1;
}

/* ---------------------------------------------------
   5. Card & Grid Layout
   --------------------------------------------------- */
/* Grid only for home/archive pages */
.home main.container,
.archive main.container,
.blog main.container,
.search main.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 5rem;
}

.home article,
.archive article,
.blog article,
.search article {
    grid-column: span 4;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
}


/* Post Thumbnail */
article .post-thumbnail {
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 4/3;
    background: var(--color-panel);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

article .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    opacity: 0.9;
}

article:hover .post-thumbnail img {
    transform: scale(1.05);
    opacity: 1;
}

/* Post Meta */
article .entry-meta {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--color-meta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* Post Title */
article .entry-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

article .entry-title a {
    color: var(--color-heading);
}

article .entry-excerpt {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* First Post Highlight - Home/Archive only */
.home article:first-child,
.archive article:first-child,
.blog article:first-child,
.search article:first-child {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 5rem;
}

.home article:first-child .post-thumbnail,
.archive article:first-child .post-thumbnail,
.blog article:first-child .post-thumbnail,
.search article:first-child .post-thumbnail {
    grid-column: span 7;
    aspect-ratio: 16/9;
    margin-bottom: 0;
}

.home article:first-child .entry-header-wrap,
.archive article:first-child .entry-header-wrap,
.blog article:first-child .entry-header-wrap,
.search article:first-child .entry-header-wrap {
    grid-column: span 5;
    padding-bottom: 1rem;
}

.home article:first-child .entry-title,
.archive article:first-child .entry-title,
.blog article:first-child .entry-title,
.search article:first-child .entry-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}



/* Responsive adjustments */
@media (max-width: 1024px) {

    .home article,
    .archive article,
    .blog article,
    .search article {
        grid-column: span 6;
    }

    .home article:first-child .post-thumbnail,
    .archive article:first-child .post-thumbnail,
    .blog article:first-child .post-thumbnail,
    .search article:first-child .post-thumbnail {
        grid-column: span 12;
        aspect-ratio: 3/2;
    }

    .home article:first-child .entry-header-wrap,
    .archive article:first-child .entry-header-wrap,
    .blog article:first-child .entry-header-wrap,
    .search article:first-child .entry-header-wrap {
        grid-column: span 12;
        order: -1;
    }

    .home article:first-child .entry-title,
    .archive article:first-child .entry-title,
    .blog article:first-child .entry-title,
    .search article:first-child .entry-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {

    .home main.container,
    .archive main.container,
    .blog main.container,
    .search main.container {
        display: block;
    }

    .home article,
    .archive article,
    .blog article,
    .search article {
        margin-bottom: 4rem;
    }

    .home article:first-child,
    .archive article:first-child,
    .blog article:first-child,
    .search article:first-child {
        display: block;
    }
}

/* ---------------------------------------------------
   6. Single Post (Cinematic)
   --------------------------------------------------- */
.single main.container,
.page main.container {
    display: block;
    max-width: var(--container-width);
    padding-top: 4rem;
    padding-bottom: 6rem;
}

.single article,
.page article {
    display: block;
}

/* Hero Image */
.hero-image {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 4rem;
    max-height: 80vh;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single .entry-title,
.page .entry-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    text-align: left;
    margin-bottom: 2rem;
    line-height: 1;
}

.single .entry-meta,
.page .entry-meta {
    text-align: left;
    margin-bottom: 4rem;
    display: block;
}

.authors-note {
    font-family: var(--font-sans);
    background: var(--color-panel);
    color: var(--color-text);
    padding: 2rem;
    margin: 3rem 0;
    font-size: 0.9rem;
    line-height: 1.8;
    border-left: 4px solid var(--color-accent);
}

.authors-note strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--color-accent);
}

.entry-content {
    font-size: 1.125rem;
}

.entry-content p {
    margin-bottom: 2rem;
}

.entry-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
}

.entry-content img {
    margin: 4rem 0;
    width: 100%;
    height: auto;
}

/* Post Navigation */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.post-navigation a {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* DIY Steps */
.diy-steps .card {
    border: 1px solid var(--color-border);
    background: var(--color-panel);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.diy-steps .card h4 {
    margin-top: 0;
    color: var(--color-heading);
}

/* ---------------------------------------------------
   7. Sidebar (911 Log)
   --------------------------------------------------- */
.content-area {
    flex: 1;
    min-width: 300px;
}

.sidebar-911log {
    width: 300px;
    flex-shrink: 0;
    border-left: 1px solid var(--color-border);
    padding-left: 2rem;
}

.sidebar-911log .card {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-911log h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--color-heading);
}

.sidebar-911log ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-911log ul li {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0;
}

/* ---------------------------------------------------
   8. Footer
   --------------------------------------------------- */
footer {
    border-top: 1px solid var(--color-border);
    margin-top: 5rem;
    background: #000000;
    padding-bottom: 3rem;
}

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

.footer-menu a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
}

/* ---------------------------------------------------
   9. Utility Classes
   --------------------------------------------------- */
.btn-primary,
.btn-read-more {
    display: inline-block;
    color: var(--color-accent);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
}

.btn-primary:hover,
.btn-read-more:hover {
    color: var(--color-heading);
}

.card {
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}