\
/* Housetory House Page Override */
.housetory-house-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    color: #332c25;
}

.housetory-house-hero {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.35fr);
    gap: 32px;
    align-items: start;
    margin-bottom: 28px;
}

.housetory-house-copy,
.housetory-house-lead-media,
.housetory-panel,
.housetory-house-stats {
    background: #f8f4ee;
    border: 1px solid #d9cfbf;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(62, 47, 34, 0.05);
}

.housetory-house-copy {
    padding: 32px;
}

.housetory-house-kicker {
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7a6953;
    margin-bottom: 14px;
}

.housetory-house-title-display {
    margin: 0 0 14px;
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 0.98;
    font-family: Georgia, "Times New Roman", serif;
    color: #2f2923;
}

.housetory-house-address {
    font-size: 1.12rem;
    line-height: 1.4;
    margin-bottom: 18px;
    color: #5c5044;
}

.housetory-house-summary {
    font-size: 1.08rem;
    line-height: 1.7;
    margin: 0 0 24px;
    color: #443a31;
}

.housetory-house-meta {
    margin: 0;
    display: grid;
    gap: 12px;
}

.housetory-house-meta div {
    display: grid;
    gap: 2px;
}

.housetory-house-meta dt {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a7760;
}

.housetory-house-meta dd {
    margin: 0;
    font-size: 1rem;
    color: #372f28;
}

.housetory-house-lead-media {
    padding: 14px;
}

.housetory-house-lead-image,
.housetory-photo-single img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 420px;
    max-height: 720px;
    object-fit: cover;
    border-radius: 12px;
}

.housetory-house-lead-placeholder {
    min-height: 420px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #fdfaf6 0%, #f3ebde 100%);
    color: #7d6d59;
    font-style: italic;
}

.housetory-house-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    margin-bottom: 30px;
}

.housetory-stat {
    padding: 22px 18px;
    text-align: center;
    border-right: 1px solid #d9cfbf;
}

.housetory-stat:last-child {
    border-right: 0;
}

.housetory-stat-number {
    display: block;
    font-size: clamp(1.4rem, 3vw, 2.3rem);
    line-height: 1;
    font-family: Georgia, "Times New Roman", serif;
    color: #2f2923;
    margin-bottom: 8px;
}

.housetory-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6d5d4a;
}

.housetory-house-grid-magazine {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 26px;
}

.housetory-panel {
    padding: 26px;
}

.housetory-panel h2 {
    margin: 0 0 18px;
    font-size: 1.7rem;
    font-family: Georgia, "Times New Roman", serif;
    color: #2f2923;
}

.housetory-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.housetory-panel-header h2 {
    margin: 0;
}

.housetory-panel-count {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #e8dfd2;
    color: #4d4339;
    font-size: 0.92rem;
    font-weight: 700;
}

.housetory-prose {
    line-height: 1.75;
    color: #3d342b;
}

.housetory-prose p:first-child {
    margin-top: 0;
}

.housetory-timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 20px;
}

.housetory-timeline-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    align-items: start;
}

.housetory-timeline-date {
    font-size: 0.95rem;
    color: #7b6b59;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.housetory-timeline-body h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.housetory-timeline-body a {
    color: #3a3027;
    text-decoration: none;
}

.housetory-timeline-body a:hover {
    text-decoration: underline;
}

.housetory-timeline-body p {
    margin: 0;
    color: #5a4d40;
    line-height: 1.55;
}

.housetory-memory-cards {
    display: grid;
    gap: 18px;
}

.housetory-memory-card {
    padding: 20px;
    background: #fcfaf6;
    border: 1px solid #e2d8ca;
    border-radius: 14px;
}

.housetory-memory-card blockquote {
    margin: 0 0 14px;
    font-size: 1.06rem;
    line-height: 1.7;
    color: #40362d;
}

.housetory-memory-attribution {
    display: grid;
    gap: 4px;
    color: #6f5d4a;
    font-size: 0.92rem;
}

.housetory-gallery-output,
.housetory-documents-output {
    line-height: 1.6;
}


.housetory-photo-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
}

.housetory-photo-thumb {
    margin: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #d8cebf;
    background: #f4eee5;
    aspect-ratio: 4 / 3;
}

.housetory-photo-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

.housetory-photo-thumb:hover img {
    transform: scale(1.04);
}

.housetory-location-address {
    margin: 0 0 16px;
    color: #54473a;
    font-size: 1rem;
}

.housetory-map-embed {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #d6ccbd;
}

.housetory-map-embed iframe {
    display: block;
    width: 100%;
    min-height: 320px;
    border: 0;
}

.housetory-empty {
    margin: 0;
    color: #7b6c5a;
    font-style: italic;
}

.housetory-house-story {
    grid-column: 1;
}

.housetory-house-timeline {
    grid-column: 2;
}

.housetory-house-memories {
    grid-column: 1;
}

.housetory-house-photos {
    grid-column: 2;
}

.housetory-house-documents {
    grid-column: 1;
}

.housetory-house-location {
    grid-column: 2;
}



.house-placeholder {
    margin: 0;
    color: #8a8278;
    font-style: italic;
}

.housetory-house-footer-note {
    margin-top: 28px;
    padding: 18px 20px;
    text-align: center;
    background: #f5efe5;
    border: 1px solid #d9cfbf;
    border-radius: 14px;
    color: #5c5044;
}

@media (max-width: 1080px) {
    .housetory-house-hero,
    .housetory-house-grid-magazine {
        grid-template-columns: 1fr;
    }

    .housetory-house-story,
    .housetory-house-timeline,
    .housetory-house-memories,
    .housetory-house-photos,
    .housetory-house-documents,
    .housetory-house-location {
        grid-column: auto;
    }

    .housetory-house-lead-image,
    .housetory-photo-single img {
        min-height: 320px;
    }
}

@media (max-width: 760px) {
    .housetory-house-page {
        padding: 22px 14px 40px;
    }

    .housetory-house-copy,
    .housetory-panel {
        padding: 20px;
    }

    .housetory-house-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .housetory-stat:nth-child(2) {
        border-right: 0;
    }

    .housetory-stat:nth-child(-n+2) {
        border-bottom: 1px solid #d9cfbf;
    }

    .housetory-timeline-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ------------------------------------------------------------
   Housetory House Page Enhancements
   Safe additions for the updated house.php override.
   ------------------------------------------------------------ */

.housetory-house-lead-media {
    overflow: hidden;
}

.housetory-house-lead-image {
    height: clamp(420px, 52vw, 720px);
    min-height: 0;
    max-height: none;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.housetory-house-lead-image:hover {
    transform: scale(1.02);
}

.housetory-house-lead-placeholder {
    text-align: center;
    padding: 28px;
}

.housetory-photo-thumb a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.housetory-photo-thumb a:focus-visible,
.housetory-action-button:focus-visible {
    outline: 3px solid #8d6f48;
    outline-offset: 3px;
}

.housetory-photo-thumb figcaption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.housetory-photo-strip {
    align-items: stretch;
}

.housetory-photo-thumb {
    position: relative;
}

.housetory-house-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 0;
}

.housetory-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #5e4732;
    color: #fffaf2;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #4d3a29;
    box-shadow: 0 6px 16px rgba(62, 47, 34, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.housetory-action-button:hover {
    color: #fffaf2;
    background: #4d3a29;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(62, 47, 34, 0.16);
}

.housetory-action-button.is-secondary {
    background: #efe6d8;
    color: #49392a;
    border-color: #d5c7b5;
    box-shadow: none;
}

.housetory-action-button.is-secondary:hover {
    background: #e5d8c7;
    color: #382b20;
}

.housetory-empty {
    padding: 12px 0;
}

@media (max-width: 1080px) {
    .housetory-house-lead-image {
        height: clamp(320px, 58vw, 560px);
    }
}

@media (max-width: 760px) {
    .housetory-house-lead-image {
        height: 320px;
    }

    .housetory-house-actions {
        display: grid;
    }

    .housetory-action-button {
        width: 100%;
    }
}

/* ------------------------------------------------------------
   Housetory contribution buttons + gallery polish
   ------------------------------------------------------------ */

.housetory-house-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: -6px 0 28px;
}

.housetory-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #5e4732;
    color: #fffaf2;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #4d3a29;
    box-shadow: 0 6px 16px rgba(62, 47, 34, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.housetory-action-button:hover {
    color: #fffaf2;
    background: #4d3a29;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(62, 47, 34, 0.16);
}

.housetory-action-button.is-secondary {
    background: #efe6d8;
    color: #49392a;
    border-color: #d5c7b5;
    box-shadow: none;
}

.housetory-action-button.is-secondary:hover {
    background: #e5d8c7;
    color: #382b20;
}

.housetory-panel-header h2 a {
    color: inherit;
    text-decoration: none;
}

.housetory-panel-header h2 a:hover {
    text-decoration: underline;
}

.housetory-panel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d5c7b5;
    background: #efe6d8;
    color: #49392a;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.housetory-panel-link:hover {
    background: #e5d8c7;
    color: #382b20;
    text-decoration: none;
}

.housetory-photo-thumb a,
.housetory-photo-single a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.housetory-photo-thumb {
    cursor: zoom-in;
}

.housetory-photo-thumb::after {
    content: "⌕";
    position: absolute;
    top: 6px;
    right: 7px;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(248, 244, 238, 0.9);
    color: #4d3a29;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.housetory-photo-thumb:hover::after {
    opacity: 1;
}

/* Keep Sigplus output compact inside the archive card. */
.housetory-gallery-output img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 760px) {
    .housetory-house-actions {
        display: grid;
        margin-top: 0;
    }

    .housetory-action-button {
        width: 100%;
    }

    .housetory-panel-header {
        align-items: flex-start;
    }
}


/* Extra House fields + compact hero refinement */
.housetory-house-hero { grid-template-columns: minmax(280px, .95fr) minmax(360px, 1.15fr); align-items: stretch; }
.housetory-house-lead-media { display:flex; align-items:center; justify-content:center; padding:12px; min-height:0; }
.housetory-house-lead-image { width:100%; height:auto; max-height:420px; min-height:0; object-fit:contain; background:#f3ebde; }
.housetory-house-lead-placeholder { min-height:280px; }
.housetory-house-details { grid-column: 2; }
.housetory-detail-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; margin:0; }
.housetory-detail-list div { padding-bottom:12px; border-bottom:1px solid #e5dacf; }
.housetory-detail-list dt { margin-bottom:4px; font-size:.74rem; letter-spacing:.12em; text-transform:uppercase; color:#8a7760; }
.housetory-detail-list dd { margin:0; color:#332c25; }
.housetory-notable-events { margin-top:22px; }
.housetory-notable-events h3 { margin:0 0 10px; font-family:Georgia, "Times New Roman", serif; font-size:1.2rem; color:#2f2923; }
@media (max-width:1080px){ .housetory-house-lead-image{max-height:380px;} .housetory-house-details{grid-column:auto;} }
@media (max-width:760px){ .housetory-house-lead-image{max-height:300px;height:auto;} .housetory-house-lead-placeholder{min-height:220px;} .housetory-detail-list{grid-template-columns:1fr;} }

/* Housetory v3: keep hero/placeholder compact */
.housetory-house-lead-media {
    min-height: 0 !important;
}

.housetory-house-lead-image {
    max-height: 340px !important;
    min-height: 0 !important;
    width: 100%;
    height: auto !important;
    object-fit: contain;
}

.housetory-house-lead-placeholder {
    min-height: 220px !important;
    max-height: 260px;
}

@media (max-width: 760px) {
    .housetory-house-lead-image {
        max-height: 260px !important;
    }
    .housetory-house-lead-placeholder {
        min-height: 180px !important;
    }
}

/* Housetory Hero Phase 1: reference-style hero image with caption overlay */
.housetory-house-hero {
    grid-template-columns: minmax(280px, 0.88fr) minmax(420px, 1.28fr) !important;
    align-items: stretch !important;
}

.housetory-house-lead-media {
    position: relative !important;
    display: block !important;
    height: 420px !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f3ebde !important;
}

.housetory-house-lead-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 12px !important;
    background: #f3ebde !important;
}

.housetory-house-lead-placeholder {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    background: #f3ebde !important;
    color: #7d6d59 !important;
    font-style: italic !important;
}

.housetory-hero-caption {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    max-width: min(280px, calc(100% - 36px));
    padding: 12px 16px;
    background: rgba(248, 244, 238, 0.94);
    border: 1px solid #d9cfbf;
    border-radius: 10px;
    font-family: Georgia, "Times New Roman", serif;
    color: #3a3027;
    box-shadow: 0 6px 18px rgba(62, 47, 34, 0.16);
}

.housetory-hero-caption strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.housetory-hero-caption span {
    display: block;
    margin-top: 2px;
    font-size: 0.88rem;
    font-style: italic;
    color: #7a6953;
}

@media (max-width: 1080px) {
    .housetory-house-hero {
        grid-template-columns: 1fr !important;
    }

    .housetory-house-lead-media {
        height: 360px !important;
    }
}

@media (max-width: 760px) {
    .housetory-house-lead-media {
        height: 280px !important;
    }

    .housetory-hero-caption {
        right: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
        padding: 10px 12px;
    }
}


/* Story portrait card: moves owner/resident portraits into the article story panel */
.housetory-story-layout {
    display: grid;
    gap: 22px;
}

.housetory-story-layout.has-portrait {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    align-items: start;
}

.housetory-story-portrait {
    margin: 0;
    padding: 14px;
    background: #f3ebde;
    border: 1px solid #d9cfbf;
    border-radius: 999px 999px 16px 16px;
    text-align: center;
}

.housetory-story-portrait a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.housetory-story-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.18;
    object-fit: cover;
    object-position: center;
    border-radius: 999px 999px 18px 18px;
    border: 3px solid #f8f4ee;
    box-shadow: 0 8px 20px rgba(62, 47, 34, 0.12);
    filter: sepia(0.12) contrast(1.04);
}

.housetory-story-portrait-caption {
    margin-top: 12px;
    font-family: Georgia, "Times New Roman", serif;
    color: #3a3027;
}

.housetory-story-portrait-caption strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
}

.housetory-story-portrait-caption span {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    font-style: italic;
    color: #7a6953;
}

/* Keep Photos through time focused on house/street images */
.housetory-house-photos .housetory-photo-strip {
    align-items: start;
}

@media (max-width: 760px) {
    .housetory-story-layout.has-portrait {
        grid-template-columns: 1fr;
    }

    .housetory-story-portrait {
        max-width: 220px;
        margin: 4px auto 0;
    }
}

/* Housetory portrait polish override - integrated editorial card */
.housetory-story-layout {
    display: grid;
    gap: 22px;
}

.housetory-story-layout.has-portrait {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
    align-items: start;
}

.housetory-story-portrait {
    position: relative;
    margin: 2px 0 8px;
    padding: 12px 12px 14px;
    background: #fcfaf6;
    border: 1px solid #e2d8ca;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(62, 47, 34, 0.06);
}

.housetory-story-portrait::before {
    content: "\201C";
    position: absolute;
    top: -18px;
    left: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 64px;
    line-height: 1;
    color: rgba(216, 206, 191, 0.5);
    pointer-events: none;
}

.housetory-story-portrait a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.housetory-story-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.15;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    border: 3px solid #f8f4ee;
    box-shadow: 0 8px 20px rgba(62, 47, 34, 0.12);
    filter: sepia(0.12) contrast(1.04);
}

.housetory-story-portrait-caption {
    margin-top: 10px;
    font-family: Georgia, "Times New Roman", serif;
    color: #3a3027;
}

.housetory-story-portrait-caption strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
}

.housetory-story-portrait-caption span {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    font-style: italic;
    color: #7a6953;
}

@media (max-width: 760px) {
    .housetory-story-layout.has-portrait {
        grid-template-columns: 1fr;
    }

    .housetory-story-portrait {
        max-width: 210px;
        margin: 8px auto 0;
    }
}

/* Housetory portrait polish v4 - stronger visible editorial treatment */
.housetory-house-story .housetory-story-layout.has-portrait {
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 26px;
    align-items: start;
}

.housetory-house-story .housetory-story-portrait {
    position: relative;
    margin-top: 4px;
    padding: 14px 12px 13px;
    background: linear-gradient(180deg, #fffdf8 0%, #f5efe5 100%);
    border: 1px solid #e6dccd;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(62, 47, 34, 0.08);
}

.housetory-house-story .housetory-story-portrait::before {
    content: "\201C";
    position: absolute;
    top: -20px;
    left: 8px;
    z-index: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 72px;
    line-height: 1;
    color: rgba(174, 145, 104, 0.22);
    pointer-events: none;
}

.housetory-house-story .housetory-story-portrait a {
    position: relative;
    z-index: 1;
    display: block;
    text-decoration: none;
    color: inherit;
}

.housetory-house-story .housetory-story-portrait img {
    display: block;
    width: 126px;
    height: 150px;
    margin: 0 auto;
    object-fit: cover;
    object-position: center;
    border-radius: 999px 999px 42px 42px;
    border: 5px solid #f8f4ee;
    outline: 1px solid #d6c8b6;
    box-shadow: 0 8px 18px rgba(62, 47, 34, 0.14);
    filter: sepia(0.16) contrast(1.06) grayscale(0.08);
}

.housetory-house-story .housetory-story-portrait-caption {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2d8ca;
    font-family: Georgia, "Times New Roman", serif;
    color: #3a3027;
}

.housetory-house-story .housetory-story-portrait-caption strong {
    display: block;
    font-size: 0.94rem;
    line-height: 1.2;
    font-weight: 700;
}

.housetory-house-story .housetory-story-portrait-caption span {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.25;
    font-style: italic;
    color: #7a6953;
}

@media (max-width: 760px) {
    .housetory-house-story .housetory-story-layout.has-portrait {
        grid-template-columns: 1fr;
    }

    .housetory-house-story .housetory-story-portrait {
        max-width: 180px;
        margin: 12px auto 0;
    }
}

/* Structured Photo article gallery captions */
.housetory-photo-strip-captioned {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    align-items: start;
}

.housetory-photo-thumb-captioned {
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
    border: 0;
}

.housetory-photo-thumb-captioned a {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #d8cebf;
    background: #f4eee5;
    aspect-ratio: 4 / 3;
}

.housetory-photo-thumb-captioned figcaption {
    display: grid;
    gap: 3px;
    margin-top: 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #6f5f4e;
    text-align: center;
}

.housetory-photo-thumb-captioned figcaption strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.84rem;
    color: #3a3027;
    font-weight: 600;
}

.housetory-photo-thumb-captioned figcaption span {
    display: block;
}

/* Housetory lightbox viewer */
html.housetory-lightbox-open,
html.housetory-lightbox-open body { overflow: hidden; }
.housetory-lightbox { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: 28px; background: rgba(30,25,20,.88); }
.housetory-lightbox.is-open { display: flex; }
.housetory-lightbox-figure { max-width: min(1100px, 88vw); max-height: 88vh; margin: 0; display: grid; gap: 12px; justify-items: center; }
.housetory-lightbox-image { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 12px; background: #f8f4ee; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.housetory-lightbox-caption { min-height: 1.4em; max-width: 760px; padding: 10px 14px; border: 1px solid rgba(217,207,191,.45); border-radius: 999px; background: rgba(248,244,238,.94); color: #3a3027; font-size: .92rem; line-height: 1.35; text-align: center; }
.housetory-lightbox-caption strong { font-family: Georgia, "Times New Roman", serif; margin-right: 8px; }
.housetory-lightbox-close, .housetory-lightbox-nav { appearance: none; border: 1px solid rgba(248,244,238,.45); background: rgba(248,244,238,.92); color: #3a3027; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.housetory-lightbox-close { position: absolute; top: 20px; right: 22px; width: 42px; height: 42px; border-radius: 999px; font-size: 2rem; line-height: 1; }
.housetory-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border-radius: 999px; font-size: 3rem; line-height: .8; }
.housetory-lightbox-prev { left: 24px; }
.housetory-lightbox-next { right: 24px; }
.housetory-lightbox-close:hover, .housetory-lightbox-nav:hover, .housetory-lightbox-close:focus-visible, .housetory-lightbox-nav:focus-visible { background: #fffaf2; outline: 2px solid #d9cfbf; outline-offset: 3px; }
@media (max-width: 760px) { .housetory-lightbox { padding: 18px; } .housetory-lightbox-nav { width: 42px; height: 52px; font-size: 2.35rem; } .housetory-lightbox-prev { left: 10px; } .housetory-lightbox-next { right: 10px; } .housetory-lightbox-close { top: 10px; right: 10px; } .housetory-lightbox-caption { border-radius: 14px; } }

/* === Housetory fixed overlay lightbox, Sigplus-like === */
.housetory-lightbox-fixed {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 32px 84px !important;
    background: rgba(24, 20, 17, 0.90) !important;
    box-sizing: border-box !important;
}

.housetory-lightbox-fixed.is-open {
    display: flex !important;
}

.housetory-lightbox-fixed * {
    box-sizing: border-box !important;
}

.housetory-lightbox-fixed .htlb-stage {
    max-width: min(1180px, 92vw) !important;
    max-height: 92vh !important;
    margin: 0 !important;
    display: grid !important;
    gap: 12px !important;
    justify-items: center !important;
}

.housetory-lightbox-fixed .htlb-image {
    display: block !important;
    max-width: min(1180px, 88vw) !important;
    max-height: 78vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 10px !important;
    background: #f8f4ee !important;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55) !important;
}

.housetory-lightbox-fixed .htlb-caption {
    min-height: 1.4em !important;
    max-width: 820px !important;
    margin: 0 !important;
    padding: 10px 15px !important;
    border: 1px solid rgba(217,207,191,0.5) !important;
    border-radius: 999px !important;
    background: rgba(248,244,238,0.96) !important;
    color: #3a3027 !important;
    font-size: 0.92rem !important;
    line-height: 1.35 !important;
    text-align: center !important;
}

.housetory-lightbox-fixed .htlb-caption strong {
    font-family: Georgia, "Times New Roman", serif !important;
    margin-right: 8px !important;
}

.housetory-lightbox-fixed .htlb-close,
.housetory-lightbox-fixed .htlb-nav {
    appearance: none !important;
    position: absolute !important;
    border: 1px solid rgba(248,244,238,0.5) !important;
    background: rgba(248,244,238,0.94) !important;
    color: #3a3027 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    z-index: 2147483001 !important;
}

.housetory-lightbox-fixed .htlb-close {
    top: 22px !important;
    right: 26px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 999px !important;
    font-size: 2rem !important;
    line-height: 1 !important;
}

.housetory-lightbox-fixed .htlb-nav {
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 54px !important;
    height: 72px !important;
    border-radius: 999px !important;
    font-size: 3.2rem !important;
    line-height: 0.8 !important;
}

.housetory-lightbox-fixed .htlb-prev { left: 24px !important; }
.housetory-lightbox-fixed .htlb-next { right: 24px !important; }

.housetory-lightbox-fixed .htlb-close:hover,
.housetory-lightbox-fixed .htlb-nav:hover,
.housetory-lightbox-fixed .htlb-close:focus-visible,
.housetory-lightbox-fixed .htlb-nav:focus-visible {
    background: #fffaf2 !important;
    outline: 2px solid #d9cfbf !important;
    outline-offset: 3px !important;
}

html.housetory-lightbox-open,
html.housetory-lightbox-open body {
    overflow: hidden !important;
}

@media (max-width: 760px) {
    .housetory-lightbox-fixed { padding: 22px 56px !important; }
    .housetory-lightbox-fixed .htlb-image { max-width: 86vw !important; max-height: 74vh !important; }
    .housetory-lightbox-fixed .htlb-nav { width: 42px !important; height: 56px !important; font-size: 2.45rem !important; }
    .housetory-lightbox-fixed .htlb-prev { left: 8px !important; }
    .housetory-lightbox-fixed .htlb-next { right: 8px !important; }
    .housetory-lightbox-fixed .htlb-close { top: 10px !important; right: 10px !important; }
    .housetory-lightbox-fixed .htlb-caption { border-radius: 14px !important; }
}

/* === Housetory Photo Archive Additions === */
/* Housetory Photo Archive additions
   Append these to /templates/shaper_helixultimate/css/housetory-house.css
*/

.housetory-photo-archive-page {
    max-width: 1180px;
}

.housetory-photo-archive-header {
    margin-bottom: 24px;
    padding: 30px;
    background: #f8f4ee;
    border: 1px solid #d9cfbf;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(62, 47, 34, 0.05);
}

.housetory-back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #6d5d4a;
    text-decoration: none;
    font-size: 0.95rem;
}

.housetory-back-link:hover {
    text-decoration: underline;
}

.housetory-photo-archive-intro {
    max-width: 680px;
    margin: 18px 0 0;
    color: #5c5044;
    line-height: 1.65;
    font-size: 1.04rem;
}

.housetory-photo-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.housetory-photo-filter {
    appearance: none;
    border: 1px solid #d9cfbf;
    background: #f8f4ee;
    color: #4d4339;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.housetory-photo-filter:hover,
.housetory-photo-filter.is-active {
    background: #6d553f;
    border-color: #6d553f;
    color: #fff;
}

.housetory-photo-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
}

.housetory-photo-archive-card {
    background: #f8f4ee;
    border: 1px solid #d9cfbf;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(62, 47, 34, 0.05);
}

.housetory-photo-archive-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.housetory-photo-archive-image-button img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.housetory-photo-archive-image-button:hover img {
    transform: scale(1.03);
}

.housetory-photo-archive-card-body {
    padding: 16px;
}

.housetory-photo-archive-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.housetory-photo-date,
.housetory-photo-type {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.76rem;
    line-height: 1;
}

.housetory-photo-date {
    background: #e8dfd2;
    color: #3a3027;
    font-weight: 700;
}

.housetory-photo-type {
    background: #fcfaf6;
    border: 1px solid #e2d8ca;
    color: #6d5d4a;
}

.housetory-photo-archive-card h2 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.25;
    color: #2f2923;
}

.housetory-photo-archive-card p {
    margin: 6px 0 0;
    color: #5c5044;
    line-height: 1.45;
    font-size: 0.9rem;
}

body.ht-lightbox-open {
    overflow: hidden;
}

.ht-lightbox-figure {
    margin: 0;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.ht-lightbox-caption {
    max-width: min(760px, 86vw);
    background: rgba(248, 244, 238, 0.96);
    color: #3a3027;
    border: 1px solid rgba(217, 207, 191, 0.8);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
}

@media (max-width: 760px) {
    .housetory-photo-archive-header {
        padding: 22px;
    }

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

    .housetory-photo-filters {
        gap: 8px;
    }
}
