/*
 Theme Name:   À Portée de Vue Child
 Template:     astra
 Version:      1.1.0
 Description:  Optimized custom styles for À Portée de Vue (child theme)
*/

:root {
  --apdv-bg: #fbf9f7;
  --apdv-ink: #0a2458;
  --apdv-accent: #8a2723;
  --apdv-muted: #e8e4e0;
  --apdv-shadow: rgba(10,36,88,0.08);
  --max-width: 1200px;
}

/* ---------------------------
   Base typography & helpers
   --------------------------- */
* { box-sizing: border-box; }
html, body {
  background: var(--apdv-bg);
  color: var(--apdv-ink);
  font-family: 'Garamond', serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
  width: 100%;
  position: relative;
}
a { color: var(--apdv-accent); text-decoration: underline; }
a:hover { text-decoration: underline; }
.site-title a, .ast-site-title a {
  font-family: 'Garamond', serif;
  color: var(--apdv-ink);
}
.post-thumbnail { display: block; max-width: 100%; height: auto; }

/* ---------------------------
   Search / header row
   --------------------------- */
.custom-search-container {
  max-width: var(--max-width) !important;
  margin: 5px auto 15px !important;
  padding: 0 20px !important;
  width: 100%;
  position: relative;
}

.custom-search-container > div,
.custom-search-container > div[style] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Expandable search wrapper */
.expandable-search-wrapper {
  position: relative;
  margin-left: auto;
  padding: 0 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon-trigger {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--apdv-ink);
  background: rgba(10,36,88,0.08);
  border-radius: 50%;
  transition: all .3s;
  position: relative;
  z-index: 1001;
}

.search-icon-trigger:hover {
  background: var(--apdv-ink);
  color: #fff;
  transform: scale(1.05);
}

.expandable-search-wrapper.active .search-icon-trigger {
  opacity: 0;
  pointer-events: none;
}

/* Popup search container */
.search-form-container {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  pointer-events: none;
  z-index: 1000;
}

.expandable-search-wrapper.active .search-form-container {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Search form look */
.expandable-search-form {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--apdv-ink), var(--apdv-accent));
  border-radius: 30px;
  padding: 6px 10px 6px 20px;
  box-shadow: 0 4px 20px rgba(10,36,88,0.3);
  min-width: 320px;
  position: relative;
}

.expandable-search-form .search-field {
  border: none;
  background: rgba(255,255,255,0.95);
  padding: 10px 15px;
  flex: 1;
  outline: none;
  font-size: 14px;
  border-radius: 20px;
  color: var(--apdv-ink);
  font-weight: 500;
}

.expandable-search-form .search-field::placeholder {
  color: rgba(10,36,88,0.5);
}

.expandable-search-form .search-submit,
.expandable-search-form .search-close {
  background: rgba(255,255,255,0.2);
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  margin-left: 8px;
  transition: all .3s;
  min-width: 36px;
  height: 36px;
}

.expandable-search-form .search-close {
  background: transparent;
  color: rgba(255,255,255,0.8);
  margin-left: 4px;
}

.expandable-search-form .search-submit:hover,
.expandable-search-form .search-close:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.expandable-search-form .search-close:hover {
  transform: rotate(90deg);
}

/* ---------------------------
   Home vs non-home
   --------------------------- */
body.home .custom-search-container > div,
body.home .custom-search-container > div[style] {
  justify-content: center !important;
  gap: 18px;
  padding: 0;
}
body.home .custom-search-container .expandable-search-wrapper {
  margin-left: 0 !important;
}
body.home .custom-search-container .search-form-container {
  right: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

body:not(.home) .custom-search-container .header-left-element {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
body:not(.home) .custom-search-container > div,
body:not(.home) .custom-search-container > div[style] {
  justify-content: center !important;
  padding: 0;
}
body:not(.home) .custom-search-container {
  margin-bottom: 8px !important;
}
body:not(.home) .custom-search-container .expandable-search-wrapper {
  margin-left: 0 !important;
}
body:not(.home) .custom-search-container .search-form-container {
  right: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* MOBILE SEARCH FIX */
@media (max-width: 768px) {
  .expandable-search-wrapper {
    position: relative !important;
    overflow: visible !important;
  }

  .search-form-container {
    position: fixed !important;
    top: 60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    max-width: 500px !important;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
  }

  .expandable-search-wrapper.active .search-form-container {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .expandable-search-form {
    width: 100% !important;
    background: linear-gradient(135deg, var(--apdv-ink), var(--apdv-accent));
    border-radius: 28px;
    padding: 6px 10px !important;
    display: flex !important;
    align-items: center;
    box-shadow: 0 4px 20px rgba(10,36,88,0.3);
  }

  .expandable-search-form .search-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 10px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.95);
    color: var(--apdv-ink);
  }

  .expandable-search-form .search-submit,
  .expandable-search-form .search-close {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    cursor: pointer;
  }

  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
  }
}

.apdv-featured-image { margin-bottom: 30px; }
.apdv-featured-image .apdv-featured-caption {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

