/*
Theme Name: SimplyHA
Theme URI: https://simplyha.com
Author: Chris
Author URI: https://simplyha.com
Description: A warm, friendly block theme for SimplyHA. Home Assistant education for the rest of us. Built with a cream palette, sage and terracotta accents, and a Fraunces + Inter typography pairing.
Version: 1.0.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: simplyha
Tags: blog, one-column, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, block-patterns, sticky-post, threaded-comments, translation-ready, wide-blocks
*/

/* ============================
   SimplyHA Custom CSS
   Theme uses theme.json for most styling.
   This file holds refinements that the block editor cannot express cleanly.
   ============================ */

:root {
  --simplyha-shadow: 0 1px 2px rgba(42,37,32,0.04), 0 8px 24px rgba(42,37,32,0.06);
  --simplyha-radius: 10px;
  --simplyha-radius-lg: 18px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sticky header w/ blur */
.wp-block-template-part.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(250, 246, 238, 0.92);
  border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Logo wordmark treatment */
.simplyha-logo {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  line-height: 1;
}
.simplyha-logo .period {
  color: var(--wp--preset--color--sage);
}

/* Eyebrow label */
.simplyha-eyebrow {
  display: inline-block;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--terracotta-deep);
  background: rgba(200, 120, 86, 0.09);
  padding: 6px 14px;
  border-radius: 100px;
}
.simplyha-eyebrow.sage {
  color: var(--wp--preset--color--sage-deep);
  background: rgba(107, 142, 111, 0.1);
}

/* Headline italic accent */
.simplyha-italic-accent em {
  font-style: italic;
  color: var(--wp--preset--color--sage-deep);
}
.simplyha-italic-accent.terracotta em {
  color: var(--wp--preset--color--terracotta);
}

/* Rounded pill buttons globally */
.wp-block-button__link {
  border-radius: 100px !important;
  padding: 14px 26px;
  font-weight: 600;
  letter-spacing: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}
.wp-block-button__link:hover {
  transform: translateY(-1px);
}

/* Email signup pill */
.simplyha-signup {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  padding: 8px;
  border-radius: 100px;
  border: 1px solid var(--wp--preset--color--border);
  box-shadow: var(--simplyha-shadow);
  display: flex;
  gap: 8px;
  align-items: center;
}
.simplyha-signup input[type="email"] {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 20px;
  font-size: 16px;
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--ink);
  outline: none;
  min-width: 0;
}
.simplyha-signup input::placeholder {
  color: var(--wp--preset--color--ink-muted);
}
.simplyha-signup button {
  background: var(--wp--preset--color--sage);
  color: #fff;
  border: 0;
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--wp--preset--font-family--inter);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.simplyha-signup button:hover {
  background: var(--wp--preset--color--sage-deep);
  transform: translateY(-1px);
}

/* Promise cards */
.simplyha-card {
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--simplyha-radius-lg);
  padding: 36px 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}
.simplyha-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--simplyha-shadow);
}
.simplyha-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(107, 142, 111, 0.12);
  color: var(--wp--preset--color--sage-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  font-size: 22px;
}
.simplyha-card-icon svg {
  display: block;
}
.simplyha-card-icon.terracotta {
  background: rgba(200, 120, 86, 0.12);
  color: var(--wp--preset--color--terracotta-deep);
}

/* Tool cards (homepage tools feature block) */
.simplyha-tool-card {
  display: block;
  background: #FFFFFF;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--simplyha-radius-lg);
  padding: 32px 28px;
  text-decoration: none;
  color: var(--wp--preset--color--ink);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.simplyha-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--simplyha-shadow);
  border-color: var(--wp--preset--color--sage);
}
.simplyha-tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  background: rgba(107, 142, 111, 0.12);
  color: var(--wp--preset--color--sage-deep);
}
.simplyha-tool-icon.terracotta {
  background: rgba(200, 120, 86, 0.12);
  color: var(--wp--preset--color--terracotta-deep);
}
.simplyha-tool-icon svg {
  display: block;
}
.simplyha-tool-card h3 {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--wp--preset--color--ink);
  margin: 0 0 12px 0;
}
.simplyha-tool-card p {
  color: var(--wp--preset--color--ink-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 18px 0;
}
.simplyha-tool-link {
  display: inline-block;
  color: var(--wp--preset--color--sage-deep);
  font-weight: 600;
  font-size: 15px;
  font-family: var(--wp--preset--font-family--inter);
}
.simplyha-tool-card:hover .simplyha-tool-link {
  color: var(--wp--preset--color--terracotta-deep);
}

/* Hero section soft background blobs */
.simplyha-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.simplyha-hero::before,
.simplyha-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(70px);
  will-change: transform;
}
.simplyha-hero::before {
  top: -120px;
  right: -80px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(107, 142, 111, 0.28) 0%, rgba(107, 142, 111, 0) 70%);
}
.simplyha-hero::after {
  bottom: -100px;
  left: -60px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(200, 120, 86, 0.22) 0%, rgba(200, 120, 86, 0) 70%);
}
@media (max-width: 640px) {
  .simplyha-hero::before {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
  }
  .simplyha-hero::after {
    width: 260px;
    height: 260px;
    bottom: -60px;
    left: -40px;
  }
}

/* Preview card (featured article) */
.simplyha-preview-card {
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--simplyha-radius-lg);
  padding: 40px;
  box-shadow: var(--simplyha-shadow);
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.simplyha-step-pills {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--wp--preset--color--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.simplyha-step-pill {
  font-size: 13px;
  color: var(--wp--preset--color--ink-muted);
  background: var(--wp--preset--color--cream);
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--wp--preset--color--border);
  font-family: var(--wp--preset--font-family--inter);
}

/* Article cards (homepage Latest grid) */
.simplyha-article-card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--simplyha-radius-lg);
  padding: 32px 28px;
  color: var(--wp--preset--color--ink);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.simplyha-article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--simplyha-shadow);
  border-color: var(--wp--preset--color--sage);
}
.simplyha-article-card h3 {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  margin: 20px 0 14px;
  color: var(--wp--preset--color--ink);
}
.simplyha-article-card p {
  color: var(--wp--preset--color--ink-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
}
.simplyha-article-meta {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--wp--preset--color--ink-muted);
  margin-bottom: 20px;
  align-items: center;
}
.simplyha-article-meta .dot {
  color: var(--wp--preset--color--border);
}
.simplyha-article-link {
  display: inline-block;
  color: var(--wp--preset--color--sage-deep);
  font-weight: 600;
  font-size: 15px;
  font-family: var(--wp--preset--font-family--inter);
  text-decoration: none;
}
/* Stretched link — makes the entire card clickable */
.simplyha-article-link.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--simplyha-radius-lg);
}
.simplyha-article-card > * {
  position: relative;
  z-index: 0;
}

/* Thumbnailed variant (used on homepage "Three guides") */
.simplyha-article-card.has-thumb {
  padding: 0;
  overflow: hidden;
}
.simplyha-article-card.has-thumb .simplyha-article-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--wp--preset--color--cream-deep);
}
.simplyha-article-card.has-thumb .simplyha-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.simplyha-article-card.has-thumb:hover .simplyha-article-thumb img {
  transform: scale(1.03);
}
.simplyha-article-card.has-thumb .simplyha-article-body {
  padding: 28px 28px 32px;
}
.simplyha-article-card.has-thumb h3 {
  margin-top: 14px;
}

/* About avatar */
.simplyha-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wp--preset--color--sage) 0%, var(--wp--preset--color--terracotta) 100%);
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 36px;
  font-weight: 500;
}

/* Single article body polish */
.wp-block-post-content p {
  line-height: 1.75;
}
.wp-block-post-content h2,
.wp-block-post-content h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.wp-block-post-content img {
  border-radius: var(--simplyha-radius);
  box-shadow: var(--simplyha-shadow);
}

/* Footer tweaks */
.wp-block-template-part.site-footer {
  background: var(--wp--preset--color--ink);
  color: rgba(250, 246, 238, 0.75);
}
.wp-block-template-part.site-footer a {
  color: rgba(250, 246, 238, 0.75);
}
.wp-block-template-part.site-footer a:hover {
  color: var(--wp--preset--color--cream);
}

/* Responsive */
@media (max-width: 782px) {
  .simplyha-signup {
    flex-direction: column;
    border-radius: var(--simplyha-radius-lg);
    padding: 12px;
  }
  .simplyha-signup input[type="email"] {
    text-align: center;
  }
  .simplyha-signup button {
    width: 100%;
  }
}
