/*
 * post-content.css
 * Full typography styles for WordPress post/page content.
 * Scoped to .post-detail .article-body-row .text to avoid
 * affecting the rest of the theme.
 *
 * Theme colour palette:
 *   Text:       #36342f
 *   Green:      #4a7339
 *   Light bg:   #f7f6f3
 *   Muted:      #7f7f7f
 *   Border:     #d9d9d9
 */

/* ============================================================
   SCOPE: all rules are nested under the content wrapper
   ============================================================ */

.post-detail .article-body-row .text {
    color: #36342f;
    font-family: AvenirNext-Regular, "Avenir Next", Avenir, -apple-system,
                 BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;           /* 16 px */
    line-height: 1.75;
}

/* ============================================================
   HEADINGS
   ============================================================ */

.post-detail .article-body-row .text h1,
.post-detail .article-body-row .text h2,
.post-detail .article-body-row .text h3,
.post-detail .article-body-row .text h4,
.post-detail .article-body-row .text h5,
.post-detail .article-body-row .text h6 {
    font-family: AvenirNext-DemiBold, "Avenir Next", Avenir, -apple-system,
                 BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #36342f;
    line-height: 1.25;
    margin-top: 1.75em;
    margin-bottom: 0.6em;
}

.post-detail .article-body-row .text h1:first-child,
.post-detail .article-body-row .text h2:first-child,
.post-detail .article-body-row .text h3:first-child,
.post-detail .article-body-row .text h4:first-child,
.post-detail .article-body-row .text h5:first-child,
.post-detail .article-body-row .text h6:first-child {
    margin-top: 0;
}

.post-detail .article-body-row .text h1 { font-size: 2rem; }
.post-detail .article-body-row .text h2 { font-size: 1.625rem; }
.post-detail .article-body-row .text h3 { font-size: 1.375rem; }
.post-detail .article-body-row .text h4 { font-size: 1.125rem; }
.post-detail .article-body-row .text h5 { font-size: 1rem; }
.post-detail .article-body-row .text h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================================
   PARAGRAPHS
   ============================================================ */

.post-detail .article-body-row .text p {
    margin-top: 0;
    margin-bottom: 1.4em;
    line-height: 1.75;
}

.post-detail .article-body-row .text p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   LINKS
   ============================================================ */

.post-detail .article-body-row .text a {
    color: #4a7339;
    text-decoration: underline;
    -webkit-text-decoration-color: rgba(74, 115, 57, 0.4);
    text-decoration-color: rgba(74, 115, 57, 0.4);
    transition: color 0.2s, text-decoration-color 0.2s;
}

.post-detail .article-body-row .text a:hover,
.post-detail .article-body-row .text a:focus {
    color: #3a5a2b;
    -webkit-text-decoration-color: rgba(74, 115, 57, 0.8);
    text-decoration-color: rgba(74, 115, 57, 0.8);
}

/* ============================================================
   LISTS  (override global ul,li { list-style: none })
   ============================================================ */

.post-detail .article-body-row .text ul,
.post-detail .article-body-row .text ol {
    margin: 0 0 1.4em 0;
    padding-left: 1.75em;
}

.post-detail .article-body-row .text ul {
    list-style: disc;
}

.post-detail .article-body-row .text ol {
    list-style: decimal;
}

.post-detail .article-body-row .text li {
    list-style: inherit;
    line-height: 1.75;
    margin-bottom: 0.4em;
}

/* Nested lists */
.post-detail .article-body-row .text ul ul,
.post-detail .article-body-row .text ol ol,
.post-detail .article-body-row .text ul ol,
.post-detail .article-body-row .text ol ul {
    margin-top: 0.4em;
    margin-bottom: 0;
}

.post-detail .article-body-row .text ul ul   { list-style: circle; }
.post-detail .article-body-row .text ul ul ul { list-style: square; }

/* Definition lists */
.post-detail .article-body-row .text dl { margin: 0 0 1.4em; }
.post-detail .article-body-row .text dt {
    font-family: AvenirNext-DemiBold, "Avenir Next", Avenir, sans-serif;
    font-weight: 600;
    margin-bottom: 0.2em;
}
.post-detail .article-body-row .text dd {
    margin-left: 1.5em;
    margin-bottom: 0.75em;
    color: #555;
}

/* ============================================================
   TABLE
   ============================================================ */

.post-detail .article-body-row .text table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 1.75em;
    font-size: 0.9375rem;
    line-height: 1.5;
    overflow-x: auto;
    display: table;         /* ensure it renders as a table */
}

.post-detail .article-body-row .text thead {
    background-color: #4a7339;
    color: #ffffff;
}

.post-detail .article-body-row .text thead th {
    padding: 10px 14px;
    text-align: left;
    font-family: AvenirNext-DemiBold, "Avenir Next", Avenir, sans-serif;
    font-weight: 600;
    border: 1px solid #3a5a2b;
    white-space: nowrap;
}

.post-detail .article-body-row .text tbody tr {
    border-bottom: 1px solid #d9d9d9;
    transition: background-color 0.15s;
}

.post-detail .article-body-row .text tbody tr:nth-child(even) {
    background-color: #f7f6f3;
}

.post-detail .article-body-row .text tbody tr:hover {
    background-color: #edf3ea;
}

.post-detail .article-body-row .text tbody td {
    padding: 9px 14px;
    vertical-align: top;
    border: 1px solid #d9d9d9;
}

.post-detail .article-body-row .text tfoot td,
.post-detail .article-body-row .text tfoot th {
    padding: 9px 14px;
    border: 1px solid #d9d9d9;
    font-family: AvenirNext-DemiBold, "Avenir Next", Avenir, sans-serif;
    font-size: 0.875rem;
    color: #7f7f7f;
}

/* Responsive table wrapper – wraps wide tables on small screens */
.post-detail .article-body-row .text .table-responsive,
.post-detail .article-body-row .text figure.wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.75em;
}

.post-detail .article-body-row .text .table-responsive table,
.post-detail .article-body-row .text figure.wp-block-table table {
    margin-bottom: 0;
}

/* ============================================================
   BLOCKQUOTE
   ============================================================ */

.post-detail .article-body-row .text blockquote {
    position: relative;
    margin: 2em 0;
    padding: 0.5em 2em 0.5em 3.5em;
    border: none;
    background: none;
    font-family: ACaslonPro-Regular, Georgia, "Times New Roman", serif;
    font-size: 1.125rem;
    line-height: 1.6;
    font-style: normal;
    color: #36342f;
}

/* Decorative opening quote mark – mirrors .quote-symbol in the theme */
.post-detail .article-body-row .text blockquote::before {
    content: "\201C";               /* " */
    font-family: ACaslonPro-Italic, Georgia, serif;
    font-size: 7rem;
    line-height: 0;
    position: absolute;
    top: 2.25rem;
    left: 0;
    color: #4a7339;
    opacity: 0.2;
    pointer-events: none;
}

.post-detail .article-body-row .text blockquote p {
    margin-bottom: 0.6em;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.post-detail .article-body-row .text blockquote p:last-of-type {
    margin-bottom: 0;
}

/* Attribution / cite */
.post-detail .article-body-row .text blockquote cite,
.post-detail .article-body-row .text blockquote footer {
    display: block;
    margin-top: 0.75em;
    font-family: AvenirNext-Regular, "Avenir Next", Avenir, sans-serif;
    font-size: 0.875rem;
    font-style: normal;
    color: #a6a6a6;
    letter-spacing: 0.04em;
}

.post-detail .article-body-row .text blockquote cite::before {
    content: "— ";
}

/* Responsive */
@media (max-width: 767px) {
    .post-detail .article-body-row .text blockquote {
        padding: 0.5em 1em 0.5em 2.75em;
    }
    .post-detail .article-body-row .text blockquote::before {
        font-size: 5.5rem;
        top: 1.75rem;
    }
}

/* ============================================================
   CODE & PRE
   ============================================================ */

.post-detail .article-body-row .text code,
.post-detail .article-body-row .text kbd,
.post-detail .article-body-row .text samp {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875em;
    background-color: #f0ede8;
    color: #c0392b;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.post-detail .article-body-row .text pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background-color: #2a2926;
    color: #f7f6f3;
    padding: 1.25em 1.5em;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.75em;
    white-space: pre;
}

.post-detail .article-body-row .text pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: 1em;
}

/* ============================================================
   IMAGES
   ============================================================ */

.post-detail .article-body-row .text img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    margin-bottom: 1em;
}

.post-detail .article-body-row .text figure {
    margin: 1.5em 0;
}

.post-detail .article-body-row .text figcaption,
.post-detail .article-body-row .text .wp-caption-text {
    font-size: 0.8125rem;
    color: #7f7f7f;
    text-align: center;
    margin-top: 0.4em;
    font-style: italic;
}

/* WordPress image alignment helpers */
.post-detail .article-body-row .text .alignleft  { float: left;  margin: 0.25em 1.5em 1em 0; }
.post-detail .article-body-row .text .alignright { float: right; margin: 0.25em 0 1em 1.5em; }
.post-detail .article-body-row .text .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.post-detail .article-body-row .text .alignnone  { margin: 0.25em 1.5em 1em 0; }

/* ============================================================
   HORIZONTAL RULE
   ============================================================ */

.post-detail .article-body-row .text hr {
    border: none;
    border-top: 1px solid #d9d9d9;
    margin: 2em 0;
}

/* ============================================================
   MISC INLINE ELEMENTS
   ============================================================ */

.post-detail .article-body-row .text strong,
.post-detail .article-body-row .text b {
    font-family: AvenirNext-DemiBold, "Avenir Next", Avenir, sans-serif;
    font-weight: 600;
}

.post-detail .article-body-row .text em,
.post-detail .article-body-row .text i {
    font-style: italic;
}

.post-detail .article-body-row .text mark {
    background-color: #fff9c4;
    padding: 0 0.2em;
}

.post-detail .article-body-row .text abbr[title] {
    border-bottom: 1px dotted #7f7f7f;
    cursor: help;
    text-decoration: none;
}

.post-detail .article-body-row .text sub,
.post-detail .article-body-row .text sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
.post-detail .article-body-row .text sup { top: -0.5em; }
.post-detail .article-body-row .text sub { bottom: -0.25em; }

/* ============================================================
   GUTENBERG / BLOCK EDITOR BLOCKS
   ============================================================ */

/* wp:separator */
.post-detail .article-body-row .text .wp-block-separator {
    border: none;
    border-top: 1px solid #d9d9d9;
    margin: 2em auto;
}

/* wp:pullquote */
.post-detail .article-body-row .text .wp-block-pullquote {
    border-top: 4px solid #4a7339;
    border-bottom: 4px solid #4a7339;
    padding: 1.25em 0;
    margin: 1.75em 0;
    text-align: center;
}

.post-detail .article-body-row .text .wp-block-pullquote blockquote {
    border: none;
    background: none;
    padding: 0;
    font-size: 1.25rem;
}

/* wp:cover, wp:group, wp:columns */
.post-detail .article-body-row .text .wp-block-columns {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 1.5em;
    flex-wrap: wrap;
    margin-bottom: 1.75em;
}

.post-detail .article-body-row .text .wp-block-column {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 220px;
    flex: 1 1 220px;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 767px) {
    .post-detail .article-body-row .text h1 { font-size: 1.625rem; }
    .post-detail .article-body-row .text h2 { font-size: 1.375rem; }
    .post-detail .article-body-row .text h3 { font-size: 1.125rem; }
    .post-detail .article-body-row .text h4 { font-size: 1rem; }

    .post-detail .article-body-row .text table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .post-detail .article-body-row .text .alignleft,
    .post-detail .article-body-row .text .alignright {
        float: none;
        margin: 0 0 1em 0;
    }

    .post-detail .article-body-row .text .wp-block-columns {
        flex-direction: column;
    }
}

@media (max-width: 543px) {
    .post-detail .article-body-row .text h1 { font-size: 1.375rem; }
    .post-detail .article-body-row .text h2 { font-size: 1.25rem; }
    .post-detail .article-body-row .text h3 { font-size: 1.125rem; }
}
