@layer reset, base, components, utilities, property, custom;

/* @layer reset {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0;
    padding: 0;
    font-size: 100%;
    font-weight: normal;
  }
} */

:root {
  --color-primary: #e32828;
  --color-secondary: #730707;
  --color-line: #00b54c;
  --color-fg: #333;
  --color-fg-inversed: white;
  --color-bg: white;
  --color-bg-muted: #f5f5f5;
  --color-panel: white;
  --color-border: #ccc;
}

@layer utilities {
  .inline-block {
    display: inline-block;
  }
  .inline-flex {
    display: inline-flex;
  }
  .flex {
    display: flex;
  }

  .fg {
    color: var(--color-fg);
  }
  .fg-inversed {
    color: var(--color-fg-inversed);
  }

  .fg-primary {
    color: var(--color-primary);
  }

  .fg-secondary {
    color: var(--color-secondary);
  }

  .bg-primary {
    background-color: var(--color-primary);
  }
  .bg-primary.fg-contrast {
    color: white;
  }

  .bg {
    background-color: var(--color-bg);
  }

  .bg-secondary {
    background-color: var(--color-secondary);
  }
  .bg-secondary.fg-contrast {
    color: white;
  }

  .bg-line {
    background-color: var(--color-line);
  }
  .bg-line.fg-contrast {
    color: white;
  }

  .border {
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-border);
  }

  .border-primary {
    border-color: var(--color-primary);
  }

  .border-secondary {
    border-color: var(--color-secondary);
  }

  .border-line {
    border-color: var(--color-line);
  }

  .bold {
    font-weight: bold;
  }

  .horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .justify-center {
    justify-content: center;
  }

  .align-stretch {
    align-items: stretch;
  }

  .self-stretch {
    align-self: stretch;
  }

  .gap-sm {
    gap: 0.5em;
  }

  .gap-md {
    gap: 1em;
  }

  .gap-lg {
    gap: 2em;
  }

  .p-0 {
    padding: 0;
  }

  .p-sm {
    padding: var(--p-sm);
  }

  .p-md {
    padding: var(--p-md);
  }

  .p-lg {
    padding: var(--p-lg);
  }

  .p-xl {
    padding: var(--p-xl);
  }

  .px-0 {
    padding-inline: 0;
  }

  .px-sm {
    padding-inline: 0.5em;
  }

  .px-md {
    padding-inline: 1em;
  }

  .px-lg {
    padding-inline: 2em;
  }

  .px-xl {
    padding-inline: 3em;
  }

  .py-0 {
    padding-block: 0;
  }

  .py-sm {
    padding-block: 0.5em;
  }

  .py-md {
    padding-block: 1em;
  }

  .py-lg {
    padding-block: 2em;
  }

  .py-xl {
    padding-block: 3em;
  }

  .pt-0 {
    padding-top: 0;
  }

  .pt-sm {
    padding-top: 0.5em;
  }

  .pt-md {
    padding-top: 1em;
  }

  .pt-lg {
    padding-top: 2em;
  }

  .pt-xl {
    padding-top: 3em;
  }

  .pb-0 {
    padding-bottom: 0;
  }

  .pb-sm {
    padding-bottom: 0.5em;
  }

  .pb-md {
    padding-bottom: 1em;
  }

  .pb-lg {
    padding-bottom: 2em;
  }

  .pb-xl {
    padding-bottom: 3em;
  }

  .pl-0 {
    padding-left: 0;
  }

  .pl-sm {
    padding-left: 0.5em;
  }

  .pl-md {
    padding-left: 1em;
  }

  .pl-lg {
    padding-left: 2em;
  }

  .pl-xl {
    padding-left: 3em;
  }

  .pr-0 {
    padding-right: 0;
  }

  .pr-sm {
    padding-right: 0.5em;
  }

  .pr-md {
    padding-right: 1em;
  }

  .pr-lg {
    padding-right: 2em;
  }

  .pr-xl {
    padding-right: 3em;
  }

  .text-center {
    text-align: center;
  }

  .font-mincho {
    font-family: "Noto Serif JP", serif;
  }
  .font-gothic {
    font-family: "Noto Sans JP", sans-serif;
  }

  .font-size-0 {
    font-size: 0;
  }

  .font-size-xs {
    font-size: 0.75rem;
  }

  .font-size-sm {
    font-size: 0.875rem;
  }

  .font-size-md {
    font-size: 1rem;
  }

  .font-size-lg {
    font-size: 1.5rem;
  }

  .font-size-xl {
    font-size: 2rem;
  }

  .font-size-xxl {
    font-size: 3rem;
  }

  .decoration-none {
    text-decoration: none;
  }

  .text-yellow {
    color: #fee422;
  }

  .text-red {
    color: #e32828;
  }
}

@layer components {
  .badge {
    padding: 0.25em 1em;
    font-size: 0.875em;
    border-radius: 0.5em;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
  }

  .badge.outline {
    border-width: 1px;
    border-style: solid;
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    border-radius: 9999px;
    padding: 0.5em 2em;
    text-decoration: none;
    cursor: pointer;
    border: none;
  }

  .button:hover {
    opacity: 0.8;
  }

  .card {
    padding: 1em;
    border-radius: 0.5em;
    background-color: var(--color-panel);
  }

  .sep {
    background-color: rgb(from currentColor r g b / 0.2);
    width: 2px;
    min-height: 1em;
    display: inline-block;
  }

  .list-none {
    list-style: none;
  }
  .list-none > li {
    margin-left: 2em;
  }

  .list-disc {
    list-style: disc;
  }
  .list-disc > li {
    margin-left: 2em;
  }
}

@layer custom {
  body {
    grid-template-rows: max-content 1fr max-content;
  }

  /* Header */

  .header {
    padding: 0;
    position: relative;
    border: none;

    @media (max-width: 890px) {
      height: 80px;
      border-radius: 0;
      width: 100%;
      top: 0;
      margin: 0;
      padding: 20px;
      background-color: var(--header-color);
    }
  }

  .header > .inner {
    --content-spacing: clamp(1.875rem, 24vw, max(calc(50vw - var(--main-width) / 2), 12px));
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    padding: var(--p-lg) var(--content-spacing);
    gap: 16px;

    @media (max-width: 890px) {
      padding: 0;
    }
  }

  .header .inner .header-info {
    padding-right: 56px;
    flex-grow: 1;
    justify-content: flex-end;
  }

  .header .inner .information {
    padding-top: 0;
  }
  .header .inner .hours-wrapper {
    flex-wrap: wrap;
    gap: 0 0.5em;
    justify-content: center;
  }

  .header .inner .header-info .button-wrapper {
    flex-grow: 1;
    justify-content: flex-end;
    max-width: 456px;
  }

  .header .inner .header-info .button {
    max-width: 224px;
    flex-grow: 1;
    gap: var(--gap-md);
    white-space: nowrap;
  }

  .header .inner .header-info .button .fa-line,
  .header .inner .header-info .button .fa-envelope {
    font-size: var(--text-xl);
    @media (max-width: 890px) {
      font-size: var(--text-md);
    }
  }

  .header .list {
    display: flex;
    justify-content: center;
    background: var(--color-secondary);
    color: white;
    gap: var(--gap-md);
    padding-block: 0;
    padding-inline: var(--p-md);
  }

  .header .list .item {
    height: auto;
    max-width: 300px;
    padding-block: var(--p-md);
  }
  .header .list .item .text {
    color: white;
    padding-block: 0;
  }
  .header .list .item:hover .text {
    color: var(--color-secondary);
  }
  .header .list .item:hover .menu .heading {
    padding-top: var(--p-lg);
  }

  .header .list .link {
    color: white;
    padding: var(--p-md);
  }

  .header .list .link:hover {
    background: rgb(from var(--color-fg-inversed) r g b / 0.1);
  }

  .header .list .sep {
    background: rgb(from currentColor r g b / 0.2);
    width: 2px;
  }

  .header .list .sep:is(:first-child, :last-child) {
    display: none;
  }

  @media (max-width: 890px) {
    .header .logo {
      max-height: 40px;
    }
    .header .logo + * {
      display: none;
    }
    .header .list {
      display: none;
    }
  }

  /* Hamburger Menu */

  .hamburger-menu {
    --content-spacing: clamp(1.875rem, 24vw, max(calc(50vw - var(--main-width) / 2), 12px));
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 4px;
    top: 30px;
    @media (max-width: 890px) {
      left: calc(90% - 10px);
      top: 20px;
    }
  }

  .hamburger-menu .item {
    height: 4px;
    border-radius: 9999px;
    background: var(--color-primary);
    width: 30px;
  }

  /* Footer */

  .footer {
    background: var(--color-secondary);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, max-content);
    grid-template-areas:
      "top"
      "middle"
      "bottom";
  }

  .footer-top {
    grid-area: top;
    background: url("/app/themes/formatline/assets/image/inuki_top_fv_pc.jpg") no-repeat center center / cover;
    padding-block: var(--p-xl);
    padding-inline: var(--content-spacing);

    br {
      display: none;
      @media (max-width: 400px) {
        display: block;
      }
    }
  }

  .footer-top > p {
    @media (max-width: 1100px) {
      font-size: var(--text-md);
    }
  }

  .footer-top .inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: max-content max-content;
    width: fit-content;
    gap: var(--gap-xxl);
    margin-inline: auto;

    @media (max-width: 1100px) {
      grid-template-columns: 1fr 1fr;
      grid-template-rows: max-content max-content;
      gap: var(--gap-xxl);
      width: 70%;
    }
    @media (max-width: 700px) {
      width: 100%;
      gap: 14px;
    }
  }

  .footer-top .inner > .card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: subgrid;
    grid-row: span 2;
    gap: var(--gap-md);
    align-items: center;
    padding: var(--p-xxl) var(--p-xl);
    border-radius: 10px;

    @media (max-width: 1100px) {
      padding-block: var(--p-lg);
    }
  }

  .footer-top .inner > .card:first-child {
    @media (max-width: 1100px) {
      grid-column: span 2;
    }
  }

  .footer-top .inner > .card:not(:first-child) {
    @media (max-width: 1100px) {
      grid-column: span 1;
      padding-inline: var(--p-md);
    }
    @media (max-width: 400px) {
      padding-inline: 6px;
    }
  }

  .footer-top .inner > .card > p {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -1px;

    @media (max-width: 1100px) {
      font-size: var(--text-md);
    }
  }

  .footer-top .inner > .card:not(:first-child) > p {
    @media (max-width: 400px) {
      font-size: 13px;
    }
  }

  .footer-top .inner > .card .tel-link-wrapper {
    gap: var(--gap-sm);
    @media (max-width: 1100px) {
      gap: 14px;
    }
  }

  .footer-top .inner > .card .contact-time {
    font-size: var(--text-sm);
    @media (max-width: 1100px) {
      font-size: 18px;
    }
  }

  .footer-top .inner > .card .tel-link {
    font-size: var(--text-xxl);

    @media (max-width: 400px) {
      font-size: 28px;
    }
  }

  .footer-top .inner > .card .mail-link,
  .footer-top .inner > .card .line-link {
    padding: 16px var(--p-xxl);
    align-items: center;
    line-height: 1.1;
    gap: var(--gap-md);
    width: 100%;

    @media (max-width: 1100px) {
      font-size: 11px;
      padding: var(--p-md);
      gap: var(--gap-sm);
      line-height: 0.9;
      max-width: 224px;
    }
  }

  .footer-top .inner > .card .mail-link .fa-envelope,
  .footer-top .inner > .card .line-link .fa-line {
    font-size: 24px;

    @media (max-width: 1100px) {
      font-size: var(--text-md);
    }
  }

  .footer-middle {
    grid-area: middle;
    padding-block: 2em;
    display: flex;
    justify-content: start;
    padding-block: 50px;
    padding-inline: var(--content-spacing);

    @media (max-width: 1120px) {
      justify-content: center;
    }

    @media (max-width: 510px) {
      padding-block: 30px;
      justify-content: start;
    }
  }

  .footer-middle .inner {
    display: grid;
    grid-template-columns: repeat(5, auto);
    align-items: start;
    max-width: 1200px;
    gap: var(--gap-xxl);

    @media (max-width: 1120px) {
      grid-template-columns: repeat(3, auto);
    }

    @media (max-width: 510px) {
      grid-template-columns: 1fr;
      justify-items: start;
      gap: 48px;
    }
  }

  .footer-middle .inner .tel-wrapper {
    @media (max-width: 510px) {
      flex-direction: row;
      gap: var(--gap-md);
    }
    @media (max-width: 400px) {
      flex-direction: column;
      gap: 0;
    }
  }

  .footer-middle .inner .list-disc {
    display: grid;
    gap: 6px;

    @media (max-width: 510px) {
      gap: 18px;
    }
  }

  .footer-middle .inner .list-disc > li {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.6;
  }

  .footer-middle .inner .search-menu-wrapper {
    display: flex;
    gap: var(--gap-xl);
    flex-wrap: wrap;
    @media (max-width: 890px) {
      display: none;
    }

    @media (max-width: 1120px) {
      grid-column: span 3;
    }
  }

  .footer-middle .inner .search-menu-wrapper .vertical {
    gap: var(--gap-md);
  }

  .footer-middle .inner .search-menu-wrapper .list-none {
    display: grid;
    gap: 6px;
  }

  .footer-middle .inner .search-menu-wrapper .list-none > li {
    font-size: var(--text-md);
    font-weight: 400;
    line-height: 1.6;
  }

  .footer-middle .inner .sep {
    @media (max-width: 890px) {
      display: none;
    }
  }
  .footer-middle .inner .sep:nth-of-type(4) {
    @media (max-width: 1120px) {
      display: none;
    }
  }

  .footer-bottom {
    grid-area: bottom;
    background: var(--color-bg);
    padding-block: var(--p-xl);
    padding-inline: var(--content-spacing);
  }
  .footer-bottom .inner {
    max-width: 1200px;
    margin-inline: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    @media (max-width: 890px) {
      flex-direction: column;
      align-items: center;
    }
  }

  .header .inner a,
  .footer a {
    transition: opacity 0.3s;
  }

  .header .inner a:hover,
  .footer a:hover {
    opacity: 0.8;
  }

  .footer-banner-image {
    object-fit: contain;
  }

  .navigation .link::before {
    border-color: var(--sub-color);
  }

  .wp-rengodb .line-banner {
    display: none;
  }

  .line-banner {
    position: fixed;
    bottom: 1.25rem;
    right: 0;
    z-index: 1000;
    background: #00c300;
    border-radius: 0.75rem 0 0 0.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 195, 0, 0.3);
    transition: all 0.3s ease;
    padding: 0.9375rem;
    opacity: 1;
    pointer-events: auto;

    @media (max-width: 890px) {
      bottom: 0;
      left: 0;
      right: 0;
      padding: 0.625rem;
      margin: 0;
      border-radius: 0;
      z-index: 1000;
    }
  }
  .line-banner:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1rem rgba(0, 195, 0, 0.4);
    @media (max-width: 890px) {
      transform: translateY(0);
      box-shadow: none;
    }
  }
  .line-banner.is-hidden {
    opacity: 0;
    pointer-events: none; /* 非表示中はクリックできないように */
  }
  .line-banner-link {
    display: block;
    text-decoration: none;
    color: white;
  }

  .line-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    @media (max-width: 890px) {
      gap: 10px;
      justify-content: center;
    }
  }

  .line-banner-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    font-size: 2rem;
    @media (max-width: 890px) {
      flex-direction: row;
      align-items: center;
      font-size: 1.5rem;
    }
  }

  .line-banner-logo {
    background: white;
    border-radius: 8px;
    padding: 4px 8px;
    display: inline-block;
    width: fit-content;
    @media (max-width: 890px) {
      padding: 3px 6px;
    }
  }

  .line-logo-text {
    color: #00c300;
    font-size: 12px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    @media (max-width: 890px) {
      font-size: 10px;
    }
  }

  .line-banner-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;

    @media (max-width: 890px) {
      flex-direction: row;
    }
  }

  .line-banner-qr {
    display: flex;
    align-items: center;
    aspect-ratio: 1 / 1;
    width: 78px;
    background: #fff;
    @media (max-width: 890px) {
      display: none;
    }
  }
}

@layer custom {
  .detail-page-header .contact .inquiry-button,
  .detail-page-header .contact .tel-button {
    border-color: #e32828;
  }
  .detail-page-header .contact .inquiry-button {
    background: #e32828;
  }

  .detail-page-header .contact .tel-button {
    color: #e32828;
  }
}
