/* =============================================================================
   FD Category Page — overrides for cat-featured hero and cat-paired features
   =============================================================================
   Styles specific to the category landing pages (Productivity, PKM/Notes,
   Form/Training, Living, Essays).

   Depends on cards.css for the base shortcode markup.

   Contains:
     1. cat-featured — the single-post hero card at the top of category pages
     2. cat-paired   — the two-post editorial features row
   ============================================================================= */


/* =============================================================================
   1. CAT-FEATURED — single-post hero
   =============================================================================
   Used in the half-row hero at the top of category pages.
   The shortcode call requires a label parameter:
     [fd_selected_posts ids="13475" label="Featured"]
   ============================================================================= */


/* -----------------------------------------------------------------------------
   Column reset — kill the wrapper grid behaviour for this context
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-posts {
  display: block;
  gap: 0;
  margin: 0;
  grid-template-columns: 1fr;
}


/* -----------------------------------------------------------------------------
   Card — hero treatment
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card {
  position: relative;
  display: block;
  background: var(--fd-bg);
  border-radius: var(--fd-card-radius);
  overflow: hidden;
  min-height: 360px;
  margin: 0;
}

@media (min-width: 600px) {
  .cat-featured .fd-selected-post-card {
    min-height: 420px;
  }
}

@media (min-width: 900px) {
  .cat-featured .fd-selected-post-card {
    min-height: 480px;
  }
}


/* -----------------------------------------------------------------------------
   Image — fills the entire card
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card__image-link {
  position: absolute;
  inset: 0;
  display: block;
  aspect-ratio: auto;
  border-radius: 0;
  z-index: 1;
}

.cat-featured .fd-selected-post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease-out;
}

.cat-featured .fd-selected-post-card:hover .fd-selected-post-card__image {
  transform: scale(1.025);
}


/* -----------------------------------------------------------------------------
   Uniform dark overlay
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(20, 18, 16, 0.40);
  transition: background 300ms ease-out;
}

.cat-featured .fd-selected-post-card:hover::after {
  background: rgba(20, 18, 16, 0.50);
}


/* -----------------------------------------------------------------------------
   Content — centred over the image
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card__content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: transparent;
  gap: 0;
}

@media (min-width: 600px) {
  .cat-featured .fd-selected-post-card__content {
    padding: 2.5rem;
  }
}

@media (min-width: 900px) {
  .cat-featured .fd-selected-post-card__content {
    padding: 3rem;
  }
}

.cat-featured .fd-selected-post-card__meta {
  display: none;
}


/* -----------------------------------------------------------------------------
   Featured label
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card__category {
  display: inline-block;
  font-family: var(--fd-font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fd-accent);
  margin: 0 0 0.85rem 0;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cat-featured a.fd-selected-post-card__category:hover {
  color: var(--fd-accent);
}


/* -----------------------------------------------------------------------------
   Title — large serif, centred
   ----------------------------------------------------------------------------- */

.cat-featured .fd-selected-post-card__title {
  font-family: var(--fd-font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--fd-text);
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  max-width: 30rem;
}

@media (min-width: 600px) {
  .cat-featured .fd-selected-post-card__title {
    font-size: 1.85rem;
  }
}

@media (min-width: 900px) {
  .cat-featured .fd-selected-post-card__title {
    font-size: 2.1rem;
  }
}

.cat-featured .fd-selected-post-card__title a {
  color: inherit;
  text-decoration: none;
}

.cat-featured .fd-selected-post-card__title a:hover {
  color: var(--fd-text);
}


/* =============================================================================
   2. CAT-PAIRED — two-post editorial features row
   =============================================================================
   Used in the 50/50 row below the hero. Each column contains a shortcode
   call rendering image + title, plus a separate text element with class
   "cat-paired-framing" containing the italic framing line.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   Row-level rhythm
   ----------------------------------------------------------------------------- */

.cat-paired {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 900px) {
  .cat-paired {
    margin-top: 4rem;
    margin-bottom: 4rem;
  }
}


/* -----------------------------------------------------------------------------
   Reset card containers — no backgrounds or enforced heights
   ----------------------------------------------------------------------------- */

.cat-paired .fd-selected-posts,
.cat-paired .fd-selected-post-card {
  background: transparent !important;
  border-radius: 0;
  margin: 0;
  min-height: 0;
  display: block;
  flex-direction: initial;
  overflow: visible;
  padding: 0;
}

.cat-paired .fd-selected-posts {
  gap: 0;
  grid-template-columns: 1fr;
}

.cat-paired .fd-selected-post-card:hover {
  background: transparent !important;
  transform: none;
}


/* -----------------------------------------------------------------------------
   Image — large, top of card, no overlay
   ----------------------------------------------------------------------------- */

.cat-paired .fd-selected-post-card__image-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--fd-card-radius);
  margin-bottom: 1.25rem;
  position: relative;
}

@media (min-width: 900px) {
  .cat-paired .fd-selected-post-card__image-link {
    aspect-ratio: 3 / 2;
    margin-bottom: 1.5rem;
  }
}

.cat-paired .fd-selected-post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms ease-out;
}

.cat-paired .fd-selected-post-card:hover .fd-selected-post-card__image {
  transform: scale(1.02);
}

.cat-paired .fd-selected-post-card::after {
  display: none;
}


/* -----------------------------------------------------------------------------
   Content — below image, left-aligned, constrained width
   ----------------------------------------------------------------------------- */

.cat-paired .fd-selected-post-card__content {
  padding: 0;
  gap: 0.5rem;
  background: transparent;
  display: flex;
  flex-direction: column;
  position: static;
  inset: auto;
  z-index: auto;
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 90%;
}

@media (min-width: 600px) {
  .cat-paired .fd-selected-post-card__content {
    max-width: 95%;
  }
}

.cat-paired .fd-selected-post-card__meta,
.cat-paired .fd-selected-post-card__category {
  display: none;
}


/* -----------------------------------------------------------------------------
   Title — substantial serif, constrained width
   ----------------------------------------------------------------------------- */

.cat-paired .fd-selected-post-card__title {
  font-family: var(--fd-font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--fd-text);
  margin: 0;
  text-shadow: none;
  max-width: 24rem;
}

@media (min-width: 600px) {
  .cat-paired .fd-selected-post-card__title {
    font-size: 1.55rem;
    max-width: 28rem;
  }
}

@media (min-width: 900px) {
  .cat-paired .fd-selected-post-card__title {
    font-size: 1.75rem;
    max-width: 30rem;
  }
}

.cat-paired .fd-selected-post-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 220ms ease-out;
}

.cat-paired .fd-selected-post-card__title a:hover {
  color: var(--fd-accent);
}


/* -----------------------------------------------------------------------------
   Framing line — italic serif, below the title
   ----------------------------------------------------------------------------- */

.cat-paired-framing,
.cat-paired-framing p {
  font-family: var(--fd-font-serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fd-text-muted);
  opacity: 0.92;
  margin: 0.75rem 0 0 0;
  max-width: 30rem;
}

@media (min-width: 900px) {
  .cat-paired-framing,
  .cat-paired-framing p {
    font-size: 1.05rem;
    margin-top: 1rem;
  }
}
