/*
Donegal Family Site Style
A warm, practical stylesheet for the family-help website and guide plugins.
Install as the Donegal Family Site Style plugin, or paste this CSS into Appearance > Customize > Additional CSS.
*/

:root {
    --dfw-ink: #23312f;
    --dfw-muted: #64736f;
    --dfw-bg: #fbf6eb;
    --dfw-bg-soft: #fffaf1;
    --dfw-card: #ffffff;
    --dfw-border: #e8ddca;
    --dfw-green: #2f6b57;
    --dfw-green-dark: #224f41;
    --dfw-green-soft: #e7f2ec;
    --dfw-gold: #d99a36;
    --dfw-clay: #9b5b35;
    --dfw-blue-soft: #e9f2f4;
    --dfw-shadow: 0 18px 45px rgba(35, 49, 47, 0.10);
    --dfw-radius-lg: 28px;
    --dfw-radius-md: 18px;
    --dfw-radius-sm: 12px;
    --dfw-width: 1120px;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--dfw-ink);
    background:
        radial-gradient(circle at top left, rgba(217, 154, 54, 0.16), transparent 34rem),
        linear-gradient(180deg, #fffdf8 0%, var(--dfw-bg) 34rem, #fff 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.62;
}

body, button, input, select, textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--dfw-green-dark);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--dfw-clay);
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(217, 154, 54, 0.44);
    outline-offset: 3px;
}

/* Page frame */
.wp-site-blocks,
.site,
#page {
    overflow-x: clip;
}

main,
.site-main,
.wp-block-group:where(.alignwide) {
    max-width: var(--dfw-width);
    margin-left: auto;
    margin-right: auto;
}

.entry-content,
.wp-block-post-content,
.wp-site-blocks > main {
    max-width: var(--dfw-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(18px, 4vw, 34px);
    padding-right: clamp(18px, 4vw, 34px);
}

/* Header and navigation */
header,
.site-header,
.wp-site-blocks > header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232, 221, 202, 0.9);
    box-shadow: 0 8px 24px rgba(35, 49, 47, 0.05);
}

.wp-block-site-title,
.site-title {
    font-weight: 900;
    letter-spacing: -0.03em;
}

.wp-block-site-title a,
.site-title a {
    color: var(--dfw-ink);
    text-decoration: none;
}

.wp-block-navigation,
.main-navigation,
.primary-navigation {
    font-weight: 750;
}

.wp-block-navigation a,
.main-navigation a,
.primary-navigation a,
.menu a {
    color: var(--dfw-ink);
    text-decoration: none;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.wp-block-navigation a:hover,
.main-navigation a:hover,
.primary-navigation a:hover,
.menu a:hover {
    color: var(--dfw-green-dark);
    background: var(--dfw-green-soft);
    transform: translateY(-1px);
}

/* Homepage intro */
.entry-content > h1:first-child,
.wp-block-post-title,
main h1:first-child {
    max-width: 900px;
    margin-top: clamp(28px, 5vw, 58px);
    margin-bottom: 0.55rem;
    font-size: clamp(2.2rem, 6vw, 4.9rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
    color: var(--dfw-ink);
}

.entry-content > h2:first-of-type,
main h2:first-of-type {
    max-width: 900px;
    margin-top: clamp(24px, 4vw, 48px);
    font-size: clamp(2rem, 4.6vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
    color: var(--dfw-ink);
}

.entry-content > h2:first-of-type::after,
main h2:first-of-type::after {
    content: "";
    display: block;
    width: 84px;
    height: 6px;
    margin-top: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--dfw-gold), var(--dfw-green));
}

.entry-content > p,
.wp-block-post-content > p {
    max-width: 800px;
    font-size: clamp(1.05rem, 1.5vw, 1.18rem);
    color: var(--dfw-muted);
}

.entry-content > p strong,
.wp-block-post-content > p strong {
    color: var(--dfw-ink);
}

/* General cards and image links on the home page */
.wp-block-columns {
    gap: clamp(18px, 3vw, 28px);
}

.wp-block-column,
.wp-block-group.is-style-card,
.entry-content > figure.wp-block-image,
.wp-block-media-text,
.wp-block-cover {
    border-radius: var(--dfw-radius-lg);
}

.wp-block-image img,
.entry-content img {
    border-radius: 22px;
    box-shadow: 0 16px 38px rgba(35, 49, 47, 0.12);
}

.wp-block-image figcaption {
    color: var(--dfw-muted);
    font-size: 0.95rem;
}

.entry-content .wp-block-image + p a,
.entry-content .wp-block-image + h2 a,
.entry-content .wp-block-image + h3 a,
.entry-content .wp-block-image + h4 a,
.entry-content > p > a:only-child,
.entry-content > h3 > a:only-child,
.entry-content > h4 > a:only-child {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.25rem 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: var(--dfw-green);
    text-decoration: none;
    font-weight: 850;
    box-shadow: 0 12px 24px rgba(47, 107, 87, 0.20);
}

.entry-content .wp-block-image + p a::after,
.entry-content > p > a:only-child::after,
.entry-content > h3 > a:only-child::after,
.entry-content > h4 > a:only-child::after {
    content: "→";
    font-weight: 900;
}

.entry-content .wp-block-image + p a:hover,
.entry-content .wp-block-image + h2 a:hover,
.entry-content .wp-block-image + h3 a:hover,
.entry-content .wp-block-image + h4 a:hover,
.entry-content > p > a:only-child:hover,
.entry-content > h3 > a:only-child:hover,
.entry-content > h4 > a:only-child:hover {
    background: var(--dfw-green-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* Buttons */
.wp-block-button__link,
button,
input[type="submit"] {
    border-radius: 999px;
    font-weight: 850;
}

.wp-block-button__link {
    background: var(--dfw-green);
    color: #fff;
    box-shadow: 0 12px 24px rgba(47, 107, 87, 0.18);
}

.wp-block-button__link:hover {
    background: var(--dfw-green-dark);
}

/* Generic form polish for other tools such as recycling and meal planner */
.entry-content form:not(.sfkg__form):not(.crg-form),
.wp-block-post-content form:not(.sfkg__form):not(.crg-form) {
    max-width: 920px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--dfw-border);
    border-radius: var(--dfw-radius-lg);
    padding: clamp(18px, 3vw, 28px);
    box-shadow: var(--dfw-shadow);
}

.entry-content form label,
.wp-block-post-content form label {
    font-weight: 800;
    color: var(--dfw-ink);
}

.entry-content input:not([type="checkbox"]):not([type="radio"]),
.entry-content select,
.entry-content textarea,
.wp-block-post-content input:not([type="checkbox"]):not([type="radio"]),
.wp-block-post-content select,
.wp-block-post-content textarea {
    border: 1px solid #d5c9b7;
    border-radius: 14px;
    background: #fff;
    min-height: 46px;
    padding: 0.72rem 0.85rem;
    color: var(--dfw-ink);
}

.entry-content textarea,
.wp-block-post-content textarea {
    min-height: 110px;
}

.entry-content input[type="submit"],
.entry-content button:not(.components-button),
.wp-block-post-content input[type="submit"],
.wp-block-post-content button:not(.components-button) {
    background: var(--dfw-green);
    color: #fff;
    border: 0;
    padding: 0.78rem 1.15rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(47, 107, 87, 0.18);
}

.entry-content input[type="submit"]:hover,
.entry-content button:not(.components-button):hover,
.wp-block-post-content input[type="submit"]:hover,
.wp-block-post-content button:not(.components-button):hover {
    background: var(--dfw-green-dark);
}

/* Screen-Free Kids Guide */
body .sfkg {
    --sfkg-bg: #fff8ed;
    --sfkg-card: #ffffff;
    --sfkg-ink: var(--dfw-ink);
    --sfkg-muted: var(--dfw-muted);
    --sfkg-accent: var(--dfw-green);
    --sfkg-accent-soft: var(--dfw-green-soft);
    --sfkg-border: var(--dfw-border);
    max-width: var(--dfw-width);
    margin: clamp(18px, 3vw, 34px) auto;
    border-radius: var(--dfw-radius-lg);
    box-shadow: var(--dfw-shadow);
    background:
        radial-gradient(circle at top right, rgba(47, 107, 87, 0.13), transparent 28rem),
        linear-gradient(180deg, #fffaf2, #ffffff 58%);
}

body .sfkg__eyebrow,
body .crg-eyebrow {
    letter-spacing: 0.08em;
    font-size: 0.76rem;
}

body .sfkg h2,
body .crg-hero h1 {
    letter-spacing: -0.055em;
}

body .sfkg__form,
body .crg-form {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(232, 221, 202, 0.95);
    box-shadow: 0 14px 34px rgba(35, 49, 47, 0.07);
}

body .sfkg input,
body .sfkg select,
body .sfkg textarea,
body .crg-field input,
body .crg-field select,
body .crg-field textarea {
    border-color: #d5c9b7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body .sfkg__button,
body .crg-button {
    background: var(--dfw-green);
    box-shadow: 0 12px 24px rgba(47, 107, 87, 0.20);
}

body .sfkg__button:hover,
body .crg-button:hover {
    background: var(--dfw-green-dark);
    filter: none;
}

body .sfkg__button--ghost,
body .sfkg__button--print {
    background: #ffffff;
    color: var(--dfw-green-dark);
    border: 1px solid rgba(47, 107, 87, 0.25);
    box-shadow: none;
}

body .sfkg-card,
body .sfkg__guide article {
    border-color: var(--dfw-border);
    box-shadow: 0 12px 28px rgba(35, 49, 47, 0.07);
}

body .sfkg-card__top span,
body .sfkg-card dl div {
    background: #f7f1e7;
}

body .sfkg-card--ai {
    border-left-color: var(--dfw-gold);
}

/* Children’s Reading Guide */
body .crg-wrap {
    --crg-bg: #fff8ed;
    --crg-panel: #ffffff;
    --crg-ink: var(--dfw-ink);
    --crg-muted: var(--dfw-muted);
    --crg-border: var(--dfw-border);
    --crg-accent: var(--dfw-clay);
    --crg-soft: #f6ead7;
    max-width: var(--dfw-width);
    padding-left: clamp(0px, 2vw, 12px);
    padding-right: clamp(0px, 2vw, 12px);
}

body .crg-hero {
    border-radius: var(--dfw-radius-lg);
    background:
        radial-gradient(circle at top right, rgba(217, 154, 54, 0.18), transparent 24rem),
        linear-gradient(135deg, #fff8e9, #eef6f0);
    box-shadow: var(--dfw-shadow);
}

body .crg-hero-card,
body .crg-panel,
body .crg-result-card,
body .crg-age-cards div,
body .crg-resource-box {
    border-color: var(--dfw-border);
    box-shadow: 0 12px 28px rgba(35, 49, 47, 0.06);
}

body .crg-hero-card strong {
    color: var(--dfw-green-dark);
}

body .crg-checks {
    background: #fffaf3;
}

body .crg-pill {
    background: var(--dfw-green-soft);
    color: var(--dfw-green-dark);
}

body .crg-result-card-ai {
    border-left-color: var(--dfw-gold);
}

body .crg-ai-item {
    background: #ffffff;
    border-color: var(--dfw-border);
    box-shadow: 0 10px 22px rgba(35, 49, 47, 0.06);
}

/* Guide/result sections across plugins */
.sfkg__results h3,
.crg-results h3,
.crg-panel h2,
.sfkg__guide h3 {
    color: var(--dfw-ink);
    letter-spacing: -0.025em;
}

.sfkg li::marker,
.crg-wrap li::marker,
.entry-content li::marker {
    color: var(--dfw-green);
    font-weight: 900;
}

/* Footer */
footer,
.site-footer,
.wp-site-blocks > footer {
    margin-top: clamp(34px, 7vw, 80px);
    padding: 28px clamp(18px, 4vw, 34px);
    border-top: 1px solid var(--dfw-border);
    color: var(--dfw-muted);
    background: rgba(255, 250, 241, 0.75);
}

/* Mobile */
@media (max-width: 900px) {
    .entry-content,
    .wp-block-post-content,
    .wp-site-blocks > main {
        padding-left: 18px;
        padding-right: 18px;
    }

    .wp-block-navigation__container,
    .menu {
        gap: 0.35rem;
    }

    .wp-block-navigation a,
    .main-navigation a,
    .primary-navigation a,
    .menu a {
        padding: 0.38rem 0.66rem;
    }
}

@media (max-width: 640px) {
    body {
        background: linear-gradient(180deg, #fffdf8 0%, var(--dfw-bg) 32rem, #fff 100%);
    }

    .entry-content > h1:first-child,
    .wp-block-post-title,
    main h1:first-child {
        font-size: clamp(2rem, 12vw, 3.1rem);
        letter-spacing: -0.055em;
    }

    .entry-content > h2:first-of-type,
    main h2:first-of-type {
        font-size: clamp(1.85rem, 9vw, 2.65rem);
        letter-spacing: -0.045em;
    }

    body .sfkg,
    body .crg-hero,
    body .crg-panel,
    .entry-content form:not(.sfkg__form):not(.crg-form),
    .wp-block-post-content form:not(.sfkg__form):not(.crg-form) {
        border-radius: 20px;
    }

    .entry-content .wp-block-image + p a,
    .entry-content > p > a:only-child,
    .entry-content > h3 > a:only-child,
    .entry-content > h4 > a:only-child {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
