/*
Theme Name: Dikarabelo
Theme URI: https://example.com/
Author: Michalsons (draft for Dikarabelo Mental Health Services)
Description: Calm, warm block theme for Dikarabelo Mental Health Services. Edit everything in Appearance > Editor. No code needed.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 0.8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dikarabelo
*/

/* ---- Brand details that use the theme's own files (letterhead look) ---- */

/* Double rule from the letterhead: deep green bar over a thin gold line. */
.wp-site-blocks > header.wp-block-template-part {
	background:
		linear-gradient(#003733, #003733) top / 100% 7px no-repeat,
		linear-gradient(#AF731F, #AF731F) 0 10px / 100% 2px no-repeat;
	padding-top: 12px;
}
.site-footer {
	background-image: linear-gradient(#AF731F, #AF731F) !important;
	background-size: 100% 3px !important;
	background-repeat: no-repeat !important;
}

/* Logo lockup in the header */
.brand .brand-mark img { display: block; width: 62px; height: auto; }
.brand .site-title-text { font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.25rem; letter-spacing: .01em; }
.brand .site-tagline { text-transform: uppercase; letter-spacing: .18em; font-size: .7rem; font-weight: 700; color: var(--wp--preset--color--ochre); }
@media (max-width: 600px) {
	.brand .brand-mark img { width: 48px; }
	.brand .site-title-text { font-size: 1.05rem; }
	.brand .site-tagline { letter-spacing: .12em; font-size: .62rem; }
}

/* Hero: gold rule under the heading */
.hero { position: relative; overflow: hidden; }
.hero h1::after { content: ""; display: block; width: 76px; height: 2px; margin-top: 1.1rem; background: var(--wp--preset--color--ochre); }

/* Green page banner with a photo, as Mariel asked: richer colour, practice photo instead of the logo */
.hero-dark {
	background:
		radial-gradient(1200px 500px at 85% 0%, rgba(217,174,110,.20), transparent 60%),
		linear-gradient(135deg, #00483F 0%, #003733 55%, #002A26 100%) !important;
}
.hero-dark h1, .hero-dark p { color: #fff; }
.hero-dark .eyebrow { color: #E2BC84; }
.hero-dark h1::after { background: #D9AE6E; }
.hero-dark .wp-block-button__link { background: #D9AE6E; color: var(--wp--preset--color--forest); }
.hero-dark .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--forest); }
.hero-dark .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: #fff; }
.hero-dark .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--forest); }
.hero-cols { align-items: center !important; gap: 3rem !important; }
.hero-photo { margin: 0 !important; }
.hero-photo img { border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); border: 3px solid rgba(217,174,110,.6); width: 100%; height: auto; }

/* Line icons for the four services (same set as the letterhead) */
.card.has-icon::before {
	content: ""; display: block; width: 44px; height: 44px; margin-bottom: .9rem;
	background: var(--wp--preset--color--ochre);
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
}
.icon-talk::before { -webkit-mask-image: url(assets/icons/talk.svg); mask-image: url(assets/icons/talk.svg); }
.icon-brain::before { -webkit-mask-image: url(assets/icons/brain.svg); mask-image: url(assets/icons/brain.svg); }
.icon-scales::before { -webkit-mask-image: url(assets/icons/scales.svg); mask-image: url(assets/icons/scales.svg); }
.icon-people::before { -webkit-mask-image: url(assets/icons/people.svg); mask-image: url(assets/icons/people.svg); }
.icon-group::before { -webkit-mask-image: url(assets/icons/group.svg); mask-image: url(assets/icons/group.svg); }
.card { border-top: 3px solid var(--wp--preset--color--ochre); }
.card h3 { font-weight: 600; }

/* Calls to action band in deep green, like the letterhead icons */
.has-ochre-light-background-color.section h2 { color: var(--wp--preset--color--forest); }
@media (max-width: 781px) {
	.site-header > .alignwide { flex-wrap: nowrap !important; align-items: center; }
	.site-header .brand { min-width: 0; flex: 1; }
	.site-header .brand > .wp-block-group { min-width: 0; }
}

/* Article titles: no underline until hover */
.wp-block-post-title a { text-decoration: none; }
.wp-block-post-title a:hover { text-decoration: underline; }
/* Detail tables (label and value) */
.details-table td:first-child { font-weight: 700; color: var(--wp--preset--color--forest); width: 32%; }
.details-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--wp--preset--color--sage-light); }
.details-table { margin-top: 2.5rem !important; }

/* ---- Readability ---- */
.section p, .section li { max-width: 70ch; }
.card p, .feature p, .step p, .wp-block-media-text p, .wp-block-media-text li, .wp-block-cover p { max-width: none; }
.section h2 { margin-bottom: .6rem; }

/* ---- Icon feature grid ---- */
.features { gap: 1.5rem !important; margin-top: 1.5rem; }
.feature { background: var(--wp--preset--color--white); border-radius: 16px; padding: 1.6rem !important; height: 100%; box-shadow: 0 1px 3px rgba(0,55,51,.06); }
.has-white-background-color .feature { background: var(--wp--preset--color--sand); box-shadow: none; border: 1px solid var(--wp--preset--color--sage-light); }
.feature h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.feature p { margin: 0; }
.has-icon::before {
	content: ""; display: block; width: 42px; height: 42px; margin-bottom: .85rem; background: var(--wp--preset--color--ochre);
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
}
.icon-heart::before { -webkit-mask-image: url(assets/icons/heart.svg); mask-image: url(assets/icons/heart.svg); }
.icon-globe::before { -webkit-mask-image: url(assets/icons/globe.svg); mask-image: url(assets/icons/globe.svg); }
.icon-clipboard::before { -webkit-mask-image: url(assets/icons/clipboard.svg); mask-image: url(assets/icons/clipboard.svg); }
.icon-link::before { -webkit-mask-image: url(assets/icons/link.svg); mask-image: url(assets/icons/link.svg); }
.icon-language::before { -webkit-mask-image: url(assets/icons/language.svg); mask-image: url(assets/icons/language.svg); }
.icon-shield::before { -webkit-mask-image: url(assets/icons/shield.svg); mask-image: url(assets/icons/shield.svg); }
.icon-laptop::before { -webkit-mask-image: url(assets/icons/laptop.svg); mask-image: url(assets/icons/laptop.svg); }
.icon-pin::before { -webkit-mask-image: url(assets/icons/pin.svg); mask-image: url(assets/icons/pin.svg); }
.icon-phone::before { -webkit-mask-image: url(assets/icons/phone.svg); mask-image: url(assets/icons/phone.svg); }
.icon-mail::before { -webkit-mask-image: url(assets/icons/mail.svg); mask-image: url(assets/icons/mail.svg); }
.icon-clock::before { -webkit-mask-image: url(assets/icons/clock.svg); mask-image: url(assets/icons/clock.svg); }
.icon-whatsapp::before { -webkit-mask-image: url(assets/icons/whatsapp.svg); mask-image: url(assets/icons/whatsapp.svg); }

/* Contact lines with a small icon, like the letterhead */
.icon-line { position: relative; padding-left: 3rem; min-height: 2.2rem; }
.icon-line::before {
	content: ""; position: absolute; left: 0; top: .1rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
	background: var(--wp--preset--color--forest);
}
.icon-line::after {
	content: ""; position: absolute; left: .5rem; top: .6rem; width: 1.1rem; height: 1.1rem; background: #fff;
	-webkit-mask: var(--m) no-repeat center / contain; mask: var(--m) no-repeat center / contain;
}
.icon-line.icon-phone::after { -webkit-mask-image: url(assets/icons/phone.svg); mask-image: url(assets/icons/phone.svg); }
.icon-line.icon-whatsapp::after { -webkit-mask-image: url(assets/icons/whatsapp.svg); mask-image: url(assets/icons/whatsapp.svg); }
.icon-line.icon-mail::after { -webkit-mask-image: url(assets/icons/mail.svg); mask-image: url(assets/icons/mail.svg); }
.icon-line.icon-pin::after { -webkit-mask-image: url(assets/icons/pin.svg); mask-image: url(assets/icons/pin.svg); }
.icon-line.icon-clock::after { -webkit-mask-image: url(assets/icons/clock.svg); mask-image: url(assets/icons/clock.svg); }
.icon-line::after { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; }

/* ---- Numbered steps ---- */
.steps { counter-reset: step; gap: 1.25rem !important; margin-top: 1.5rem; }
.step { counter-increment: step; position: relative; background: var(--wp--preset--color--white); border-radius: 16px; padding: 1.5rem !important; border-top: 3px solid var(--wp--preset--color--ochre); height: 100%; }
.step::before {
	content: counter(step); display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; margin-bottom: .8rem;
	border-radius: 50%; background: var(--wp--preset--color--forest); color: #fff; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.15rem;
}
.step h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.step p { margin: 0; font-size: 1rem; }

/* ---- Chips (short lists shown as tags) ---- */
ul.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; max-width: none !important; }
ul.chips li { background: var(--wp--preset--color--white); border: 1px solid #DCCBB1; color: var(--wp--preset--color--forest); padding: .45rem 1rem; border-radius: 999px; font-size: 1rem; max-width: none; }
.has-white-background-color ul.chips li { background: var(--wp--preset--color--ochre-light); }

/* ---- Media and text ---- */
.brand-media { gap: 0; }
.brand-media .wp-block-media-text__media img { border-radius: 18px; box-shadow: 0 10px 30px rgba(0,55,51,.10); }
.brand-media .wp-block-media-text__content { padding: 0 0 0 3rem; }
.brand-media.has-media-on-the-right .wp-block-media-text__content { padding: 0 3rem 0 0; }
@media (max-width: 600px) {
	.brand-media .wp-block-media-text__content, .brand-media.has-media-on-the-right .wp-block-media-text__content { padding: 1.5rem 0 0; }
}
.wp-block-image.rounded img { border-radius: 16px; margin-top: 1rem; }

/* ---- Cover band ---- */
.brand-cover { padding: clamp(3rem, 7vw, 5.5rem) 1.25rem !important; }
.brand-cover h2, .brand-cover p { color: #fff !important; }
.brand-cover h2::after { content: ""; display: block; width: 64px; height: 2px; margin-top: .9rem; background: #D9AE6E; }
.brand-cover .wp-block-button__link { background: #D9AE6E; color: var(--wp--preset--color--forest); }
.brand-cover .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: #fff; }

/* ---- Related services strip ---- */
.related { gap: 1rem !important; }
.related-link { border: 1px solid var(--wp--preset--color--sage-light); border-radius: 14px; padding: 1.1rem 1.2rem !important; display: flex !important; align-items: center; gap: .8rem; }
.related-link::before { width: 30px; height: 30px; margin: 0; flex: none; }
.related-link p { margin: 0; font-weight: 700; }
.related-link a { text-decoration: none; }
.related-link a::after { content: " \2192"; color: var(--wp--preset--color--ochre); }
.related-band { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }

/* ---- Resources: icon on each article card, by practice area ---- */
.wp-block-post .card::before {
	content: ""; display: block; width: 36px; height: 36px; margin-bottom: .6rem; background: var(--wp--preset--color--ochre);
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain;
}
.category-therapy .card::before { -webkit-mask-image: url(assets/icons/talk.svg); mask-image: url(assets/icons/talk.svg); }
.category-group-sessions .card::before { -webkit-mask-image: url(assets/icons/group.svg); mask-image: url(assets/icons/group.svg); }
.category-assessments .card::before { -webkit-mask-image: url(assets/icons/brain.svg); mask-image: url(assets/icons/brain.svg); }
.category-medico-legal .card::before { -webkit-mask-image: url(assets/icons/scales.svg); mask-image: url(assets/icons/scales.svg); }
.category-workplace-wellness .card::before { -webkit-mask-image: url(assets/icons/people.svg); mask-image: url(assets/icons/people.svg); }
.brand-cover .wp-block-cover__inner-container { max-width: 760px !important; margin: 0 auto; text-align: center; }
.brand-cover h2::after { margin-left: auto; margin-right: auto; }
.brand-cover .wp-block-buttons { justify-content: center; }

.icon-cash::before { -webkit-mask-image: url(assets/icons/cash.svg); mask-image: url(assets/icons/cash.svg); }
.icon-eft::before { -webkit-mask-image: url(assets/icons/eft.svg); mask-image: url(assets/icons/eft.svg); }
.mobile-bar .wp-block-button__link { font-size: .95rem; padding-left: .6rem; padding-right: .6rem; }

/* ---- Floating buttons: Request an appointment and Chat on WhatsApp stay in view while scrolling ---- */
.wp-block-buttons.float-cta {
	position: fixed; z-index: 60; margin: 0 !important;
	right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(24px, env(safe-area-inset-bottom, 0px));
	display: flex; flex-direction: column; align-items: stretch; gap: .5rem !important;
}
.float-cta .wp-block-button__link { box-shadow: 0 8px 24px rgba(0,55,51,.25); font-size: .95rem; text-align: center; width: 100%; }
.float-cta .is-style-outline .wp-block-button__link { background: #fff; color: var(--wp--preset--color--forest); border: 2px solid var(--wp--preset--color--forest); }
.float-cta .is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--forest); color: #fff; }
@media (max-width: 781px) {
	.wp-block-buttons.float-cta {
		left: 0; right: 0; bottom: 0; flex-direction: row; gap: .6rem !important;
		padding: .6rem max(.6rem, env(safe-area-inset-right, 0px)) max(.6rem, env(safe-area-inset-bottom, 0px)) max(.6rem, env(safe-area-inset-left, 0px)) !important;
		background: #fff; box-shadow: 0 -4px 16px rgba(0,55,51,.12);
	}
	.float-cta .wp-block-button { flex: 1; }
	.float-cta .wp-block-button__link { box-shadow: none; padding-left: .5rem; padding-right: .5rem; font-size: .9rem; }
	body { padding-bottom: 76px; }
}

/* Photos: keep crops tidy and consistent */
.brand-media .wp-block-media-text__media img, .hero-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.brand-media img[src*="mariel-full-length"] { aspect-ratio: 3 / 4; }
.brand-gallery { gap: 1rem !important; margin-top: 1.25rem; }
.brand-gallery .wp-block-image img { border-radius: 14px; aspect-ratio: 4 / 3; object-fit: cover; }
.float-cta .wp-block-button:not(.is-style-outline) .wp-block-button__link { border: 2px solid #D9AE6E; }
.brand-gallery.wp-block-gallery figure.wp-block-image img { height: auto !important; width: 100% !important; flex: none !important; aspect-ratio: 4 / 3; object-fit: cover; }
.brand-gallery.wp-block-gallery figure.wp-block-image { display: block !important; }

/* Banner photo shown whole (no crop). Add the class hero-photo-fit to a banner image to use it. */
.hero-photo.hero-photo-fit img { aspect-ratio: auto; object-fit: contain; width: auto; max-width: 100%; max-height: 560px; margin: 0 auto; display: block; }
/* Keep every gallery photo the same size; an unfinished last row sits centred. */
.brand-gallery.wp-block-gallery { justify-content: center; }
.brand-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex-grow: 0 !important; }
@media (max-width: 599px) { .brand-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: calc(50% - .5rem) !important; } }

/* Photo carousel (gallery with the class brand-carousel): one row that slides sideways. */
.carousel-wrap { position: relative; margin-top: 1.25rem; }
.brand-gallery.brand-carousel.wp-block-gallery { flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; justify-content: flex-start; margin-top: 0; padding-bottom: .5rem; scrollbar-width: thin; }
.brand-gallery.brand-carousel.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex: 0 0 calc((100% - 2rem) / 3) !important; width: calc((100% - 2rem) / 3) !important; scroll-snap-align: start; }
@media (max-width: 781px) { .brand-gallery.brand-carousel.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex-basis: 85% !important; width: 85% !important; } }
.carousel-btn { position: absolute; top: calc(50% - .25rem); transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #D9AE6E; background: var(--wp--preset--color--forest); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0,55,51,.25); display: flex; align-items: center; justify-content: center; padding: 0 0 4px; }
.carousel-btn:hover, .carousel-btn:focus-visible { background: var(--wp--preset--color--ochre); outline: none; }
.carousel-prev { left: -14px; } .carousel-next { right: -14px; }
@media (max-width: 781px) { .carousel-prev { left: 4px; } .carousel-next { right: 4px; } }

/* Floating buttons: centred on the right edge on larger screens (mobile keeps the bottom bar). */
@media (min-width: 782px) {
	.wp-block-buttons.float-cta { top: 50%; bottom: auto; right: 0; transform: translateY(-50%); }
	.float-cta .wp-block-button__link { border-radius: 999px 0 0 999px !important; padding-right: 1.1rem; }
}
/* Side tabs: on computers the floating buttons read vertically so they sit in the page margin and never cover text. */
@media (min-width: 782px) {
	.wp-block-buttons.float-cta { gap: .4rem !important; }
	.float-cta .wp-block-button__link { writing-mode: vertical-rl; transform: rotate(180deg); padding: 1rem .6rem !important; font-size: .9rem; line-height: 1.2; border-radius: 0 12px 12px 0 !important; white-space: nowrap; }
}

/* Floating buttons as a slim bar fixed to the top of the screen (all screen sizes). This replaces the side tabs. */
.wp-block-buttons.float-cta {
	top: 0 !important; bottom: auto !important; left: 0 !important; right: 0 !important; transform: none !important;
	flex-direction: row !important; flex-wrap: nowrap; justify-content: center; align-items: center; gap: .6rem !important;
	padding: .45rem max(.75rem, env(safe-area-inset-right, 0px)) .45rem max(.75rem, env(safe-area-inset-left, 0px)) !important;
	background: var(--wp--preset--color--forest); box-shadow: 0 4px 16px rgba(0,55,51,.18);
}
.float-cta .wp-block-button { flex: 0 1 auto !important; }
.float-cta .wp-block-button__link { writing-mode: horizontal-tb !important; transform: none !important; border-radius: 999px !important; padding: .45rem 1.1rem !important; font-size: .9rem !important; box-shadow: none !important; white-space: nowrap; }
.float-cta .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: #D9AE6E; color: var(--wp--preset--color--forest); border: 0 !important; }
.float-cta .is-style-outline .wp-block-button__link { background: transparent !important; color: #fff !important; border: 2px solid #fff !important; }
.float-cta .is-style-outline .wp-block-button__link:hover { background: #fff !important; color: var(--wp--preset--color--forest) !important; }
body { padding-top: 50px; padding-bottom: 0 !important; }
.admin-bar .wp-block-buttons.float-cta { top: 32px !important; }
@media (max-width: 782px) { .admin-bar .wp-block-buttons.float-cta { top: 46px !important; } }
@media (max-width: 600px) {
	.wp-block-buttons.float-cta { align-items: stretch; }
	.float-cta .wp-block-button { flex: 1 1 0 !important; display: flex; }
	.float-cta .wp-block-button__link { display: flex !important; align-items: center; justify-content: center; text-align: center; }
	.float-cta .wp-block-button__link { white-space: normal; width: 100%; font-size: .8rem !important; padding: .4rem .6rem !important; line-height: 1.2; }
	body { padding-top: 58px; }
}

/* Shorter banner photo: a wide crop (used on the FAQ page). */
.hero-photo.hero-photo-wide img { aspect-ratio: 16 / 9 !important; }
