/*
Theme Name: ALEGRIA
Author: ALEGRIA
Description: Official ALEGRIA WordPress Theme
Version: 1.0
Text Domain: alegria
*/


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;

  margin: 0;
  padding: 0;

  overflow-x: hidden;

  background: #ffffff;
  color: #111111;

  font-family:
    Inter,
    "Noto Sans JP",
    "Helvetica Neue",
    Arial,
    sans-serif;

  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
}


/* =========================================================
   WORDPRESS RESET
========================================================= */

#secondary,
.sidebar,
.widget-area,
.widget,
.comments-area,
.navigation,
.post-navigation {
  display: none !important;
}


/* WordPressが自動表示するページタイトル */

.entry-title,
.page-title,
.wp-block-post-title,
.entry-header,
.page-header {
  display: none !important;
}


/* WordPress本文 */

.entry-content {
  width: 100%;
  max-width: none !important;

  margin: 0 !important;
  padding: 0 !important;
}

.entry-content > * {
  max-width: none;
}


/* =========================================================
   CONTAINERS
========================================================= */

.ag-container,
.ag-home-container {
  width: min(92%, 1280px);
  margin: 0 auto;
}


/* =========================================================
   MAIN
========================================================= */

.ag-main {
  width: 100%;
  max-width: 100%;

  min-height: 50vh;

  margin: 0;
  padding: 0;
}


/* =========================================================
   HEADER
========================================================= */

.ag-header {
  position: sticky;
  top: 0;

  z-index: 9999;

  width: 100%;

  background: rgba(255,255,255,.97);

  border-bottom: 1px solid #eeeeee;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ag-header-inner {
  width: min(94%, 1360px);
  height: 80px;

  margin: 0 auto;

  display: flex;
  align-items: center;
}


/* LOGO */

.ag-logo {
  flex-shrink: 0;
}

.ag-logo img {
  width: 190px;
}


/* NAV */

.ag-nav {
  display: flex;
  align-items: center;

  gap: 34px;

  margin-left: 56px;
}

.ag-nav a {
  position: relative;

  color: #151515;

  font-size: 14px;
  font-weight: 600;

  white-space: nowrap;
}

.ag-nav a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -9px;

  width: 0;
  height: 2px;

  background: #ff001c;

  transition: width .2s ease;
}

.ag-nav a:hover::after {
  width: 100%;
}


/* ACCOUNT */

.ag-account {
  margin-left: auto;

  display: flex;
  align-items: center;

  gap: 10px;
}

.ag-login,
.ag-primary {
  min-height: 42px;

  padding: 0 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  font-size: 13px;
  font-weight: 700;

  transition: .2s ease;
}

.ag-login {
  border: 1px solid #dddddd;

  background: #ffffff;

  color: #111111;
}

.ag-login:hover {
  border-color: #ff001c;
  color: #ff001c;
}

.ag-primary {
  border: 1px solid #ff001c;

  background: #ff001c;

  color: #ffffff;
}

.ag-primary:hover {
  background: #e9001a;
  border-color: #e9001a;
}


/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.ag-menu-button {
  display: none;

  width: 44px;
  height: 44px;

  margin-left: auto;
  padding: 0;

  border: 0;

  background: transparent;

  cursor: pointer;
}

.ag-menu-button span {
  display: block;

  width: 24px;
  height: 2px;

  margin: 5px auto;

  background: #111111;
}


/* =========================================================
   MOBILE MENU
========================================================= */

.ag-mobile-menu {
  display: none;

  width: 100%;

  padding: 8px 5% 25px;

  background: #ffffff;

  border-top: 1px solid #eeeeee;
}

.ag-mobile-menu.is-open {
  display: block;
}

.ag-mobile-menu > a {
  display: block;

  padding: 18px 0;

  border-bottom: 1px solid #eeeeee;

  color: #111111;

  font-size: 17px;
  font-weight: 600;
}

.ag-mobile-account {
  margin-top: 20px;

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;
}

.ag-mobile-account a {
  width: 100%;
}


/* =========================================================
   COMMON LABEL
========================================================= */

.ag-label,
.ag-home-section-label {
  margin: 0 0 14px;

  color: #ff001c;

  font-size: 10px;
  font-weight: 700;

  line-height: 1.4;

  letter-spacing: .18em;
}


/* =========================================================
   HOME NEWS
========================================================= */

.ag-home-news {
  width: 100%;

  padding: 130px 0;

  background: #ffffff;
}

.ag-home-news-head {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 40px;

  margin-bottom: 60px;
}

.ag-home-news-head h2 {
  margin: 16px 0 0;

  color: #111111;

  font-size: clamp(48px, 6vw, 82px);
  font-weight: 700;

  line-height: 1;

  letter-spacing: -.055em;
}

.ag-home-news-all {
  display: inline-flex;

  align-items: center;

  gap: 12px;

  margin-bottom: 8px;

  color: #111111;

  font-size: 13px;
  font-weight: 700;
}

.ag-home-news-all span {
  color: #ff001c;

  transition: transform .2s ease;
}

.ag-home-news-all:hover span {
  transform: translateX(5px);
}


/* HOME NEWS LIST */

.ag-home-news-list {
  width: 100%;

  border-top: 1px solid #dddddd;
}

.ag-home-news-item {
  position: relative;

  width: 100%;
  min-height: 155px;

  padding: 28px 10px;

  display: grid;

  grid-template-columns: 120px 1fr 60px;

  gap: 35px;

  align-items: center;

  border-bottom: 1px solid #dddddd;

  color: #111111;

  overflow: hidden;

  transition: background .25s ease;
}

.ag-home-news-item:hover {
  background: #f5f5f5;
}

.ag-home-news-date {
  display: flex;

  flex-direction: column;

  gap: 3px;
}

.ag-home-news-date span {
  color: #999999;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: .12em;
}

.ag-home-news-date strong {
  color: #111111;

  font-size: 22px;
  font-weight: 600;

  line-height: 1.2;

  letter-spacing: -.03em;
}

.ag-home-news-meta {
  margin-bottom: 9px;
}

.ag-home-news-meta span {
  color: #ff001c;

  font-size: 9px;
  font-weight: 700;

  letter-spacing: .15em;
}

.ag-home-news-content h3 {
  margin: 0;

  color: #111111;

  font-size: 18px;
  font-weight: 600;

  line-height: 1.55;

  letter-spacing: -.02em;
}

.ag-home-news-arrow {
  width: 42px;
  height: 42px;

  display: flex;

  align-items: center;
  justify-content: center;

  justify-self: end;

  border: 1px solid #dddddd;

  border-radius: 50%;

  color: #111111;

  font-size: 16px;

  transition: .25s ease;
}

.ag-home-news-item:hover .ag-home-news-arrow {
  background: #ff001c;

  border-color: #ff001c;

  color: #ffffff;

  transform: rotate(45deg);
}


/* =========================================================
   NEWS ARCHIVE PAGE
========================================================= */

.ag-news-page {
  width: 100%;

  margin: 0 !important;

  padding: 110px 0 130px;

  background: #ffffff;

  color: #111111;
}

.ag-news-page * {
  box-sizing: border-box;
}

.ag-news-page .ag-home-container {
  width: min(92%, 1280px);

  max-width: 1280px;

  margin: 0 auto;

  padding: 0;
}


/* NEWS HERO */

.ag-news-page-head {
  margin: 0;

  padding: 0 0 75px;
}

.ag-news-page-head .ag-home-section-label {
  display: block;

  margin: 0 0 18px;

  color: #ff001c;

  font-size: 10px;
  font-weight: 700;

  line-height: 1.4;

  letter-spacing: .18em;
}

.ag-news-page-head h1 {
  display: block;

  margin: 0;
  padding: 0;

  color: #111111;

  font-size: clamp(58px, 7vw, 100px);
  font-weight: 700;

  line-height: .95;

  letter-spacing: -.06em;
}

.ag-news-page-head > p:last-child {
  display: block;

  max-width: 660px;

  margin: 30px 0 0;
  padding: 0;

  color: #666666;

  font-size: 15px;

  line-height: 1.9;
}


/* NEWS LIST */

.ag-news-page-list {
  width: 100%;

  margin: 0;
  padding: 0;

  border-top: 1px solid #dddddd;
}


/* NEWS ITEM */

.ag-news-page-item {
  position: relative;

  width: 100%;
  min-height: 155px;

  margin: 0;
  padding: 28px 12px;

  display: grid;

  grid-template-columns: 120px 1fr 56px;

  gap: 35px;

  align-items: center;

  background: #ffffff;

  color: #111111;

  border-bottom: 1px solid #dddddd;

  overflow: hidden;

  transition: background .25s ease;
}

.ag-news-page-item:hover {
  background: #f5f5f5;
}


/* DATE */

.ag-news-page-date {
  display: flex;

  flex-direction: column;

  gap: 3px;
}

.ag-news-page-date span {
  color: #999999;

  font-size: 9px;
  font-weight: 700;

  line-height: 1.3;

  letter-spacing: .12em;
}

.ag-news-page-date strong {
  color: #111111;

  font-size: 23px;
  font-weight: 600;

  line-height: 1.2;

  letter-spacing: -.03em;
}


/* CATEGORY */

.ag-news-page-category {
  display: block;

  margin: 0 0 9px;

  color: #ff001c;

  font-size: 9px;
  font-weight: 700;

  line-height: 1.4;

  letter-spacing: .15em;
}


/* TITLE */

.ag-news-page-content h2 {
  margin: 0;
  padding: 0;

  color: #111111;

  font-size: 20px;
  font-weight: 600;

  line-height: 1.55;

  letter-spacing: -.02em;
}


/* ARROW */

.ag-news-page-arrow {
  width: 42px;
  height: 42px;

  display: flex;

  align-items: center;
  justify-content: center;

  justify-self: end;

  color: #111111;

  border: 1px solid #dddddd;

  border-radius: 50%;

  font-size: 16px;

  line-height: 1;

  transition: .25s ease;
}

.ag-news-page-item:hover .ag-news-page-arrow {
  color: #ffffff;

  background: #ff001c;

  border-color: #ff001c;

  transform: rotate(45deg);
}


/* EMPTY */

.ag-news-empty {
  padding: 60px 0;

  border-bottom: 1px solid #dddddd;
}

.ag-news-empty p {
  margin: 0;

  color: #777777;

  font-size: 15px;
}


/* PAGINATION */

.ag-news-pagination {
  margin-top: 55px;

  display: flex;

  align-items: center;

  gap: 8px;
}

.ag-news-pagination .page-numbers {
  min-width: 42px;
  height: 42px;

  padding: 0 12px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  color: #111111;

  background: #ffffff;

  border: 1px solid #dddddd;

  border-radius: 999px;
}

.ag-news-pagination .page-numbers.current {
  color: #ffffff;

  background: #ff001c;

  border-color: #ff001c;
}


/* =========================================================
   CONTACT / FOOTER CTA
========================================================= */

.ag-contact-section {
  padding: 90px 0 60px;

  background: #f5f5f5;
}

.ag-contact-inner {
  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  gap: 50px;
}

.ag-contact-section h2 {
  margin: 0;

  color: #111111;

  font-size: clamp(42px, 5vw, 72px);
  font-weight: 700;

  line-height: 1;

  letter-spacing: -.055em;
}

.ag-contact-copy {
  margin: 24px 0 0;

  color: #666666;

  font-size: 15px;

  line-height: 1.9;
}

.ag-contact-action {
  flex-shrink: 0;
}

.ag-whatsapp-button {
  min-height: 56px;

  padding: 0 28px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  border-radius: 999px;

  background: #ff001c;

  color: #ffffff;

  font-size: 13px;
  font-weight: 700;

  transition: .2s ease;
}

.ag-whatsapp-button:hover {
  background: #e9001a;
}

.ag-contact-action small {
  display: block;

  margin-top: 8px;

  color: #777777;

  font-size: 11px;
}


/* =========================================================
   FOOTER
========================================================= */

.ag-footer {
  padding: 0 0 28px;

  background: #f5f5f5;

  border-top: 1px solid #dddddd;
}

.ag-footer-main {
  padding: 45px 0;

  display: grid;

  grid-template-columns: 1.3fr 1fr;

  gap: 70px;
}

.ag-footer-brand img {
  width: 205px;
}

.ag-footer-brand p {
  margin: 20px 0 0;

  color: #666666;

  font-size: 13px;

  line-height: 1.7;
}

.ag-footer-links {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 35px;
}

.ag-footer-links h4 {
  margin: 0 0 18px;

  color: #111111;

  font-size: 13px;
  font-weight: 700;
}

.ag-footer-links a {
  display: block;

  margin-bottom: 13px;

  color: #666666;

  font-size: 14px;
}

.ag-footer-links a:hover {
  color: #ff001c;
}

.ag-footer-bottom {
  padding-top: 24px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-top: 1px solid #dddddd;
}

.ag-footer-bottom p,
.ag-footer-bottom a {
  margin: 0;

  color: #777777;

  font-size: 12px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

  .ag-header-inner {
    width: 100%;

    padding: 0 18px;
  }

  .ag-nav,
  .ag-account {
    display: none;
  }

  .ag-menu-button {
    display: block;
  }

  .ag-contact-inner {
    flex-direction: column;

    align-items: flex-start;
  }

  .ag-footer-main {
    grid-template-columns: 1fr;
  }

  .ag-home-news {
    padding: 100px 0;
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

  .ag-container,
  .ag-home-container {
    width: 90%;
  }


  /* HEADER */

  .ag-header-inner {
    height: 70px;
  }

  .ag-logo img {
    width: 150px;
  }

  .ag-mobile-account {
    grid-template-columns: 1fr;
  }


  /* HOME NEWS */

  .ag-home-news {
    padding: 80px 0;
  }

  .ag-home-news-head {
    align-items: flex-start;

    flex-direction: column;

    gap: 25px;

    margin-bottom: 40px;
  }

  .ag-home-news-head h2 {
    font-size: 48px;
  }

  .ag-home-news-item {
    grid-template-columns: 1fr 42px;

    gap: 16px;

    min-height: auto;

    padding: 27px 0;
  }

  .ag-home-news-date {
    grid-column: 1 / -1;

    flex-direction: row;

    align-items: center;

    gap: 7px;
  }

  .ag-home-news-date strong {
    font-size: 15px;
  }

  .ag-home-news-content h3 {
    font-size: 16px;
  }

  .ag-home-news-arrow {
    width: 38px;
    height: 38px;
  }


  /* NEWS PAGE */

  .ag-news-page {
    padding: 65px 0 90px;
  }

  .ag-news-page .ag-home-container {
    width: 90%;
  }

  .ag-news-page-head {
    padding-bottom: 48px;
  }

  .ag-news-page-head h1 {
    font-size: 52px;
  }

  .ag-news-page-head > p:last-child {
    margin-top: 24px;

    font-size: 14px;

    line-height: 1.85;
  }

  .ag-news-page-item {
    min-height: auto;

    padding: 27px 0;

    grid-template-columns: 1fr 42px;

    gap: 16px;
  }

  .ag-news-page-date {
    grid-column: 1 / -1;

    flex-direction: row;

    align-items: center;

    gap: 7px;
  }

  .ag-news-page-date strong {
    font-size: 15px;
  }

  .ag-news-page-content h2 {
    font-size: 17px;
  }

  .ag-news-page-arrow {
    width: 38px;
    height: 38px;
  }


  /* CONTACT */

  .ag-contact-section {
    padding: 65px 0 45px;
  }

  .ag-contact-section h2 {
    font-size: 42px;
  }

  .ag-whatsapp-button {
    width: 100%;
  }


  /* FOOTER */

  .ag-footer-links {
    grid-template-columns: 1fr;

    gap: 30px;
  }

  .ag-footer-bottom {
    flex-direction: column;

    align-items: flex-start;
  }

}
/* =========================================================
   SINGLE NEWS ARTICLE
========================================================= */

.ag-single {
  width: 100%;
  background: #ffffff;
  color: #111111;
}

.ag-single-container {
  width: min(90%, 1120px);
  margin: 0 auto;
}


/* =========================================================
   HERO
========================================================= */

.ag-single-hero {
  padding: 105px 0 85px;
  background: #ffffff;
}

.ag-single-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 65px;

  color: #777777;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: .16em;

  transition: color .2s ease;
}

.ag-single-back span {
  color: #ff001c;
  font-size: 16px;

  transition: transform .2s ease;
}

.ag-single-back:hover {
  color: #111111;
}

.ag-single-back:hover span {
  transform: translateX(-4px);
}


/* META */

.ag-single-meta {
  display: flex;
  align-items: center;
  gap: 18px;

  margin-bottom: 25px;
}

.ag-single-category {
  color: #ff001c;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: .16em;
}

.ag-single-meta time {
  color: #999999;

  font-size: 11px;
  font-weight: 600;

  letter-spacing: .08em;
}


/* TITLE */

.ag-single-title {
  max-width: 1000px;

  margin: 0;

  color: #111111;

  font-size: clamp(44px, 6vw, 84px);

  font-weight: 700;

  line-height: 1.08;

  letter-spacing: -.055em;
}


/* =========================================================
   FEATURED IMAGE
========================================================= */

.ag-single-featured {
  width: 100%;

  margin-bottom: 90px;

  overflow: hidden;

  border-radius: 28px;

  background: #f5f5f5;
}

.ag-single-featured-image {
  width: 100%;
  height: auto;

  max-height: 680px;

  object-fit: cover;

  display: block;
}


/* =========================================================
   ARTICLE
========================================================= */

.ag-single-content-section {
  padding: 0 0 130px;
}

.ag-single-article {
  width: min(100%, 760px);

  margin: 0 auto;
}

.ag-single-content {
  color: #333333;

  font-size: 16px;

  line-height: 2;
}


/* PARAGRAPH */

.ag-single-content p {
  margin: 0 0 30px;
}


/* HEADINGS */

.ag-single-content h2 {
  margin: 75px 0 28px;

  color: #111111;

  font-size: clamp(30px, 4vw, 44px);

  font-weight: 700;

  line-height: 1.3;

  letter-spacing: -.035em;
}

.ag-single-content h3 {
  margin: 55px 0 22px;

  color: #111111;

  font-size: 26px;

  font-weight: 700;

  line-height: 1.4;

  letter-spacing: -.025em;
}


/* LINKS */

.ag-single-content a {
  color: #ff001c;

  text-decoration: underline;

  text-underline-offset: 4px;
}


/* IMAGES */

.ag-single-content img {
  width: 100%;
  height: auto;

  margin: 38px 0;

  border-radius: 18px;
}


/* BLOCKQUOTE */

.ag-single-content blockquote {
  margin: 50px 0;

  padding: 10px 0 10px 28px;

  border-left: 3px solid #ff001c;

  color: #555555;

  font-size: 18px;

  line-height: 1.9;
}

.ag-single-content blockquote p {
  margin: 0;
}


/* LISTS */

.ag-single-content ul,
.ag-single-content ol {
  margin: 30px 0;

  padding-left: 25px;
}

.ag-single-content ul {
  list-style: disc;
}

.ag-single-content ol {
  list-style: decimal;
}

.ag-single-content li {
  margin-bottom: 10px;
}


/* =========================================================
   ARTICLE FOOTER
========================================================= */

.ag-single-footer {
  width: min(100%, 760px);

  margin: 80px auto 0;

  padding-top: 35px;

  border-top: 1px solid #dddddd;
}

.ag-single-news-link {
  display: inline-flex;

  align-items: center;

  gap: 12px;

  color: #111111;

  font-size: 13px;

  font-weight: 700;
}

.ag-single-news-link span {
  color: #ff001c;

  transition: transform .2s ease;
}

.ag-single-news-link:hover span {
  transform: translateX(-5px);
}


/* =========================================================
   WORDPRESS CONTENT RESET
========================================================= */

.ag-single .entry-title,
.ag-single .entry-header {
  display: none !important;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

  .ag-single-hero {
    padding: 80px 0 70px;
  }

  .ag-single-back {
    margin-bottom: 50px;
  }

  .ag-single-featured {
    margin-bottom: 70px;
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

  .ag-single-container {
    width: 90%;
  }


  .ag-single-hero {
    padding: 55px 0 55px;
  }


  .ag-single-back {
    margin-bottom: 40px;

    font-size: 9px;
  }


  .ag-single-meta {
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 20px;
  }


  .ag-single-title {
    font-size: 42px;

    line-height: 1.13;
  }


  .ag-single-featured {
    margin-bottom: 55px;

    border-radius: 20px;
  }


  .ag-single-content-section {
    padding-bottom: 90px;
  }


  .ag-single-content {
    font-size: 15px;

    line-height: 1.95;
  }


  .ag-single-content p {
    margin-bottom: 25px;
  }


  .ag-single-content h2 {
    margin-top: 55px;

    font-size: 31px;
  }


  .ag-single-content h3 {
    margin-top: 42px;

    font-size: 23px;
  }


  .ag-single-content img {
    margin: 30px 0;

    border-radius: 14px;
  }


  .ag-single-content blockquote {
    margin: 40px 0;

    padding-left: 20px;

    font-size: 16px;
  }


  .ag-single-footer {
    margin-top: 60px;
  }

}
/* =========================================================
   ALEGRIA WELCOME EMAIL
========================================================= */

add_action('rest_api_init', function () {

    register_rest_route(
        'alegria/v1',
        '/welcome-email',
        array(
            'methods'  => 'POST',
            'callback' => 'alegria_send_welcome_email',
            'permission_callback' => '__return_true',
        )
    );

});


function alegria_send_welcome_email(WP_REST_Request $request) {

    $body = $request->get_json_params();

    $email =
        isset($body['email'])
            ? sanitize_email($body['email'])
            : '';

    $name =
        isset($body['name'])
            ? sanitize_text_field($body['name'])
            : '';

    $customer_id =
        isset($body['customer_id'])
            ? sanitize_text_field($body['customer_id'])
            : '';


    if (
        !$email ||
        !is_email($email) ||
        !$customer_id
    ) {

        return new WP_REST_Response(
            array(
                'success' => false,
                'message' => 'Invalid request'
            ),
            400
        );

    }


    $subject =
        'ALEGRIAへようこそ｜会員登録が完了しました';


    $display_name =
        $name
            ? esc_html($name)
            : 'お客様';


    $mypage_url =
        home_url('/mypage/');


    $logo_url =
        'https://www.ouralegria.com/wp-content/uploads/2026/09/ALEGRIA-新ロゴ.png';


    $message = '
    <!doctype html>
    <html lang="ja">
    <head>
        <meta charset="UTF-8">
    </head>

    <body style="
        margin:0;
        padding:0;
        background:#f5f5f5;
        font-family:Arial, Helvetica, sans-serif;
        color:#111;
    ">

        <table width="100%" cellpadding="0" cellspacing="0" border="0">

            <tr>
                <td align="center" style="padding:40px 15px;">

                    <table
                        width="100%"
                        cellpadding="0"
                        cellspacing="0"
                        border="0"
                        style="
                            max-width:620px;
                            background:#ffffff;
                            border-radius:18px;
                            overflow:hidden;
                        "
                    >

                        <tr>
                            <td style="
                                padding:34px 34px 20px;
                            ">

                                <img
                                    src="' . esc_url($logo_url) . '"
                                    alt="ALEGRIA"
                                    style="
                                        width:150px;
                                        height:auto;
                                    "
                                >

                            </td>
                        </tr>


                        <tr>
                            <td style="
                                padding:20px 34px 10px;
                            ">

                                <p style="
                                    margin:0 0 10px;
                                    color:#ff001c;
                                    font-size:11px;
                                    font-weight:700;
                                    letter-spacing:.14em;
                                ">
                                    WELCOME TO ALEGRIA
                                </p>

                                <h1 style="
                                    margin:0;
                                    font-size:34px;
                                    line-height:1.2;
                                    letter-spacing:-.03em;
                                ">
                                    会員登録が完了しました。
                                </h1>

                            </td>
                        </tr>


                        <tr>
                            <td style="
                                padding:25px 34px;
                                font-size:14px;
                                line-height:1.9;
                                color:#555;
                            ">

                                <p>
                                    ' . $display_name . ' 様
                                </p>

                                <p>
                                    ALEGRIAへの会員登録ありがとうございます。
                                </p>

                                <p>
                                    あなたのCustomer IDは以下です。
                                </p>


                                <div style="
                                    margin:24px 0;
                                    padding:20px;
                                    background:#f7f7f7;
                                    border-radius:12px;
                                ">

                                    <span style="
                                        display:block;
                                        margin-bottom:6px;
                                        color:#999;
                                        font-size:10px;
                                        letter-spacing:.12em;
                                    ">
                                        CUSTOMER ID
                                    </span>

                                    <strong style="
                                        font-size:24px;
                                        color:#111;
                                    ">
                                        ' . esc_html($customer_id) . '
                                    </strong>

                                </div>


                                <p>
                                    マイページでは、
                                    会員情報やお問い合わせ履歴などをご確認いただけます。
                                </p>


                                <p style="
                                    margin:30px 0;
                                ">

                                    <a
                                        href="' . esc_url($mypage_url) . '"
                                        style="
                                            display:inline-block;
                                            padding:16px 24px;
                                            background:#ff001c;
                                            color:#fff;
                                            text-decoration:none;
                                            border-radius:999px;
                                            font-weight:700;
                                        "
                                    >
                                        マイページを開く →
                                    </a>

                                </p>


                                <p style="
                                    margin-top:30px;
                                    color:#888;
                                    font-size:12px;
                                ">
                                    このメールはALEGRIAの会員登録完了時に
                                    自動送信されています。
                                </p>

                            </td>
                        </tr>


                        <tr>
                            <td style="
                                padding:24px 34px;
                                background:#111;
                                color:#aaa;
                                font-size:11px;
                                line-height:1.7;
                            ">

                                ALEGRIA<br>
                                Connecting People, Opportunities and the World.<br>
                                support@ouralegria.com

                            </td>
                        </tr>

                    </table>

                </td>
            </tr>

        </table>

    </body>
    </html>
    ';


    $headers = array(
        'Content-Type: text/html; charset=UTF-8',
        'From: ALEGRIA <support@ouralegria.com>',
    );


    $sent =
        wp_mail(
            $email,
            $subject,
            $message,
            $headers
        );


    if (!$sent) {

        return new WP_REST_Response(
            array(
                'success' => false,
                'message' => 'Email could not be sent'
            ),
            500
        );

    }


    return new WP_REST_Response(
        array(
            'success' => true
        ),
        200
    );

}