/*
 * ObituaryWeb About page — consolidated stylesheet
 * File: app/static/css/about_style.css
 * Brand colours: #384E2D (green) and #D8CF82 (gold)
 *
 * Sections are grouped by page structure:
 * 1. Page foundation and layout
 * 2. Sidebar and Latest Lived Lives
 * 3. Main article and typography
 * 4. Founder portrait, contacts and social profiles
 * 5. Founder message, signature and engagement
 * 6. Founder message sharing panel
 * 7. Accessibility and responsive layouts
 */

/* =========================================================
   1. PAGE FOUNDATION AND LAYOUT
   ========================================================= */

html:has(.about-page),
body:has(.about-page),
.page-body:has(.about-page) {
    background-color: #f5f5ed !important;
    background-image: none !important;
    background-attachment: initial !important;
}

body:has(.about-page) {
    color: #25291f;
}

.about-page,
.about-page * {
    box-sizing: border-box;
}

.about-page {
    --about-green: #384E2D;
    --about-gold: #D8CF82;
    --about-ink: #25291f;
    --about-muted: #62675d;

    width: min(1500px, calc(100% - 64px));
    margin: 18px auto 42px;
    color: var(--about-ink);
    background: transparent;
    font-family: Georgia, "Times New Roman", serif;
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(290px, 0.29fr) minmax(0, 1fr);
    gap: clamp(24px, 2.1vw, 34px);
    align-items: start;
}

/* =========================================================
   2. SIDEBAR AND LATEST LIVED LIVES
   ========================================================= */

.about-sidebar {
    min-width: 0;
    padding: 12px;
    background: #fffefa;
    border: 1px solid #e6e2d4;
    border-radius: 17px;
    box-shadow: 0 3px 12px rgba(38, 48, 30, 0.08);
}

.about-sidebar__heading {
    margin: 0;
    padding: 16px 21px;
    color: #fffefa;
    background: var(--about-green);
    border-radius: 11px 11px 2px 2px;
    font-size: clamp(21px, 1.65vw, 26px);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.about-sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 10px 9px 18px;
}

.about-sidebar__link {
    display: block;
    padding: 10px 15px;
    color: var(--about-ink);
    border-bottom: 1px solid #e9e5da;
    border-left: 5px solid transparent;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    transition: background-color 160ms ease, color 160ms ease;
}

.about-sidebar__link:hover,
.about-sidebar__link:focus-visible {
    color: var(--about-green);
    background: #f7f0d1;
    outline: none;
}

.about-sidebar__link--active {
    color: var(--about-green);
    background: #f4e8b8;
    border-left-color: var(--about-green);
    border-radius: 7px;
    border-bottom-color: transparent;
}

/* Latest Lived Lives list */

.about-sidebar__latest {
    margin: 0 13px 8px;
    padding-top: 15px;
    border-top: 2px solid #c5a92f;
}

.about-sidebar__heading-row {
    margin-bottom: 13px;
}

.about-sidebar__latest-title {
    margin: 0;
    color: var(--about-green);
    font-size: clamp(20px, 1.55vw, 25px);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.about-sidebar__accent {
    display: none;
}

.about-latest-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.about-latest-list__item {
    padding: 12px 2px;
    border-top: 1px solid #e9e5da;
}

.about-latest-list__link {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    color: var(--about-green);
    text-decoration: none;
}

.about-latest-list__link:hover .about-latest-list__title,
.about-latest-list__link:focus-visible .about-latest-list__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-latest-list__image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 0.82;
    object-fit: cover;
    border-radius: 8px;
    background: #e9eadf;
}

.about-latest-list__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.about-latest-list__title {
    color: var(--about-green);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.about-latest-list__date {
    display: block;
    margin-top: 6px;
    color: var(--about-ink);
    font-size: 13px;
    line-height: 1.3;
}

.about-latest-list__date::before {
    content: "▦";
    display: inline-block;
    margin-right: 7px;
    color: var(--about-green);
    font-family: Arial, sans-serif;
}

.about-sidebar__empty {
    margin: 0;
    padding: 10px 2px 14px;
    color: var(--about-muted);
    font-size: 15px;
    line-height: 1.5;
}

.about-sidebar__more-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: calc(100% - 20px);
    margin: 17px auto 5px;
    padding: 9px 14px;
    color: var(--about-green);
    background: transparent;
    border: 1.5px solid var(--about-green);
    border-radius: 28px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.about-sidebar__more-link:hover,
.about-sidebar__more-link:focus-visible {
    color: #fffefa;
    background: var(--about-green);
    outline: none;
}

/* =========================================================
   3. MAIN ARTICLE, HEADER AND GENERAL TYPOGRAPHY
   ========================================================= */

.about-article {
    min-width: 0;
    padding: 20px clamp(18px, 2.1vw, 32px) 28px;
    background: #fbfaf3;
    border: 1px solid #ece8d9;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(38, 48, 30, 0.06);
}

.about-article__header {
    margin: 0 0 12px;
}

.about-article__eyebrow {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 5px;
    color: var(--about-green);
    font-size: clamp(14px, 1.2vw, 18px);
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}

.about-article__eyebrow::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--about-gold);
}

.about-article__header h1 {
    margin: 0;
    color: var(--about-green);
    font-size: clamp(32px, 2.8vw, 43px);
    font-weight: 700;
    line-height: 1.1;
    text-align: left;
}

/* Paragraphs are justified; headings remain left-aligned. */

.about-prose p,
.about-founder__message p,
.about-article__section .about-prose p {
    margin: 0 0 13px;
    color: var(--about-ink);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.58;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.about-prose p:last-child {
    margin-bottom: 0;
}

.about-prose h3 {
    margin: 15px 0 5px;
    color: var(--about-green);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
}

.about-prose__story-link {
    color: var(--about-green);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--about-gold);
    text-underline-offset: 3px;
}

.about-article__section {
    margin: 0;
    padding: 15px 2px 18px;
    border-bottom: 2px solid var(--about-gold);
    scroll-margin-top: 24px;
}

.about-article__section h2 {
    margin: 0 0 8px;
    color: var(--about-green);
    font-size: clamp(23px, 1.9vw, 29px);
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.about-article__section .about-prose {
    padding-left: 2px;
}

.about-article__section:last-child {
    border-bottom: 0;
}

/* =========================================================
   4. FOUNDER PORTRAIT, CONTACTS AND SOCIAL PROFILES
   ========================================================= */

/*
 * The portrait floats to the left so the founder's message can
 * flow around it. The figure may also contain contact links.
 */

.about-founder {
    display: block;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--about-gold);
    scroll-margin-top: 24px;
}

.about-founder__portrait {
    float: left;
    width: 268px;
    max-width: 36%;
    min-width: 0;
    margin: 7px 26px 16px 0;
}

.about-founder__portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 4.25;
    object-fit: cover;
    object-position: center 25%;
    border-radius: 8px;
    background: #e8eadf;
}

.about-founder__portrait figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 7px;
}

.about-founder__portrait figcaption strong {
    color: var(--about-green);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.about-founder__portrait figcaption span {
    color: #30352d;
    font-size: 14px;
    font-style: italic;
    line-height: 1.3;
}

/* Founder and official ObituaryWeb social links */

.about-founder__social {
    margin: 18px 0 25px;
    padding: 17px;
    background: #f0f1e8;
    border-radius: 7px;
}

.about-founder__social h3 {
    margin: 0 0 13px;
    color: var(--about-green);
    font-size: 16px;
    font-weight: 700;
}

.about-founder__social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.about-founder__social-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(56, 78, 45, 0.2);
    border-radius: 5px;
    color: var(--about-green);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.about-founder__social-links a i {
    font-size: 15px;
}

.about-founder__social-links a:hover {
    background: var(--about-green);
    color: #fff;
}

.about-founder__official-social {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(56, 78, 45, 0.16);
}

.about-founder__official-social h4 {
    margin: 0 0 11px;
    color: #656957;
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   5. FOUNDER MESSAGE, SIGNATURE AND ENGAGEMENT
   ========================================================= */

.about-founder__message {
    display: block;
}

.about-founder__message p {
    margin-bottom: 19px;
    line-height: 1.85;
    text-align: justify;
}

.about-founder__message a {
    color: var(--about-green);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-founder__message a:hover {
    color: #6b7f42;
}

/* Clear the floated portrait after the founder content. */

.about-founder::after {
    content: "";
    display: block;
    clear: both;
}

/* Handwritten signature and founder identification */

.about-founder__signature-block {
    clear: both;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 30px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(56, 78, 45, 0.18);
}

.about-founder__signature-image {
    width: 220px;
    max-width: 65%;
    margin-bottom: 3px;
}

.about-founder__signature-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.about-founder__signature-details h3 {
    margin: 0;
    color: var(--about-green);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.about-founder__signature-details p {
    margin: 3px 0 0;
    color: #777766;
    font-size: 13px;
    font-weight: 500;
}

/* Founder invitation and Lived Lives link */

.about-founder__engagement {
    margin-top: 25px;
    padding: 22px 24px;
    background: #f0f1e8;
    border-left: 4px solid var(--about-green);
    border-radius: 5px;
}

.about-founder__engagement h3 {
    margin: 0 0 10px;
    color: var(--about-green);
    font-size: 19px;
    font-weight: 700;
}

.about-founder__engagement p {
    margin: 0 0 12px;
    color: #505348;
    font-size: 14px;
    line-height: 1.75;
    text-align: left;
}

.about-founder__lived-lives-link {
    display: inline-block;
    margin-top: 5px;
    padding-bottom: 3px;
    color: var(--about-green);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    border-bottom: 1px solid #b4ad64;
}

.about-founder__lived-lives-link:hover {
    color: #687b3f;
    border-bottom-color: var(--about-green);
}

/* =========================================================
   6. FOUNDER MESSAGE SHARING PANEL
   ========================================================= */

.about-founder__sharing {
    margin-top: 28px;
    padding: 25px;
    background: #f0f1e8;
    border: 1px solid rgba(56, 78, 45, 0.12);
    border-radius: 8px;
}

.about-founder__sharing h3 {
    margin: 0 0 10px;
    color: var(--about-green);
    font-size: 19px;
    font-weight: 700;
}

.about-founder__sharing > p {
    margin: 0 0 19px;
    color: #55594d;
    font-size: 14px;
    line-height: 1.7;
}

.about-founder__share-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-bottom: 22px;
}

.about-founder__share-platforms button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 105px;
    padding: 11px 14px;
    border: 1px solid #d8d8ca;
    border-radius: 6px;
    background: #fff;
    color: var(--about-green);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.about-founder__share-platforms button i {
    font-size: 17px;
}

.about-founder__share-platforms button:hover,
.about-founder__share-platforms button.is-selected {
    color: #fff;
    background: var(--about-green);
    border-color: var(--about-green);
}

.about-founder__share-message {
    margin-bottom: 20px;
}

.about-founder__share-message label {
    display: block;
    margin-bottom: 8px;
    color: var(--about-green);
    font-size: 13px;
    font-weight: 700;
}

.about-founder__share-message textarea {
    display: block;
    width: 100%;
    min-height: 85px;
    padding: 12px;
    border: 1px solid #d8d8ca;
    border-radius: 5px;
    background: #fff;
    color: #45483e;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.about-founder__share-message textarea:focus {
    outline: none;
    border-color: var(--about-green);
    box-shadow: 0 0 0 2px rgba(56, 78, 45, 0.1);
}

.about-founder__share-action {
    padding-top: 16px;
    border-top: 1px solid rgba(56, 78, 45, 0.15);
}

.about-founder__share-action p {
    margin: 0 0 13px;
    color: #777966;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.about-founder__share-action p i {
    margin-right: 6px;
    color: var(--about-green);
}

.about-founder__share-action button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 21px;
    border: none;
    border-radius: 5px;
    background: var(--about-green);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.about-founder__share-action button:hover:not(:disabled) {
    background: #526b3d;
}

.about-founder__share-action button:disabled {
    background: #a8ad9e;
    cursor: not-allowed;
    opacity: 0.8;
}

.about-founder__share-action small {
    display: block;
    margin-top: 10px;
    color: #626756;
    font-size: 12px;
    line-height: 1.5;
}

/* =========================================================
   7. ACCESSIBILITY AND RESPONSIVE LAYOUTS
   ========================================================= */

.about-page a:focus-visible,
.about-founder__share-platforms button:focus-visible,
.about-founder__share-action button:focus-visible {
    outline: 3px solid #b5a94f;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .about-page *,
    .about-page *::before,
    .about-page *::after {
        transition-duration: 0.01ms !important;
    }
}

/* Tablet */

@media (max-width: 980px) {
    .about-page {
        width: min(100% - 36px, 820px);
        margin-top: 16px;
    }

    .about-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .about-sidebar__nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px 10px;
    }

    .about-latest-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
    }

    .about-founder__portrait {
        width: 230px;
        max-width: 38%;
        margin-right: 20px;
    }

    .about-prose p,
    .about-founder__message p,
    .about-article__section .about-prose p {
        font-size: 16px;
        line-height: 1.55;
    }
}

/* Mobile */

@media (max-width: 600px) {
    .about-page {
        width: calc(100% - 22px);
        margin: 12px auto 25px;
    }

    .about-sidebar {
        padding: 9px;
        border-radius: 13px;
    }

    .about-sidebar__heading {
        padding: 13px 16px;
        font-size: 22px;
    }

    .about-sidebar__nav {
        grid-template-columns: 1fr;
        padding: 8px 5px 12px;
    }

    .about-sidebar__link {
        padding: 9px 12px;
        font-size: 16px;
    }

    .about-sidebar__latest {
        margin: 0 7px 7px;
        padding-top: 12px;
    }

    .about-latest-list {
        grid-template-columns: 1fr;
    }

    .about-latest-list__link {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 12px;
    }

    .about-sidebar__more-link {
        width: 100%;
        font-size: 16px;
    }

    .about-article {
        padding: 15px 14px 20px;
        border-radius: 12px;
    }

    .about-article__header h1 {
        font-size: 35px;
    }

    /* Stack the founder portrait above the message on mobile. */

    .about-founder__portrait {
        float: none;
        width: min(100%, 260px);
        max-width: 100%;
        margin: 3px 0 15px;
    }

    .about-prose p,
    .about-founder__message p,
    .about-article__section .about-prose p {
        font-size: 16px;
        line-height: 1.55;
        text-align: left;
    }

    .about-article__section h2 {
        font-size: 25px;
    }

    .about-founder__social {
        padding: 14px;
    }

    .about-founder__social-links {
        gap: 7px;
    }

    .about-founder__social-links a {
        padding: 8px 9px;
        font-size: 11px;
    }

    .about-founder__message p {
        line-height: 1.75;
        margin-bottom: 16px;
    }

    .about-founder__signature-block {
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .about-founder__signature-image {
        width: 185px;
        max-width: 75%;
    }

    .about-founder__engagement {
        padding: 18px;
    }

    .about-founder__engagement h3 {
        font-size: 17px;
    }

    .about-founder__sharing {
        padding: 18px;
    }

    .about-founder__share-platforms {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .about-founder__share-platforms button {
        min-width: 0;
        padding: 11px 8px;
    }

    .about-founder__share-action button {
        width: 100%;
    }
}
