/*
 * HealthAffPro Mega Categories Stylesheet
 * Mega dropdown styles + PetPlanetPro-style category archive layout.
 */

.hap-mega-menu {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #d1f7e8 !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: all 0.22s ease;
    z-index: 99999;
}
.menu-item:hover > .hap-mega-menu,
.menu-item.hap-open > .hap-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.hap-mega-inner {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}
.hap-mega-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    margin-bottom: 18px;
}
.hap-mega-head-row span {
    font-size: 15px;
    font-weight: 700;
    border: 2px solid rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    text-transform: uppercase;
}
.hap-mega-all {
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    color: #111;
}
.hap-mega-grid {
    display: grid;
    gap: 8px 16px;
}
.hap-mega-grid.hap-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.hap-mega-grid.hap-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hap-mega-grid.hap-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hap-mega-grid.hap-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hap-mega-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hap-mega-cat {
    font-size: 16px;
    line-height: 1.45;
    color: #111;
    text-decoration: none;
}
.hap-mega-cat:hover {
    color: #005f73;
    text-decoration: underline;
}
.hap-mega-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hap-mega-featured {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.hap-mega-post {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}
.hap-mega-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    background: #ddd;
    border-radius: 4px;
}
.hap-mega-thumb.placeholder { background: #ccc; }
.hap-mega-post-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hap-mega-post-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.hap-mega-post-date {
    font-size: 12px;
    color: #666;
}
.hap-mobile-arrow {
    margin-left: 6px;
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #111;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}
.menu-item.hap-open > a .hap-mobile-arrow {
    transform: rotate(180deg);
}
@media (min-width: 768px) {
    .hap-mobile-arrow { display: none; }
}
@media (max-width: 767px) {
    .hap-mega-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: hidden;
        pointer-events: none;
        display: none;
        margin-top: 4px;
    }
    .menu-item.hap-open > .hap-mega-menu {
        display: block;
        visibility: visible;
        pointer-events: auto;
    }
    .hap-mega-inner {
        grid-template-columns: 1fr;
    }
    .hap-mega-right {
        margin-top: 20px;
    }
    .hap-mobile-arrow {
        border-left-width: 5px;
        border-right-width: 5px;
        border-top-width: 6px;
    }
}

/* =========================================================
   PetPlanetPro Category Archive Layout - v1.3
   ========================================================= */
.hap-category-page,
.hap-category-page * {
    box-sizing: border-box;
}

.hap-category-page {
    width: 100%;
    overflow-x: hidden;
    background: #ffffff;
    color: #111111;
    font-family: inherit;
}

.hap-container {
    width: min(100% - 40px, 1200px);
    margin-left: auto;
    margin-right: auto;
}

.hap-category-hero {
    position: relative;
    isolation: isolate;
    min-height: 420px;
    padding: 0 20px 48px;
    background: transparent;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hap-category-hero-bg {
    position: absolute;
    inset: 0 0 auto 0;
    height: 178px;
    background-image: linear-gradient(180deg, rgba(11, 35, 17, .16), rgba(11, 35, 17, .35)), var(--hap-hero-image);
    background-position: center 42%;
    background-size: cover;
    filter: blur(2.4px);
    transform: scale(1.03);
    z-index: -2;
}

.hap-category-hero::before {
    content: "";
    position: absolute;
    inset: 136px 0 0;
    background: transparent;
    z-index: -1;
}

.hap-category-hero-content {
    position: relative;
    width: min(100%, 980px);
    margin: 0 auto;
    padding-top: 118px;
}

.hap-category-title {
    display: inline-block;
    margin: 0 auto 18px;
    padding: 18px 54px 24px;
    border-radius: 30px 30px 0 0;
    background: transparent;
    color: #ffffff !important;
    font-size: clamp(58px, 7vw, 102px);
    font-weight: 800;
    letter-spacing: .0em;
    line-height: .98;
    text-transform: none;
}

.hap-category-desc {
    max-width: 920px;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, .88);
    font-size: clamp(17px, 1.6vw, 24px);
    line-height: 1.5;
}

.hap-category-desc p {
    margin: 0;
}

.hap-subtopics-nav {
    width: min(100%, 860px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px 18px;
}

.hap-subtopics-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 28px;
    border-radius: 999px;
    background: #f15c2b;
    color: #ffffff !important;
    font-size: clamp(15px, 1.25vw, 20px);
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 7px 16px rgba(0,0,0,.08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.hap-subtopics-nav a:hover {
    background: #e95123;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0,0,0,.12);
}

.hap-category-posts {
    padding: 34px 0 80px;
    background: #ffffff;
}

.hap-featured-article {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(340px, .94fr);
    gap: 34px;
    align-items: center;
    margin: 0 0 46px;
}

.hap-featured-image,
.hap-grid-image,
.hap-more-image {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e7e7e7;
    text-decoration: none;
}

.hap-featured-image {
    border-radius: 10px;
    border: 4px solid #111111;
    aspect-ratio: 2.08 / 1;
}

.hap-featured-image img,
.hap-grid-image img,
.hap-more-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hap-featured-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 170px;
    background: linear-gradient(135deg, #e5e5e5, #cfcfcf);
}

.hap-category-badge {
    position: absolute;
    top: 20px;
    left: 18px;
    min-width: 150px;
    max-width: calc(100% - 36px);
    padding: 8px 20px;
    border-radius: 999px;
    background: #f15c2b;
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

.hap-featured-copy h2,
.hap-grid-card h3,
.hap-more-copy h3 {
    margin: 0;
    color: #111111;
    font-weight: 800;
    letter-spacing: .0em;
    line-height: 1.24;
}

.hap-featured-copy h2 {
    max-width: 620px;
    font-size: clamp(31px, 3.2vw, 48px);
}

.hap-featured-copy h2 a,
.hap-grid-card h3 a,
.hap-more-copy h3 a {
    color: inherit !important;
    text-decoration: none !important;
}

.hap-featured-copy h2 a:hover,
.hap-grid-card h3 a:hover,
.hap-more-copy h3 a:hover {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
}

.hap-featured-copy p,
.hap-grid-card p,
.hap-more-copy p {
    margin: 16px 0 0;
    color: #111111;
    font-size: clamp(18px, 1.7vw, 25px);
    line-height: 1.42;
    letter-spacing: .0em;
}

.hap-archive-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    color: #111111;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: .0em;
}

.hap-archive-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex: 0 0 auto;
}

.hap-archive-author a {
    color: #111111 !important;
    font-weight: 800;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.hap-archive-dot {
    color: rgba(0,0,0,.55);
}

.hap-three-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin: 0 0 54px;
}

.hap-grid-image {
    border-radius: 12px;
    aspect-ratio: 1.82 / 1;
    margin-bottom: 20px;
}

.hap-grid-card h3 {
    font-size: clamp(23px, 2.1vw, 31px);
}

.hap-grid-card p {
    font-size: clamp(17px, 1.35vw, 22px);
}

.hap-grid-card .hap-archive-author {
    margin-top: 24px;
}

.hap-more-archive-title {
    margin: 36px 0 30px;
    color: #111111;
    font-size: clamp(42px, 4.5vw, 64px);
    font-weight: 800;
    line-height: 1;
    text-align: center;
    letter-spacing: .0em;
}

.hap-more-list {
    display: flex;
    flex-direction: column;
}

.hap-more-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 290px;
    gap: 46px;
    align-items: start;
    padding: 30px 0 38px;
    border-bottom: 1px solid rgba(0,0,0,.12);
}

.hap-more-date {
    padding-top: 6px;
    color: #777777;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .0em;
    white-space: nowrap;
}

.hap-more-copy h3 {
    max-width: 720px;
    font-size: clamp(27px, 2.4vw, 39px);
}

.hap-more-copy p {
    max-width: 780px;
    font-size: clamp(18px, 1.55vw, 24px);
}

.hap-more-image {
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 1.72 / 1;
    margin-top: 6px;
}

.hap-category-page .navigation.pagination {
    margin-top: 40px;
    text-align: center;
}

.hap-no-posts {
    font-size: 18px;
    text-align: center;
    margin: 40px 0;
}

@media (max-width: 1100px) {
    .hap-featured-article {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hap-featured-copy h2,
    .hap-featured-copy p {
        max-width: none;
    }

    .hap-more-row {
        grid-template-columns: 105px minmax(0, 1fr) 240px;
        gap: 28px;
    }
}

@media (max-width: 860px) {
    .hap-container {
        width: min(100% - 32px, 1200px);
    }

    .hap-category-hero {
        min-height: auto;
        padding: 0 16px 34px;
    }

    .hap-category-hero-bg {
        height: 150px;
        background-position: center center;
    }

    .hap-category-hero::before {
        inset: 116px 0 0;
    }

    .hap-category-hero-content {
        padding-top: 120px;
    }

    .hap-category-title {
        padding: 14px 28px 18px;
        border-radius: 22px 22px 0 0;
        font-size: clamp(42px, 12vw, 70px);
        letter-spacing: .0em;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hap-category-desc {
        max-width: 680px;
        font-size: 17px;
        line-height: 1.45;
    }

    .hap-subtopics-nav {
        gap: 12px;
    }

    .hap-subtopics-nav a {
        min-height: 38px;
        padding: 9px 18px;
        font-size: 15px;
    }

    .hap-category-posts {
        padding-top: 28px;
    }

    .hap-featured-image {
        aspect-ratio: 1.65 / 1;
    }

    .hap-three-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .hap-more-row {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 28px 0 34px;
    }

    .hap-more-date {
        padding-top: 0;
    }

    .hap-more-image {
        order: -1;
        width: min(100%, 460px);
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .hap-container {
        width: min(100% - 28px, 1200px);
    }

    .hap-category-hero {
        padding: 0 14px 30px;
    }

    .hap-category-hero-bg {
        height: 132px;
    }

    .hap-category-hero::before {
        inset: 100px 0 0;
    }

    .hap-category-hero-content {
        padding-top: 104px;
    }

    .hap-category-title {
        width: auto;
        max-width: 100%;
        padding: 12px 18px 15px;
        border-radius: 18px 18px 0 0;
        font-size: clamp(34px, 13vw, 54px);
        letter-spacing: .0em;
        overflow-wrap: anywhere;
    }

    .hap-category-desc {
        margin-bottom: 22px;
        font-size: 16px;
    }

    .hap-subtopics-nav {
        gap: 10px;
    }

    .hap-subtopics-nav a {
        min-height: 36px;
        padding: 8px 15px;
        font-size: 14px;
    }

    .hap-featured-image {
        border-width: 3px;
        aspect-ratio: 1.35 / 1;
    }

    .hap-category-badge {
        top: 12px;
        left: 12px;
        min-width: 115px;
        font-size: 13px;
        padding: 7px 14px;
    }

    .hap-featured-copy h2,
    .hap-more-copy h3 {
        font-size: clamp(26px, 8vw, 32px);
        letter-spacing: .0em;
    }

    .hap-grid-card h3 {
        font-size: clamp(24px, 7.2vw, 30px);
        letter-spacing: .0em;
    }

    .hap-featured-copy p,
    .hap-grid-card p,
    .hap-more-copy p {
        font-size: 17px;
        letter-spacing: .0em;
    }

    .hap-archive-author {
        flex-wrap: wrap;
        row-gap: 5px;
    }

    .hap-more-archive-title {
        font-size: clamp(36px, 12vw, 46px);
        letter-spacing: .0em;
    }
}

/* =========================================================
   PetPlanetPro Archive Precision Patch - Canva Match v1.4
   Fixes live/theme differences: featured row alignment, title sizing,
   spacing, and responsive behaviour.
   ========================================================= */
.hap-category-page .hap-category-posts{
    padding: 30px 0 82px !important;
}

.hap-category-page .hap-container{
    width: min(100% - 40px, 1200px) !important;
    max-width: 1200px !important;
}

.hap-category-page .hap-featured-article{
    display: grid !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr) !important;
    gap: 34px !important;
    align-items: start !important;
    margin: 0 0 42px !important;
}

.hap-category-page .hap-featured-image{
    align-self: start !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border: 4px solid #111 !important;
    aspect-ratio: 2.08 / 1 !important;
    min-height: 0 !important;
}

.hap-category-page .hap-featured-copy{
    align-self: start !important;
    padding-top: 18px !important;
}

.hap-category-page .hap-featured-copy h2{
    margin: 0 !important;
    max-width: 610px !important;
    font-size: clamp(32px, 2.65vw, 42px) !important;
    line-height: 1.22 !important;
    letter-spacing: .0em !important;
    font-weight: 800 !important;
}

.hap-category-page .hap-featured-copy p{
    max-width: 600px !important;
    margin: 16px 0 0 !important;
    font-size: clamp(18px, 1.48vw, 22px) !important;
    line-height: 1.45 !important;
    letter-spacing: .0em !important;
}

.hap-category-page .hap-archive-author{
    margin-top: 22px !important;
}

.hap-category-page .hap-three-grid{
    margin-top: 0 !important;
}

@media (max-width: 1180px){
    .hap-category-page .hap-featured-article{
        grid-template-columns: minmax(0, 1fr) minmax(330px, .86fr) !important;
        gap: 28px !important;
    }
    .hap-category-page .hap-featured-copy h2{
        font-size: clamp(30px, 3vw, 38px) !important;
        max-width: 560px !important;
    }
}

@media (max-width: 900px){
    .hap-category-page .hap-container{
        width: min(100% - 32px, 1200px) !important;
    }
    .hap-category-page .hap-featured-article{
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        margin-bottom: 42px !important;
    }
    .hap-category-page .hap-featured-copy{
        padding-top: 0 !important;
    }
    .hap-category-page .hap-featured-copy h2{
        max-width: none !important;
        font-size: clamp(30px, 6vw, 42px) !important;
    }
    .hap-category-page .hap-featured-copy p{
        max-width: none !important;
    }
}

@media (max-width: 560px){
    .hap-category-page .hap-container{
        width: min(100% - 28px, 1200px) !important;
    }
    .hap-category-page .hap-category-posts{
        padding-top: 24px !important;
    }
    .hap-category-page .hap-featured-article{
        gap: 18px !important;
        margin-bottom: 36px !important;
    }
    .hap-category-page .hap-featured-image{
        border-width: 3px !important;
        aspect-ratio: 1.45 / 1 !important;
    }
    .hap-category-page .hap-featured-copy h2{
        font-size: clamp(26px, 8vw, 32px) !important;
        letter-spacing: .0em !important;
        line-height: 1.2 !important;
    }
    .hap-category-page .hap-featured-copy p{
        font-size: 16.5px !important;
        line-height: 1.45 !important;
        letter-spacing: .0em !important;
    }
}


/* =========================================================
   PetPlanetPro Archive Patch - v1.5
   Wider hero title green tab + badges on every post image.
   ========================================================= */
.hap-category-page .hap-category-title{
    min-width: min(100%, 640px) !important;
    padding-left: 70px !important;
    padding-right: 70px !important;
}

.hap-category-page .hap-grid-image,
.hap-category-page .hap-more-image{
    position: relative !important;
}

.hap-category-page .hap-grid-image .hap-category-badge,
.hap-category-page .hap-more-image .hap-category-badge{
    top: 14px !important;
    left: 14px !important;
    min-width: 132px !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    z-index: 2 !important;
}

.hap-category-page .hap-more-image .hap-category-badge{
    min-width: 118px !important;
    max-width: calc(100% - 28px) !important;
}

@media (max-width: 860px){
    .hap-category-page .hap-category-title{
        min-width: min(100%, 520px) !important;
        padding-left: 34px !important;
        padding-right: 34px !important;
    }
}

@media (max-width: 560px){
    .hap-category-page .hap-category-title{
        min-width: 0 !important;
        width: min(100%, 390px) !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .hap-category-page .hap-grid-image .hap-category-badge,
    .hap-category-page .hap-more-image .hap-category-badge{
        top: 10px !important;
        left: 10px !important;
        min-width: 105px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}
