/*
Theme Name: CraftyFever
Theme URI: https://craftyfever.com/
Author: CraftyFever
Description: Fast, minimal block theme for CraftyFever: free printables, DIY ideas, trends and travel guides. No jQuery, no web fonts.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: craftyfever
*/

/* Cards (home, archives, search) */
.cf-card { display: flex; flex-direction: column; height: 100%; }
.cf-card .wp-block-post-featured-image { margin: 0 0 1rem; overflow: hidden; border-radius: 14px; }
.cf-card .wp-block-post-featured-image img { transition: transform .35s ease; }
.cf-card:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.cf-card .wp-block-post-terms { margin: 0 0 .35rem; }
.cf-card .wp-block-post-title { margin: 0 0 .5rem; }
.cf-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.cf-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.wp-block-post-terms a { text-decoration: none; }

/* Header */
.cf-header .wp-block-site-title a { text-decoration: none; }
.cf-header .wp-block-navigation a { text-decoration: none; }
.cf-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }

/* Post content */
.cf-content img { border-radius: 10px; height: auto; }
.cf-content figure { margin-top: 1.75rem; margin-bottom: 1.75rem; }
.cf-content table { width: 100%; border-collapse: collapse; font-size: .95em; }
.cf-content th, .cf-content td { padding: .6em .75em; border-bottom: 1px solid var(--wp--preset--color--line); text-align: left; }
.cf-content blockquote { border-left: 3px solid var(--wp--preset--color--accent); margin-left: 0; padding-left: 1.25rem; font-style: italic; }
.cf-content .wp-block-gallery { gap: .75rem; }
.cf-content hr { border: 0; border-top: 1px solid var(--wp--preset--color--line); margin: 2.5rem 0; }

/* "You Might Also Like" block (added by seo_apply.py, last h3 + list in content) */
.cf-content h3:has(+ ul):last-of-type,
.cf-content h3:has(+ .wp-block-list):last-of-type {
  margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--wp--preset--color--line);
}

/* Featured image on single posts: pins are tall, keep them reasonable */
.cf-single-cover img { max-height: 760px; width: auto; max-width: 100%; margin-inline: auto; display: block; border-radius: 14px; }

/* Buttons (download freebies) */
.wp-element-button, .wp-block-button__link { transition: background-color .2s ease, transform .2s ease; }
.wp-element-button:hover, .wp-block-button__link:hover { transform: translateY(-1px); }

/* Sidebar (widget area: newsletter + ads) */
.cf-sidebar { position: sticky; top: 2rem; }
.cf-sidebar .widget { background: var(--wp--preset--color--cream); border-radius: 14px; padding: 1.25rem 1.25rem 1.4rem; margin-bottom: 1.75rem; }
.cf-sidebar .widget-title { font-family: var(--wp--preset--font-family--serif); font-size: 1.05rem; margin: 0 0 .75rem; }
.cf-sidebar .widget_custom_html .widget-title { font-family: var(--wp--preset--font-family--sans); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--muted); font-weight: 600; }
.cf-sidebar .widget_custom_html { background: transparent; padding: 0; }

/* Mailchimp for WP forms (sidebar + footer band) */
.mc4wp-form input[type="email"], .mc4wp-form input[type="text"] {
  width: 100%; box-sizing: border-box; padding: .8rem 1rem; margin: .35rem 0 .6rem;
  border: 1px solid var(--wp--preset--color--line); border-radius: 999px; font: inherit; background: #fff;
}
.mc4wp-form input[type="submit"], .mc4wp-form button {
  width: 100%; padding: .8rem 1.2rem; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--wp--preset--color--accent); color: #fff;
}
.mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover { background: var(--wp--preset--color--accent-dark); }
.mc4wp-form p { margin: 0; }
.cf-newsletter .mc4wp-form-fields { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cf-newsletter .mc4wp-form-fields > * { flex: 1 1 200px; }
.cf-newsletter .mc4wp-form input { margin: 0; }

@media (max-width: 781px) {
  .cf-sidebar { position: static; }
}


/* Two-column layout on posts/pages: content + 300px sidebar */
@media (min-width: 782px) {
  main > .wp-block-columns > .wp-block-column:first-child { flex: 1 1 0 !important; min-width: 0; max-width: 760px; }
  main > .wp-block-columns > .wp-block-column:last-child { flex: 0 0 300px !important; }
}

/* Footer newsletter: hide the form's own intro texts, one clean row (email + button) */
.cf-newsletter .mc4wp-form-fields { max-width: 620px; flex-wrap: nowrap; }
.cf-newsletter .mc4wp-form-fields > *:not(:has(input, button)) { display: none; }
.cf-newsletter .mc4wp-form-fields > *:has(input[type="email"]) { flex: 1 1 auto; }
.cf-newsletter .mc4wp-form-fields > *:has(input[type="submit"], button) { flex: 0 0 170px; }
@media (max-width: 600px) {
  .cf-newsletter .mc4wp-form-fields { flex-wrap: wrap; }
  .cf-newsletter .mc4wp-form-fields > *:has(input[type="submit"], button) { flex: 1 1 100%; }
}

/* Pinterest "Save" button on post images (hover, desktop) */
.cf-pin { position: absolute; z-index: 50; display: none; align-items: center; gap: .35rem; background: #e60023; color: #fff !important;
  font: 700 .9rem/1 var(--wp--preset--font-family--sans); padding: .55rem .95rem; border-radius: 999px; text-decoration: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.cf-pin.is-on { display: inline-flex; }
.cf-pin:hover { background: #ad081b; }

/* Accessible focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

@media (max-width: 781px) {
  .cf-header .wp-block-site-title { font-size: 1.35rem !important; }
}
