/* ==========================================================================
   Possum Hollow Lodge — theme.css
   Only things theme.json can't express: tap targets, responsive nudges,
   focus-visible, transitions, mobile menu polish, card hover, section
   underline sizing, prices-on-mobile. Tokens live in theme.json.
   ========================================================================== */

:root {
  --phl-transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Never pure white — enforce even if a block tries */
html, body { background-color: var(--wp--preset--color--cream); }

/* Body text uses an inheritable custom property so dark-background blocks
   can override the value for their descendants without specificity wars. */
body, p, li, dd, dt, blockquote, figcaption, td, th {
  color: var(--phl-body-text-color, var(--wp--preset--color--dark));
}

/* On dark-background blocks, swap the variable so descendants inherit cream.
   Explicit `has-*-color` classes on individual elements still win because
   their generated rule (specificity 0,1,0) beats the type-selector rule
   above (0,0,1). */
.has-primary-background-color,
.has-primary-deep-background-color,
.has-secondary-background-color,
.has-dark-background-color,
.has-lake-background-color {
  --phl-body-text-color: var(--wp--preset--color--light-text);
}

/* Mobile-first: tap targets. iOS input zoom prevention. */
button,
.wp-element-button,
.wp-block-button__link,
.wp-block-navigation-item__content {
  min-height: var(--wp--custom--tap-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--phl-transition),
    color var(--phl-transition),
    transform var(--phl-transition),
    box-shadow var(--phl-transition);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
textarea,
select {
  font-size: 1rem; /* prevents iOS zoom */
  min-height: var(--wp--custom--tap-target-min);
  padding: 0.75rem 1rem;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--md);
  background: #fff;
  font-family: var(--wp--preset--font-family--body);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
  border-color: var(--wp--preset--color--accent);
}

/* Focus states for all interactive elements */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: var(--wp--custom--radius--sm);
}

/* Button hover: subtle lift + deeper shadow */
.wp-element-button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: var(--wp--custom--shadow--card);
}

.wp-element-button:active,
.wp-block-button__link:active {
  transform: translateY(0);
}

/* Section underline — the accent divider under section headings */
.phl-section-underline,
.wp-block-separator.has-accent-background-color {
  border: 0;
  height: 3px;
  max-width: 48px;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--wp--preset--color--accent) !important;
  opacity: 1;
}

/* Site header polish */
.phl-site-header {
  border-bottom: 1px solid var(--wp--preset--color--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background-color: rgba(244, 236, 219, 0.92);
}

.phl-header-inner {
  max-width: var(--wp--style--global--wide-size);
  margin: 0 auto;
  width: 100%;
  gap: var(--wp--preset--spacing--lg);
}

.phl-header-inner .wp-block-site-title a {
  text-decoration: none;
  color: var(--wp--preset--color--primary) !important;
}

/* Hide header CTA on mobile — booking button still lives in mobile menu overlay */
@media (max-width: 767px) {
  .phl-header-cta { display: none; }
}

/* Desktop nav menu items — cream on sapphire header. Explicit !important
   defeats WP block-supports rules that can override at higher specificity. */
.phl-primary-nav .wp-block-navigation-item__content {
  color: var(--wp--preset--color--light-text) !important;
  font-weight: 500;
  transition: color var(--phl-transition), opacity var(--phl-transition);
}

.phl-primary-nav .wp-block-navigation-item__content:hover,
.phl-primary-nav .wp-block-navigation-item__content:focus-visible {
  color: var(--wp--preset--color--accent) !important;
}

/* Header logo container — fixed width, no shrink in flex row */
.phl-header-logo {
  margin: 0;
  flex: 0 0 auto;
  max-width: 340px;
}
.phl-header-logo a { display: block; line-height: 0; }
.phl-header-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 340px;
}

@media (max-width: 767px) {
  .phl-header-logo,
  .phl-header-logo img { max-width: 260px; }
}

/* Mobile nav overlay styling (WP core navigation block) */
.wp-block-navigation__responsive-container.is-menu-open {
  padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--lg);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-size: var(--wp--preset--font-size--xl);
  padding: var(--wp--preset--spacing--md) 0;
  color: var(--wp--preset--color--light-text);
}

/* Hero cover — vignette + slight image blur to mask the low-source-res
   sunset photo on wide monitors. Removed once a higher-res source lands. */
.phl-hero-cover .wp-block-cover__image-background {
  filter: blur(0.5px);
  transform: scale(1.01);  /* hides edge artifacts from the blur */
}

.phl-hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(31, 26, 20, 0.4) 100%);
  pointer-events: none;
  z-index: 1;
}

.phl-hero-cover > .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
}

/* To-go phone banner at top of Restaurant page. Whole strip is the tap target. */
.phl-togo-strip {
  text-align: center;
}

.phl-togo-banner {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  padding: 0.5rem 1rem;
  border-radius: var(--wp--custom--radius--md);
  transition: background-color var(--phl-transition);
}

.phl-togo-banner:hover,
.phl-togo-banner:focus-visible {
  background-color: rgba(244, 236, 219, 0.08);
  outline: none;
}

.phl-togo-eyebrow {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--wp--preset--color--light-text);
  opacity: 0.7;
  font-size: 0.8125rem;
  margin: 0 0 0.25rem 0;
}

.phl-togo-number {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--wp--preset--color--accent);
  margin: 0 0 0.125rem 0;
  letter-spacing: 0.04em;
  line-height: 1.1;
  transition: color var(--phl-transition);
}

.phl-togo-cta {
  font-family: 'Lato', sans-serif;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--light-text);
  opacity: 0.9;
  margin: 0;
}

.phl-togo-banner:hover .phl-togo-cta,
.phl-togo-banner:focus-visible .phl-togo-cta {
  opacity: 1;
}

@media (max-width: 480px) {
  .phl-togo-number { font-size: 1.625rem; }
  .phl-togo-eyebrow { font-size: 0.75rem; letter-spacing: 0.15em; }
}

/* Home page three-up feature cards — white surface lifted off cream page */
.phl-feature-card {
  box-shadow: 0 1px 2px rgba(27, 82, 120, 0.04), 0 8px 24px rgba(27, 82, 120, 0.08);
  transition: transform var(--phl-transition), box-shadow var(--phl-transition);
}

.phl-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(27, 82, 120, 0.06), 0 12px 32px rgba(27, 82, 120, 0.12);
}

/* Cabin cards — hover lift */
.phl-cabin-card {
  overflow: hidden;
  transition: transform var(--phl-transition), box-shadow var(--phl-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.phl-cabin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wp--custom--shadow--elevated);
  border-color: var(--wp--preset--color--accent) !important;
}

.phl-cabin-card .phl-cabin-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.phl-cabin-ribbon {
  margin: 0 0 var(--wp--preset--spacing--xs) 0 !important;
}

.phl-cabin-footer {
  margin-top: auto;
  align-items: center;
}

/* Menu item rows */
.phl-menu-item {
  gap: var(--wp--preset--spacing--md);
  align-items: baseline;
}

.phl-menu-item:last-child {
  border-bottom: 0 !important;
}

/* Events Calendar tweaks — make plugin output match brand */
.tribe-events-calendar-list__event,
.tribe-events-calendar-list .tribe-common-g-row {
  background: var(--wp--preset--color--cream);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--card);
  padding: var(--wp--preset--spacing--lg);
  margin-bottom: var(--wp--preset--spacing--md);
  transition: transform var(--phl-transition), box-shadow var(--phl-transition);
}

.tribe-events-calendar-list__event:hover {
  transform: translateY(-2px);
  box-shadow: var(--wp--custom--shadow--card);
  border-color: var(--wp--preset--color--accent);
}

.tribe-events-calendar-list__event-title {
  font-family: var(--wp--preset--font-family--heading) !important;
  color: var(--wp--preset--color--primary) !important;
}

.tribe-events-calendar-list__event-date-tag,
.tribe-events-calendar-list__event-datetime {
  font-family: var(--wp--preset--font-family--subhead) !important;
  color: var(--wp--preset--color--accent) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* MailPoet form — match brand */
.mailpoet_form input[type="email"],
.mailpoet_form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.mailpoet_form input[type="submit"] {
  background: var(--wp--preset--color--accent) !important;
  color: var(--wp--preset--color--light-text) !important;
  font-family: var(--wp--preset--font-family--subhead) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 0;
  padding: 0.75rem 1.5rem;
  border-radius: var(--wp--custom--radius--md);
  cursor: pointer;
  transition: background-color var(--phl-transition);
}

.mailpoet_form input[type="submit"]:hover {
  background: var(--wp--preset--color--primary) !important;
}

/* Map wrapper */
.phl-map-wrap {
  width: 100%;
}

/* Food carousel — horizontal scroll-snap with prev/next */
.phl-carousel {
  position: relative;
  max-width: var(--wp--style--global--wide-size);
  margin: 0 auto;
  padding: 0 var(--wp--preset--spacing--lg);
}

.phl-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(260px, 38vw, 420px);
  gap: var(--wp--preset--spacing--md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--wp--preset--spacing--lg);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-block: var(--wp--preset--spacing--xs);
}

.phl-carousel__track::-webkit-scrollbar { display: none; }

.phl-carousel__track:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 4px;
  border-radius: var(--wp--custom--radius--card);
}

.phl-carousel__slide {
  scroll-snap-align: start;
  margin: 0;
  border-radius: var(--wp--custom--radius--card);
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--cream);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.phl-carousel__slide img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.phl-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--light-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: background-color var(--phl-transition), transform var(--phl-transition);
}

.phl-carousel__btn:hover {
  background: var(--wp--preset--color--accent);
  transform: translateY(-50%) scale(1.05);
}

.phl-carousel__btn:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

.phl-carousel__btn--prev { left: 0; }
.phl-carousel__btn--next { right: 0; }

@media (max-width: 600px) {
  .phl-carousel { padding: 0 var(--wp--preset--spacing--md); }
  .phl-carousel__track { grid-auto-columns: 78vw; }
  .phl-carousel__btn { display: none; } /* swipe on mobile, no buttons needed */
}

/* Patio Pooches submission form */
.phl-pooch-form-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--md);
}

.phl-pooch-form {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--md);
}

.phl-pooch-field {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--xs);
  margin: 0;
}

.phl-pooch-field label {
  font-family: var(--wp--preset--font-family--subhead);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wp--preset--color--primary);
}

.phl-pooch-field input[type="text"],
.phl-pooch-field input[type="file"] {
  width: 100%;
  box-sizing: border-box;
}

.phl-pooch-field input[type="file"] {
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--md);
  font-family: var(--wp--preset--font-family--body);
}

.phl-pooch-field small {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--xs);
}

.phl-pooch-optional {
  color: var(--wp--preset--color--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.phl-pooch-submit {
  margin-top: var(--wp--preset--spacing--sm);
}

.phl-pooch-submit button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-family: var(--wp--preset--font-family--subhead);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--wp--preset--font-size--base);
  border: 0;
  border-radius: var(--wp--custom--radius--md);
  cursor: pointer;
}

.phl-pooch-fineprint {
  font-size: var(--wp--preset--font-size--xs);
  color: var(--wp--preset--color--muted);
  line-height: 1.6;
  margin: 0;
}

/* Honeypot — visually and assistively hidden, but still focusable by bots */
.phl-pooch-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Submission status messages */
.phl-pooch-msg {
  padding: var(--wp--preset--spacing--md) var(--wp--preset--spacing--lg);
  border-radius: var(--wp--custom--radius--md);
  font-family: var(--wp--preset--font-family--body);
  line-height: 1.6;
}

.phl-pooch-msg--ok {
  background: rgba(27, 82, 120, 0.08);
  border: 1px solid var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
}

.phl-pooch-msg--err {
  background: rgba(224, 138, 30, 0.10);
  border: 1px solid var(--wp--preset--color--accent);
  color: var(--wp--preset--color--secondary);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Links inside the dark sapphire footer — cream by default, amber on hover.
   WP's default link color is sapphire which matches the bg = invisible. */
.phl-site-footer a:not(.wp-block-button__link) {
  color: var(--wp--preset--color--light-text);
  text-decoration: underline;
  text-decoration-color: rgba(244, 236, 219, 0.3);
  text-underline-offset: 3px;
  transition: color var(--phl-transition), text-decoration-color var(--phl-transition);
}

.phl-site-footer a:not(.wp-block-button__link):hover,
.phl-site-footer a:not(.wp-block-button__link):focus-visible {
  color: var(--wp--preset--color--accent);
  text-decoration-color: var(--wp--preset--color--accent);
}

/* Footer horizontal nav — mirrors header style with cream text, amber hover.
   Higher specificity defeats WP's block-supports color rules. */
.phl-footer-nav .wp-block-navigation-item__content {
  color: var(--wp--preset--color--light-text) !important;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  transition: color var(--phl-transition);
}

.phl-footer-nav .wp-block-navigation-item__content:hover,
.phl-footer-nav .wp-block-navigation-item__content:focus-visible {
  color: var(--wp--preset--color--accent) !important;
}

.phl-footer-nav {
  gap: 0.5rem 1.5rem;
}

/* MailPoet footer signup form — brand styling overrides the free-plan
   limits in MailPoet's visual editor (it doesn't expose font color etc).
   Scoped to .phl-site-footer so the rules don't leak to forms elsewhere. */
.phl-site-footer .mailpoet_form {
  background: transparent;
  padding: 0;
  margin: 0;
}

.phl-site-footer .mailpoet_paragraph {
  margin-bottom: 0.75rem;
}

.phl-site-footer .mailpoet_text_label,
.phl-site-footer .mailpoet_textarea_label,
.phl-site-footer .mailpoet_select_label,
.phl-site-footer .mailpoet_form_paragraph {
  color: var(--wp--preset--color--light-text);
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.875rem;
}

.phl-site-footer .mailpoet_text,
.phl-site-footer .mailpoet_textarea,
.phl-site-footer .mailpoet_select,
.phl-site-footer [id^="mailpoet_form_"] .mailpoet_text,
.phl-site-footer [id^="mailpoet_form_"] .mailpoet_textarea,
.phl-site-footer [id^="mailpoet_form_"] .mailpoet_select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 236, 219, 0.25);
  color: var(--wp--preset--color--light-text);
  border-radius: var(--wp--custom--radius--md);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--phl-transition), background-color var(--phl-transition);
}

.phl-site-footer .mailpoet_text::placeholder {
  color: rgba(244, 236, 219, 0.55);
}

.phl-site-footer .mailpoet_text:focus,
.phl-site-footer .mailpoet_textarea:focus,
.phl-site-footer .mailpoet_select:focus {
  outline: none;
  border-color: var(--wp--preset--color--accent);
  background: rgba(255, 255, 255, 0.12);
}

.phl-site-footer .mailpoet_submit,
.phl-site-footer [id^="mailpoet_form_"] .mailpoet_submit {
  background: var(--wp--preset--color--accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--wp--custom--radius--md);
  padding: 0.75rem 1.5rem;
  font-family: var(--wp--preset--font-family--subhead);
  font-size: 0.9375rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: background-color var(--phl-transition), transform var(--phl-transition);
}

.phl-site-footer .mailpoet_submit:hover,
.phl-site-footer .mailpoet_submit:focus-visible {
  background: var(--wp--preset--color--accent-dark, #B86E0F);
  transform: translateY(-1px);
  outline: none;
}

.phl-site-footer .mailpoet_validate_success,
.phl-site-footer .mailpoet_validate_error {
  color: var(--wp--preset--color--light-text);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.phl-site-footer .mailpoet_validate_error {
  color: #FFD9C2;
}

/* Print — keep it clean */
@media print {
  .phl-site-header,
  .phl-site-footer,
  .wp-block-buttons {
    display: none !important;
  }
}

/* Editor-only tweaks — show a subtle background in the block editor */
.editor-styles-wrapper {
  background-color: var(--wp--preset--color--cream);
}

/* Small-screen adjustments */
@media (max-width: 767px) {
  .phl-cabin-footer {
    gap: var(--wp--preset--spacing--sm);
  }

  /* Cabin grid already uses grid layout; ensure single column on small phones */
  .phl-cabin-grid {
    grid-template-columns: 1fr !important;
  }
}
