/*
 Theme Name:   Bricks Child - Cornish Craft Barn
 Theme URI:    https://cornishcraftbarn.com
 Description:  Child theme for Bricks - Cornish Craft Barn. Carries the barn's Events Calendar and Event Tickets overrides, the event info boxes, the DSA booking redirect and event styling. Replaces kadence-child-ccb.
 Author:       Cornish Craft Barn
 Author URI:   https://cornishcraftbarn.com
 Template:     bricks
 Version:      2.0.4
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  bricks-child-ccb
*/

/* ==========================================================================
   Cornish Craft Barn - Child Theme Styles
   Rules below the TEC section are carried over from kadence-child-ccb 1.0.6,
   with rem turned into px: Bricks sets a 10px root, Kadence used 16px.
   The Kadence gallery/slider fixes were dropped: event galleries are now
   core gallery blocks.
   ========================================================================== */

/* --- Kadence's global variables, which the barn's Additional CSS still reads --- */
:root {
    --global-palette1: #2B6CB0;
    --global-palette2: #265E9A;
    --global-palette3: #222222;
    --global-palette4: #3B3B3B;
    --global-palette5: #515151;
    --global-palette6: #626262;
    --global-palette7: #E1E1E1;
    --global-palette8: #F5F5F5;
    --global-palette9: #ffffff;
    --global-content-width: 1290px;
    --global-content-narrow-width: 842px;
    --global-content-edge-padding: 24px;
    --global-body-font-family: Jost, sans-serif;
    --global-heading-font-family: Jost, sans-serif;
}


/* --- Kadence palette classes kept by blocks converted to core (e.g. has-theme-palette-9-color) --- */
.has-theme-palette-1-color { color: var(--global-palette1) !important; }
.has-theme-palette-1-background-color { background-color: var(--global-palette1) !important; }
.has-theme-palette1-color { color: var(--global-palette1) !important; }
.has-theme-palette1-background-color { background-color: var(--global-palette1) !important; }
.has-theme-palette-2-color { color: var(--global-palette2) !important; }
.has-theme-palette-2-background-color { background-color: var(--global-palette2) !important; }
.has-theme-palette2-color { color: var(--global-palette2) !important; }
.has-theme-palette2-background-color { background-color: var(--global-palette2) !important; }
.has-theme-palette-3-color { color: var(--global-palette3) !important; }
.has-theme-palette-3-background-color { background-color: var(--global-palette3) !important; }
.has-theme-palette3-color { color: var(--global-palette3) !important; }
.has-theme-palette3-background-color { background-color: var(--global-palette3) !important; }
.has-theme-palette-4-color { color: var(--global-palette4) !important; }
.has-theme-palette-4-background-color { background-color: var(--global-palette4) !important; }
.has-theme-palette4-color { color: var(--global-palette4) !important; }
.has-theme-palette4-background-color { background-color: var(--global-palette4) !important; }
.has-theme-palette-5-color { color: var(--global-palette5) !important; }
.has-theme-palette-5-background-color { background-color: var(--global-palette5) !important; }
.has-theme-palette5-color { color: var(--global-palette5) !important; }
.has-theme-palette5-background-color { background-color: var(--global-palette5) !important; }
.has-theme-palette-6-color { color: var(--global-palette6) !important; }
.has-theme-palette-6-background-color { background-color: var(--global-palette6) !important; }
.has-theme-palette6-color { color: var(--global-palette6) !important; }
.has-theme-palette6-background-color { background-color: var(--global-palette6) !important; }
.has-theme-palette-7-color { color: var(--global-palette7) !important; }
.has-theme-palette-7-background-color { background-color: var(--global-palette7) !important; }
.has-theme-palette7-color { color: var(--global-palette7) !important; }
.has-theme-palette7-background-color { background-color: var(--global-palette7) !important; }
.has-theme-palette-8-color { color: var(--global-palette8) !important; }
.has-theme-palette-8-background-color { background-color: var(--global-palette8) !important; }
.has-theme-palette8-color { color: var(--global-palette8) !important; }
.has-theme-palette8-background-color { background-color: var(--global-palette8) !important; }
.has-theme-palette-9-color { color: var(--global-palette9) !important; }
.has-theme-palette-9-background-color { background-color: var(--global-palette9) !important; }
.has-theme-palette9-color { color: var(--global-palette9) !important; }
.has-theme-palette9-background-color { background-color: var(--global-palette9) !important; }

/* --- Events Calendar page frame (was Kadence's content container) --- */
.ccb-tec-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}
.ccb-events-header {
    margin: 0 0 24px;
    padding: 8px 0 0;
}
.ccb-events-header h1 {
    font-size: 35.2px;
    font-weight: 700;
    color: #2B6CB0;
    margin: 0 0 8px;
}
.ccb-events-header p {
    font-size: 17.6px;
    color: #515151;
    margin: 0 0 16px;
    max-width: 700px;
}

/* Single event: white card on the barn's light grey, as on the Kadence site */
body.single-tribe_events {
    background-color: #F5F5F5;
}
.single-tribe_events #tribe-events-content {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 15px 25px -10px rgba(0, 0, 0, 0.05);
    padding: 10px 32px 32px;
}
body.single-tribe_events .tribe-events-single-event-title {
    color: #2B6CB0;
    font-size: 34px;
}
.single-tribe_events .wp-block-gallery {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 767px) {
    .single-tribe_events #tribe-events-content { padding: 10px 16px 24px; }
}

/* --- Events Calendar Consistent Styling --- */

/* Remove default TEC title spacing inconsistencies */
.tribe-events .tribe-events-header {
    padding-top: 0;
}

/* Consistent event page header spacing */
.post-type-archive-tribe_events .site-main,
.single-tribe_events .site-main,
.tax-tribe_events_cat .site-main {
    padding-top: 16px;
}

/* Ensure event content matches site-wide boxed content style */
.tribe-events .tribe-events-l-container {
    max-width: var(--global-content-width, 1290px);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Photo view card styling */
.tribe-events-pro .tribe-events-pro-photo__event {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.tribe-events-pro .tribe-events-pro-photo__event:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Month view consistency */
.tribe-events .tribe-events-calendar-month__day-cell {
    min-height: 80px;
}

/* List view event cards */
.tribe-events .tribe-events-calendar-list__event {
    padding: 24px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Single event page layout */
.single-tribe_events .tribe-events-schedule {
    margin-bottom: 24px;
}

.single-tribe_events .tribe-events-single-section {
    margin-bottom: 32px;
}

/* Event category archive consistency */
.tax-tribe_events_cat .tribe-events-header__title {
    font-family: var(--global-heading-font-family, inherit);
}

/* Event Tickets styling */
.tribe-tickets__tickets-container {
    margin-top: 32px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 8px;
}

.tribe-tickets__tickets-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.tribe-tickets__tickets-buy {
    margin-top: 24px;
}

/* Ticket button styling to match CCB brand */
.tribe-tickets__tickets-buy button,
.tribe-tickets .tribe-common-c-btn {
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* --- SureCart Consistent Styling --- */

/* SureCart product pages */
.sc-product-page .site-main {
    padding-top: 16px;
}

/* SureCart checkout consistency */
.sc-checkout-form {
    max-width: var(--global-content-width, 1290px);
    margin: 0 auto;
}

/* --- Global Overrides --- */

/* Ensure consistent header-to-content spacing across all page types */
.site-main {
    margin-top: 0;
}

/* Consistent archive page styling */
.archive .site-main .entry-content,
.search .site-main .entry-content {
    padding: 16px 0;
}



/* --- Header at tablet/phone width ---
   cc-bricks-helper.css draws a "MENU" label and slate-blue bars on C&C's burger. Live's barn shows
   only a plain three-bar icon at the right of the blue bar (37 x 31). Here it is white on the blue. */
@media (max-width: 1024px) { /* Bricks' tablet switch on this site (b22), as live's Kadence */
    html body .ccb-nav-wrap { display: flex !important; justify-content: flex-end !important; align-items: center; }
    html body .bricks-mobile-menu-toggle { width: 32px !important; height: 24px !important; color: #FFFFFF !important; }
    html body .bricks-mobile-menu-toggle::before { content: none !important; display: none !important; }
    html body .bricks-mobile-menu-toggle .bar-top,
    html body .bricks-mobile-menu-toggle .bar-center,
    html body .bricks-mobile-menu-toggle .bar-bottom {
        left: 0 !important; right: 0 !important; top: auto !important;
        width: 32px !important; height: 3px !important; background: #FFFFFF !important;
    }
    html body .bricks-mobile-menu-toggle .bar-top { bottom: 20px !important; }
    html body .bricks-mobile-menu-toggle .bar-center { bottom: 11px !important; }
    html body .bricks-mobile-menu-toggle .bar-bottom { bottom: 2px !important; }
}

/* --- Kadence's spacing between blocks, on the converted pages ---
   Live's Kadence theme (content.min.css) spaces the blocks in page content: 32px under a paragraph or a row
   of buttons, 1.5em above and 0.5em below a heading, nothing above what follows a heading, nothing under
   the last item in a column. The converted elements keep Kadence's class names, so the same rules reach
   them here. A margin a block sets itself still wins, as on live: Bricks writes it against the element. */
:is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] { margin: 1.5em 0 0.5em; }
:is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"]:first-child { margin-top: 0; }
p[class*="kt-adv-heading"],
.brxe-block[class*="kb-btns"],
[class*="kadence-column"] > .brxe-text p { margin-top: 0; margin-bottom: 32px; }
:is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] + * { margin-top: 0; }
p[class*="kt-adv-heading"]:last-child,
:is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"]:last-child,
.brxe-block[class*="kb-btns"]:last-child,
[class*="kadence-column"] > .brxe-text:last-child p:last-child { margin-bottom: 0; }
/* Most columns are plain blocks, as on live (kc-block, set by krow-style.php's kcol_flow), so the 32px under
   a paragraph or buttons and the space above the next heading overlap. A column with a vertical alignment is
   a flex box on live and here, where margins add up, so there the heading takes only the difference. */
:not(.kc-block) > p[class*="kt-adv-heading"] + :is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] { margin-top: max(0px, calc(1.5em - 32px)); }
/* More room under a row of buttons than live gives (Damian, 23 Nov 2026: the hero's Book Now and View
   Workshops sat too tight on the headings below): 56px in all. In a block column the heading's margin
   overlaps the 32px under the buttons; in a flex column it adds to it. */
.kc-block > .brxe-block[class*="kb-btns"] + :is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] { margin-top: 56px; }
:not(.kc-block) > .brxe-block[class*="kb-btns"] + :is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] { margin-top: 24px; }
/* A Kadence heading set to a span tag is still a block on live. In a block column a Bricks span sat inline,
   so the café's "Make your moment happen" line took a taller line box (53px against live's 35px). */
span[class*="kt-adv-heading"] { display: block; }
/* Live's Kadence puts 1em under an image that is not the last thing in its column. Weight zero, so a margin
   the image sets itself still wins, as on live: the home's café photo had 17px under it there and none here. */
:where(.brxe-image[class*="kb-image"]:not(:last-child)) { margin-bottom: 1em; }
/* A Kadence heading or text block fills its column, so its alignment works across the column's width.
   In a Bricks column it shrank to its text, which left a centred phone heading sitting at the left. */
[class*="kadence-column"] > [class*="kt-adv-heading"] { align-self: stretch; }
/* Live's Kadence theme draws h4 and h5 in #3B3B3B, h6 in #515151, and every heading at line height 1.5;
   staging had #222222 and 1.4 (measured 23 Nov 2026). Weighted just above a bare h4, so a colour or line
   height a block sets for itself still wins, as it does on live. */
html :where(#brx-content) :is(h1, h2, h3, h4, h5, h6) { line-height: 1.5; }
html :where(#brx-content) :is(h4, h5) { color: #3B3B3B; }
html :where(#brx-content) h6 { color: #515151; }
/* Bold text is weight 700 on live, also inside a heading. The browser's own "bolder" made it 900 inside a
   700 heading here, so the info box titles came out heavier and wider than live's and wrapped. */
html :where(#brx-content) :is(b, strong) { font-weight: 700; }
/* Live's Kadence headings use line height 1.5; the C&C typography here gave them 1.4. A heading that sets
   its own (the home hero's 75px) still wins. */
:is(h1, h2, h3, h4, h5, h6)[class*="kt-adv-heading"] { line-height: 1.5; }
/* Live's Kadence breaks a word too long for its line inside page content, except in tables. At tablet width the
   contact page's "manuals.dandelions.sculpting" took two lines there and ran past its column here. */
:where(#brx-content) { word-break: break-word; }
:where(#brx-content) table { word-break: normal; }
/* A dropdown in page content shows live's arrow: Kadence's grey chevron 98% across (the café booking form's
   "Booking time" and "How many"). Here Bricks drew its own small triangle. Longhands only, so Formidable's
   own 3px nudge down still applies, as on live. */
:where(#brx-content) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' fill='none' stroke-width='2' stroke='%23bbb'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-size: auto; background-repeat: no-repeat; background-position-x: 98%;
}
/* Live's Kadence sets body text at line height 1.6 on every page; Bricks' own default is 1.7. */
html body { line-height: 1.6; }

/* Plain WordPress headings inside converted text (the contact page's "Our Location", "Call Us"…) take live's
   theme spacing: 1.5em above, 0.5em below, nothing above the first one in a column or what follows a heading.
   Here they had none, so the contact details sat 31px higher than on live (23 Nov 2026). */
[class*="kadence-column"] > .brxe-text :is(h1, h2, h3, h4, h5, h6) { margin: 1.5em 0 0.5em; }
[class*="kadence-column"] > .brxe-text:first-child > :is(h1, h2, h3, h4, h5, h6):first-child,
[class*="kadence-column"] > .brxe-text :is(h1, h2, h3, h4, h5, h6) + * { margin-top: 0; }
/* A link in converted text is the barn blue and underlined, as on live; orange on hover (the barn's own
   ".page a:hover"). Here it was the text colour with no line, so the contact page's What3Words link hid. */
[class*="kadence-column"] > .brxe-text :is(p, li) a { color: #2B6CB0; text-decoration: underline; text-underline-offset: 0.1em; transition: 0.1s linear; }
[class*="kadence-column"] > .brxe-text :is(p, li) a:is(:hover, :focus) { color: #FF9933; text-underline-offset: 0.25em; }
/* The title band's "Home" link, as live's Kadence breadcrumbs: underlined, orange on hover */
.brxe-breadcrumbs a.item { text-decoration: underline; text-underline-offset: 0.1em; transition: 0.1s linear; }
.brxe-breadcrumbs a.item:is(:hover, :focus) { color: #FF9933; text-underline-offset: 0.25em; }

/* A WordPress separator in converted text draws as live's: a 1px bar in its own colour (the contact page's dark
   line under "Popular Questions"), 32px under it. Here the site's default hr showed instead: a pale border and 17px. */
[class*="kadence-column"] > .brxe-text hr.wp-block-separator { border: 0; height: 1px; margin: 0 0 32px; }
[class*="kadence-column"] > .brxe-text hr.wp-block-separator:last-child { margin-bottom: 0; }
/* Hand-written forms kept as HTML (the contact page's enquiry form) take live's theme defaults where their own
   inline styles say nothing (Bricks prints the HTML with no wrapper, so the form sits in the column; the
   Formidable forms sit in their own wrapper and are not reached): text line height 1.6, field text #515151, labels in the text colour, the button's
   words centred, no minimum height on the message box. The site's form defaults made the fields 62px tall
   against live's 49, greyed the labels and put the button's words at the left (23 Nov 2026). */
[class*="kadence-column"] > form :is(input, textarea, select) { line-height: 1.6; color: #515151; min-height: 0; }
[class*="kadence-column"] > form label { color: inherit; }
[class*="kadence-column"] > form button { line-height: 1.6; text-align: center; }

/* --- Kadence accordions as live draws them (the café FAQ). The title, its line and the gaps are the element's
   own settings (kcomp-style.php kaccordion), the gap is here; the plus and minus are Kadence's: two 20x4px bars in a 24px box,
   10px before the title, in the title's colour. Open, the upright bar goes, leaving a minus. --- */
/* Kadence's 10px between panes (the café FAQ's title marginTop), none above the first. */
.kc-acc > .accordion-item + .accordion-item { margin-top: 10px; }
.kc-acc .accordion-title { justify-content: flex-start; }
.kc-acc .accordion-title::before {
    content: ""; flex: 0 0 24px; height: 24px; margin-right: 10px;
    background: linear-gradient(#2B6CB0, #2B6CB0) center / 20px 4px no-repeat, linear-gradient(#2B6CB0, #2B6CB0) center / 4px 20px no-repeat;
}
.kc-acc .brx-open .accordion-title::before { background: linear-gradient(#2B6CB0, #2B6CB0) center / 20px 4px no-repeat; }
.kc-acc .accordion-title .title { margin: 0; }
/* Bricks tucks each title's bottom line 1px under the next pane; live keeps every pane its full 53px. */
.kc-acc .accordion-title-wrapper { margin-bottom: 0; }
.kc-acc .accordion-content-wrapper > * { margin: 0 0 32px; }
.kc-acc .accordion-content-wrapper > :last-child { margin-bottom: 0; }

/* --- FAQ panes (were Kadence accordions, now core details blocks): bordered rows with a +/- marker --- */
.wp-block-details {
    max-width: 842px;
    margin: 0 auto 10px;
    border: 1px solid #E1E1E1;
    border-radius: 4px;
    background: #FFFFFF;
}
.wp-block-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    font-weight: 600;
    color: #222222;
    cursor: pointer;
    list-style: none;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 24px; font-weight: 400; line-height: 1; }
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details > :not(summary) { padding: 0 18px; }
.wp-block-details > :last-child:not(summary) { padding-bottom: 14px; }
