/* ==========================================================
   HEAVENLY DANCER — CASSIOPEIA CHILD TEMPLATE
   Consolidated stylesheet | December 2026

   Sections:
   1. Theme colors and shared surfaces
   2. Header and navigation
   3. Homepage tribute and video
   4. Lucy's Writings archive
   5. Full letters
   6. Letter Previous / Next navigation
   7. Archive pagination and lavender mist
   8. Responsive adjustments

   Read More wisps intentionally removed.
   ========================================================== */

/* 1. THEME TOKENS AND SHARED SURFACES ---------------------- */
:root {
    --hd-plum: #59205c;
    --hd-plum-light: #a64ba7;
    --hd-text: #39323d;
    --hd-muted: #766b78;
    --hd-border: #eee1ee;
    --hd-card-gradient: linear-gradient(
        145deg, #ffffff 0%, #fdf9fd 42%, #f7eef9 100%
    );
}

/* 2. HEADER AND NAVIGATION -------------------------------- */
.container-header {
    background: #fff;
    background-image: none;
    box-shadow: none;
}

.container-header .grid-child:has(.navbar-brand) {
    display: flex;
    justify-content: center;
}

.container-header .navbar-brand {
    display: block;
    margin: 0;
    padding: 12px 0;
}

.container-header .navbar-brand img {
    display: block;
    width: min(640px, 90vw);
    max-width: 100%;
    height: auto;
}

.container-header .container-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #eee5ee;
    border-bottom: 1px solid #eee5ee;
    padding: 6px 0;
}

/* Explicit horizontal layout fixes the stacked desktop links. */
.container-header .container-nav .mod-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 24px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.container-header .mod-menu > li {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.container-header .mod-menu > li > a,
.container-header .mod-menu .nav-link {
    color: var(--hd-plum) !important;
}

.container-header .mod-menu > li > a:hover,
.container-header .mod-menu .nav-link:hover {
    color: var(--hd-plum-light) !important;
}

.container-header .navbar-toggler {
    color: var(--hd-plum);
    border-color: var(--hd-plum);
}

/* 3. HOMEPAGE TRIBUTE AND VIDEO --------------------------- */
.hd-tribute {
    max-width: 850px;
    margin: 45px auto 65px;
    padding: clamp(28px, 5vw, 55px);
    background: var(--hd-card-gradient);
    border: 1px solid var(--hd-border);
    border-radius: 14px;
    color: var(--hd-text);
    font-size: 1.08rem;
    line-height: 1.85;
}

.hd-tribute h1 {
    color: var(--hd-plum);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    margin: 0 0 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid #dfc6e0;
}

.hd-tribute p {
    margin: 0 0 22px;
}

.hd-tribute p:last-child {
    margin: 30px 0 0;
    text-align: right;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #733777;
}

.hd-video {
    width: min(850px, 100%);
    margin: 0 auto 65px;
    padding: 0;
}

.hd-video iframe,
.hd-video video {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(65, 25, 70, .12);
}

/* 4. LUCY'S WRITINGS — ARCHIVE ---------------------------- */
.com-content-category-blog {
    max-width: 900px;
    margin: 45px auto 70px;
    padding: 0 20px;
}

.com-content-category-blog .blog-items {
    row-gap: 28px;
}

.com-content-category-blog .blog-item {
    padding: clamp(25px, 4vw, 45px);
    background: var(--hd-card-gradient);
    border: 1px solid var(--hd-border);
    border-radius: 14px;
    color: var(--hd-text);
    line-height: 1.8;
}

.com-content-category-blog .blog-item h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 12px;
}

.com-content-category-blog .blog-item h2 a,
.com-content-category-blog .blog-item h2 a:visited {
    color: var(--hd-plum);
    text-decoration: none;
}

.com-content-category-blog .blog-item h2 a:hover {
    color: var(--hd-plum-light);
}

.com-content-category-blog .article-info {
    color: var(--hd-muted);
    font-size: .9rem;
    margin-bottom: 24px;
}

.com-content-category-blog .blog-item p {
    line-height: 1.85;
}

/* Read More buttons: clean purple, WITHOUT decorative wisps. */
.com-content-category-blog .readmore a {
    display: inline-block;
    background: var(--hd-plum);
    border: 1px solid var(--hd-plum);
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease;
}

.com-content-category-blog .readmore a:hover {
    background: #814086;
    border-color: #814086;
    color: #fff;
}

.com-content-category-blog .readmore a:focus-visible {
    outline: 3px solid #ac77b9;
    outline-offset: 3px;
}

/* 5. FULL LETTERS ----------------------------------------- */
/* Exclude the Home article, which has its own .hd-tribute. */
.com-content-article:not(:has(.hd-tribute)) {
    max-width: 900px;
    margin: 45px auto 70px;
    padding: clamp(28px, 5vw, 50px);
    background: var(--hd-card-gradient);
    border: 1px solid var(--hd-border);
    border-radius: 14px;
    color: var(--hd-text);
}

.com-content-article:not(:has(.hd-tribute)) .page-header h1,
.com-content-article:not(:has(.hd-tribute)) .page-header h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 400;
    line-height: 1.3;
    color: var(--hd-plum);
    margin-bottom: 15px;
    text-align: center;
}

.com-content-article:not(:has(.hd-tribute)) .article-info {
    font-size: .9rem;
    color: var(--hd-muted);
    margin-bottom: 30px;
    text-align: center;
}

.com-content-article:not(:has(.hd-tribute)) .com-content-article__body {
    font-size: 1.08rem;
    line-height: 1.85;
}

.com-content-article:not(:has(.hd-tribute)) .com-content-article__body p {
    margin-bottom: 14px;
}

/* 6. FULL-LETTER PREVIOUS / NEXT BUTTONS ------------------ */
.com-content-article:not(:has(.hd-tribute)) .pagenavigation {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid #e9d9ec;
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid #d9b9e0;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffaff 0%, #ead7ef 100%);
    color: var(--hd-plum);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(89, 32, 92, .08);
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation a.btn:hover {
    background: linear-gradient(135deg, #f3e6f7 0%, #dfbee8 100%);
    border-color: #bd8ac8;
    color: var(--hd-plum);
    box-shadow: 0 5px 15px rgba(89, 32, 92, .14);
    transform: translateY(-2px);
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation a.btn:focus-visible {
    outline: 3px solid #ac77b9;
    outline-offset: 3px;
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation a.previous {
    margin-right: auto;
}

.com-content-article:not(:has(.hd-tribute)) .pagenavigation a.next {
    margin-left: auto;
}

/* 7. ARCHIVE PAGINATION AND SOFT LAVENDER MIST ------------ */
.com-content-category-blog ul.pagination {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    margin: 28px 0 12px;
    padding: 14px 18px;
}

.com-content-category-blog .pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 43px;
    min-height: 43px;
    padding: 9px 13px;
    margin: 0;
    border: 1px solid #dfc6e4;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #fffaff 0%, #ead7ef 100%);
    color: var(--hd-plum);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(89, 32, 92, .06);
}

.com-content-category-blog .pagination .page-link:hover {
    background: linear-gradient(135deg, #f3e6f7 0%, #dfbee8 100%);
    border-color: #bd8ac8;
    color: var(--hd-plum);
}

.com-content-category-blog .pagination .page-item.active .page-link,
.com-content-category-blog .pagination .page-link.active {
    background: linear-gradient(135deg, #783b80 0%, #59205c 100%);
    border-color: var(--hd-plum);
    color: #fff;
    box-shadow: 0 3px 10px rgba(89, 32, 92, .16);
}

.com-content-category-blog .pagination .page-item.disabled .page-link {
    background: #f6f2f6;
    border-color: #eee5ee;
    color: #a49aa6;
    box-shadow: none;
}

.com-content-category-blog .pagination .page-link:focus-visible {
    outline: 3px solid #ac77b9;
    outline-offset: 2px;
}

/* Mist only behind the archive page-number controls. */
.com-content-category-blog ul.pagination::before {
    content: "";
    position: absolute;
    inset: 0 -18px;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse 35% 70% at 18% 55%,
            rgba(205, 163, 222, .28), transparent 85%
        ),
        radial-gradient(
            ellipse 45% 85% at 52% 35%,
            rgba(231, 205, 241, .55), transparent 85%
        ),
        radial-gradient(
            ellipse 35% 65% at 85% 60%,
            rgba(193, 149, 215, .22), transparent 85%
        );
    filter: blur(9px);
    border-radius: 50%;
}

/* 8. RESPONSIVE ADJUSTMENTS ------------------------------- */
@media (max-width: 767px) {
    .container-header .container-nav {
        padding: 10px 15px;
    }

    .container-header .mod-menu > li > a {
        padding: 6px 0;
    }
}

@media (max-width: 600px) {
    .hd-tribute {
        margin: 20px 12px 40px;
        padding: 25px 20px;
        font-size: 1rem;
        line-height: 1.75;
    }

    .hd-video {
        margin-bottom: 35px;
    }

    .com-content-category-blog {
        margin: 25px auto 45px;
        padding: 0 12px;
    }

    .com-content-category-blog .blog-item {
        padding: 25px 20px;
    }

    .com-content-article:not(:has(.hd-tribute)) {
        margin: 25px 12px 45px;
        padding: 25px 20px;
    }

    .com-content-article:not(:has(.hd-tribute)) .com-content-article__body {
        font-size: 1rem;
        line-height: 1.75;
    }
}

@media (prefers-reduced-motion: reduce) {
    .com-content-article:not(:has(.hd-tribute)) .pagenavigation a.btn,
    .com-content-category-blog .readmore a {
        transition: none;
    }

    .com-content-article:not(:has(.hd-tribute)) .pagenavigation a.btn:hover {
        transform: none;
    }
}

/* HEAVENLY DANCER — FOOTER */

.container-footer {
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #fcf8fd 45%,
        #f2e6f6 100%
    );
    background-image: linear-gradient(
        180deg,
        #ffffff 0%,
        #fcf8fd 45%,
        #f2e6f6 100%
    );
    border-top: 1px solid #eee1ee;
    box-shadow: none;
    color: #59205c;
}

.container-footer .grid-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 26px 16px;
    text-align: center;
}

.container-footer a {
    color: #59205c;
}

.container-footer img {
    display: block;
    max-width: 125px;
    height: auto;
}

.container-footer .mod-footer {
    font-size: .9rem;
    text-align: center;
}

/* HEAVENLY DANCER — WEBSITE CREDIT */

.container-footer .hd-credit-rule {
    width: 120px;
    margin: 6px auto 14px;
    border: 0;
    border-top: 1px solid #d9b9e0;
    opacity: 1;
}

.container-footer .hd-credit-label {
    margin: 0 0 8px;
    color: #777078;
    font-size: .78rem;
    letter-spacing: .04em;
}

/* =========================================
   HEAVENLY DANCER — RECENT WRITINGS
   ========================================= */

.hd-recent {
    max-width: 980px;
    margin: 30px auto 65px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

/* Module heading */
.hd-recent .card-header,
.hd-recent .module-title {
    background: transparent;
    border: 0;
    color: #59205c;
    font: 400 clamp(1.7rem, 3vw, 2.2rem) Georgia, serif;
    text-align: center;
    padding: 10px 0 22px;
}

.hd-recent .card-body {
    padding: 0;
}

/* Three cards */
.hd-recent .mod-articles-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hd-recent .mod-articles-items > li {
    display: flex;
    min-width: 0;
}

.hd-recent .mod-articles-item {
    display: flex;
    width: 100%;
    padding: 26px 23px;
    border: 1px solid #eee1ee;
    border-radius: 14px;
    background: linear-gradient(
        145deg,
        #fff 0%,
        #fdf9fd 42%,
        #f7eef9 100%
    );
    color: #39323d;
}

.hd-recent .mod-articles-item-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

/* Titles */
.hd-recent .mod-articles-title {
    font: 400 1.4rem/1.3 Georgia, serif;
    margin: 0 0 15px;
}

.hd-recent .mod-articles-title a {
    color: #59205c;
    text-decoration: none;
}

.hd-recent .mod-articles-title a:hover {
    color: #a64ba7;
}

/* Dates */
.hd-recent .mod-articles-date {
    color: #766b78;
    font-size: .85rem;
    margin-bottom: 18px;
}

/* Preview text */
.hd-recent .mod-articles-item p {
    font-size: .96rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

/* Read Letter buttons */
.hd-recent .readmore {
    margin-top: auto;
    padding-top: 16px;
}

.hd-recent .readmore a {
    display: inline-block;
    padding: 10px 17px;
    border-radius: 8px;
    background: #59205c;
    border: 1px solid #59205c;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
}

.hd-recent .readmore a:hover {
    background: #814086;
    color: #fff;
}

/* Responsive layout */
@media (max-width: 850px) {
    .hd-recent .mod-articles-items {
        grid-template-columns: 1fr;
    }

    .hd-recent {
        margin: 25px 16px 45px;
    }
}

/* Heavenly Dancer — View All Writings */

.hd-view-all {
    text-align: center;
    margin: -30px auto 55px;
}

.hd-view-all a {
    display: inline-block;
    color: #59205c;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #d9b9e0;
    padding: 8px 4px;
}

.hd-view-all a:hover {
    color: #a64ba7;
    border-color: currentColor;
}

/* HEAVENLY DANCER — BACK TO TOP */

.back-to-top-link {
    background: linear-gradient(135deg, #fffaff, #ead7ef);
    border: 1px solid #d9b9e0;
    border-radius: 10px;
    color: #59205c;
    box-shadow: 0 3px 12px rgba(89, 32, 92, .12);
}

.back-to-top-link:hover {
    background: linear-gradient(135deg, #f3e6f7, #dfbee8);
    border-color: #bd8ac8;
    color: #59205c;
}

.back-to-top-link:focus-visible {
    outline: 3px solid #ac77b9;
    outline-offset: 3px;
}

/* HEAVENLY DANCER — RETURN TO WRITINGS */

.hd-back-writings {
    display: none;
}

body.view-article .hd-back-writings {
    display: block;
    max-width: 900px;
    margin: -25px auto 55px;
    text-align: center;
}

.hd-back-writings a {
    display: inline-block;
    padding: 8px 4px;
    color: #59205c;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #d9b9e0;
}

.hd-back-writings a:hover {
    color: #a64ba7;
    border-color: currentColor;
}

.hd-back-writings a:focus-visible {
    outline: 3px solid #ac77b9;
    outline-offset: 3px;
}


/* HEAVENLY DANCER — MOBILE PAGINATION */

@media (max-width: 767px) {

    .com-content-category-blog__navigation {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .com-content-category-blog__pagination {
        order: 1;
        display: flex;
        justify-content: center;
        width: 100%;
        float: none;
    }

    .com-content-category-blog__pagination nav {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .com-content-category-blog ul.pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: fit-content;
        max-width: 100%;
        margin: 12px auto 8px;
    }

    .com-content-category-blog__counter {
        order: 2;
        float: none !important;
        width: 100%;
        text-align: center;
        margin: 0 0 15px;
        padding: 0 !important;
        color: #766b78;
        font-size: .9rem;
    }
}

/* Fix Joomla pagination alignment on mobile */
@media (max-width: 767px) {
    .com-content-category-blog ul.pagination {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}
