/*
 * CurioDock Theme v0.1
 * Site shell / archive / card styling.
 * Article-body styling remains in CurioDock Article Design plugin.
 */

:root {
  --cdt-ink: #171b22;
  --cdt-text: #252b33;
  --cdt-muted: #66717f;
  --cdt-navy: #0b1f3a;
  --cdt-blue: #0f4caa;
  --cdt-cyan: #007f95;
  --cdt-border: #d7dde5;
  --cdt-soft: #f6f8fa;
  --cdt-white: #ffffff;
  --cdt-max: 1180px;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cdt-white); color: var(--cdt-text); }
a { transition: color .18s ease, opacity .18s ease, transform .18s ease; }
a:hover { color: var(--cdt-cyan); }
img { max-width: 100%; height: auto; }

.cd-site-header {
  position: relative;
  z-index: 20;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--cdt-border);
}

.cd-header-main {
  max-width: var(--cdt-max);
  margin: 0 auto;
  padding: 1rem 1.25rem .85rem;
}

.cd-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cd-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}

.cd-brand .wp-block-site-logo img {
  max-height: 46px;
  width: auto;
}

.cd-brand .wp-block-site-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.cd-brand .wp-block-site-title a { color: var(--cdt-navy); }

.cd-header-search {
  width: min(310px, 34vw);
}

.cd-header-search .wp-block-search__inside-wrapper {
  border: 1px solid var(--cdt-border);
  border-radius: 6px;
  padding: 3px;
  background: #fff;
}

.cd-header-search .wp-block-search__input {
  min-width: 0;
  border: 0;
  padding: .55rem .7rem;
  font-size: .9rem;
}

.cd-header-search .wp-block-search__button {
  margin: 0;
  border: 0;
  border-radius: 4px;
  padding: .52rem .8rem;
  background: var(--cdt-navy);
  color: #fff;
  font-size: .85rem;
}

.cd-header-categories {
  margin-top: .9rem;
  border-top: 1px solid #edf0f3;
  padding-top: .75rem;
}

.cd-category-nav {
  display: flex;
  align-items: center;
  gap: .35rem 1.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.cd-category-nav::-webkit-scrollbar { display: none; }
.cd-category-nav a {
  position: relative;
  flex: 0 0 auto;
  color: #303945;
  font-size: .9rem;
  font-weight: 750;
}
.cd-category-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -.38rem;
  height: 2px;
  background: var(--cdt-blue);
  transition: right .18s ease;
}
.cd-category-nav a:hover::after { right: 0; }

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

.cd-shell,
.cd-front-shell,
.cd-archive-shell,
.cd-single-shell,
.cd-page-shell {
  width: min(calc(100% - 2.5rem), var(--cdt-max));
  margin-inline: auto;
}

.cd-front-shell { padding: 2.5rem 0 4.5rem; }

.cd-front-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 2.3rem;
  padding-bottom: 1.35rem;
  border-bottom: 3px solid var(--cdt-navy);
}

.cd-front-intro h1 {
  margin: 0 0 .5rem;
  color: var(--cdt-ink);
  font-size: clamp(1.65rem, 3.2vw, 2.55rem);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.cd-front-intro p {
  max-width: none;
  margin: 0;
  color: var(--cdt-muted);
  font-size: .95rem;
  line-height: 1.8;
}

.cd-front-intro .wp-block-group:first-child {
  min-width: 0;
}

.cd-front-intro__mark {
  width: 22px;
  color: var(--cdt-blue);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
}

.cd-home-section { margin: 3.4rem 0; }

.cd-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: .55rem;
  border-bottom: 2px solid var(--cdt-ink);
}

.cd-section-heading h2 {
  margin: 0;
  color: var(--cdt-ink);
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  font-weight: 850;
  letter-spacing: -.02em;
}

.cd-section-heading > span {
  margin-left: auto;
  color: var(--cdt-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.cd-section-more {
  margin-left: auto;
  color: var(--cdt-blue);
  font-size: .82rem;
  font-weight: 750;
}

.cd-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.65rem 1.35rem;
}

.cd-theme-card {
  min-width: 0;
}

.cd-theme-card__media {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: .85rem;
  border-radius: 4px;
  background: #e9edf2;
}

.cd-theme-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.cd-theme-card:hover .cd-theme-card__image { transform: scale(1.025); }

.cd-theme-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 78% 25%, rgba(0,127,149,.24), transparent 28%),
    linear-gradient(135deg, #0b1f3a, #183c66);
  color: rgba(255,255,255,.82);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.cd-theme-card__meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .45rem;
  color: var(--cdt-muted);
  font-size: .73rem;
}

.cd-theme-card__category {
  color: var(--cdt-blue);
  font-weight: 800;
}

.cd-theme-card__title {
  margin: 0 0 .55rem;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -.012em;
}

.cd-theme-card__title a { color: var(--cdt-ink); }
.cd-theme-card__title a:hover { color: var(--cdt-blue); }

.cd-theme-card__excerpt {
  margin: 0;
  color: var(--cdt-muted);
  font-size: .83rem;
  line-height: 1.7;
}

.cd-theme-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 2rem;
  align-items: center;
  padding-bottom: 1.5rem;
}

.cd-theme-card--featured .cd-theme-card__media {
  margin: 0;
  border-radius: 5px;
}

.cd-theme-card--featured .cd-theme-card__title {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.45;
}

.cd-theme-card--featured .cd-theme-card__excerpt {
  font-size: .92rem;
  line-height: 1.8;
}

.cd-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .45rem;
  margin: 1.25rem 0 1.7rem;
  color: var(--cdt-muted);
  font-size: .74rem;
  line-height: 1.55;
}

.cd-breadcrumbs a { color: var(--cdt-muted); }
.cd-breadcrumbs__sep { color: #a4adb8; }

.cd-single-shell {
  padding-bottom: 4.5rem;
}

.cd-single-header {
  max-width: 920px;
  margin: 0 auto 1.4rem;
}

.cd-single-categories .wp-block-post-terms {
  margin-bottom: .65rem;
  color: var(--cdt-blue);
  font-size: .78rem;
  font-weight: 800;
}

.cd-single-title {
  margin: 0 !important;
  color: var(--cdt-ink) !important;
  font-size: clamp(1.85rem, 3.4vw, 2.55rem) !important;
  font-weight: 850 !important;
  line-height: 1.32 !important;
  letter-spacing: -.028em;
}

.cd-post-meta {
  display: flex;
  gap: 1rem;
  margin-top: .7rem;
  color: var(--cdt-muted);
  font-size: .75rem;
}

.cd-single-featured {
  width: min(100%, 980px);
  margin: 1.8rem auto 2.1rem;
}

.cd-single-featured img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
}

.cd-single-content {
  max-width: 820px;
  margin-inline: auto;
}

.cd-single-content > .wp-block-post-content {
  margin-top: 0;
}

.cd-related {
  max-width: var(--cdt-max);
  margin: 4rem auto 0;
  padding-top: 2.1rem;
  border-top: 1px solid var(--cdt-border);
}

.cd-archive-shell,
.cd-page-shell {
  padding: 1.4rem 0 4.5rem;
}

.cd-archive-header {
  margin: 1rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--cdt-navy);
}

.cd-archive-title {
  margin: 0 !important;
  color: var(--cdt-ink) !important;
  font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
  font-weight: 850 !important;
}

.cd-archive-description {
  max-width: 760px;
  margin-top: .7rem;
  color: var(--cdt-muted);
  font-size: .9rem;
}

.cd-query-grid .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.35rem;
}

.cd-query-grid .wp-block-post {
  min-width: 0;
}

.cd-query-grid .wp-block-post-featured-image {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: .8rem;
  border-radius: 4px;
  background: #eef1f4;
}

.cd-query-grid .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cd-query-grid .wp-block-post-terms {
  margin: 0 0 .35rem;
  color: var(--cdt-blue);
  font-size: .72rem;
  font-weight: 800;
}

.cd-query-grid .wp-block-post-title {
  margin: 0 0 .5rem !important;
  font-size: 1.06rem !important;
  line-height: 1.55 !important;
}

.cd-query-grid .wp-block-post-title a { color: var(--cdt-ink); }
.cd-query-grid .wp-block-post-date {
  color: var(--cdt-muted);
  font-size: .72rem;
}

.cd-query-grid .wp-block-post-excerpt {
  color: var(--cdt-muted);
  font-size: .82rem;
  line-height: 1.7;
}

.cd-query-pagination {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cdt-border);
}

.cd-empty-state {
  padding: 2rem;
  background: var(--cdt-soft);
  color: var(--cdt-muted);
  text-align: center;
}

.cd-page-title {
  margin: 0 0 1.5rem !important;
  padding-bottom: .8rem;
  border-bottom: 3px solid var(--cdt-navy);
  font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
  font-weight: 850 !important;
}

.cd-page-content {
  max-width: 820px;
  margin-inline: auto;
}

.cd-404 {
  max-width: 720px;
  margin: 5rem auto;
  padding: 2rem 0;
  text-align: center;
}

.cd-404 h1 {
  margin-bottom: .5rem;
  font-size: clamp(2.5rem, 8vw, 5rem);
}

.cd-site-footer {
  border-top: 1px solid var(--cdt-border);
  background: #f8f9fb;
}

.cd-footer-inner {
  max-width: var(--cdt-max);
  margin: 0 auto;
  padding: 2.6rem 1.25rem 1.8rem;
}

.cd-footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 2rem;
  padding-bottom: 1.8rem;
}

.cd-footer-brand .wp-block-site-title {
  margin: 0 0 .45rem;
  font-size: 1.25rem;
  font-weight: 850;
}

.cd-footer-brand p {
  max-width: 520px;
  margin: 0;
  color: var(--cdt-muted);
  font-size: .83rem;
  line-height: 1.7;
}

.cd-footer-pages .wp-block-page-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
}

.cd-footer-pages a { color: #3d4753; }

.cd-footer-bottom {
  padding-top: 1rem;
  border-top: 1px solid var(--cdt-border);
}

.cd-footer-copy {
  margin: 0;
  color: var(--cdt-muted);
  font-size: .72rem;
}

@media (max-width: 900px) {
  .cd-theme-grid,
  .cd-query-grid .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cd-theme-card--featured {
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
  }

  .cd-footer-top {
    grid-template-columns: 1fr;
  }

  .cd-footer-pages .wp-block-page-list {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .cd-header-main { padding-inline: 1rem; }
  .cd-header-top { align-items: center; gap: .8rem; }
  .cd-brand .wp-block-site-logo img { max-height: 38px; }
  .cd-brand .wp-block-site-title { font-size: 1.18rem; }
  .cd-header-search { width: 42vw; }
  .cd-header-search .wp-block-search__button { display: none; }

  .cd-shell,
  .cd-front-shell,
  .cd-archive-shell,
  .cd-single-shell,
  .cd-page-shell {
    width: min(calc(100% - 2rem), var(--cdt-max));
  }

  .cd-front-shell { padding-top: 1.7rem; }
  .cd-front-intro { grid-template-columns: 1fr; }
  .cd-front-intro__mark { display: none; }

  .cd-theme-grid,
  .cd-query-grid .wp-block-post-template {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .cd-theme-card--featured {
    grid-template-columns: 1fr;
  }

  .cd-theme-card--featured .cd-theme-card__title {
    font-size: 1.35rem;
  }

  .cd-home-section { margin: 2.7rem 0; }

  .cd-single-title {
    font-size: clamp(1.55rem, 7vw, 1.9rem) !important;
  }

  .cd-single-featured {
    margin-top: 1.25rem;
  }

  .cd-footer-inner { padding-inline: 1rem; }
}


/* ---------------------------------------------------------
   Future advertising slots — v0.1.3
   All output is controlled by Appearance > CurioDock Ads.
   --------------------------------------------------------- */

.cd-single-layout {
  display: block;
}

.cd-single-primary {
  min-width: 0;
}

.cd-ad-rail {
  display: none;
}

.cd-ad-slot {
  width: 100%;
  margin: 2.25rem auto;
  text-align: center;
  overflow: hidden;
}

.cd-ad-label {
  display: block;
  margin-bottom: .35rem;
  color: #8a929c;
  font-size: .66rem;
  font-weight: 650;
  letter-spacing: .08em;
  line-height: 1.2;
}

.cd-ad-code {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 1px;
}

.cd-ad-mobile-only {
  display: none;
}

@media (min-width: 769px) {
  .cd-ad-desktop-only {
    display: block;
  }

  .cd-ad-mobile-only {
    display: none !important;
  }
}

@media (min-width: 1280px) {
  body.cd-has-desktop-rail-ads .cd-single-layout {
    display: grid;
    grid-template-columns: minmax(0, 820px) 300px;
    gap: 40px;
    align-items: start;
  }

  body.cd-has-desktop-rail-ads .cd-single-header,
  body.cd-has-desktop-rail-ads .cd-single-featured,
  body.cd-has-desktop-rail-ads .cd-single-content,
  body.cd-has-desktop-rail-ads .cd-related {
    max-width: 820px;
    margin-left: 0;
    margin-right: 0;
  }

  body.cd-has-desktop-rail-ads .cd-ad-rail {
    display: block;
    width: 300px;
    padding-top: .25rem;
  }

  body.cd-has-desktop-rail-ads .cd-ad-rail .cd-ad-slot {
    margin: 0 0 2.5rem;
  }
}

@media (max-width: 768px) {
  .cd-ad-desktop-only,
  .cd-ad-rail {
    display: none !important;
  }

  .cd-ad-mobile-only {
    display: block;
  }

  .cd-ad-slot {
    margin: 1.9rem auto;
  }
}


/* =========================================================
   Header / Logo / Footer final refinement - v0.1.4
   ========================================================= */

.cd-brand {
  flex: 0 0 auto;
}

.cd-brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.cd-brand-logo img {
  display: block;
  width: auto;
  height: auto;
}

.cd-brand-logo--header img {
  width: 218px;
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.cd-brand-logo--footer img {
  width: 185px;
  max-height: 47px;
  object-fit: contain;
  object-position: left center;
}

.cd-header-top {
  min-height: 58px;
}

.cd-header-search {
  width: min(300px, 31vw);
}

.cd-header-categories {
  margin-top: .65rem;
  padding-top: .65rem;
}

.cd-site-footer {
  margin-top: 1rem;
  border-top: 3px solid var(--cdt-navy);
  background: #f7f9fb;
}

.cd-footer-inner {
  padding-top: 2.8rem;
}

.cd-footer-top {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(160px, .65fr) minmax(190px, .8fr);
  gap: 3rem;
  align-items: start;
}

.cd-footer-brand p {
  max-width: 520px;
  margin-top: .9rem;
  color: var(--cdt-muted);
  font-size: .82rem;
  line-height: 1.85;
}

.cd-footer-column h3 {
  margin: .15rem 0 .9rem;
  color: var(--cdt-ink);
  font-size: .88rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.cd-footer-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cd-footer-link-list li {
  margin: .45rem 0;
}

.cd-footer-link-list a {
  color: #46515d;
  font-size: .8rem;
  line-height: 1.6;
}

.cd-footer-link-list a:hover {
  color: var(--cdt-blue);
}

.cd-footer-empty {
  margin: 0;
  color: var(--cdt-muted);
  font-size: .78rem;
}

.cd-footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
}

@media (max-width: 900px) {
  .cd-footer-top {
    grid-template-columns: 1.25fr .75fr;
    gap: 2rem 2.5rem;
  }

  .cd-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .cd-header-top {
    min-height: 50px;
  }

  .cd-brand-logo--header img {
    width: 156px;
    max-height: 40px;
  }

  .cd-header-search {
    width: min(46vw, 210px);
  }

  .cd-brand-logo--footer img {
    width: 165px;
  }

  .cd-footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .cd-footer-brand {
    grid-column: auto;
  }
}


/* =========================================================
   WordPress-managed logo + category navigation - v0.1.5
   ========================================================= */

/* WordPress standard Site Logo is the single source for
   both header and footer. Site Icon / favicon stays separate. */
.cd-brand {
  min-width: 0;
}

.cd-brand .wp-block-site-logo {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.cd-brand .wp-block-site-logo a {
  display: block;
  line-height: 0;
}

.cd-brand .wp-block-site-logo img {
  display: block;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
}

.cd-brand--header .wp-block-site-logo img {
  max-width: 220px;
  max-height: 54px;
}

.cd-brand--footer .wp-block-site-logo img {
  max-width: 190px;
  max-height: 50px;
}

/* If a logo is configured, hide the text fallback.
   If not, CurioDock site title remains visible. */
.cd-brand:has(.wp-block-site-logo img) .cd-brand-fallback-title {
  display: none;
}

.cd-brand-fallback-title {
  margin: 0 !important;
  color: var(--cdt-navy);
  font-size: 1.4rem !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  letter-spacing: -.03em;
}

.cd-brand-fallback-title a {
  color: var(--cdt-navy);
}

/* Category navigation:
   subtle media-style pills rather than plain text links. */
.cd-category-nav {
  gap: .5rem;
  padding: .05rem 0 .15rem;
}

.cd-category-nav a {
  position: relative;
  flex: 0 0 auto;
  padding: .42rem .78rem;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #f7f9fb;
  color: #303945;
  font-size: .82rem;
  font-weight: 760;
  line-height: 1.25;
}

.cd-category-nav a::after {
  display: none !important;
}

.cd-category-nav a:hover {
  border-color: #9eb6d1;
  background: #eef4fa;
  color: var(--cdt-blue);
}

@media (max-width: 680px) {
  .cd-brand--header .wp-block-site-logo img {
    max-width: 158px;
    max-height: 40px;
  }

  .cd-brand--footer .wp-block-site-logo img {
    max-width: 170px;
    max-height: 44px;
  }

  .cd-brand-fallback-title {
    font-size: 1.15rem !important;
  }

  .cd-category-nav {
    gap: .42rem;
  }

  .cd-category-nav a {
    padding: .38rem .68rem;
    font-size: .78rem;
  }
}
