/*
Theme Name: Tidewater Creative (Kadence)
Theme URI: https://tidewatercreative.com
Description: Kadence child theme for Tidewater Creative: brand palette and typography, block style variations, and editable homepage patterns.
Author: Tidewater Creative
Template: kadence
Version: 1.0.2
Requires at least: 6.3
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tidewater-kadence
*/

/*
 * Brand tokens. Colours point at Kadence's global palette, so changing the palette in
 * Customizer → Colors updates these sections too. Fallbacks match the defaults in functions.php.
 */
:root {
  --tw-clay: var(--global-palette1, #934b33);
  --tw-clay-deep: var(--global-palette2, #7a3b28);
  --tw-ink-deep: var(--global-palette3, #0a2c34);
  --tw-text: var(--global-palette4, #293a39);
  --tw-muted: var(--global-palette5, #516260);
  --tw-linen: var(--global-palette7, #eee1ce);
  --tw-paper: var(--global-palette8, #fbf8f0);
  --tw-card: var(--global-palette9, #fffdf8);
  --tw-sea: var(--global-palette10, #c9dcda);
  --tw-line: rgba(22, 62, 70, .18);
  --tw-field-line: rgba(22, 62, 70, .55);
  --tw-serif: var(--global-heading-font-family, "Fraunces", Georgia, serif);
  --tw-gutter: clamp(2rem, 6vw, 7rem);
}

html { scroll-padding-top: 6rem; }
h1, h2, h3 { letter-spacing: -.045em; }

/* ------------------------------------------------------------------ */
/* Block style variations (registered in functions.php)                */
/* ------------------------------------------------------------------ */

.entry-content .is-style-tw-eyebrow,
.is-style-tw-eyebrow {
  color: var(--tw-clay);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.5;
  margin: 0 0 1.15rem;
  text-transform: uppercase;
}

.entry-content .is-style-tw-lede,
.is-style-tw-lede {
  color: var(--tw-muted);
  font-size: clamp(1.1rem, 1.7vw, 1.31rem);
  line-height: 1.58;
}

.entry-content .is-style-tw-intro,
.is-style-tw-intro {
  color: var(--tw-ink-deep);
  font-family: var(--tw-serif);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.23;
  margin: 1.4rem 0 1.1rem;
  max-width: 29rem;
}

.entry-content .is-style-tw-note,
.is-style-tw-note {
  border-left: 2px solid var(--tw-clay);
  color: var(--tw-muted);
  font-size: .92rem;
  line-height: 1.5;
  margin: 0;
  max-width: 19rem;
  padding: 1rem 0 1rem 1rem;
}

.entry-content .is-style-tw-number,
.is-style-tw-number {
  color: var(--tw-clay);
  flex: 0 0 auto;
  font-family: var(--tw-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
  margin: 0;
  min-width: 2.4rem;
  padding-top: .15rem;
}

/* Numbered step: number beside a heading + text group, with a rule above. */
.wp-block-group.is-style-tw-step {
  align-items: flex-start;
  border-top: 1px solid var(--tw-line);
  flex-wrap: nowrap;
  gap: .9rem;
  padding-top: 1.25rem;
}
.entry-content .is-style-tw-step h3,
.is-style-tw-step h3 {
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  line-height: 1.15;
  margin: 0 0 .35rem;
}
.entry-content .is-style-tw-step p:not(.is-style-tw-number),
.is-style-tw-step p:not(.is-style-tw-number) {
  color: var(--tw-muted);
  font-size: .96rem;
  line-height: 1.6;
  margin: 0;
}

/* Dark rounded panel with a faint ring in the corner. */
.wp-block-group.is-style-tw-dark-panel {
  background: var(--tw-ink-deep);
  border-radius: 2rem;
  color: rgba(255, 255, 255, .82);
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 5.5rem);
  position: relative;
}
.wp-block-group.is-style-tw-dark-panel::after {
  border: 1px solid rgba(201, 220, 218, .24);
  border-radius: 50%;
  content: "";
  height: 35rem;
  pointer-events: none;
  position: absolute;
  right: -21rem;
  top: -23rem;
  width: 35rem;
}
.is-style-tw-dark-panel > * { position: relative; z-index: 1; }
.is-style-tw-dark-panel h1,
.is-style-tw-dark-panel h2,
.is-style-tw-dark-panel h3 { color: #fff; }
.entry-content .is-style-tw-dark-panel .is-style-tw-eyebrow,
.entry-content .is-style-tw-dark-panel .is-style-tw-number,
.is-style-tw-dark-panel .is-style-tw-eyebrow,
.is-style-tw-dark-panel .is-style-tw-number { color: var(--tw-sea); }
.is-style-tw-dark-panel p { color: rgba(255, 255, 255, .82); }
.is-style-tw-dark-panel .wp-block-group.is-style-tw-step { border-top-color: rgba(255, 255, 255, .23); padding-bottom: 1.25rem; }
.entry-content .is-style-tw-dark-panel .is-style-tw-step p:not(.is-style-tw-number),
.is-style-tw-dark-panel .is-style-tw-step p:not(.is-style-tw-number) { color: rgba(255, 255, 255, .82); }
.is-style-tw-dark-panel :focus-visible { outline-color: #fff; }

/* Arch-framed image, slightly rotated, with an offset card behind it and a dark caption tag. */
.wp-block-image.is-style-tw-arch {
  margin: 0 0 0 auto;
  max-width: 25rem;
  position: relative;
}
.wp-block-image.is-style-tw-arch img {
  aspect-ratio: 2 / 3;
  background: #fffdf8;
  border: 1px solid rgba(22, 62, 70, .12);
  border-radius: 13rem 13rem 1.2rem 1.2rem;
  box-shadow: 1.4rem 1.4rem 0 var(--tw-linen), 0 1.4rem 3.2rem rgba(10, 44, 52, .12);
  height: auto;
  object-fit: cover;
  padding: .7rem;
  transform: rotate(2.3deg);
  width: 100%;
}
.wp-block-image.is-style-tw-arch figcaption {
  background: var(--tw-ink-deep);
  color: rgba(255, 255, 255, .84);
  font-size: .78rem;
  line-height: 1.45;
  margin: -1.2rem -1.25rem 0 auto;
  max-width: 20rem;
  padding: 1rem 1.1rem;
  position: relative;
  text-align: left;
}
.wp-block-image.is-style-tw-arch figcaption strong { color: #fff; display: block; font-weight: 700; margin-bottom: .2rem; }

/* White card that holds a website screenshot; stays in view beside long text on wide screens. */
.wp-block-group.is-style-tw-card {
  background: #fffdf8;
  border: 1px solid rgba(22, 62, 70, .13);
  box-shadow: 1.1rem 1.1rem 0 rgba(22, 62, 70, .1), 0 1.25rem 2.8rem rgba(10, 44, 52, .13);
  padding: 0.7rem 0.7rem 1.5rem;
  position: sticky;
  top: 7rem;
}
.entry-content .is-style-tw-card .is-style-tw-eyebrow,
.is-style-tw-card .is-style-tw-eyebrow { font-size: .7rem; margin: 0 0 .65rem; }
.entry-content .is-style-tw-card .wp-block-image,
.is-style-tw-card .wp-block-image { margin: 0; }
.is-style-tw-card .wp-block-image img {
  aspect-ratio: 1200 / 613;
  border: 1px solid rgba(22, 62, 70, .14);
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/* Dark button: ink by default, clay on hover. */
.wp-block-button.is-style-tw-dark .wp-block-button__link { background: var(--tw-ink-deep); color: #fff; }
.wp-block-button.is-style-tw-dark .wp-block-button__link:hover,
.wp-block-button.is-style-tw-dark .wp-block-button__link:focus { background: var(--tw-clay); color: #fff; }

/* ------------------------------------------------------------------ */
/* Homepage sections (class names come from the patterns)              */
/* ------------------------------------------------------------------ */

.entry-content > .tw-section,
.tw-section {
  margin-bottom: 0;
  margin-top: 0;
  padding-bottom: clamp(4.75rem, 8vw, 8rem);
  padding-top: clamp(4.75rem, 8vw, 8rem);
}
/*
 * Side gutters and the content width. Kadence's full-width layout zeroes padding on
 * `.entry-content .alignfull` and WordPress's constrained-layout width doesn't reach the
 * section's inner container here, so both are set explicitly.
 */
.entry-content .tw-section.alignfull,
.tw-section.alignfull {
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}
.tw-section > * {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--global-content-width, 1220px);
}
.tw-section > .wp-block-group__inner-container > * { max-width: none; }
.tw-section .wp-block-columns { gap: var(--tw-gutter); margin-bottom: 0; }

.entry-content .tw-section h1,
.tw-section h1 { margin: 0 0 .5rem; }
.entry-content .tw-section h2,
.tw-section h2 { margin: 0; }

/* Hero */
.tw-hero {
  background: var(--tw-paper);
  border-bottom: 1px solid var(--tw-line);
  overflow: hidden;
  position: relative;
}
.entry-content > .tw-hero,
.tw-hero { padding-bottom: clamp(3rem, 5vw, 5rem); padding-top: clamp(3rem, 5vw, 5rem); }
.tw-hero::before {
  background: var(--tw-sea);
  border-radius: 50%;
  content: "";
  height: 34rem;
  opacity: .32;
  pointer-events: none;
  position: absolute;
  right: -18rem;
  top: -21rem;
  width: 34rem;
}
.tw-hero > * { position: relative; }
/* Keep the headline to three lines beside the artwork. Below 1025px Kadence's tablet/mobile H1 sizes apply. */
@media (min-width: 1025px) {
  .entry-content .tw-hero h1,
  .tw-hero h1 { font-size: clamp(2.6rem, 4.2vw, 3.75rem); }
}
.entry-content .tw-hero .is-style-tw-lede,
.tw-hero .is-style-tw-lede { margin: 0 0 2.2rem; }
.tw-actions { gap: 1.35rem 1.8rem; }
.entry-content .tw-actions .wp-block-buttons,
.tw-actions .wp-block-buttons { margin: 0; }

/* Intro and outcomes */
.tw-intro { background: #fffdf8; }
.entry-content .tw-intro-copy,
.tw-intro-copy { color: var(--tw-muted); font-size: 1.12rem; line-height: 1.65; margin: 0; max-width: 30rem; }
.tw-section .wp-block-columns.tw-outcomes { gap: 1.3rem 2.5rem; margin-top: clamp(3rem, 6vw, 5.5rem); }

/* Approach */
.entry-content > .tw-approach-section,
.tw-approach-section { background: var(--tw-paper); padding-top: 0; }
.entry-content .tw-approach-section .is-style-tw-dark-panel > .wp-block-columns > .wp-block-column:first-child p:not(.is-style-tw-eyebrow),
.tw-approach-section .is-style-tw-dark-panel > .wp-block-columns > .wp-block-column:first-child p:not(.is-style-tw-eyebrow) {
  font-size: 1.08rem;
  line-height: 1.6;
  margin: 1.4rem 0 0;
  max-width: 31rem;
}
.tw-steps .wp-block-group.is-style-tw-step:last-child { border-bottom: 1px solid rgba(255, 255, 255, .23); }

/* Case study */
.tw-case { background: var(--tw-linen); }
.entry-content .tw-muted,
.tw-muted { color: var(--tw-muted); margin-bottom: 0; max-width: 41rem; }
.tw-details { margin: 2rem 0 1.65rem; }
.tw-detail { border-top: 1px solid rgba(22, 62, 70, .22); padding: 1rem 0; }
.entry-content .tw-detail .is-style-tw-eyebrow,
.tw-detail .is-style-tw-eyebrow { font-size: .7rem; margin: 0 0 .3rem; }
.entry-content .tw-detail p:not(.is-style-tw-eyebrow),
.tw-detail p:not(.is-style-tw-eyebrow) { color: var(--tw-text); margin: 0; }
.tw-case .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid var(--tw-ink-deep);
  color: var(--tw-ink-deep);
}
.tw-case .wp-block-button.is-style-outline .wp-block-button__link:hover,
.tw-case .wp-block-button.is-style-outline .wp-block-button__link:focus { background: var(--tw-ink-deep); color: #fff; }

/* Contact panel: dark intro beside a light form column */
.entry-content > .tw-contact,
.tw-contact { background: var(--tw-paper); padding-top: 0; }
.tw-section .wp-block-columns.tw-contact__panel {
  background: var(--tw-ink-deep);
  border-radius: 2rem;
  gap: 0;
  overflow: hidden;
}
.tw-contact__intro { color: rgba(255, 255, 255, .82); padding: clamp(2.25rem, 5vw, 5rem); }
.tw-contact__intro h2 { color: #fff; }
.entry-content .tw-contact__intro h2,
.tw-contact__intro h2 { margin-bottom: 1.4rem; }
.entry-content .tw-contact__intro .is-style-tw-eyebrow,
.tw-contact__intro .is-style-tw-eyebrow { color: var(--tw-sea); }
.entry-content .tw-contact__intro p,
.tw-contact__intro p { color: rgba(255, 255, 255, .82); font-size: 1.04rem; line-height: 1.65; }
.entry-content .tw-contact__intro .tw-small-print,
.tw-contact__intro .tw-small-print { color: var(--tw-sea); font-size: .85rem; font-weight: 700; letter-spacing: .03em; margin-top: 1.6rem; }
.tw-contact__intro :focus-visible { outline-color: #fff; }
.tw-contact__form { background: #fffdf8; padding: clamp(1.6rem, 4vw, 3.6rem); }

.tw-form-placeholder {
  border: 2px dashed var(--tw-field-line);
  border-radius: .5rem;
  color: var(--tw-muted);
  padding: 1.5rem;
}

/* Text links to buttons. */
.wp-block-group__inner-container > p.wp-block-paragraph > a:not(.wp-block-button__link) {
  display: inline-block;
  padding: 7.2px 18px;
  border: 1px solid #0a2c34;
  border-radius: 999px;
  color: #0a2c34;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  
}

.wp-block-group__inner-container > p.wp-block-paragraph > a:not(.wp-block-button__link):hover {
  background: #0a2c34;
  color: #fff;
}

/* HubSpot form (applies when the embed renders plain HTML rather than HubSpot's own styles). */
.tw-contact__form .hs-form fieldset { max-width: none; }
.tw-contact__form .hs-form .hs-form-field { margin-bottom: 1rem; }
.tw-contact__form .hs-form label { color: var(--tw-ink-deep); font-size: .82rem; font-weight: 700; }
.tw-contact__form .hs-form .hs-input {
  background: #fff;
  border: 1px solid var(--tw-field-line);
  border-radius: .25rem;
  box-sizing: border-box;
  color: var(--tw-text);
  font: inherit;
  padding: .78rem .85rem;
  width: 100% !important;
}
.tw-contact__form .hs-form .hs-input:focus { border-color: var(--tw-clay); outline: 3px solid rgba(147, 75, 51, .25); }
.tw-contact__form .hs-form .hs-button {
  background: var(--tw-clay);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font: 700 .9rem/1.2 inherit;
  min-height: 3.15rem;
  padding: .78rem 1.2rem;
}
.tw-contact__form .hs-form .hs-button:hover,
.tw-contact__form .hs-form .hs-button:focus { background: var(--tw-clay-deep); }
.tw-contact__form .hs-error-msg,
.tw-contact__form .hs-error-msgs label { color: #9b3425; }

/* ------------------------------------------------------------------ */
/* Small screens (core columns stack below 782px)                      */
/* ------------------------------------------------------------------ */

@media (max-width: 781px) {
  html { scroll-padding-top: 5rem; }
  .wp-block-image.is-style-tw-arch { margin: 1rem auto 0; max-width: 19.5rem; }
  .wp-block-image.is-style-tw-arch img { box-shadow: 1rem 1rem 0 var(--tw-linen), 0 1.1rem 2.2rem rgba(10, 44, 52, .12); }
  .wp-block-image.is-style-tw-arch figcaption { margin-right: -.5rem; }
  .wp-block-group.is-style-tw-dark-panel { border-radius: 1.4rem; padding: 2.1rem 1.35rem; }
  .wp-block-group.is-style-tw-card { position: static; }
  .tw-case .wp-block-columns > .wp-block-column:last-child { order: -1; }
  .tw-section .wp-block-columns.tw-contact__panel { border-radius: 1.4rem; }
  .tw-contact__intro { padding: 2.25rem 1.35rem; }
  .tw-contact__form { padding: 1.75rem 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
