
/* =========================================================
   WamOceanic Publications
   Main catalogue stylesheet
   ========================================================= */

/* ---------- 1. Design settings ---------- */

:root {
    --pub-ink: #252722;
    --pub-green: #243b32;
    --pub-cream: #eee8dc;
    --pub-paper: #fffdf9;
    --pub-muted: #69645b;
    --pub-rule: #e7e2da;
    --pub-rust: #963f2c;

    /* Adjust these two settings to control image dimensions */
    --book-cover-width: 200px;
    --author-photo-width: 180px;
    --author-photo-ratio: 3 / 4;
}

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

/* ---------- 2. General catalogue page ---------- */

.catalogue-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 24px 72px;
    color: var(--pub-ink);
}

.catalogue-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pub-rust);
    font-weight: 700;
    margin: 0 0 10px;
}

.catalogue-page h1,
.catalogue-page h2,
.catalogue-page h3 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.15;
}

.catalogue-page h1 {
    font-size: clamp(2.25rem, 4.2vw, 3.5rem);
    margin: 0.45rem 0 1rem;
}

.catalogue-page h2 {
    font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.catalogue-intro {
    max-width: 760px;
    line-height: 1.7;
    color: #5d5a53;
}

/* ---------- 3. Search and filters ---------- */

.catalogue-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 26px 0 30px;
}

.catalogue-tools input,
.catalogue-tools select {
    padding: 12px 14px;
    border: 1px solid #d9d1c5;
    background: var(--pub-paper);
    min-width: 210px;
    font: inherit;
}

.catalogue-tools button {
    font: inherit;
    cursor: pointer;
}

/* ---------- 4. Catalogue grid and cards ---------- */

.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.catalogue-card {
    min-width: 0;
}

.catalogue-card a {
    color: inherit;
    text-decoration: none;
}

.catalogue-card a:hover h3 {
    text-decoration: underline;
    text-decoration-color: var(--pub-rust);
    text-underline-offset: 4px;
}

.catalogue-card h2,
.catalogue-card h3 {
    font-size: 1.28rem;
    margin: 0 0 8px;
}

/* ---------- 5. Book covers on catalogue pages ---------- */

/* The cover container follows the actual image dimensions. */
.catalogue-card:not(.author-directory-card) .catalogue-cover {
    width: min(100%, var(--book-cover-width));
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    display: block;
    background: transparent;
    overflow: hidden;
    margin: 0 0 13px;
}

.catalogue-card:not(.author-directory-card) .catalogue-cover img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Shared cover styles for other catalogue contexts. */
.catalogue-cover {
    background: var(--pub-cream);
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 13px;
}

.catalogue-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.catalogue-cover img.author-photo {
    object-fit: cover;
}

.catalogue-cover .image-fallback {
    padding: 18px;
    text-align: center;
    color: #766f63;
}

/* ---------- 6. Book metadata and buttons ---------- */

.catalogue-meta {
    color: var(--pub-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.catalogue-tag {
    display: inline-block;
    border: 1px solid #ded5c8;
    padding: 4px 9px;
    font-size: 0.8rem;
    margin-top: 8px;
}

.catalogue-button {
    display: inline-block;
    background: var(--pub-green);
    color: #fff !important;
    padding: 11px 16px;
    text-decoration: none;
    border: 1px solid var(--pub-green);
    margin: 8px 8px 0 0;
    line-height: 1.35;
}

.catalogue-button:hover {
    background: #385347;
}

.catalogue-button.secondary {
    background: transparent;
    color: var(--pub-green) !important;
}

.catalogue-button.secondary:hover {
    background: #f2eee6;
}

/* ---------- 7. Individual book detail page ---------- */

.catalogue-detail {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 38px;
    align-items: start;
}

/* Individual book detail: make the cover container match the image itself.
   Do not force a 3:4 box, which creates visible side bands on some covers. */
.catalogue-detail-cover {
    display: block;
    width: min(100%, 280px);
    max-width: 280px;
    height: auto;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
}

.catalogue-detail-cover img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    object-fit: initial;
}

.catalogue-detail-cover .image-fallback {
    padding: 18px;
    text-align: center;
    color: #766f63;
}

.catalogue-detail-copy h1 {
    font-size: clamp(2rem, 3.3vw, 3.15rem);
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.catalogue-detail-copy .catalogue-intro {
    margin: 0 0 14px;
}

.catalogue-detail-copy .catalogue-byline {
    font-size: 1rem;
    margin: 0 0 16px;
}

.catalogue-detail-copy .catalogue-meta {
    margin: 0 0 12px;
}

.catalogue-prose {
    white-space: pre-line;
    line-height: 1.8;
    color: #514e47;
}

/* ---------- 8. Author directory cards ---------- */

.author-directory-cover {
    width: min(100%, var(--author-photo-width));
    aspect-ratio: var(--author-photo-ratio);
    height: auto;
    max-height: none;
    margin-bottom: 13px;
}

.author-directory-cover img.author-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-directory-card h3 {
    margin-bottom: 7px;
}

.author-directory-card .catalogue-meta {
    margin: 7px 0;
}

/* ---------- 9. Individual author profile ---------- */

.catalogue-author-heading {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

.catalogue-author-avatar {
    width: 140px;
    height: 140px;
    flex: 0 0 140px;
    border-radius: 50%;
    background: var(--pub-cream);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalogue-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Empty search results */
.catalogue-empty {
    padding: 28px;
    background: #f7f3ec;
    color: #6c665c;
}

/* ---------- 10. Main website header ---------- */

.site-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--pub-rule);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 0 1 auto;
    min-width: 0;
}

.site-logo {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-brand-name {
    display: flex;
    flex-direction: column;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.12;
    color: var(--pub-green);
    white-space: normal;
}

.site-brand-first,
.site-brand-second {
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 18px;
    flex: 0 0 auto;
}

.site-nav a {
    color: var(--pub-ink);
    text-decoration: none;
    font-size: 1.08rem;
    font-weight: 500;
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--pub-rust);
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* ---------- 11. Main content and footer ---------- */

.site-main {
    min-height: 55vh;
}

.site-footer {
    background: var(--pub-green);
    color: #f8f5ee;
    padding: 34px 24px;
}

.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}

.site-footer a {
    color: #f8f5ee;
}

/* ---------- 12. Tablet layout ---------- */

@media (max-width: 1100px) {
    .site-header {
        padding: 18px 24px;
        gap: 18px;
    }

    .site-logo {
        width: 64px;
        height: 64px;
    }

    .site-brand-name {
        font-size: 1.2rem;
    }

    .site-nav {
        gap: 12px;
    }

    .site-nav a {
        font-size: 0.96rem;
    }
}

@media (max-width: 900px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .site-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    .catalogue-detail {
        grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
        gap: 26px;
    }
}

/* ---------- 13. Mobile layout ---------- */

@media (max-width: 650px) {
    .catalogue-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
    }

    .catalogue-detail {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .catalogue-detail-cover {
        max-width: 230px;
    }

    .catalogue-detail-copy h1 {
        font-size: 2.15rem;
    }

    .catalogue-page {
        padding: 34px 18px 56px;
    }

    .catalogue-author-heading {
        align-items: flex-start;
        gap: 14px;
    }

    .catalogue-author-avatar {
        width: 88px;
        height: 88px;
        flex-basis: 88px;
    }

    .catalogue-tools input,
    .catalogue-tools select {
        width: 100%;
        min-width: 0;
    }

    .site-header {
        padding: 16px 18px;
    }

    .site-brand-name {
        font-size: 1.15rem;
    }

    .site-logo {
        width: 60px;
        height: 60px;
    }

    .site-nav {
        gap: 12px;
    }

    .site-nav a {
        font-size: 0.93rem;
    }
}

/* ---------- 14. Very small screens ---------- */

@media (max-width: 390px) {
    .catalogue-grid {
        grid-template-columns: 1fr;
    }
}
