/* Cordinant — Blog Category, Stage 2: responsive refinement */
/* Replace assets/css/blog-category.css with this entire file. */

.category-page { color:#213b4f; background:#fff; }
.category-container { width:min(1280px,calc(100% - 48px)); margin-inline:auto; }

/* Hero */
.category-hero { position:relative; isolation:isolate; overflow:hidden; min-height:425px; background:linear-gradient(105deg,#f6f3eb 0%,#e8f1f7 62%,#c9dfe8 100%); }
.category-hero::before { content:""; position:absolute; inset:0; z-index:-1; background-image:linear-gradient(90deg,rgba(249,248,244,.99) 0%,rgba(249,248,244,.95) 33%,rgba(249,248,244,.57) 60%,rgba(249,248,244,.04) 100%),var(--category-hero-image,none); background-position:center,right center; background-size:cover,cover; background-repeat:no-repeat; }
.category-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding-top:37px; color:#536c7c; font-size:14px; }
.category-breadcrumb a { color:inherit; text-decoration:none; }
.category-breadcrumb a:hover { color:#087f9d; }
.category-hero-copy { max-width:650px; padding:68px 0 82px; }
.category-eyebrow { display:block; font-size:12px; letter-spacing:.14em; font-weight:800; color:#a47742; }
.category-hero h1 { font-size:clamp(40px,5.6vw,76px); line-height:1.08; letter-spacing:-.045em; margin:17px 0 22px; color:#213b4f; }
.category-hero-copy p { font-size:clamp(17px,1.8vw,21px); line-height:1.65; color:#415a6a; max-width:560px; }
.category-count { display:inline-block; margin-top:22px; font-weight:700; color:#315a70; }

/* Articles */
.category-content { padding-top:76px; padding-bottom:82px; }
.category-section-heading { display:flex; justify-content:space-between; align-items:end; gap:24px; margin-bottom:30px; }
.category-section-heading h2,.category-other h2 { font-size:clamp(27px,3.5vw,42px); letter-spacing:-.035em; margin:12px 0 0; line-height:1.2; }
.category-section-heading > a { color:#007f9c; font-weight:700; text-decoration:none; }
.category-section-heading > a:hover,.category-read:hover { text-decoration:underline; }
.category-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; align-items:stretch; }
.category-card { min-width:0; overflow:hidden; display:flex; flex-direction:column; border:1px solid #e0e9ee; border-radius:16px; background:#fff; box-shadow:0 12px 32px rgba(33,59,79,.05); }
.category-card-image { display:block; background:#e7eff4; overflow:hidden; }
.category-card-image img { display:block; width:100%; object-fit:cover; transition:transform .25s; }
.category-card:hover img { transform:scale(1.035); }
.category-card-placeholder { display:flex; align-items:center; justify-content:center; height:100%; color:#477083; letter-spacing:.2em; font-weight:800; }
.category-card-body { display:flex; flex-direction:column; flex:1; padding:20px 10px; }
.category-card-date { font-size:13px; color:#6d7e89; }
.category-card h3 { font-size:clamp(18px,1.55vw,20px); line-height:1.38; margin:13px 0 10px; overflow-wrap:anywhere; }
.category-card h3 a { color:#213b4f; text-decoration:none; }
.category-card h3 a:hover { color:#007f9c; }
.category-card-body p { color:#536b7b; line-height:1.45; font-size:15px; margin:0 0 14px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:5; line-clamp:5; overflow:hidden; }
.category-read { display:inline-block; align-self:flex-start; margin-top:auto; padding-top:5px; color:#007f9c; font-weight:700; font-size:14px; text-decoration:none; }

/* Pagination */
.category-pagination { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:42px; }
.category-pagination a { display:inline-flex; align-items:center; justify-content:center; min-height:42px; min-width:42px; border:1px solid #d7e4e9; padding:10px 14px; border-radius:9px; text-decoration:none; color:#213b4f; }
.category-pagination a:hover { border-color:#007f9c; }
.category-pagination a[aria-current] { background:#213b4f; color:#fff; border-color:#213b4f; }

/* Other topics */
.category-other { background:#f2f6f8; padding:62px 0 74px; }
.category-topics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin-top:28px; }
.category-topics a { display:flex; justify-content:space-between; align-items:center; gap:15px; min-width:0; padding:20px 22px; border-radius:12px; background:#fff; border:1px solid #e0e9ee; text-decoration:none; color:#213b4f; font-weight:800; }
.category-topics a:hover { border-color:#9ac7d5; }
.category-topics span { color:#67808e; font-size:13px; font-weight:500; white-space:nowrap; }

/* Tablet: readable two-column grid and image safely behind text */
@media (max-width:1000px) {
  .category-container { width:calc(100% - 40px); }
  .category-grid,.category-topics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
  .category-card h3 { font-size:18px; }
  .category-card-body p { font-size:15px; -webkit-line-clamp:4; line-clamp:4; }
  .category-hero::before { background-image:linear-gradient(90deg,rgba(249,248,244,.99) 0%,rgba(249,248,244,.88) 44%,rgba(249,248,244,.32) 100%),var(--category-hero-image,none); }
}

/* Mobile: compact cards, legible text, accessible controls */
@media (max-width:600px) {
  .category-container { width:calc(100% - 32px); }
  .category-hero { min-height:0; }
  .category-hero::before { background-image:linear-gradient(90deg,rgba(249,248,244,.97) 0%,rgba(249,248,244,.9) 48%,rgba(249,248,244,.66) 100%),var(--category-hero-image,none); background-position:center,68% center; }
  .category-breadcrumb { padding-top:25px; font-size:12px; gap:8px; }
  .category-hero-copy { padding:36px 0 46px; max-width:100%; }
  .category-hero h1 { font-size:clamp(31px,8.5vw,42px); margin:12px 0 14px; }
  .category-hero-copy p { font-size:15px; line-height:1.55; max-width:100%; }
  .category-eyebrow { font-size:10px; }
  .category-count { margin-top:15px; font-size:13px; }
  .category-content { padding:46px 0 54px; }
  .category-section-heading { align-items:start; flex-direction:column; gap:12px; margin-bottom:22px; }
  .category-section-heading h2,.category-other h2 { font-size:27px; }
  .category-grid,.category-topics { grid-template-columns:minmax(0,1fr); gap:16px; }
  .category-card-image { aspect-ratio:16/9; }
  .category-card-body { padding:20px; }
  .category-card h3 { font-size:18px; line-height:1.4; }
  .category-card-body p { font-size:14px; line-height:1.6; -webkit-line-clamp:4; line-clamp:4; }
  .category-read { font-size:14px; }
  .category-pagination { margin-top:30px; }
  .category-pagination a { min-height:44px; min-width:44px; }
  .category-other { padding:44px 0 52px; }
  .category-topics { margin-top:20px; }
  .category-topics a { padding:16px 18px; }
}

/* On very narrow screens, preserve image readability and card width */
@media (max-width:360px) {
  .category-hero::before { background-image:linear-gradient(90deg,rgba(249,248,244,.98),rgba(249,248,244,.84)),var(--category-hero-image,none); }
  .category-card-body { padding:17px; }
  .category-card h3 { font-size:17px; }
}

@media (prefers-reduced-motion:reduce) {
  .category-card-image img { transition:none; }
  .category-card:hover img { transform:none; }
}


/* Stage 2.1 — Mobile Article Cards Redesign.
   Existing article markup is unchanged: image link + .category-card-body. */
@media (max-width:600px) {
  .category-grid { gap:12px; }
  .category-card {
    display:grid;
    grid-template-columns:clamp(104px,29vw,136px) minmax(0,1fr);
    align-items:stretch;
    min-height:138px;
    border-radius:12px;
    box-shadow:0 5px 18px rgba(33,59,79,.045);
  }
  .category-card-image {
    grid-column:1;
    grid-row:1;
    aspect-ratio:auto;
    height:100%;
    min-height:138px;
    border-radius:0;
  }
  .category-card-image img { width:100%;height:100%;object-fit:cover; }
  .category-card-body {
    grid-column:2;
    grid-row:1;
    min-width:0;
    padding:14px 14px 13px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:0;
  }
  .category-card-date { font-size:11px; line-height:1.35; }
  .category-card h3 {
    font-size:15px;
    line-height:1.32;
    margin:7px 0 7px;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    line-clamp:3;
    overflow:hidden;
  }
  .category-card-body p {
    font-size:12px;
    line-height:1.45;
    margin:0 0 8px;
    -webkit-line-clamp:2;
    line-clamp:2;
  }
  .category-read {
    margin-top:auto;
    padding-top:2px;
    font-size:12px;
    line-height:1.4;
  }
  .category-card:focus-within { outline:2px solid #007f9c; outline-offset:2px; }
}
@media (max-width:390px) {
  .category-card { grid-template-columns:98px minmax(0,1fr); min-height:124px; }
  .category-card-image { min-height:124px; }
  .category-card-body { padding:12px; }
  .category-card h3 { font-size:14px; margin:6px 0; }
  .category-card-body p { display:none; }
  .category-read { font-size:12px; }
}

/* Stage 2.2 — preserve full article cover artwork in mobile list cards.
   Overrides Stage 2.1 only; desktop and tablet layouts are unchanged. */
@media (max-width:600px) {
  .category-card {
    grid-template-columns:104px minmax(0,1fr);
    min-height:32px;
    padding: 4px;
  }
  .category-card-image {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:32px;
    height:100%;
    background:#edf3f6;
  }
  .category-card-image img {
    display:block;
    width:100%;
    height:auto;
    max-height:100%;
    object-fit:contain;
    object-position:center;
  }
  .category-card-body { padding:13px 14px; }
  .category-card h3 { font-size:15px; line-height:1.42; margin:7px 0; }
  .category-card-body p { line-height:1.5; }
}
@media (max-width:390px) {
  .category-card { grid-template-columns:86px minmax(0,1fr); min-height:122px; }
  .category-card-image { min-height:122px; }
  .category-card-body { padding:12px 11px; }
  .category-card h3 { font-size:14px; line-height:1.45; }
}

/* Stage 2.3 — Image Area & Tablet Typography.
   Scoped overrides: preserves existing PHP markup, hero and desktop layout. */
@media (min-width:601px) and (max-width:1000px) {
  .category-card-body { padding:16px 6px; }
  .category-card h3 { font-size:19px; line-height:1.43; margin:12px 0 10px; }
  .category-card-body p { font-size:15.5px; line-height:1.45; }
  .category-card-date { font-size:13px; }
  .category-read { font-size:14px; }
}
@media (max-width:600px) {
  /* Use the image's entire width and its natural proportions.
     The link no longer paints a tall tinted panel behind landscape artwork. */
  .category-card-image {
    display:flex;
    align-self:center;
    align-items:center;
    justify-content:center;
    width:100%;
    height:auto;
    min-height:0;
    aspect-ratio:auto;
    padding:0 0 0 10px;
    background:transparent;
    overflow:hidden;
    border-radius:0;
  }
  .category-card-image img {
    display:block;
    width:100%;
    height:auto;
    max-height:110px;
    object-fit:contain;
    object-position:center;
    transform:none;
  }
  .category-card:hover .category-card-image img { transform:none; }
  .category-card-placeholder {
    min-height:66px;
    width:100%;
    border-radius:6px;
    background:#edf3f6;
    font-size:10px;
  }
}
@media (max-width:390px) {
  .category-card-image { padding-left:9px; }
  .category-card-image img { max-height:100px; }
}


/* Stage 3 — Category redesign, additions only; article cards unchanged */
/* Category redesign additions. Existing article card CSS is intentionally untouched. */
.category-page{--cat-navy:#203e54;--cat-teal:#087b98;--cat-line:#dce7ed}
.category-page .category-hero-copy{max-width:690px}
.category-page .category-hero-copy h1{letter-spacing:-.045em}
.category-page .category-hero-meta{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin-top:22px}
.category-page .category-count{display:inline-flex;align-items:center;gap:8px;padding:9px 15px;background:rgba(233,242,246,.88);border:1px solid #dce6eb;border-radius:999px;color:var(--cat-navy);font-weight:700}
.category-page .category-nav{display:flex;align-items:center;gap:20px;margin-top:22px;margin-bottom:30px;padding:18px 22px;background:#f1f5f7;border:1px solid #e6edf1;border-radius:18px}
.category-page .category-nav-label{flex:0 0 auto;color:#0e526c;font-size:.78rem;font-weight:800;letter-spacing:.025em}
.category-page .category-nav-links{display:flex;flex-wrap:wrap;gap:9px}
.category-page .category-nav-links a{display:inline-flex;align-items:center;justify-content:center;padding:10px 17px;border:1px solid #cfdfe7;border-radius:999px;background:#fff;color:#1e4055;font-size:.88rem;font-weight:600;text-decoration:none;transition:background .2s,color .2s}
.category-page .category-nav-links a:hover{background:#e0eff5}
.category-page .category-nav-links a.is-active{background:#07657f;color:#fff;border-color:#07657f}
.category-page .category-heading-intro{margin:10px 0 0;color:#51677a;line-height:1.6}
.category-page .category-topic{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.45fr);gap:32px;align-items:center;margin-top:48px;margin-bottom:62px;padding:34px 38px;border:1px solid #d8e8ec;border-radius:24px;background:linear-gradient(115deg,#e1f3f3 0%,#fff 44%,#eff8fa 100%)}
.category-page .category-topic-intro{padding-right:28px;border-right:1px solid #d1e0e6}
.category-page .category-topic-intro h2{margin:10px 0 14px;color:#203e54;font-size:clamp(1.55rem,2.6vw,2.5rem);line-height:1.1;letter-spacing:-.03em}
.category-page .category-topic-intro p{margin:0;color:#405a6c;line-height:1.65}
.category-page .category-topic-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 22px}
.category-page .category-topic-item{display:flex;align-items:flex-start;gap:13px;min-width:0}
.category-page .category-topic-symbol{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:13px;background:#dceff2;color:#087b98;font-size:1.3rem;font-weight:700}
.category-page .category-topic-item h3{margin:0 0 6px;font-size:1rem;line-height:1.35;color:#203e54}
.category-page .category-topic-item p{margin:0;color:#476174;font-size:.9rem;line-height:1.55}
@media(max-width:900px){.category-page .category-nav{align-items:flex-start;flex-direction:column}.category-page .category-topic{grid-template-columns:1fr}.category-page .category-topic-intro{border-right:0;border-bottom:1px solid #d1e0e6;padding:0 0 24px}}
@media(max-width:600px){.category-page .category-nav{padding:15px;margin-top:15px}.category-page .category-nav-links{gap:7px}.category-page .category-nav-links a{padding:9px 12px;font-size:.82rem}.category-page .category-topic{padding:24px 19px;margin-top:32px}.category-page .category-topic-items{grid-template-columns:1fr;gap:20px}.category-page .category-topic-symbol{width:38px;height:38px;flex-basis:38px}}
