/* PDF brochure archive + viewer (self-hosted PDF.js / PageFlip) */

.bathgiant-brochure-viewer [hidden] {
 display: none !important;
}

.bathgiant-brochures-archive {
 margin: var(--bathgiant-space-section) 0 calc(var(--bathgiant-space-section) + 0.35rem);
}

/* Page intro only (not site header): block cover art from painting beside/over this row */
.bathgiant-brochures-archive .bathgiant-archive-header {
 position: relative;
 z-index: 2;
 overflow: hidden;
 margin-bottom: 1.5rem;
 background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.bathgiant-brochures-archive__grid-wrap {
 position: relative;
 z-index: 1;
 clear: both;
 padding-top: 0.35rem;
 overflow: visible;
}

.bathgiant-brochures-archive__toolbar {
 position: relative;
 z-index: 2;
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: flex-end;
 gap: 0.65rem 1rem;
 margin: 0 0 1.35rem;
 background: #fff;
}

.bathgiant-brochures-archive__toolbar-label {
 margin: 0;
 font-size: 0.88rem;
 font-weight: 600;
 color: #64748b;
}

.bathgiant-brochures-archive-layout-toggle {
 display: inline-flex;
 flex-wrap: wrap;
 gap: 0.35rem;
 padding: 0.2rem;
 border: 1px solid #e2e8f0;
 border-radius: 999px;
 background: #f8fafc;
}

.bathgiant-brochures-archive-layout-toggle__btn {
 padding: 0.42rem 0.95rem;
 border: 1px solid transparent;
 border-radius: 999px;
 background: transparent;
 color: #334155;
 font: inherit;
 font-size: 0.88rem;
 font-weight: 600;
 cursor: pointer;
 transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bathgiant-brochures-archive-layout-toggle__btn:hover {
 color: #1f3552;
}

.bathgiant-brochures-archive-layout-toggle__btn.is-active,
.bathgiant-brochures-archive-layout-toggle__btn[aria-pressed="true"] {
 border-color: var(--bathgiant-brand, #3d7dd9);
 background: #fff;
 color: #17365d;
 box-shadow: 0 1px 4px rgba(61, 125, 217, 0.18);
}

.bathgiant-brochures-archive-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
 gap: 2.5rem 1.25rem;
 align-items: start;
}

.bathgiant-brochure-card {
 display: flex;
 flex-direction: column;
 height: 100%;
 background: #fff;
 border: 1px solid var(--bathgiant-border, #e4e9f0);
 border-radius: var(--bathgiant-radius-lg, 16px);
 overflow: hidden;
 box-shadow: 0 1px 3px rgba(15, 20, 25, 0.06), 0 10px 28px rgba(15, 20, 25, 0.05);
 transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bathgiant-brochure-card:hover {
 box-shadow: 0 4px 16px rgba(15, 20, 25, 0.1);
 transform: translateY(-2px);
}

.bathgiant-brochure-card__media {
 display: block;
 aspect-ratio: 4 / 3;
 overflow: hidden;
 background-color: #e2e8f0;
 background-image: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
 background-size: cover;
 background-position: center center;
 background-repeat: no-repeat;
 border-radius: var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px) 0 0;
}

/* Tile cards: cover image fills the media area via background-image */
.bathgiant-brochure-card__media--has-bg {
 background-size: cover;
 background-position: center center;
 background-repeat: no-repeat;
}

.bathgiant-brochures-archive-layout.is-layout-grid .bathgiant-brochure-card__media--has-bg .bathgiant-brochure-card__cover,
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--showcase-tile .bathgiant-brochure-card__cover,
.bathgiant-brochures-archive-layout.is-layout-grid .bathgiant-brochure-card--featured .bathgiant-brochure-card__cover {
 display: none;
}

.bathgiant-brochure-card__cover {
 position: absolute;
 inset: 0;
 z-index: 2;
 display: block;
 width: 100%;
 max-width: none;
 line-height: 0;
 pointer-events: none;
 overflow: visible;
}

.bathgiant-brochure-card__img {
 display: block;
 width: 100%;
 max-width: 100%;
 height: auto;
 object-fit: contain;
 object-position: bottom center;
}

.bathgiant-brochure-card:not(.bathgiant-brochure-card--has-cover) .bathgiant-brochure-card__img {
 width: 100%;
 height: 100%;
 max-height: none;
 object-fit: cover;
}

.bathgiant-brochure-card__placeholder {
 display: flex;
 align-items: center;
 justify-content: center;
 width: 100%;
 height: 100%;
 min-height: 180px;
}

.bathgiant-brochure-card__placeholder-icon {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 4rem;
 height: 4rem;
 border-radius: 12px;
 background: rgba(31, 53, 82, 0.08);
 color: #1f3552;
 font-size: 0.85rem;
 font-weight: 800;
 letter-spacing: 0.06em;
}

.bathgiant-brochure-card__body {
 display: flex;
 flex-direction: column;
 flex: 1;
 padding: 1rem 1.05rem 1.15rem;
 background: #fff;
 border-radius: 0 0 var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px);
 position: relative;
 z-index: 3;
}

.bathgiant-brochure-card__title {
 margin: 0 0 0.35rem;
 font-size: 1.1rem;
 line-height: 1.3;
}

.bathgiant-brochure-card__title a {
 color: #1f3552;
 text-decoration: none;
}

.bathgiant-brochure-card__title a:hover {
 color: var(--bathgiant-accent);
}

.bathgiant-brochure-card__subtitle {
 margin: 0 0 0.35rem;
 font-size: 0.88rem;
 color: #64748b;
}

.bathgiant-brochure-card__excerpt {
 margin: 0 0 0.75rem;
 font-size: 0.9rem;
 line-height: 1.45;
 color: #475569;
 flex: 1;
}

.bathgiant-brochure-card__actions {
 margin-top: auto;
}

/* Showcase: featured hero row, then 4→1 column grid of standard cards */
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochures-archive-grid {
 display: grid;
 grid-template-columns: 1fr;
 gap: 1.25rem;
 align-items: start;
 isolation: isolate;
}

@media (min-width: 560px) {
 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochures-archive-grid {
 grid-template-columns: repeat(2, minmax(0, 1fr));
 }
}

@media (min-width: 860px) {
 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochures-archive-grid {
 grid-template-columns: repeat(3, minmax(0, 1fr));
 }
}

@media (min-width: 1100px) {
 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochures-archive-grid {
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 1.25rem 1.25rem;
 }
}

/* Featured row: full width, content left / image right (7 cols) */
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured {
 display: grid;
 grid-template-columns: repeat(12, minmax(0, 1fr));
 column-gap: 0;
 grid-column: 1 / -1;
 align-items: start;
 min-height: 0;
 margin-top: 0;
 margin-bottom: 2rem;
 height: auto;
 position: relative;
 z-index: 2;
 overflow: visible;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured.bathgiant-brochure-card--has-cover {
 margin-top: 1.75rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__media {
 grid-column: 6 / span 7;
 grid-row: 1;
 position: relative;
 z-index: 1;
 display: block;
 width: 100%;
 max-width: none;
 min-width: 0;
 min-height: 0;
 height: auto;
 padding: 1rem 0 0;
 margin: 0;
 align-self: start;
 justify-self: stretch;
 aspect-ratio: auto;
 overflow: visible;
 border-radius: 0 var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px) 0;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__cover {
 position: static;
 z-index: auto;
 display: block;
 width: 100%;
 max-width: none;
 height: auto;
 margin: -1rem 0 0;
 line-height: 0;
 transform: none;
 pointer-events: none;
 overflow: visible;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__img {
 position: relative;
 display: block;
 flex: 0 0 auto;
 width: 100%;
 max-width: none;
 height: auto;
 max-height: none;
 margin: 0;
 padding: 0;
 border: 0;
 object-fit: none;
 object-position: bottom center;
 transform: none;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__body {
 grid-column: 1 / span 5;
 grid-row: 1;
 display: flex;
 flex-direction: column;
 flex: none;
 justify-content: flex-start;
 align-self: stretch;
 min-height: 100%;
 gap: 0.65rem;
 padding: clamp(1.35rem, 3vw, 2.25rem);
 border-radius: var(--bathgiant-radius-lg, 16px) 0 0 var(--bathgiant-radius-lg, 16px);
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__title {
 font-size: clamp(1.35rem, 2.5vw, 1.85rem);
 margin-bottom: 0.15rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__subtitle {
 margin-bottom: 0.25rem;
 font-size: 0.95rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__excerpt {
 font-size: 1rem;
 line-height: 1.65;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__actions {
 margin-top: auto;
 padding-top: 1rem;
}

/* Showcase hero: editor content (the_content) */
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content {
 flex: 1 1 auto;
 min-width: 0;
 max-width: 42rem;
 font-size: clamp(0.95rem, 1.35vw, 1.05rem);
 line-height: 1.7;
 color: #475569;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content > *:first-child {
 margin-top: 0;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content > *:last-child {
 margin-bottom: 0;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content p {
 margin: 0 0 0.9rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h2,
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h3,
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h4 {
 margin: 1.35rem 0 0.55rem;
 font-family: var(--bathgiant-font-display, Georgia, 'Times New Roman', serif);
 font-weight: 700;
 line-height: 1.25;
 color: #1f3552;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h2 {
 font-size: clamp(1.15rem, 2vw, 1.35rem);
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h3 {
 font-size: clamp(1.05rem, 1.75vw, 1.2rem);
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content h4 {
 font-size: 1.05rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content ul,
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content ol {
 margin: 0 0 1rem;
 padding-left: 1.35rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content li {
 margin: 0.35rem 0;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content li::marker {
 color: #94a3b8;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content a {
 color: var(--bathgiant-brand, #3d7dd9);
 text-decoration: underline;
 text-underline-offset: 0.15em;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content a:hover {
 color: #1f3552;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content strong {
 font-weight: 700;
 color: #334155;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content blockquote {
 margin: 1rem 0;
 padding: 0.75rem 0 0.75rem 1rem;
 border-left: 3px solid var(--bathgiant-brand, #3d7dd9);
 color: #64748b;
 font-style: italic;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content .wp-block-image,
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content figure {
 margin: 0 0 1rem;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__content img {
 max-width: 100%;
 height: auto;
 border-radius: var(--bathgiant-radius-sm, 8px);
}

/* Grid tiles below the hero (same card stack as simple Grid layout) */
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--showcase-tile {
 display: flex;
 flex-direction: column;
 height: 100%;
 min-height: 0;
 margin-top: 0;
 position: relative;
 z-index: 1;
 overflow: hidden;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--showcase-tile.bathgiant-brochure-card--has-cover {
 margin-top: 0;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--showcase-tile .bathgiant-brochure-card__media {
 flex: none;
 width: 100%;
 min-height: 0;
 height: auto;
 aspect-ratio: 4 / 3;
 overflow: hidden;
 border-radius: var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px) 0 0;
}

/* Showcase hero: full PNG in column (background hidden; grid layout uses background fill) */
.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__media--has-bg {
 background-image: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

.bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--showcase-tile .bathgiant-brochure-card__body {
 flex: 1;
 border-radius: 0 0 var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px);
 padding: 1rem 1.05rem 1.15rem;
}

@media (max-width: 991px) {
 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured {
 display: flex;
 flex-direction: column;
 min-height: 0;
 }

 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__body {
 order: -1;
 grid-column: auto;
 border-radius: var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px) 0 0;
 }

 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__cover {
 margin-top: -0.65rem;
 }

 .bathgiant-brochures-archive-layout.is-layout-showcase .bathgiant-brochure-card--featured .bathgiant-brochure-card__media {
 order: 0;
 grid-column: auto;
 width: 100%;
 min-height: 0;
 height: auto;
 padding-top: 0.65rem;
 border-radius: 0 0 var(--bathgiant-radius-lg, 16px) var(--bathgiant-radius-lg, 16px);
 }
}

/* Single brochure viewer */
.bathgiant-brochure-single {
 padding-top: clamp(1rem, 3vw, 1.5rem);
 padding-bottom: clamp(2rem, 4vw, 3rem);
}

.bathgiant-brochure-single__header {
 margin-bottom: 1.25rem;
 max-width: 48rem;
}

.bathgiant-brochure-single__title {
 margin: 0 0 0.35rem;
 font-size: clamp(1.5rem, 3vw, 2rem);
 color: #1f3552;
}

.bathgiant-brochure-single__subtitle {
 margin: 0 0 0.5rem;
 font-size: 1.05rem;
 color: #64748b;
}

.bathgiant-brochure-single__intro {
 margin: 0;
 color: #475569;
 line-height: 1.55;
}

.bathgiant-brochure-viewer {
 --brochure-toolbar-h: 3.25rem;
 border: 1px solid #dce7f4;
 border-radius: 16px;
 background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
 box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
 overflow: hidden;
}

.bathgiant-brochure-viewer--empty {
 padding: 2rem 1.25rem;
 text-align: center;
 background: #fff;
}

.bathgiant-brochure-viewer__toolbar {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 0.65rem 1rem;
 padding: 0.65rem 0.85rem;
 background: #fff;
 border-bottom: 1px solid #e2e8f0;
 min-height: var(--brochure-toolbar-h);
}

.bathgiant-brochure-viewer__toolbar-group {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 0.4rem;
}

.bathgiant-brochure-viewer__mode-btn {
 padding: 0.42rem 0.85rem;
 border: 1px solid #c8d6e7;
 border-radius: 8px;
 background: #fff;
 color: #334155;
 font: inherit;
 font-size: 0.88rem;
 font-weight: 600;
 cursor: pointer;
 transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.bathgiant-brochure-viewer__mode-btn:hover {
 border-color: #95b6df;
 color: #1f3552;
}

.bathgiant-brochure-viewer__mode-btn.is-active,
.bathgiant-brochure-viewer__mode-btn[aria-pressed="true"] {
 border-color: var(--bathgiant-brand, #3d7dd9);
 background: linear-gradient(180deg, #eef5ff 0%, #e2efff 100%);
 color: #17365d;
}

.bathgiant-brochure-viewer__icon-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 min-width: 2.35rem;
 min-height: 2.35rem;
 padding: 0;
 border: 1px solid #c8d6e7;
 border-radius: 8px;
 background: #fff;
 color: #1f3552;
 font-size: 1.15rem;
 line-height: 1;
 cursor: pointer;
}

.bathgiant-brochure-viewer__icon-btn svg {
 display: block;
 flex-shrink: 0;
}

.bathgiant-brochure-viewer__icon-btn:hover {
 border-color: var(--bathgiant-brand);
}

.bathgiant-brochure-viewer__page-label {
 min-width: 5.5rem;
 text-align: center;
 font-size: 0.88rem;
 font-weight: 600;
 color: #475569;
}

.bathgiant-brochure-viewer__download {
 padding: 0.42rem 0.75rem !important;
 font-size: 0.86rem !important;
 white-space: nowrap;
}

.bathgiant-brochure-viewer__stage {
 position: relative;
 min-height: min(72vh, 720px);
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 1.25rem 1rem 1.5rem;
}

.bathgiant-brochure-viewer__stage:fullscreen {
 padding: 1rem;
 background: #1a2332;
}

.bathgiant-brochure-viewer__loading,
.bathgiant-brochure-viewer__error {
 margin: 0;
 padding: 1rem;
 text-align: center;
 color: #475569;
}

.bathgiant-brochure-viewer__error {
 color: #b32d2e;
}

.bathgiant-brochure-viewer__flip-wrap {
 width: 100%;
 max-width: 1100px;
 margin: 0 auto;
 display: flex;
 justify-content: center;
}

.bathgiant-brochure-viewer__flip-book {
 margin: 0 auto;
}

.bathgiant-brochure-viewer__page {
 background: #fff;
 box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.bathgiant-brochure-viewer__page.is-loading {
 background: linear-gradient(145deg, #f8fafc 0%, #e8eef5 100%);
}

.bathgiant-brochure-viewer__page.is-loading img[data-placeholder] {
 visibility: hidden;
 min-height: 320px;
}

.bathgiant-brochure-viewer__page img {
 display: block;
 width: 100%;
 height: 100%;
 object-fit: contain;
}

.bathgiant-brochure-viewer__scroll-wrap {
 width: 100%;
 max-width: 920px;
 margin: 0 auto;
 padding: 0.25rem 0 1rem;
}

/* Scroll mode: full document height - page scrolls, not an inner panel */
.bathgiant-brochure-viewer--scroll {
 overflow: visible;
}

.bathgiant-brochure-viewer--scroll .bathgiant-brochure-viewer__stage {
 min-height: 0;
 display: block;
 padding: 0.75rem 1rem 1.25rem;
}

.bathgiant-brochure-viewer--scroll .bathgiant-brochure-viewer__scroll-wrap {
 max-height: none;
 overflow: visible;
}

.bathgiant-brochure-viewer--scroll .bathgiant-brochure-viewer__scroll-pages {
 gap: 0.75rem;
}

.bathgiant-brochure-viewer__scroll-pages {
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 1rem;
}

.bathgiant-brochure-viewer__scroll-page {
 width: 100%;
 max-width: 920px;
 background: #fff;
 border-radius: 4px;
 box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
 overflow: hidden;
}

.bathgiant-brochure-viewer__scroll-canvas {
 display: block;
 width: 100%;
 height: auto;
}

@media (max-width: 640px) {
 .bathgiant-brochure-viewer__toolbar {
 flex-direction: column;
 align-items: stretch;
 }

 .bathgiant-brochure-viewer__toolbar-group {
 justify-content: center;
 }

 .bathgiant-brochure-viewer__download {
 width: 100%;
 text-align: center;
 }
}
