/*
Theme Name:  Tiny Joys
Description: A clean, elegant theme matching the Tiny Joys plugin — sage and plum palette, Cormorant Garamond and Inter fonts.
Version:     1.0
Author:      Midori
*/

/* ─── Google Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;700&display=swap');

/* ─── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #2C3528;
    background: #F7F9F5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #6B3A5C; text-decoration: none; }
a:hover { text-decoration: underline; }

strong, b { font-weight: 700; }
em, i { font-style: italic; }

/* ─── Layout wrapper ─────────────────────────────────────────────────────── */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-content {
    flex: 1;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
    background: #fff;
    border-bottom: 1px solid #B8849A;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 64px;
}

/* Site title / logo */
.site-branding a {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #6B3A5C;
    text-decoration: none;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.site-branding a:hover { color: #57304b; text-decoration: none; }
.site-branding .ornament { color: #2C5F2E; font-size: 1.1rem; }

/* Navigation */
.primary-nav ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}
.primary-nav ul li a {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2C3528;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}
.primary-nav ul li a:hover,
.primary-nav ul li.current-menu-item > a,
.primary-nav ul li.current_page_item > a {
    color: #6B3A5C;
    background: #f0ebe8;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1.5px solid #B8849A;
    border-radius: 3px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #2C3528;
    font-size: 1.1rem;
    line-height: 1;
}
.menu-toggle:hover { border-color: #B8849A; color: #6B3A5C; }

/* ─── Page content ───────────────────────────────────────────────────────── */
.page-header { margin-bottom: 2.5rem; }

.page-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    line-height: 1.15;
    color: #2C3528;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #6a7d65;
}

/* Divider ornament used between sections */
.tjoys-divider {
    text-align: center;
    margin: 2.5rem 0;
    color: #B8849A;
    opacity: 0.6;
    font-size: 1.2rem;
    letter-spacing: 0.3em;
}

/* ─── Prose / entry content ──────────────────────────────────────────────── */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: #2C3528;
    margin: 2rem 0 0.75rem;
    line-height: 1.2;
}
.entry-content h1 { font-size: 2.2rem; }
.entry-content h2 { font-size: 1.75rem; }
.entry-content h3 { font-size: 1.35rem; }
.entry-content h4 { font-size: 1.1rem; }

.entry-content p { margin-bottom: 1.25rem; color: #2C3528; }
.entry-content p:last-child { margin-bottom: 0; }

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.25rem 1.5rem;
    color: #2C3528;
}
.entry-content li { margin-bottom: 0.4rem; }

.entry-content blockquote {
    border-left: 3px solid #B8849A;
    margin: 1.75rem 0;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-radius: 0 3px 3px 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #6B3A5C;
}

.entry-content a { color: #6B3A5C; text-decoration: underline; }
.entry-content a:hover { color: #57304b; }

.entry-content img {
    border-radius: 3px;
    margin: 1.5rem 0;
}

.entry-content hr {
    border: none;
    border-top: 1px solid #B8849A;
    margin: 2.5rem 0;
}

/* ─── Buttons (WordPress blocks) ─────────────────────────────────────────── */
.wp-block-button__link,
.entry-content .button,
.entry-content button {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: #6B3A5C;
    color: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 3px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.wp-block-button__link:hover,
.entry-content .button:hover { background: #57304b; }

/* Ghost / outline button */
.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    color: #6B3A5C !important;
    border: 1.5px solid #B8849A;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: #6B3A5C;
    color: #fff !important;
    border-color: #6B3A5C;
}

/* ─── Cards / callout box ────────────────────────────────────────────────── */
.tjoys-box {
    background: #fff;
    border: 1px solid #B8849A;
    border-radius: 4px;
    padding: 2.25rem 2.5rem;
    margin: 2rem 0;
}

.wp-block-group {
    margin-bottom: 1.5rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    background: #F7F9F5;
    border-top: 1px solid #dce7d8;
    padding: 2rem 2rem;
    text-align: center;
}
.site-footer-inner {
    max-width: 1024px;
    margin: 0 auto;
}
.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.footer-nav ul li a {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6a7d65;
    padding: 0.25rem 0.6rem;
    text-decoration: none;
    transition: color 0.15s;
}
.footer-nav ul li a:hover { color: #6B3A5C; }

.footer-ornament {
    color: #2C5F2E;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}
.footer-copy {
    font-size: 0.8rem;
    color: #4a5645;
}
.footer-copy a { color: #2C3528; }
.footer-copy a:hover { color: #6B3A5C; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .site-content { padding: 2rem 1.25rem 4rem; }
    .site-header-inner { padding: 0 1.25rem; }

    .menu-toggle { display: block; }

    .primary-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #B8849A;
        padding: 0.75rem 1.25rem 1rem;
        box-shadow: 0 4px 12px rgba(44,53,40,0.08);
    }
    .primary-nav.open { display: block; }
    .primary-nav ul { flex-direction: column; gap: 0; }
    .primary-nav ul li a { display: block; padding: 0.6rem 0.5rem; }
}

/* ─── WordPress alignment helpers ────────────────────────────────────────── */
.alignleft  { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { margin: 1.5rem auto; text-align: center; }
.alignwide  { max-width: 1024px; margin-left: auto; margin-right: auto; }
.alignfull  { max-width: 100%; }

/* ─── WordPress admin bar fix ────────────────────────────────────────────── */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ─── Visually hidden (accessible) ──────────────────────────────────────────
   Applied to page titles when "Hide title visually" is checked in the editor.
   The H1 stays in the DOM for SEO and screen readers but is invisible on screen. */
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ─── Two-column page layout (content + sidebar) ─────────────────────────── */
/* Grid is applied via inline style on the div for reliable rendering */
.page-layout { display: block; }
.page-layout > .page-content { min-width: 0; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.page-sidebar-column {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.page-sidebar {
    background: #F7F9F5;
    border: 1px solid rgba(184,132,154,0.4);
    border-radius: 4px;
}
.sidebar-widget {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: .85rem 0;
    margin-bottom: 0;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    color: #4a5645 !important;
    line-height: 1.6 !important;
}
/* Also strip borders from any WordPress widget class applied to the same element */
.page-sidebar .widget {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* Strip borders from all Gutenberg block elements inside the sidebar */
.page-sidebar [class*="wp-block"],
.page-sidebar .wp-block-group,
.page-sidebar .wp-block-widget-area,
.page-sidebar .entry-content,
.page-sidebar .widget-content {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
.sidebar-widget:first-child { padding-top: 0; }
.sidebar-widget:last-child { padding-bottom: 0; }
/* Use inline style on the widget wrapper to guarantee the heading font —
   WordPress injects the title as <h3> which browsers bold by default */
.page-sidebar .sidebar-widget h3,
.page-sidebar h3,
.page-sidebar .sidebar-widget-title {
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 24px !important;
    font-weight: 500 !important;
    color: #2C3528 !important;
    margin: 0 0 .75rem !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.sidebar-widget p,
.sidebar-widget li {
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    color: #4a5645 !important;
    line-height: 1.6 !important;
    margin: 0 0 .5em !important;
}
.sidebar-widget p:last-child,
.sidebar-widget li:last-child { margin-bottom: 0 !important; }
.sidebar-widget a { color: #6B3A5C !important; text-decoration: none; }
.sidebar-widget a:hover { color: #57304b !important; text-decoration: underline; }

/* Sidebar aligns via grid — no extra padding needed when header is properly absent */
.page-sidebar { padding-top: 0; }
/* Link-box style — add class="link-box" to Custom HTML widget wrapper */
.sidebar-widget.link-box {
    text-align: center;
    background: #F7F9F5;
}
.sidebar-widget .wp-block-button__link,
.sidebar-widget a.button {
    display: inline-block;
    padding: .6rem 1.4rem;
    background: #6B3A5C;
    color: #fff !important;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s;
}
.sidebar-widget .wp-block-button__link:hover,
.sidebar-widget a.button:hover { background: #57304b; }

@media (max-width: 900px) {
    .page-layout[style*="grid"] {
        display: block !important;
    }
    .page-sidebar-column {
        position: static !important;
        margin-top: 2.5rem !important;
        width: 100% !important;
    }
}



/* ─── Separator spacing ───────────────────────────────────────────────────── */
hr, .wp-block-separator,
.entry-content hr,
.entry-content .wp-block-separator,
.wp-block-separator.has-alpha-channel-opacity,
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}
