/*
Theme Name: Driftly
Theme URI: https://driftly.blog
Author: Driftly
Author URI: https://driftly.blog
Description: A warm, slow personal blog theme about sleep, wellness, and a quieter mind. Block theme (FSE), four built-in color variations (Terracotta, Rosewood, Honey, Sage), self-hosted typography. Plug-and-play compatible with Jetpack, MailPoet, WPForms, Contact Form 7, WooCommerce, and the WordPress mobile apps.
Version: 1.3.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: driftly
Tags: blog, one-column, two-columns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, threaded-comments, translation-ready, block-styles, wide-blocks, accessibility-ready
*/

/* Self-hosted fonts */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/newsreader-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/newsreader-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/dmsans-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/dmsans-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
  font-family: 'Crimson Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/crimson-pro-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/dm-serif-display-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/playfair-display-400.woff2') format('woff2');
}

/* Base */
body {
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 400px at 80% -10%, rgba(217,154,58,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(194,86,46,0.06), transparent 60%);
  background-attachment: fixed;
}

a { transition: color .15s ease; }
.wp-block-post-title a:hover,
.wp-block-navigation a:hover { color: var(--wp--preset--color--terra) !important; }

/* Buttons */
.wp-block-button__link {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Footer list */
.driftly-footer-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0;
}
.driftly-footer-list li { margin-bottom: 10px; font-size: 14px; }
.driftly-footer-list li a { color: var(--wp--preset--color--ink-soft); }
.driftly-footer-list li a:hover { color: var(--wp--preset--color--terra); }

/* Hero art panel */
.driftly-hero-art {
  aspect-ratio: 4/5;
  border-radius: 8px;
  background:
    radial-gradient(circle at 60% 35%, rgba(255,255,255,0.35), transparent 55%),
    linear-gradient(160deg, #c8d0a8 0%, #8a9968 55%, #3a4a2e 100%);
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.driftly-hero-art .wp-block-site-logo img {
  filter: drop-shadow(0 8px 20px rgba(34,42,29,0.3));
}

/* Hero title display */
.driftly-hero h1, .driftly-hero h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.driftly-hero h1 em, .driftly-hero h2 em {
  font-style: italic;
  color: var(--wp--preset--color--terra);
  font-weight: 300;
}

/* Eyebrow */
.driftly-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.28em;
  color: var(--wp--preset--color--terra);
}
.driftly-eyebrow::before {
  content: ""; width: 28px; height: 1px;
  background: var(--wp--preset--color--terra); display: inline-block;
}

/* Category cards */
.driftly-cat-card {
  position: relative; border: 1px solid var(--wp--preset--color--rule);
  border-radius: 16px; padding: 32px 28px;
  background: var(--wp--preset--color--paper);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.driftly-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -22px rgba(164, 69, 32, 0.25);
  border-color: var(--wp--preset--color--terra);
}
.driftly-cat-card .driftly-glyph {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; background: var(--wp--preset--color--cream-2);
}

/* Post cards */
.driftly-post-card .wp-block-post-featured-image img {
  border-radius: 6px; aspect-ratio: 4/3; object-fit: cover; width: 100%;
}
.driftly-post-card .wp-block-post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; letter-spacing: -0.015em;
  text-wrap: balance;
}
.driftly-post-card .wp-block-post-terms {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--wp--preset--color--terra);
}
.driftly-post-card .wp-block-post-date {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--wp--preset--color--ink-mute);
}

/* Trending list */
.driftly-trending .wp-block-post {
  display: grid; grid-template-columns: 80px 1fr; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--rule);
}
.driftly-trending .wp-block-post:last-child { border-bottom: 0; }
.driftly-trending .wp-block-post-featured-image img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 4px;
}
.driftly-trending .wp-block-post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px; line-height: 1.2; font-weight: 400;
}

/* Newsletter dark block */
.driftly-newsletter {
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--paper);
  border-radius: 24px; padding: 56px;
  position: relative; overflow: hidden;
}
.driftly-newsletter::before {
  content: ""; position: absolute; right: -10%; top: -40%;
  width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--wp--preset--color--amber), var(--wp--preset--color--plum) 70%);
  opacity: 0.85; pointer-events: none;
}
.driftly-newsletter > * { position: relative; z-index: 1; }
.driftly-newsletter .wp-block-heading {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; letter-spacing: -0.02em; text-wrap: balance;
}

/* Cookie banner (Jetpack-compatible) — themed only */
.cmplz-cookiebanner, .wp-block-cookie-notice {
  background: var(--wp--preset--color--ink) !important;
  color: var(--wp--preset--color--paper) !important;
  border-radius: 14px !important;
}

/* Mobile / tablet */
@media (max-width: 1024px) {
  .driftly-hero h1, .driftly-hero h2 { font-size: clamp(40px, 7vw, 64px) !important; }
  .driftly-newsletter { padding: 36px 28px; border-radius: 18px; }
}
@media (max-width: 640px) {
  .driftly-hero h1, .driftly-hero h2 { font-size: clamp(36px, 9vw, 48px) !important; }
  .driftly-cat-card { padding: 24px 20px; }
  .driftly-trending .wp-block-post { grid-template-columns: 64px 1fr; gap: 12px; }
  .driftly-trending .wp-block-post-featured-image img { width: 64px; height: 64px; }
}

/* === PLUGIN COMPATIBILITY ============================================ */

/* Jetpack — Subscriptions */
.wp-block-jetpack-subscriptions input[type="email"],
.jetpack_subscription_widget input[type="email"] {
  border: 1px solid var(--wp--preset--color--rule) !important;
  background: var(--wp--preset--color--cream) !important;
  color: var(--wp--preset--color--ink) !important;
  padding: 12px 16px !important;
  border-radius: 4px !important;
  font-family: inherit !important;
}
.wp-block-jetpack-subscriptions button,
.jetpack_subscription_widget input[type="submit"] {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 12px 22px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}
.wp-block-jetpack-subscriptions button:hover { background: var(--wp--preset--color--terra-deep) !important; }

/* Jetpack — Related Posts */
.jp-relatedposts h3.jp-relatedposts-headline em {
  font-family: 'Newsreader', Georgia, serif !important;
  font-style: italic !important;
  color: var(--wp--preset--color--terra) !important;
}
.jp-relatedposts-post-title a { color: var(--wp--preset--color--ink) !important; }
.jp-relatedposts-post-title a:hover { color: var(--wp--preset--color--terra) !important; }

/* Jetpack — Sharing */
.sd-content ul li a.sd-button,
.sharedaddy .sd-content ul li a {
  border-radius: 4px !important;
}

/* MailPoet */
.mailpoet_form input.mailpoet_text,
.mailpoet_form input.mailpoet_email {
  border: 1px solid var(--wp--preset--color--rule) !important;
  background: var(--wp--preset--color--cream) !important;
  border-radius: 4px !important;
  padding: 12px 16px !important;
  font-family: inherit !important;
}
.mailpoet_form .mailpoet_submit {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 12px 22px !important;
  font-weight: 500 !important;
}

/* WPForms */
.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container textarea,
.wpforms-container select {
  border: 1px solid var(--wp--preset--color--rule) !important;
  background: var(--wp--preset--color--cream) !important;
  border-radius: 4px !important;
  font-family: inherit !important;
  color: var(--wp--preset--color--ink) !important;
}
.wpforms-container button[type="submit"],
.wpforms-submit {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 12px 22px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
}
.wpforms-container button[type="submit"]:hover { background: var(--wp--preset--color--terra-deep) !important; }

/* Contact Form 7 */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea,
.wpcf7 select {
  border: 1px solid var(--wp--preset--color--rule) !important;
  background: var(--wp--preset--color--cream) !important;
  border-radius: 4px !important;
  padding: 12px 14px !important;
  font-family: inherit !important;
  color: var(--wp--preset--color--ink) !important;
  width: 100%;
}
.wpcf7 input[type="submit"] {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 12px 22px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--terra-deep) !important; }

/* Newsletter Glue */
.ngl-form input,
.ngl-form button {
  border-radius: 4px !important;
  font-family: inherit !important;
}

/* Cookie banners — Complianz, CookieYes, GDPR Cookie Compliance */
.cmplz-cookiebanner,
.cky-consent-container,
.gdpr-cookie-consent-bar {
  background: var(--wp--preset--color--ink) !important;
  color: var(--wp--preset--color--paper) !important;
  border-radius: 14px !important;
  font-family: inherit !important;
}
.cmplz-cookiebanner .cmplz-btn,
.cky-btn-accept,
.gdpr-cookie-consent-bar-button-bar > button {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border-radius: 999px !important;
  border: 0 !important;
}

/* Yoast & RankMath breadcrumbs */
#breadcrumbs,
.rank-math-breadcrumb {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wp--preset--color--ink-mute);
}
#breadcrumbs a,
.rank-math-breadcrumb a { color: var(--wp--preset--color--ink); }
#breadcrumbs a:hover,
.rank-math-breadcrumb a:hover { color: var(--wp--preset--color--terra); }

/* WooCommerce — primary buttons */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--wp--preset--color--terra) !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 12px 22px !important;
  font-weight: 500 !important;
}
.woocommerce a.button:hover { background: var(--wp--preset--color--terra-deep) !important; }
.woocommerce-info, .woocommerce-message {
  border-top-color: var(--wp--preset--color--terra) !important;
  background: var(--wp--preset--color--paper) !important;
}

/* Site Kit / analytics — no styling */

/* Lazy-load placeholder */
img.lazyload, img.lazyloading {
  background: var(--wp--preset--color--cream-2);
}

/* === SINGLE POST + PAGE CONTENT ====================================== */
.wp-block-post-content {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--wp--preset--color--ink-soft);
  max-width: 680px;
  margin: 0 auto;
}
.wp-block-post-content > * + * { margin-top: 1.2em; }
.wp-block-post-content > p { margin-top: 1em; }
.wp-block-post-content h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  color: var(--wp--preset--color--ink);
  margin-top: 2.4em;
  margin-bottom: 0.4em;
  letter-spacing: -0.015em;
}
.wp-block-post-content h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  color: var(--wp--preset--color--ink);
  margin-top: 2em;
  margin-bottom: 0.3em;
}
.wp-block-post-content h4 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 18px;
  margin-top: 1.8em;
  margin-bottom: 0.3em;
  color: var(--wp--preset--color--ink);
}
.wp-block-post-content blockquote {
  border-left: 3px solid var(--wp--preset--color--terra);
  padding-left: 24px;
  margin: 2em 0;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--wp--preset--color--ink);
}
.wp-block-post-content a {
  color: var(--wp--preset--color--terra);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.wp-block-post-content a:hover { color: var(--wp--preset--color--terra-deep); }
.wp-block-post-content ul, .wp-block-post-content ol { padding-left: 1.4em; }
.wp-block-post-content li { margin-bottom: 0.4em; }
.wp-block-post-content img,
.wp-block-post-content .wp-block-image {
  border-radius: 6px;
  margin: 1.6em 0;
}
.wp-block-post-content details {
  background: var(--wp--preset--color--paper);
  border: 1px solid var(--wp--preset--color--rule);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 1.5em 0;
}
.wp-block-post-content details summary {
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* Single post header */
.wp-site-blocks .wp-block-post-title {
  text-wrap: balance;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--wp--preset--color--terra);
  outline-offset: 3px; border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper);
  padding: 8px 12px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }
