/*
Theme Name: SmartDoves
Theme URI: https://smartdoves.com
Author: SmartDoves
Description: Lightweight editorial block theme for SmartDoves — warm ivory, sage and charcoal, built for long-form educational content.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: smartdoves
*/

/* Small refinements theme.json can't express. */
html { -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img { height: auto; }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--wp--preset--color--sage-dark); outline-offset: 3px; }

.sd-eyebrow { font-family: var(--wp--preset--font-family--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--sage-dark); font-weight: 600; margin: 0; }
.sd-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.sd-header .wp-block-site-title a { text-decoration: none; }
.sd-header .wp-block-navigation a { text-decoration: none; }
.sd-header .wp-block-navigation a:hover { text-decoration: underline; }

.sd-card { background: var(--wp--preset--color--surface); border-radius: 6px; overflow: hidden; height: 100%; }
.sd-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.sd-card .wp-block-post-title a:hover { text-decoration: underline; }


.sd-note { border-left: 3px solid var(--wp--preset--color--wood); background: var(--wp--preset--color--surface); padding: 1rem 1.25rem; border-radius: 0 6px 6px 0; }
.sd-concept-label { display: inline-block; font-family: var(--wp--preset--font-family--sans); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; background: var(--wp--preset--color--wood); color: #fff; padding: .2em .6em; border-radius: 3px; }

.sd-breadcrumbs { font-family: var(--wp--preset--font-family--sans); font-size: .85rem; color: var(--wp--preset--color--muted); }
.sd-breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.sd-breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--wp--preset--color--line-dark); }
.sd-breadcrumbs a { color: inherit; }

/* Forms rendered by the SmartDoves Core plugin */
.sd-form { display: grid; gap: .85rem; max-width: 560px; }
.sd-form label { font-family: var(--wp--preset--font-family--sans); font-size: .9rem; font-weight: 600; display: block; margin-bottom: .3rem; }
.sd-form input[type=text], .sd-form input[type=email], .sd-form select, .sd-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: .7rem .85rem;
  border: 1px solid var(--wp--preset--color--line-dark); border-radius: 4px; background: #fff; color: var(--wp--preset--color--charcoal);
}
.sd-form textarea { min-height: 140px; }
.sd-form button { justify-self: start; font-family: var(--wp--preset--font-family--sans); font-weight: 600; font-size: 1rem; padding: .8rem 1.4rem; border: 0; border-radius: 4px; background: var(--wp--preset--color--sage-dark); color: #fff; cursor: pointer; }
.sd-form button:hover { background: var(--wp--preset--color--charcoal); }
.sd-form .sd-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.sd-form-msg { padding: .85rem 1rem; border-radius: 4px; background: #E8EEDF; color: var(--wp--preset--color--sage-dark); font-family: var(--wp--preset--font-family--sans); }
.sd-form-msg.is-error { background: #F6E5DF; color: #8A3B22; }
.sd-form small { color: var(--wp--preset--color--muted); font-family: var(--wp--preset--font-family--sans); }
.sd-form-row { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .sd-form-row { grid-template-columns: 1fr 1fr; } }

@media (max-width: 781px) {
  .sd-hero h1 { font-size: 2.4rem !important; }
  .sd-stack-mobile-reverse { flex-direction: column-reverse; }
}

.sd-nav-cta a { background: var(--wp--preset--color--sage-dark); color: #fff !important; padding: .55rem 1rem; border-radius: 4px; }
.sd-nav-cta a:hover { background: var(--wp--preset--color--charcoal); text-decoration: none !important; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--ivory) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.25rem; }
.sd-form .sd-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.sd-form .sd-fineprint, .sd-form .sd-opt { font-family: var(--wp--preset--font-family--sans); font-size: .82rem; font-weight: 400; color: var(--wp--preset--color--muted); }
.sd-form p:empty, .sd-form br { display: none; }

/* ---------- Image style D: organic pebble shapes on sage (v1.1.0) ---------- */
:root {
  --sd-pebble-1: 62% 38% 46% 54% / 55% 45% 55% 45%;
  --sd-pebble-2: 45% 55% 58% 42% / 52% 60% 40% 48%;
  --sd-pebble-3: 54% 46% 40% 60% / 44% 54% 46% 56%;
  --sd-blob-1: 58% 42% 50% 50% / 50% 55% 45% 50%;
  --sd-blob-2: 46% 54% 42% 58% / 56% 44% 56% 44%;
  --sd-grade: saturate(.88) sepia(.06) contrast(.96) brightness(1.02);
}
.sd-pebble, .sd-card .wp-block-post-featured-image, .wp-block-post-featured-image.sd-rounded,
.wp-block-image.sd-rounded, .wp-block-image.sd-hero-img { position: relative; isolation: isolate; }
.sd-card .wp-block-post-featured-image::before, .wp-block-post-featured-image.sd-rounded::before,
.wp-block-image.sd-rounded::before, .wp-block-image.sd-hero-img::before {
  content: ""; position: absolute; z-index: -1; background: var(--wp--preset--color--sage-light);
  inset: 9% 0 3% 8%; border-radius: var(--sd-blob-1); transform: rotate(-6deg);
}
.sd-card .wp-block-post-featured-image img, .wp-block-post-featured-image.sd-rounded img,
.wp-block-image.sd-rounded img, .wp-block-image.sd-hero-img img {
  display: block; width: 100%; object-fit: cover; object-position: 50% 22%;
  border-radius: var(--sd-pebble-1); filter: var(--sd-grade);
}
.wp-block-image.sd-rounded figcaption, .wp-block-image.sd-hero-img figcaption { margin-top: 1rem; }

/* Article cards: shape carries the card, no box */
.sd-card:has(> .wp-block-post-featured-image) { background: transparent; border-radius: 0; overflow: visible; }
.sd-card .wp-block-post-featured-image { margin: 0 0 .75rem; padding: 5% 7% 3% 4%; }
.sd-card .wp-block-post-featured-image img { aspect-ratio: 1 / 1; }
.sd-card:has(> .wp-block-post-featured-image) > .wp-block-group { padding-left: .25rem !important; padding-right: .25rem !important; }
.wp-block-post-template > li:nth-child(3n+2) .sd-card .wp-block-post-featured-image img { border-radius: var(--sd-pebble-2); }
.wp-block-post-template > li:nth-child(3n+2) .sd-card .wp-block-post-featured-image::before { border-radius: var(--sd-blob-2); transform: rotate(7deg); inset: 4% 6% 6% 2%; }
.wp-block-post-template > li:nth-child(3n) .sd-card .wp-block-post-featured-image img { border-radius: var(--sd-pebble-3); }
.wp-block-post-template > li:nth-child(3n) .sd-card .wp-block-post-featured-image::before { transform: rotate(-12deg); inset: 12% 4% 0 6%; }

/* Article lead image */
.wp-block-post-featured-image.sd-rounded { max-width: 640px; margin-left: auto !important; margin-right: auto !important; padding: 3% 5% 2% 3%; }
.wp-block-post-featured-image.sd-rounded img { aspect-ratio: 5 / 4; }

/* Photos inside articles and pages */
.wp-block-image.sd-rounded { padding: 3% 5% 2% 3%; }
.wp-block-image.sd-rounded img { aspect-ratio: 4 / 3; }
.wp-block-image.sd-rounded:nth-of-type(even) img { border-radius: var(--sd-pebble-2); }
.wp-block-image.sd-rounded:nth-of-type(even)::before { border-radius: var(--sd-blob-2); transform: rotate(6deg); inset: 4% 7% 6% 0; }
.wp-block-image.sd-rounded:nth-of-type(3n) img { border-radius: var(--sd-pebble-3); }

/* Homepage hero */
.wp-block-image.sd-hero-img { padding: 4% 6% 3% 3%; }
.wp-block-image.sd-hero-img img { aspect-ratio: 4 / 5; border-radius: var(--sd-pebble-2); }
.wp-block-image.sd-hero-img::before { border-radius: var(--sd-blob-2); transform: rotate(8deg); }
