/* ============================================================
   Petiquette — tips.css
   Dog & Pet Tips article hub: index + article pages.
   Uses only CSS variables defined in styles.css — no hardcoded
   colors. Works in light, dark, and all three palette variants.
   ============================================================ */

/* ---- Tips hero ---- */
.tips-hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.tips-hero .eyebrow {
  color: var(--accent);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.tips-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem);
  margin-bottom: .6rem;
  color: var(--ink);
}
.tips-hero .tips-hero__lead {
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  max-width: 58ch;
  margin: 0 auto;
  line-height: 1.55;
}

/* ---- Category filter row ---- */
.tip-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 1.8rem) 0 clamp(.8rem, 2vw, 1.2rem);
}
.tip-filter {
  padding: .38rem .9rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  line-height: 1.3;
}
.tip-filter:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.tip-filter[aria-pressed="true"],
.tip-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.tip-filter:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Card grid ---- */
.tips-section {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.1rem, 2.5vw, 1.6rem);
}
@media (min-width: 600px) {
  .tips-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .tips-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Tip card ---- */
.tip-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tip-card__img-link {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}
.tip-card__img-link picture,
.tip-card__img-link img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .3s ease;
}
.tip-card:hover .tip-card__img-link img {
  transform: scale(1.04);
}
.tip-card__body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tip-card__chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: .2rem .55rem;
  margin-bottom: .55rem;
  white-space: nowrap;
}
.tip-card__title {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.2rem);
  font-weight: 560;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 .45rem;
  color: var(--ink);
}
.tip-card__title a {
  color: inherit;
  text-decoration: none;
}
.tip-card__title a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.tip-card__excerpt {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 .85rem;
  flex: 1;
  /* clamp to ~3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tip-card__read-more {
  font-size: .875rem;
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-top: auto;
}
.tip-card__read-more:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Visually-hidden card that's been filtered out */
.tip-card[hidden] { display: none; }

/* ---- Tips CTA section ---- */
.tips-cta {
  background: var(--accent-soft);
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  text-align: center;
}
.tips-cta h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem);
  margin-bottom: .6rem;
  color: var(--ink);
}
.tips-cta p {
  color: var(--muted);
  max-width: 50ch;
  margin: 0 auto 1.5rem;
}

/* ============================================================
   Article page
   ============================================================ */

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: clamp(.8rem, 2vw, 1.1rem) 0;
  font-size: .85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.breadcrumb nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .35rem;
}
.breadcrumb nav li + li::before {
  content: "/";
  opacity: .45;
  margin-right: .2rem;
}
.breadcrumb nav a {
  color: var(--accent-strong);
  text-decoration: none;
}
.breadcrumb nav a:hover { text-decoration: underline; }
.breadcrumb nav li[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Article layout ---- */
.article-page {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 8vw, 5rem);
}
.article {
  max-width: 72ch;
  margin: 0 auto;
}

/* ---- Featured image ---- */
.article__featured {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(1.5rem, 4vw, 2.2rem);
  box-shadow: var(--shadow);
}
.article__featured picture,
.article__featured img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---- Article heading ---- */
.article h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0 0 1rem;
  color: var(--ink);
}

/* ---- Byline ---- */
.byline {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(1.5rem, 4vw, 2.2rem);
}
.byline__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent-soft);
}
.byline__text {
  font-size: .875rem;
  line-height: 1.45;
  color: var(--muted);
}
.byline__text strong {
  color: var(--ink);
  font-weight: 700;
}
.byline__text a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}
.byline__text a:hover { text-decoration: underline; }

/* ---- Article body ---- */
.article__body {
  line-height: 1.72;
  font-size: clamp(.98rem, 0.94rem + 0.2vw, 1.07rem);
  color: var(--ink);
}
.article__body p {
  margin: 0 0 1.2em;
}
.article__body h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
  font-weight: 560;
  line-height: 1.15;
  color: var(--ink);
  margin: 2em 0 .6em;
  text-wrap: balance;
}
.article__body h2:first-child { margin-top: 0; }
.article__body ul,
.article__body ol {
  margin: 0 0 1.2em 1.3em;
  padding: 0;
}
.article__body li {
  margin-bottom: .45em;
  line-height: 1.6;
}
.article__body li::marker { color: var(--accent); }
.article__body strong { font-weight: 800; }
.article__body em { font-style: italic; }
.article__body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: .6em 1.2em;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-style: italic;
}
.article__body a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}
.article__body a:hover { text-decoration-thickness: 2px; }

/* ---- Sources ---- */
.article__sources {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}
.article__sources h2 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .7rem;
}
.article__sources ul {
  margin: 0;
  padding: 0 0 0 1.2em;
  font-size: .845rem;
  color: var(--muted);
  line-height: 1.55;
}
.article__sources li { margin-bottom: .4em; }
.article__sources a {
  color: var(--accent-strong);
  text-underline-offset: 2px;
}
.article__sources a:hover { text-decoration-thickness: 2px; }

/* ---- Related articles ---- */
.related {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.related__heading {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 560;
  margin: 0 0 1.1rem;
  color: var(--ink);
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 500px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 760px) {
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Related cards are tip-card instances — no extra overrides needed */

/* ---- Article CTA panel ---- */
.article-cta {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2.2rem) clamp(1.2rem, 3vw, 2rem);
  text-align: center;
}
.article-cta h2 {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
  font-weight: 560;
  margin: 0 0 .5rem;
  color: var(--ink);
}
.article-cta p {
  color: var(--muted);
  font-size: .95rem;
  margin: 0 auto .9rem;
  max-width: 48ch;
}

/* ============================================================
   Shared button (mirrors styles.css .btn pattern)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent);
}
.btn--ghost:hover {
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.btn--lg {
  padding: .8rem 1.7rem;
  font-size: 1.05rem;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 599px) {
  .article__featured img { aspect-ratio: 4 / 3; }
  .byline { flex-wrap: wrap; }
}
