/*
Theme Name: Cosmemoric Diary
Theme URI: http://localhost/privat_wordpress
Author: Cosmemoric
Description: Modern diary-style WordPress theme for long-form posts and quotes.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: cosmemoric-diary
*/

:root {
    --bg: #f7f5ef;
    --surface: #ffffff;
    --ink: #1f2428;
    --muted: #6f7376;
    --line: #ded9cf;
    --accent: #2f6f73;
    --accent-strong: #164f52;
    --warm: #bd6757;
    --shadow: 0 20px 60px rgba(31, 36, 40, 0.10);
    --max: 1160px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.72;
}

a {
    color: var(--accent-strong);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 245, 239, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.site-header-inner,
.site-footer-inner,
.wrap {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    color: var(--ink);
    text-decoration: none;
}

.brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
    margin-top: 6px;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    font-weight: 700;
}

.primary-menu a {
    color: var(--ink);
    text-decoration: none;
}

.front-hero {
    padding: 64px 0 42px;
    border-bottom: 1px solid var(--line);
}

.front-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 44px;
    align-items: end;
}

.kicker,
.entry-meta,
.archive-label {
    color: var(--warm);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.front-hero h1,
.page-title,
.entry-title {
    margin: 10px 0 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.98;
    letter-spacing: 0;
}

.front-intro {
    max-width: 720px;
    color: #34393d;
    font-size: 21px;
}

.quote-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.cos-quote blockquote {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    line-height: 1.35;
}

.cos-quote figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.cos-quote-source::before {
    content: "/";
    margin-right: 8px;
    color: var(--line);
}

.cos-quotes {
    transition: opacity 160ms ease;
}

.cos-quotes.is-loading {
    opacity: 0.62;
}

.cos-quotes-stage {
    min-height: 180px;
}

.cos-quote-next {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 24px;
    padding: 0 16px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.cos-quote-next:hover,
.cos-quote-next:focus-visible {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.cos-quote-next:disabled {
    cursor: wait;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 42px 0 22px;
}

.section-header h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding-bottom: 64px;
}

.post-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(31, 36, 40, 0.07);
}

.post-card-image {
    display: block;
    aspect-ratio: 16 / 10;
    background: #e5e0d6;
    overflow: hidden;
}

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

.post-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.post-card h2,
.post-card h3 {
    margin: 8px 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.12;
}

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

.post-card p {
    margin: 0;
    color: #4f5457;
    font-size: 16px;
    line-height: 1.55;
}

.entry-shell {
    width: min(860px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 80px;
}

.entry-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: min(7vw, 56px);
    box-shadow: var(--shadow);
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.18;
}

.entry-content blockquote {
    margin: 32px 0;
    padding: 18px 24px;
    border-left: 4px solid var(--accent);
    background: #f4f1ea;
    font-family: Georgia, "Times New Roman", serif;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 32px 0;
    color: var(--muted);
    font-size: 14px;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 0;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 860px) {
    .front-hero-grid,
    .post-grid {
        grid-template-columns: 1fr;
    }

    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .primary-menu {
        flex-wrap: wrap;
    }

    .front-hero {
        padding-top: 42px;
    }
}
