:root {
    /* Colors */
    --bg-main: #f5f7fb;
    --bg-card: #ffffff;
    --bg-nested: #f8fafc;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --accent: #4f46e5;
    --accent-hover: #4338ca;

    --border: #e5e7eb;

    /* Radius */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    /* Shadows */
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 15px 40px rgba(15, 23, 42, 0.1);

    --transition: all .3s ease;
}

/* ===== Base ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    font-size: 16px;
}

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

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

main {
    width: min(1200px, 92%);
    margin: 40px auto 80px;
}

/* ===== Hero ===== */

.hero {
    margin-bottom: 0;
}

.hero figure {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero figure::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.4),
        transparent
    );
}

.hero img {
    width: 100%;
    height: clamp(350px, 55vh, 650px);
    object-fit: cover;
    transition: transform .8s ease;
}

.hero:hover img {
    transform: scale(1.05);
}

/* ===== Title Card ===== */

.post-title {
    max-width: 900px;
    margin: -80px auto 50px;
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-hover);
}

.post-title h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.04em;
    margin-bottom: 18px;
}

.post-date-author {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
}

/* ===== Content ===== */

.post-content{
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-content-card {
    padding: 20px 50px;
    margin: 0px auto;
    max-width: 1200px;

}

.post-content:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.post-content-card h3 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 24px;
    font-weight: 700;
}

.post-content-card p {
    color: #334155;
    font-size: 1.08rem;
    margin-bottom: 24px;

}

.post-content-card:first-child > p:first-of-type::first-letter {
    float: left;
    font-size: 4rem;
    line-height: 1;
    font-weight: 800;
    color: var(--accent);
    margin-right: 12px;
}

.post-content-card img {
    margin: 35px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

/* ===== Quote ===== */

.quote {
    position: relative;
    background: #f1f5f9;
    border-left: 5px solid #4f46e5;
    padding: 40px 40px 40px 70px;
    border-radius: 16px;
    margin: 40px 0;
}

.quote::before {
    content: "❝";
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 5rem;
    color: rgba(79, 70, 229, 0.12);
    line-height: 1;
}

.quote p {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.8;
    font-style: italic;
    color: #334155;
}

/* ===== Categories & Tags ===== */

.category-tag {
    display: flex;
    gap: 24px;
    margin: 50px auto;
    max-width: 1200px;
}

.post-category,
.tag {
    flex: 1;
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.category-tag h4 {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.post-categories,
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-categories a,
.tag a {
    padding: 8px 16px;
    border-radius: 50px;
    background: #eef2ff;
    color: var(--accent);
    border: 1px solid #c7d2fe;
    font-size: .85rem;
    font-weight: 600;
}

.post-categories a:hover,
.tag a:hover {
    background: var(--accent);
    color: white;
}

/* ===== Author ===== */

.author {
    max-width: 1200px;
    margin: 0 auto 50px;
    background: linear-gradient(
        135deg,
        #ffffff,
        #f8fafc
    );
    padding: 30px;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 24px;
    align-items: center;
    box-shadow: var(--shadow);
}

.author figure {
    width: 90px;
    height: 90px;
}

.author img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-info p {
    font-size: 1.2rem;
    font-weight: 700;
}

.author-description {
    color: var(--text-muted);
}

/* ===== Previous / Next ===== */

.next-previous {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 60px;
}

.previous,
.next {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.previous:hover,
.next:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.previous p,
.next p {
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 8px;
}

.previous h3,
.next h3 {
    font-size: 1.05rem;
}

/* ===== Comments ===== */

.comments {
    max-width: 900px;
    margin: auto;
}

.comments > h3 {
    margin-bottom: 24px;
    font-size: 1.6rem;
}

.comment-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.comment-card figure {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.comment-card img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== Comment Form ===== */

.create-comment {
    max-width: 900px;
    margin: 40px auto 0;
    padding: 40px;
    background: white;
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
    box-shadow: var(--shadow);
}

.full-length {
    grid-column: 1 / -1;
}

.create-comment input,
.create-comment textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-main);
    transition: var(--transition);
}

.create-comment input:focus,
.create-comment textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79,70,229,.1);
}

.create-comment textarea {
    min-height: 180px;
}

.create-comment button {
    grid-column: 1 / -1;
    justify-self: start;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.create-comment button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.reply-button {
    font-size: 0.85rem;
    font-weight: 700;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
    cursor: pointer;
}

.replies {
    margin-left: 40px;
    border-left: 2px solid #e2e8f0;
    padding-left: 24px;
    display: none;
}

.reply-comment{
    margin-bottom: 20px;
}

/* ===== Tables ===== */

.post-content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.post-content-card th,
.post-content-card td {
    padding: 14px;
    border: 1px solid var(--border);
}

.post-content-card th {
    background: var(--bg-nested);
}

/* ===== Mobile ===== */

@media (max-width: 768px) {

    main {
        width: 95%;
        margin-top: 20px;
    }

    .hero img {
        height: 280px;
    }

    .post-title {
        margin-top: -40px;
        padding: 24px;
    }

    .post-title h2 {
        font-size: 1.8rem;
    }

    .post-content-card {
        padding: 24px;
    }

    .post-content-card p:first-of-type::first-letter {
        font-size: 3rem;
    }

    .category-tag,
    .next-previous,
    .create-comment {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .author {
        flex-direction: column;
        text-align: center;
    }
}

