/* The Henhouse Post - public site styles. */

/* Default colours and corner radius */
.hhp-issue, .hhp-archive {
    --hhp-buttonBg: var(--accent);
    --hhp-buttonText: #fff;
    --hhp-buttonHoverBg: var(--base-3);
    --hhp-buttonHoverText: var(--contrast);
    --hhp-buttonPadding: 1rem 2rem;
    --hhp-radius: 25px;
}

/* Shared block sizing and spacing */
.hhp-block {
    box-sizing: border-box;
    margin: 0 0 var(--hhp-spaceAfter,0px);
    min-width: 0;
}

.hhp-section {
    background: #fff;
    border-radius: var(--hhp-radius,25px);
    padding: var(--hhp-padding,60px);
    margin-bottom: var(--hhp-spaceAfter,100px);
    scroll-margin-top: 30px;
}

/* Match the slightly wider GenerateBlocks containers used around the issue. */
@media(min-width:1025px) {
    .hhp-issue > .hhp-section {
        width: calc(100% + 80px);
        margin-left: -40px;
        margin-right: -40px;
    }
}

.hhp-section-heading {
    text-align: center;
    margin-bottom: 60px;
}

.hhp-section-heading>.hhp-image {
    max-width: 240px;
    margin: 0 auto 30px;
    display: block;
}

.hhp-section-heading h2 {
    margin: 0;
}

.hhp-section-body {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: var(--hhp-gap,60px);
}

.hhp-section-body>* {
    grid-column: 1/-1;
}

.hhp-section-body>.hhp-layout-half, .hhp-section-body>.hhp-event {
    grid-column: span 3;
}

/* Articles with a photo beside the text */
.hhp-article.hhp-layout-left, .hhp-article.hhp-layout-right {
    display: grid;
    grid-template-columns: var(--hhp-imageWidth,40%) minmax(0,1fr);
    gap: 30px;
    align-items: start;
}

.hhp-article.hhp-layout-right {
    grid-template-columns: minmax(0,1fr) var(--hhp-imageWidth,40%);
}

.hhp-layout-right>.hhp-lead-photo {
    grid-column: 2;
    grid-row: 1;
}

.hhp-layout-right>.hhp-article-body {
    grid-column: 1;
    grid-row: 1;
}

/* Images and lead photos */
.hhp-image, .hhp-block .wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: var(--hhp-radius,25px);
    display: block;
}

.hhp-lead-photo {
    margin: 0;
}

.hhp-article.hhp-layout-full>.hhp-lead-photo, .hhp-article.hhp-layout-half>.hhp-lead-photo {
    margin-bottom: 30px;
}

/* Headings and card text spacing */
.hhp-block h2, .hhp-block h3 {
    margin-top: 0;
}

.hhp-block h2+p, .hhp-block h3+p, .hhp-article-body>h3+.block-editor-inner-blocks, .hhp-article-body>h3+p {
    margin-top: 30px;
}

.hhp-block h2+h3 {
    margin-top: 0;
}

.hhp-card-info {
    padding-top: 30px;
}

/* Bachelor and event card titles. */
.hhp-card-info h3 {
    margin-bottom: 20px;
    font-family: 'Advercase Demo';
    font-size: 20px;
    text-transform: uppercase;
}

.hhp-detail {
    margin: 0 0 10px;
}

.hhp-description {
    margin: 20px 0;
}

.hhp-button {
    display: inline-block;
    background: var(--hhp-buttonBg,var(--accent));
    color: var(--hhp-buttonText,#fff);
    border: 0;
    border-radius: var(--hhp-radius,25px);
    padding: var(--hhp-buttonPadding,1rem 2rem);
    text-decoration: none;
    line-height: 1.4;
    margin-top: 20px;
    transition: background-color .15s,color .15s;
}

.hhp-button:hover {
    background: var(--hhp-buttonHoverBg,var(--base-3));
    color: var(--hhp-buttonHoverText,var(--contrast));
    text-decoration: none;
}

.hhp-button:focus, .hhp-button:active {
    background: var(--hhp-buttonBg,var(--accent));
    color: var(--hhp-buttonText,#fff);
}

.hhp-button:focus-visible {
    background: var(--hhp-buttonBg,var(--accent));
    color: var(--hhp-buttonText,#fff);
    outline: 2px solid var(--contrast);
    outline-offset: 3px;
}

.hhp-question {
    font-weight: bold;
    color: var(--hhp-questionColor,var(--contrast-2));
    margin-bottom: 30px;
}

.hhp-credit, figcaption {
    margin-top: 15px;
}

.hhp-answer> :first-child {
    margin-top: 0;
}

.hhp-issue-header {
    margin-bottom: 100px;
    text-align: center;
}

.hhp-issue-header nav {
    margin-top: 30px;
}

.hhp-issue-header nav h2 {
    margin-bottom: 30px;
}

.hhp-issue-header ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* The page-level subscribe banner supplies the spacing after the final column. */
.hhp-issue > .hhp-section:last-of-type {
    margin-bottom: 0;
}

.hhp-issue-navigation {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    margin: 30px 0 60px;
}

.hhp-archive {
    padding: 60px 20px;
    max-width: 1120px;
    margin: auto;
}

.hhp-archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 100px;
}
.hhp-archive-toolbar h1 {
    margin: 0;
    text-align: left;
}

.hhp-archive-grid {
    padding-top: 100px;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 40px;
}

.hhp-newspaper {
    background: #fff;
    padding: 30px;
    border: 1px solid #ddd;
    box-shadow: 4px 5px 0 rgba(0,0,0,.07);
    border-radius: 25px;
    min-width: 0;
    text-align: center;
}

.hhp-mini-masthead {
    font-family: 'Advercase Demo',serif;
    text-align: center;
    border-bottom: 2px solid var(--contrast);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.hhp-mini-masthead-logo img {
    display: block;
    width: min(100%, 430px);
    height: auto;
    margin: 0 auto;
}

.hhp-newspaper h2 {
    margin-bottom: 30px;
}

.hhp-newspaper .hhp-image {
    margin: 0 auto 30px;
}

.hhp-newspaper p {
    text-align: center;
}

.hhp-pagination {
    margin-top: 40px;
}

.hhp-pagination .page-numbers {
    margin-right: 15px;
}

/* Tablet spacing overrides */
@media(max-width:1024px) {
    .hhp-section {
        padding: var(--hhp-paddingTablet,60px);
    }

    .hhp-section-body {
        gap: var(--hhp-gapTablet,60px);
    }

    .hhp-block {
        margin-bottom: var(--hhp-spaceAfterTablet,0px);
    }

    .hhp-section {
        margin-bottom: var(--hhp-spaceAfterTablet,100px);
    }

}

/* Mobile layouts and spacing */
@media(max-width:767px) {
    .hhp-section {
        padding: var(--hhp-paddingTablet,60px) var(--hhp-paddingMobile,20px);
    }

    .hhp-section-body {
        grid-template-columns: 1fr;
        gap: var(--hhp-gapMobile,30px);
    }

    .hhp-section-body>* {
        grid-column: 1!important;
    }

    .hhp-article.hhp-layout-left, .hhp-article.hhp-layout-right {
        display: flex;
        flex-direction: column;
    }

    .hhp-lead-photo {
        width: 100%;
        margin-bottom: 30px;
    }

    .hhp-block {
        margin-bottom: var(--hhp-spaceAfterMobile,0px);
    }

    .hhp-section {
        margin-bottom: var(--hhp-spaceAfterMobile,100px);
    }

    .hhp-archive > h1 {
    text-align: center;
}

.hhp-archive-grid {
        grid-template-columns: 1fr;
    }

}

/* Unmatched half-width article */
.hhp-section-body>.hhp-article.hhp-layout-half:last-child:nth-child(odd) {
    grid-column: 1/-1;
}

/* Article subheadings and image spacing */
.hhp-section-body>.hhp-article> .hhp-article-body>h3+h3 {
    margin-top: 0;
}

.hhp-section-body>.hhp-article>.hhp-article-body>h3+.wp-block-image {
    margin-top: 30px;
}

/* Section subheadings: no gap above, 60px padding below */
.hhp-section-heading .hhp-section-description {
    margin: 0;
    padding: 0 0 60px;
}

.hhp-section-heading:has(.hhp-section-description) {
    margin-bottom: 0;
}

.hhp-section-body>.hhp-bachelor {
    grid-column: span 2;
}

:is(.hhp-bachelor, .hhp-event) {
    border: 1px solid var(--contrast-2,#ddd);
    border-radius: var(--hhp-radius,25px);
    overflow: hidden;
    text-align: center;
}

:is(.hhp-bachelor, .hhp-event)>.hhp-card-info {
    padding: 30px 20px;
    text-align: center;
}

/* Bachelor cards: two columns on tablet */
@media(min-width:768px) and (max-width:1024px) {
    .hhp-section-body>.hhp-bachelor {
        grid-column: span 3;
    }

}

:is(.hhp-bachelor, .hhp-event)>.hhp-image {
    border-radius: var(--hhp-radius,25px) var(--hhp-radius,25px) 0 0;
}

:is(.hhp-bachelor, .hhp-event) {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

:is(.hhp-bachelor, .hhp-event)>.hhp-image {
    flex-shrink: 0;
}

:is(.hhp-bachelor, .hhp-event)>.hhp-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.hhp-bachelor .hhp-card-info>.hhp-detail:last-of-type {
    margin-bottom: 30px;
}

:is(.hhp-bachelor, .hhp-event) .hhp-card-info>.hhp-button {
    margin-top: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* Bachelor breed: no extra gap below the name. */
:is(.hhp-bachelor, .hhp-event) .hhp-card-info > h3 + .hhp-detail {
    margin-top: 0;
}

/* Column alignment: body text follows the selected column or block alignment.
   Individual WordPress text-alignment choices take precedence. */
.hhp-section-body p:not(.has-text-align-left):not(.has-text-align-center):not(.has-text-align-right),
.hhp-section-body h2:not(.has-text-align-left):not(.has-text-align-center):not(.has-text-align-right),
.hhp-section-body h3:not(.has-text-align-left):not(.has-text-align-center):not(.has-text-align-right) {
    text-align: inherit;
}

/* Henquiries: make the reader's question stand out above the answer. */
.hhp-question {
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.4;
}

/* Event location: remove its bottom spacing. */
.hhp-event .hhp-card-info > .hhp-detail:last-of-type {
    margin-bottom: 0;
}

/* Newspaper-style issue archive cards */
.hhp-archive-issue-line {
    font-family: 'Advercase Demo', serif;
    text-transform: uppercase;
    text-align: center;
    padding-bottom: 14px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--contrast);
    font-size: 20px;
}

.hhp-newspaper .hhp-archive-headline {
    font-family: 'Advercase Demo', serif;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 22px;
    padding: 22px 0;
    border-bottom: 1px solid var(--contrast);
}

.hhp-archive-story {
    display: flow-root;
    text-align: left;
    margin-bottom: 30px;
}

.hhp-newspaper .hhp-archive-story p {
    text-align: left;
    margin: 0;
}

.hhp-archive-illustration {
    float: left;
    width: 200px;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    margin: 0 18px 10px 0;
}

@media(max-width:480px) {
    .hhp-archive-illustration {
        width: 130px;
        max-height: 150px;
        margin-right: 14px;
    }
}


/* Search the Henhouse Post issue archive */
.hhp-archive-search{width:min(560px,55%);margin:0 0 0 auto;text-align:right;transform:translateX(100px)}
.hhp-search-row{display:flex;align-items:stretch;justify-content:flex-end;gap:10px}
.hhp-search-row input[type="search"]{flex:1;min-width:240px;padding:13px 18px;border:1px solid #d8d5cf;border-radius:25px;background:#fff;color:inherit;font:inherit;box-sizing:border-box}
.hhp-search-row input[type="search"]:focus{outline:2px solid var(--contrast);outline-offset:2px}
.hhp-search-row button{padding:13px 24px;border:0;border-radius:25px;background:var(--contrast-3);color:#fff;font:inherit;cursor:pointer}
.hhp-search-row button:hover{background:var(--contrast)}
.hhp-search-row button:focus{outline:none}
.hhp-search-row button:focus-visible{outline:2px solid var(--contrast);outline-offset:2px}
.hhp-search-clear{margin-top:10px;font-size:.9em}
.hhp-search-clear a{text-decoration:underline}
.hhp-search-none{text-align:center;margin:40px auto 0}
@media(max-width:700px){
 .hhp-archive-toolbar{display:block;margin-bottom:0}
 .hhp-archive-toolbar h1{margin-bottom:30px;text-align:center}
 .hhp-archive-search{width:100%;text-align:left;transform:none}
}
@media(max-width:600px){
 .hhp-search-row{display:block}
 .hhp-search-row input[type="search"],.hhp-search-row button{width:100%;min-width:0}
 .hhp-search-row button{margin-top:10px}
}


/* Homepage: newest published issue. Outer box/heading are supplied by the page builder. */
.hhp-latest-issue {
    --hhp-buttonBg: var(--accent);
    --hhp-buttonText: #fff;
    --hhp-buttonHoverBg: var(--base-3);
    --hhp-buttonHoverText: var(--contrast);
    --hhp-buttonPadding: 1rem 2rem;
    --hhp-radius: 25px;
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 60px;
    align-items: center;
}

.hhp-latest-visual {
    min-width: 0;
}

.hhp-latest-illustration {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    margin: 0 auto;
}

.hhp-latest-copy {
    min-width: 0;
}

.hhp-latest-issue-number {
    font-family: 'Advercase Demo', serif;
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hhp-latest-month {
    font-family: 'Advercase Demo', serif;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.05;
    text-transform: uppercase;
    margin: 0 0 30px;
}

.hhp-latest-excerpt {
    margin: 0 0 10px;
}

.hhp-latest-read {
    margin-right: 20px;
}

.hhp-latest-browse {
    display: inline-block;
    margin-top: 20px;
}

@media(max-width:700px) {
    .hhp-latest-issue {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hhp-latest-illustration {
        max-height: 380px;
    }
}

@media(max-width:480px) {
    .hhp-latest-read,
    .hhp-latest-browse {
        display: block;
        width: fit-content;
    }

    .hhp-latest-read {
        margin-right: 0;
    }
}

/* Compact published-issue counter for [henhouse_issue_count] */
.hhp-issue-counter {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    min-width: 174px;
    max-width: 100%;
    margin: 22px auto 0;
    padding: 17px 24px 15px;
    border: 1px solid #8D9656;
    border-radius: 25px;
    background: #F1F0EB;
    color: #262725;
    text-align: center;
}
.hhp-issue-counter-number {
    display: block;
    font-family: 'Advercase Demo', Georgia, serif;
    font-size: 44px;
    line-height: 1;
    font-weight: 400;
}
.hhp-issue-counter-label {
    display: block;
    font-family: 'Cabin', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
