/* ==========================================================================
   Edy London: Single blog post (single-post.php)
   Hero (label, title, intro, date, featured image), post content from the
   editor and the "Related Posts" section.
   The card styles come from blog.css, the breadcrumb list rules from
   services-archive.css.
   Breakpoints: 1024px (tablet), 767px (mobile).
   ========================================================================== */

/* ---------- Hero: two columns (about 50/50) like the original post.
   Left: cream panel with label, title, intro and date.
   Right: featured image filling the full hero height.
   900px and below: text first, image below it. */
.el-post-hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: var(--el-hero-height);
    background: var(--el-cream);
}

.el-post-hero--no-image {
    grid-template-columns: 1fr;
}

.el-post-hero__text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: var(--el-hero-top) clamp(32px, 5vw, 80px) clamp(64px, 8vw, 120px) clamp(20px, 8.5vw, 136px);
}

.el-post-hero__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    line-height: 1.4;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--el-sage);
    transition: color .2s ease;
}

.el-post-hero__label:hover {
    color: var(--el-ink);
}

.el-post-hero__title {
    max-width: 720px;
    margin: 36px 0 48px;
    font-size: clamp(40px, 4.4vw, 68px);
    line-height: 1.08;
    overflow-wrap: break-word;
}

.el-post-hero__intro {
    max-width: 700px;
    margin: 0 0 40px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--el-text);
}

.el-post-hero__date {
    display: block;
    font-size: 14px;
    color: var(--el-ink);
}

.el-post-hero__media {
    position: relative;
    min-height: 100%;
    overflow: hidden;
}

.el-post-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 900px) {
    .el-post-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .el-post-hero__text {
        padding: var(--el-hero-top) var(--el-gutter) clamp(48px, 10vw, 72px);
    }

    .el-post-hero__title {
        margin: 24px 0 28px;
    }

    .el-post-hero__intro {
        margin-bottom: 28px;
        font-size: 16px;
    }

    .el-post-hero__media {
        aspect-ratio: 4 / 5;
        max-height: 640px;
        min-height: 0;
    }
}

/* ---------- Content: centred, readable column with the share links on
   its left (sticky while scrolling). Mobile: share links in a row above. */
.el-post-body__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 760px) minmax(0, 1fr);
    align-items: start;
}

.el-post-body__layout > .el-post-content {
    grid-column: 2;
    width: 100%;
}

.el-post-share {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    position: sticky;
    top: 120px;
    margin-right: clamp(32px, 6vw, 110px);
}

.el-post-share__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.el-post-share__link {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--el-cream);
    color: var(--el-ink);
    transition: background .2s ease, color .2s ease;
}

.el-post-share__link svg {
    fill: currentColor;
}

.el-post-share__link:hover,
.el-post-share__link:focus-visible {
    background: var(--el-sage);
    color: #fff;
}


.el-post-body {
    padding-block: clamp(56px, 7vw, 104px);
}

.el-post-content {
    max-width: 760px;
    margin-inline: auto;
    font-family: var(--el-sans);
    font-size: 17px;
    line-height: 1.75;
    color: var(--el-text);
    overflow-wrap: break-word;
}

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

.el-post-content > *:last-child {
    margin-bottom: 0;
}

.el-post-content p {
    margin: 0 0 1.25em;
}

.el-post-content h2,
.el-post-content h3,
.el-post-content h4 {
    font-family: var(--el-serif);
    font-weight: 400;
    color: var(--el-ink);
}

.el-post-content h2 {
    margin: 1.6em 0 .6em;
    font-size: clamp(30px, 3.2vw, 40px);
    line-height: 1.12;
}

.el-post-content h3 {
    margin: 1.5em 0 .5em;
    font-size: clamp(24px, 2.4vw, 30px);
    line-height: 1.2;
}

.el-post-content h4 {
    margin: 1.4em 0 .5em;
    font-size: clamp(20px, 2vw, 24px);
    line-height: 1.25;
}

.el-post-content strong {
    font-weight: 600;
    color: var(--el-ink);
}

.el-post-content a {
    color: var(--el-ink);
    text-decoration: underline;
    text-decoration-color: var(--el-peach);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: text-decoration-color .2s ease, color .2s ease;
}

.el-post-content a:hover {
    text-decoration-color: var(--el-sage);
}

.el-post-content ul,
.el-post-content ol {
    margin: 0 0 1.25em;
    padding-left: 1.4em;
}

.el-post-content li {
    margin-bottom: .45em;
}

.el-post-content li::marker {
    color: var(--el-sage);
}

.el-post-content hr {
    margin: 2.5em auto;
    border: 0;
    border-top: 1px solid var(--el-line);
    opacity: 1;
}

/* Images and captions (block editor figures and classic captions) */
.el-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--el-radius);
}

.el-post-content figure,
.el-post-content .wp-caption {
    max-width: 100%;
    margin: 2em 0;
}

.el-post-content .wp-block-image img {
    display: block;
}

.el-post-content .aligncenter {
    margin-inline: auto;
    text-align: center;
}

.el-post-content .alignleft {
    float: left;
    max-width: 50%;
    margin: .4em 1.5em 1em 0;
}

.el-post-content .alignright {
    float: right;
    max-width: 50%;
    margin: .4em 0 1em 1.5em;
}

.el-post-content .alignwide,
.el-post-content .alignfull {
    max-width: none;
}

.el-post-content figcaption,
.el-post-content .wp-caption-text,
.el-post-content .wp-element-caption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: var(--el-text);
}

/* Quotes (not the Instagram embeds, which bring their own styles) */
.el-post-content blockquote:not(.instagram-media) {
    margin: 2em 0;
    padding: 4px 0 4px 24px;
    border-left: 2px solid var(--el-peach);
    font-family: var(--el-serif);
    font-size: clamp(22px, 2.2vw, 26px);
    line-height: 1.35;
    color: var(--el-ink);
}

.el-post-content blockquote:not(.instagram-media) p:last-child {
    margin-bottom: 0;
}

.el-post-content blockquote.instagram-media {
    margin: 2em auto !important;
}

/* Embeds (YouTube, etc.) and tables */
.el-post-content iframe,
.el-post-content video {
    max-width: 100%;
}

.el-post-content .wp-block-embed__wrapper {
    position: relative;
}

.el-post-content .wp-has-aspect-ratio .wp-block-embed__wrapper::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.el-post-content .wp-has-aspect-ratio iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.el-post-content table {
    width: 100%;
    margin: 0 0 1.5em;
    border-collapse: collapse;
    font-size: 15px;
}

.el-post-content th,
.el-post-content td {
    padding: 10px 12px;
    border: 1px solid var(--el-line);
    text-align: left;
}

.el-post-content::after {
    content: "";
    display: table;
    clear: both;
}

.el-post-pages {
    margin-top: 2em;
    font-weight: 500;
}

/* ---------- Related Posts: three cards */
.el-post-related__title {
    margin: 0 0 clamp(32px, 4vw, 48px);
    text-align: center;
}

.el-post-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(32px, 4vw, 48px) clamp(20px, 3vw, 40px);
}

/* ---------- Tablet */
@media (max-width: 1024px) {
    .el-post-related__grid .el-blog-card__title {
        font-size: 22px;
    }
}

/* ---------- Mobile: one column, images never float */
@media (max-width: 1024px) {
    .el-post-body__layout {
        grid-template-columns: 1fr;
    }

    .el-post-body__layout > .el-post-content {
        grid-column: 1;
        grid-row: 2;
    }

    .el-post-share {
        position: static;
        justify-self: stretch;
        max-width: 760px;
        width: 100%;
        margin: 0 auto 32px;
    }

    .el-post-share__list {
        flex-direction: row;
    }
}

@media (max-width: 767px) {
    .el-post-content {
        font-size: 16px;
    }

    .el-post-content .alignleft,
    .el-post-content .alignright {
        float: none;
        max-width: 100%;
        margin: 1.5em 0;
    }

    .el-post-related__grid {
        grid-template-columns: 1fr;
    }
}
