/* ====================================================
   Clean Editorial — Single Post Styles
   howtorepel.com  ·  single-post.css
   ==================================================== */

/* ── Hero image ── */
.htr-post-hero {
    width: 100%;
    height: 55vmin;
    min-height: 200px;
    max-height: 460px;
    background: center / cover no-repeat #e8f4f3;
    position: relative;
    overflow: hidden;
}
.htr-post-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,.28));
    pointer-events: none;
}

/* ── Post header (title + meta) ── */
.htr-post-header {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 1rem;
    text-align: center;
}
.htr-post-cat {
    display: inline-block;
    background: #e8f4f3;
    color: #17706e;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    margin-bottom: .9rem;
    transition: background .18s, color .18s;
}
.htr-post-cat:hover { background: #17706e; color: #fff; }

.htr-post-title {
    font-size: clamp(1.6rem, 4vw, 2.55rem);
    font-weight: 800;
    line-height: 1.2;
    color: #003f7f;
    margin: .5rem 0 1.25rem;
}

.htr-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
.htr-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e8f4f3;
}
.htr-meta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: left;
}
.htr-meta-author {
    font-weight: 600;
    color: #333;
    font-size: .88rem;
}
.htr-meta-details {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: #999;
}

/* ── Post body ── */
.htr-post-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 2.5rem;
}

/* ── Content typography ── */
.htr-post-content {
    font-size: 1.06rem;
    line-height: 1.82;
    color: #2c2c2c;
}
.htr-post-content > *:first-child { margin-top: 0; }

.htr-post-content h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: #003f7f;
    margin: 2.2rem 0 .7rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid #e8f4f3;
    line-height: 1.3;
}
.htr-post-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #003f7f;
    margin: 1.7rem 0 .5rem;
    line-height: 1.35;
}
.htr-post-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 1.4rem 0 .4rem;
}
.htr-post-content p { margin-bottom: 1.3em; }

.htr-post-content a          { color: #17706e; text-decoration: underline; text-underline-offset: 3px; }
.htr-post-content a:hover    { color: #0a5050; }

.htr-post-content ul,
.htr-post-content ol         { padding-left: 1.5rem; margin-bottom: 1.2em; }
.htr-post-content li         { margin-bottom: .45em; }

.htr-post-content img        { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.5rem auto; }
.htr-post-content figure     { margin: 1.5rem 0; }
.htr-post-content figcaption { text-align: center; font-size: .82rem; color: #888; margin-top: 6px; }

.htr-post-content blockquote {
    border-left: 4px solid #17706e;
    background: #f0f9f8;
    margin: 1.5rem 0;
    padding: .85rem 1.2rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}
.htr-post-content pre {
    background: #f4f4f4;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: .88em;
    line-height: 1.65;
    margin: 1.5rem 0;
}
.htr-post-content code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: .88em; }
.htr-post-content pre code { background: none; padding: 0; font-size: 1em; }

.htr-post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
    margin: 1.5rem 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.htr-post-content th,
.htr-post-content td { padding: 9px 14px; border: 1px solid #ddd; text-align: left; white-space: nowrap; }

/* Mobile: let cells wrap to prevent full-page overflow */
@media (max-width: 768px) {
    .htr-post-content th,
    .htr-post-content td { white-space: normal; word-break: break-word; }
}
.htr-post-content th { background: #17706e; color: #fff; font-weight: 600; }
.htr-post-content tr:nth-child(even) td { background: #f9f9f9; }

/* TOC box */
.htr-post-content .htr-guide-toc-box {
    background: #f0f9f8;
    border: 1px solid #17706e;
    border-radius: 10px;
    padding: 1.1rem 1.5rem;
    margin: 1.5rem 0 2rem;
}
.htr-post-content .htr-guide-toc-box ul { padding-left: 1.1rem; margin: 0; }
.htr-post-content .htr-guide-toc-box li { padding: 3px 0; line-height: 1.6; }

/* ── Post footer (tags + prev/next) ── */
.htr-post-footer {
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
    border-top: 1px solid #eee;
}
.htr-post-tags { font-size: .84rem; color: #aaa; margin-bottom: 1.75rem; }
.htr-post-tags a { color: #17706e; text-decoration: none; margin-right: .35rem; }
.htr-post-tags a:hover { text-decoration: underline; }

.htr-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.htr-pnav-link {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 1rem 1.2rem;
    background: #f7f7f7;
    border-radius: 8px;
    text-decoration: none;
    transition: background .18s;
}
.htr-pnav-link:hover { background: #e8f4f3; }
.htr-pnav-next        { text-align: right; }
.htr-pnav-dir {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #17706e;
}
.htr-pnav-title {
    font-size: .88rem;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Related guides ── */
.htr-related {
    background: #f7f9f8;
    padding: 2.5rem 1.25rem 3rem;
    border-top: 3px solid #e8f4f3;
}
.htr-related-title {
    max-width: 1100px;
    margin: 0 auto 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #003f7f;
}
.htr-related-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.htr-related-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.htr-related-card:hover {
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
    transform: translateY(-4px);
}
.htr-related-img {
    height: 155px;
    background: center / cover no-repeat #e8f4f3;
    flex-shrink: 0;
}
.htr-related-body {
    padding: .9rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-grow: 1;
}
.htr-related-cat  { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #17706e; }
.htr-related-ttl  {
    font-size: .9rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.htr-related-time { font-size: .76rem; color: #bbb; margin-top: auto; padding-top: .35rem; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 900px) {
    .htr-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .htr-post-header,
    .htr-post-body,
    .htr-post-footer { padding-left: .9rem; padding-right: .9rem; }
    .htr-post-content { font-size: 1rem; line-height: 1.78; }
    .htr-post-nav { grid-template-columns: 1fr; }
    .htr-pnav-next { text-align: left; }
    .htr-related-grid { grid-template-columns: 1fr; }
    .htr-related-img  { height: 190px; }
}
@media (max-width: 400px) {
    .htr-post-body { padding-left: .7rem; padding-right: .7rem; }
    .htr-post-content h2 { font-size: 1.3rem; }
    .htr-post-content h3 { font-size: 1.1rem; }
}
