/*
Theme Name: Nightshade Hall
Theme URI: https://nightshade-hall.neocities.org/
Author: Nightshade Hall
Description: A cosy, floral, bookish theme for The Nightshade Hall, with reusable reading and knitting blog components.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nightshade-hall
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==================================================
   NIGHTSHADE HALL — GLOBAL PALETTE & DESIGN TOKENS
   ================================================== */

:root {
    --nsh-cream: #fffaf3;
    --nsh-parchment: #f7efe5;
    --nsh-sage: #a8b5a0;
    --nsh-dark-sage: #596b53;
    --nsh-rose: #d6a6ad;
    --nsh-dusty-rose: #b87585;
    --nsh-plum: #65445f;
    --nsh-dark-plum: #402c3e;
    --nsh-ink: #352f33;
    --nsh-muted: #766b70;
    --nsh-border: #c8b7c0;
    --nsh-white: #ffffff;
    --nsh-shadow: 0 5px 18px rgba(64, 44, 62, 0.08);
    --nsh-radius: 12px;
    --nsh-content-width: 1120px;
}

/* Reset and base */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--nsh-cream);
    /* Tiny repeating floral motif, built in so no image upload is required. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='%23d6a6ad' fill-opacity='.23'%3E%3Cellipse cx='15' cy='13' rx='3' ry='5'/%3E%3Cellipse cx='9' cy='19' rx='3' ry='5' transform='rotate(-60 9 19)'/%3E%3Cellipse cx='21' cy='19' rx='3' ry='5' transform='rotate(60 21 19)'/%3E%3Ccircle cx='15' cy='19' r='2' fill='%23a8b5a0'/%3E%3Cellipse cx='57' cy='53' rx='3' ry='5'/%3E%3Cellipse cx='51' cy='59' rx='3' ry='5' transform='rotate(-60 51 59)'/%3E%3Cellipse cx='63' cy='59' rx='3' ry='5' transform='rotate(60 63 59)'/%3E%3Ccircle cx='57' cy='59' r='2' fill='%23a8b5a0'/%3E%3C/g%3E%3C/svg%3E");
    color: var(--nsh-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.75;
}

img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

a {
    color: var(--nsh-plum);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:hover, a:focus { color: var(--nsh-dusty-rose); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--nsh-dark-sage);
    outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--nsh-dark-plum);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.25em; }
ul, ol { padding-left: 1.5em; }
blockquote {
    margin: 1.5em 0;
    padding: .75em 1.25em;
    border-left: 4px solid var(--nsh-rose);
    background: var(--nsh-parchment);
    color: var(--nsh-dark-plum);
}
hr, .wp-block-separator { border: 0; border-top: 1px solid var(--nsh-border); }

/* Overall frame */
.site-frame {
    width: min(calc(100% - 32px), var(--nsh-content-width));
    margin: 26px auto;
    background: rgba(255, 250, 243, .97);
    border: 1px solid rgba(200, 183, 192, .75);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--nsh-shadow);
}

.site-header { position: relative; }
.header-image {
    min-height: 360px;
    display: flex;
    align-items: end;
    position: relative;
    overflow: hidden;
    /* Clean, solid fallback when no custom header image is set. */
    background: #4b3027;
}
.header-image > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}
.banner-title {
    position: relative;
    z-index: 1;
    width: fit-content;
    max-width: min(760px, 92%);
    margin: 0 0 26px clamp(18px, 4vw, 48px);
    padding: 18px 28px 20px;
    color: #fffaf3;
    background: rgba(75, 48, 39, .78);
    border: 1px solid rgba(255, 250, 243, .22);
    border-radius: 3px;
    box-shadow: 0 3px 14px rgba(30, 20, 18, .16);
}
.banner-title .site-title { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.2; }
.banner-title .site-title a { color: var(--nsh-white); text-decoration: none; }
.banner-title .site-title a:hover { color: #f7efe5; }
.banner-title .site-tagline { margin: 4px 0 0; font-style: italic; letter-spacing: .04em; color: #fffaf3; }
.banner-title h1 {
    color: var(--nsh-white);
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.banner-title p {
    margin: 4px 0 0;
    font-style: italic;
    letter-spacing: .04em;
    color: #fffaf3;
}
.custom-logo-link { display: inline-block; margin-bottom: 8px; }
.custom-logo { max-height: 100px; width: auto; }

/* Navigation */
.main-navigation {
    background: var(--nsh-parchment);
    border-top: 1px solid var(--nsh-border);
    border-bottom: 1px solid var(--nsh-border);
}
.nav-inner {
    width: min(calc(100% - 32px), var(--nsh-content-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
}
.menu-toggle {
    display: none;
    border: 1px solid var(--nsh-border);
    border-radius: 8px;
    background: var(--nsh-cream);
    color: var(--nsh-dark-plum);
    padding: 7px 12px;
}
.main-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-navigation li { margin: 0; }
.main-navigation a {
    display: block;
    padding: 12px 14px;
    color: var(--nsh-dark-plum);
    text-decoration: none;
    border-radius: 8px;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    background: var(--nsh-white);
    color: var(--nsh-plum);
}

/* Two-column body and sidebar */
.site-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 28px;
    padding: clamp(18px, 3vw, 34px);
}
.content-area {
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
}
.sidebar {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}
.sidebar-box {
    padding: 17px;
    margin: 0 0 20px;
    border: 1px solid var(--nsh-border);
    border-radius: var(--nsh-radius);
    background: var(--nsh-white);
}
.sidebar-box h2, .sidebar-box h3 {
    font-size: 1.15rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--nsh-border);
}
.sidebar-nav, .sidebar-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-nav li, .sidebar-box li { margin: 0 0 8px; }
.sidebar-nav a { text-decoration: none; }
.sidebar-box .small-note { font-size: .82rem; color: var(--nsh-muted); line-height: 1.5; margin-top: 12px; }
.sidebar .widget { margin-bottom: 20px; }
.sidebar .widget ul { padding-left: 1.2em; }

/* Calendar widget */
.nsh-calendar .calendar-title {
    text-align: center;
    color: var(--nsh-dark-plum);
    font-weight: bold;
    margin-bottom: 8px;
}
.nsh-calendar table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    text-align: center;
}
.nsh-calendar th, .nsh-calendar td { padding: 4px 1px; border: 0; }
.nsh-calendar th { color: var(--nsh-dark-sage); }
.nsh-calendar .today {
    background: var(--nsh-rose);
    color: var(--nsh-dark-plum);
    border-radius: 50%;
    font-weight: bold;
}

/* Posts and archives */
.post-card, .page-card, .content-panel {
    padding: clamp(18px, 3vw, 30px);
    margin-bottom: 24px;
    background: var(--nsh-white);
    border: 1px solid var(--nsh-border);
    border-radius: var(--nsh-radius);
}
.post-card .entry-title, .entry-title {
    margin: 0 0 8px;
}
.entry-title a { color: var(--nsh-dark-plum); text-decoration: none; }
.entry-title a:hover { color: var(--nsh-dusty-rose); }
.entry-meta, .post-date, .archive-description {
    color: var(--nsh-muted);
    font-size: .9rem;
}
.entry-meta { margin-bottom: 18px; }
.post-thumbnail { margin: 0 0 18px; }
.post-thumbnail img { display: block; width: 100%; border-radius: 8px; }
.read-more { font-weight: bold; }
.navigation.pagination, .post-navigation, .posts-navigation {
    margin: 28px 0;
    padding: 16px;
    background: var(--nsh-parchment);
    border-radius: var(--nsh-radius);
}
.page-numbers { display: inline-block; padding: 5px 10px; }
.page-numbers.current { background: var(--nsh-sage); border-radius: 6px; }

/* Article components */
.entry-content > :first-child { margin-top: 0; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content img { border-radius: 5px; }
.entry-content figure { margin: 1.5em 0; }
.wp-caption, .wp-caption-text, .blocks-gallery-caption, .wp-block-image figcaption {
    color: var(--nsh-muted);
    font-size: .88rem;
    text-align: center;
}
.wp-block-button__link {
    background: var(--nsh-plum);
    color: var(--nsh-white);
    border-radius: 8px;
}
.wp-block-button__link:hover { background: var(--nsh-dark-sage); color: var(--nsh-white); }

/* Knitting project progress table */
.knitting-progress {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border: 2px solid var(--nsh-dark-sage);
    margin: 1.5em 0;
    background: var(--nsh-white);
}
.knitting-progress td {
    border: 2px solid var(--nsh-dark-sage);
    padding: 12px;
    vertical-align: top;
}
.knitting-progress .progress-photo { width: 25%; text-align: center; }
.knitting-progress .progress-notes {
    width: 75%;
    padding: 15px 20px;
    text-align: left;
    vertical-align: top;
}
.knitting-progress .progress-photo img {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

/* At a Glance box */
.at-a-glance {
    position: relative;
    background: var(--nsh-parchment);
    border: 2px solid var(--nsh-dark-sage);
    border-radius: var(--nsh-radius);
    padding: 20px 24px 48px;
    margin: 1.5em 0;
}
.at-a-glance h2, .at-a-glance h3 { color: var(--nsh-dark-sage); margin-top: 0; }
.at-a-glance ul { padding-left: 1.5em; }
.at-a-glance li { margin-bottom: .5em; }

/* TL;DR box */
.tldr-box {
    position: relative;
    background: var(--nsh-cream);
    border: 2px solid var(--nsh-rose);
    border-radius: var(--nsh-radius);
    padding: 20px 24px 48px;
    margin: 1.5em 0;
    text-align: left;
}
.tldr-box h2, .tldr-box h3 { color: var(--nsh-plum); margin-top: 0; }
.tldr-box ul { padding-left: 1.5em; }
.tldr-box li { margin-bottom: .6em; }

/* Easter egg button: position inside a box with .has-easter-egg */
.has-easter-egg { position: relative; padding-bottom: 48px; }
.nsh-easter-egg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 12px;
    bottom: 10px;
    border: 0;
    padding: 3px;
    background: transparent;
    line-height: 1;
    border-radius: 6px;
}
.nsh-easter-egg img { display: block; width: 32px; height: auto; transition: transform .2s ease; }
.nsh-easter-egg:hover img { transform: scale(1.12) rotate(-5deg); }
.nsh-egg-message {
    display: none;
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(280px, 80vw);
    padding: 14px 16px;
    background: var(--nsh-dark-plum);
    color: var(--nsh-white);
    border-radius: 10px;
    box-shadow: var(--nsh-shadow);
    font-size: .9rem;
    line-height: 1.5;
}
.nsh-egg-message.is-open { display: block; }

/* Search and forms */
.search-form { display: flex; gap: 6px; }
.search-field, input[type="text"], input[type="email"], input[type="search"], textarea {
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--nsh-border);
    border-radius: 7px;
    background: var(--nsh-white);
    color: var(--nsh-ink);
}
.search-submit, input[type="submit"], button[type="submit"] {
    padding: 9px 13px;
    border: 0;
    border-radius: 7px;
    background: var(--nsh-plum);
    color: var(--nsh-white);
}
.search-submit:hover, input[type="submit"]:hover, button[type="submit"]:hover {
    background: var(--nsh-dark-sage);
}

/* Comments */
.comments-area {
    margin-top: 30px;
    padding: clamp(18px, 3vw, 28px);
    background: var(--nsh-white);
    border: 1px solid var(--nsh-border);
    border-radius: var(--nsh-radius);
}
.comment-list { padding-left: 1.5em; }
.comment-body { margin-bottom: 20px; }
.comment-meta { color: var(--nsh-muted); font-size: .9rem; }

/* Footer */
.site-footer {
    padding: 24px;
    background: var(--nsh-parchment);
    border-top: 1px solid var(--nsh-border);
    text-align: center;
    color: var(--nsh-muted);
    font-size: .9rem;
}
.site-footer p { margin: 4px 0; }

/* Screen-reader helper */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background: var(--nsh-white);
    clip: auto !important;
    clip-path: none;
    height: auto;
    width: auto;
    left: 8px;
    top: 8px;
    padding: 12px;
    z-index: 100000;
}

/* Responsive layout */
@media (max-width: 850px) {
    .site-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 20px; }
}
@media (max-width: 680px) {
    .site-frame { width: min(calc(100% - 16px), var(--nsh-content-width)); margin: 8px auto; border-radius: 10px; }
    .header-image { min-height: 280px; }
    .site-layout { display: flex; flex-direction: column; padding: 14px; }
    .sidebar { order: 1; }
    .content-area { order: 2; }
    .nav-inner { align-items: flex-start; flex-direction: column; padding: 8px 0; }
    .menu-toggle { display: inline-block; }
    .main-navigation .menu-wrap { display: none; width: 100%; }
    .main-navigation .menu-wrap.is-open { display: block; }
    .main-navigation ul { flex-direction: column; gap: 0; }
    .main-navigation a { padding: 9px 10px; }
    .knitting-progress, .knitting-progress tbody, .knitting-progress tr { display: block; width: 100%; }
    .knitting-progress td { display: block; width: 100% !important; }
    .knitting-progress .progress-photo img { max-width: 220px; }
    .knitting-progress .progress-notes { padding: 14px; }
    .search-form { flex-wrap: wrap; }
}


/* Header title panel: compact spacing on narrow screens */
@media (max-width: 600px) {
    .banner-title {
        max-width: calc(100% - 28px);
        margin: 0 14px 18px;
        padding: 14px 18px 16px;
    }
}


/* Keep headings typed into page content at body-text size; bold rather than oversized. */
.entry-content h1 {
    font-size: 17px;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.75;
    margin: 0 0 1.25em;
}


/* WordPress page/post title: keep it in line with body text, but bold. */
.entry-title,
.page .entry-title,
.single .entry-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.75 !important;
    text-transform: none;
    letter-spacing: normal;
    margin-top: 0;
    margin-bottom: 1.25em;
}
