/* aPR DESIGN block patterns. Uses the theme's color tokens (--apr-*).
   Rules start with :is(#main,.editor-styles-wrapper) so they apply on the site and in the block editor
   and win over the theme's generic entry-content styles without !important. */
:root{--aprp-teal:var(--apr-teal,#0ea29d);--aprp-deep:var(--apr-deep,#087c83);--aprp-ink:var(--apr-ink,#1d1c1c);--aprp-muted:var(--apr-muted,#596363);--aprp-line:var(--apr-line,#d8e1df)}

/* Classic themes wrap group content in .wp-block-group__inner-container; let the grid/flex see the real children */
:is(.aprp-heading,.aprp-cards,.aprp-cards__item,.aprp-issues,.aprp-issues__head,.aprp-issues__list,.aprp-strength,.aprp-strength__item,.aprp-flow,.aprp-flow__item,.aprp-faq,.aprp-compact-cta,.apr-compact-cta,.apr-note,.apr-alert)>.wp-block-group__inner-container{display:contents}

/* Section heading: EN label + catch copy (+ lead) */
:is(#main,.editor-styles-wrapper) .aprp-heading{display:grid;grid-template-columns:minmax(289px,1.2fr) minmax(0,1.22fr);column-gap:clamp(64px,9vw,155px);align-items:start;margin-block:clamp(64px,7vw,108px) clamp(40px,5vw,72px)}
:is(#main,.editor-styles-wrapper) .aprp-heading>*,:is(#main,.editor-styles-wrapper) .aprp-heading>.wp-block-group__inner-container>*{grid-column:1;margin:0}
:is(#main,.editor-styles-wrapper) .aprp-heading__en{margin:0 0 1rem;color:var(--aprp-ink);font-family:Arial,sans-serif;font-size:min(4.2vw,97px);font-weight:900;line-height:.9;letter-spacing:-.06em}
:is(#main,.editor-styles-wrapper) h2.aprp-heading__title{margin:0;padding:0;border:0;font-size:clamp(2rem,2.6vw,2.75rem);font-weight:700;line-height:1.5;letter-spacing:.025em}
:is(#main,.editor-styles-wrapper) h2.aprp-heading__title::before,:is(#main,.editor-styles-wrapper) h2.aprp-heading__title::after{content:none}
:is(#main,.editor-styles-wrapper) .aprp-heading__lead{grid-column:2;grid-row:1/3;align-self:end;max-width:42em;margin:0;color:var(--aprp-muted);font-size:clamp(1rem,1.05vw,1.125rem);line-height:2.05}

/* Text link with arrow box */
:is(#main,.editor-styles-wrapper) .aprp-textlink a{display:inline-flex;align-items:center;gap:28px;color:var(--aprp-ink);font-weight:700;text-decoration:none}
:is(#main,.editor-styles-wrapper) .aprp-textlink a::after{content:"→";display:grid;width:38px;height:32px;background:#303638;color:#fff;transition:background-color .3s,transform .3s;place-items:center}
:is(#main,.editor-styles-wrapper) .aprp-textlink a:is(:hover,:focus-visible)::after{background:var(--aprp-teal);transform:translateX(4px)}

/* Buttons: mail style (= green + mail icon) */
.wp-block-button.is-style-apr-mail .wp-block-button__link{border:1px solid var(--aprp-deep);background-color:var(--aprp-deep);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:1.1rem center;background-size:1.2em;padding-left:2.9rem;color:#fff}
.wp-block-button.is-style-apr-mail .wp-block-button__link:is(:hover,:focus-visible)::after{background:#fff;color:var(--aprp-deep)}
:is(#main,.editor-styles-wrapper) .aprp-buttons{gap:12px}

/* Image cards (3 columns) */
:is(#main,.editor-styles-wrapper) .aprp-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-block:clamp(40px,5vw,64px);border-top:1px solid var(--aprp-line);border-left:1px solid var(--aprp-line);background:#fafdf9}
:is(#main,.editor-styles-wrapper) .aprp-cards__item{min-width:0;margin:0;padding:clamp(28px,3.5vw,48px);border-right:1px solid var(--aprp-line);border-bottom:1px solid var(--aprp-line)}
:is(#main,.editor-styles-wrapper) .aprp-cards__item .wp-block-image{width:min(76%,300px);margin:0 auto clamp(26px,3vw,40px)}
:is(#main,.editor-styles-wrapper) .aprp-cards__item img{width:100%;aspect-ratio:1;object-fit:contain}
:is(#main,.editor-styles-wrapper) .aprp-cards__label{margin:0 0 1rem;color:var(--aprp-teal);font:700 14px/1 Arial,sans-serif;letter-spacing:.12em}
:is(#main,.editor-styles-wrapper) h3.aprp-cards__title{margin:0 0 .9rem;padding:0;border:0;font-size:clamp(1.15rem,1.5vw,1.5rem);line-height:1.6}
:is(#main,.editor-styles-wrapper) h3.aprp-cards__title::before{content:none}
:is(#main,.editor-styles-wrapper) .aprp-cards__item p:last-child{margin:0;color:var(--aprp-muted);line-height:2}

/* Issues: teal panel + numbered list */
:is(#main,.editor-styles-wrapper) .aprp-issues{display:grid;grid-template-columns:minmax(260px,.68fr) minmax(0,1.32fr);gap:clamp(40px,6vw,100px);align-items:start;margin-block:clamp(56px,7vw,100px);counter-reset:aprp-issue}
:is(#main,.editor-styles-wrapper) .aprp-issues__head{padding:clamp(34px,4vw,56px);background:var(--aprp-teal);color:#fff}
:is(#main,.editor-styles-wrapper) .aprp-issues__head .aprp-heading__en{color:#fff}
:is(#main,.editor-styles-wrapper) h2.aprp-issues__title{margin:clamp(24px,3vw,40px) 0 0;padding:0;border:0;color:#fff;font-size:clamp(1.55rem,2.2vw,2.4rem);line-height:1.55}
:is(#main,.editor-styles-wrapper) h2.aprp-issues__title::before,:is(#main,.editor-styles-wrapper) h2.aprp-issues__title::after{content:none}
:is(#main,.editor-styles-wrapper) .aprp-issues__list{border-bottom:1px solid var(--aprp-line)}
:is(#main,.editor-styles-wrapper) h3.aprp-issues__item{position:relative;margin:0;padding:clamp(22px,2.5vw,34px) 0 clamp(22px,2.5vw,34px) 56px;border:0;border-top:1px solid var(--aprp-line);font-size:clamp(1.05rem,1.25vw,1.25rem);line-height:1.65;counter-increment:aprp-issue}
:is(#main,.editor-styles-wrapper) h3.aprp-issues__item::before{content:"0" counter(aprp-issue);position:absolute;top:clamp(26px,2.8vw,38px);left:0;width:auto;height:auto;border:0;border-radius:0;background:none;color:var(--aprp-teal);font:500 1rem/1 Arial,sans-serif;letter-spacing:.08em}

/* Numbered strength cards (2 columns) */
:is(#main,.editor-styles-wrapper) .aprp-strength{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-block:clamp(40px,5vw,64px);border-top:1px solid #bac8c6;border-left:1px solid #bac8c6}
:is(#main,.editor-styles-wrapper) .aprp-strength__item{margin:0;padding:clamp(34px,4.5vw,64px);border-right:1px solid #bac8c6;border-bottom:1px solid #bac8c6}
:is(#main,.editor-styles-wrapper) .aprp-strength__num{margin:0;color:var(--aprp-teal);font:700 clamp(3rem,5vw,5rem)/1 Arial,sans-serif;letter-spacing:-.06em}
:is(#main,.editor-styles-wrapper) h3.aprp-strength__title{margin:clamp(30px,4vw,56px) 0 20px;padding:0;border:0;font-size:clamp(1.3rem,1.9vw,1.9rem);line-height:1.55}
:is(#main,.editor-styles-wrapper) h3.aprp-strength__title::before{content:none}
:is(#main,.editor-styles-wrapper) .aprp-strength__item p:last-child{margin:0;line-height:1.95}

/* FAQ (core details block with the theme's .apr-faq-item look) */
:is(#main,.editor-styles-wrapper) .aprp-faq{margin-block:clamp(40px,5vw,64px)}
:is(#main,.editor-styles-wrapper) .aprp-faq .apr-faq-item{margin:0}
:is(#main,.editor-styles-wrapper) .aprp-faq .apr-faq-item summary{font-size:clamp(1rem,1.05vw,1.125rem)}
:is(#main,.editor-styles-wrapper) .aprp-faq .apr-faq-item>p{margin:0;padding:0 0 1.6rem;color:var(--aprp-muted);line-height:2}

/* 5-step flow */
:is(#main,.editor-styles-wrapper) .aprp-flow{position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin-block:clamp(40px,5vw,64px);counter-reset:none}
:is(#main,.editor-styles-wrapper) .aprp-flow::before{content:"";position:absolute;top:40px;right:10%;left:10%;height:2px;background:var(--aprp-teal)}
:is(#main,.editor-styles-wrapper) .aprp-flow__item{position:relative;z-index:1;margin:0;padding:0 clamp(10px,1.3vw,22px);text-align:center}
:is(#main,.editor-styles-wrapper) .aprp-flow__num{display:grid;width:80px;height:80px;margin:0 auto clamp(24px,3vw,40px);border:2px solid var(--aprp-teal);border-radius:50%;background:#fff;color:var(--aprp-teal);font:500 clamp(1.25rem,1.7vw,1.7rem)/1 Arial,sans-serif;place-items:center}
:is(#main,.editor-styles-wrapper) .aprp-flow__item:last-child .aprp-flow__num{background:var(--aprp-teal);color:#fff}
:is(#main,.editor-styles-wrapper) h3.aprp-flow__title{margin:0 0 1rem;padding:0;border:0;font-size:clamp(1rem,1.15vw,1.18rem);line-height:1.6}
:is(#main,.editor-styles-wrapper) h3.aprp-flow__title::before{content:none}
:is(#main,.editor-styles-wrapper) .aprp-flow__item p:last-child{margin:0;line-height:1.85;text-align:left}

/* Image + caption, separator, table, columns, media & text */
:is(#main,.editor-styles-wrapper) .aprp-image img{border-radius:8px}
:is(#main,.editor-styles-wrapper) .aprp-separator{margin-block:clamp(48px,6vw,90px);border:0;border-top:1px solid var(--aprp-line);opacity:1}
:is(#main,.editor-styles-wrapper) .aprp-columns{gap:clamp(24px,4vw,56px);margin-block:clamp(40px,5vw,64px)}
:is(#main,.editor-styles-wrapper) .aprp-media{gap:clamp(32px,6vw,90px);margin-block:clamp(48px,6vw,90px)}
:is(#main,.editor-styles-wrapper) .aprp-media .wp-block-media-text__media img{border-radius:8px}
:is(#main,.editor-styles-wrapper) .aprp-media .wp-block-media-text__content{padding:0}
:is(#main,.editor-styles-wrapper) .aprp-cta{margin-block:clamp(56px,7vw,100px);padding:0}
:is(#main,.editor-styles-wrapper) .aprp-cta h2{padding:0;color:#fff}
:is(#main,.editor-styles-wrapper) .aprp-cta h2::before,:is(#main,.editor-styles-wrapper) .aprp-cta h2::after{content:none}
:is(#main,.editor-styles-wrapper) .aprp-compact-cta .wp-block-buttons{flex:none}

@media(max-width:900px){
  :is(#main,.editor-styles-wrapper) .aprp-heading{grid-template-columns:1fr}
  :is(#main,.editor-styles-wrapper) .aprp-heading__lead{grid-column:1;grid-row:auto;margin-top:32px}
  :is(#main,.editor-styles-wrapper) .aprp-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  :is(#main,.editor-styles-wrapper) .aprp-flow{grid-template-columns:1fr}
  :is(#main,.editor-styles-wrapper) .aprp-flow::before{content:none}
  :is(#main,.editor-styles-wrapper) .aprp-flow__item{display:grid;grid-template-columns:80px minmax(0,1fr);gap:0 28px;padding:0 0 clamp(32px,5vw,48px);text-align:left}
  :is(#main,.editor-styles-wrapper) .aprp-flow__num{grid-row:1/3;margin:0}
  :is(#main,.editor-styles-wrapper) .aprp-flow__item>:not(.aprp-flow__num){grid-column:2}
}
@media(max-width:768px){
  :is(#main,.editor-styles-wrapper) .aprp-issues{grid-template-columns:1fr;gap:0}
  :is(#main,.editor-styles-wrapper) .aprp-table table,:is(#main,.editor-styles-wrapper) .aprp-table tbody,:is(#main,.editor-styles-wrapper) .aprp-table tr,:is(#main,.editor-styles-wrapper) .aprp-table th,:is(#main,.editor-styles-wrapper) .aprp-table td{display:block;width:100%;min-width:0}
  :is(#main,.editor-styles-wrapper) .aprp-table thead{display:none}
  :is(#main,.editor-styles-wrapper) .aprp-table tr{border-bottom:1px solid var(--aprp-line)}
  :is(#main,.editor-styles-wrapper) .aprp-table :is(th,td){border:0;overflow-wrap:anywhere}
  :is(#main,.editor-styles-wrapper) .aprp-table td:first-child{background:var(--apr-surface-gray,#ededed);font-weight:700}
}
@media(max-width:600px){
  :is(#main,.editor-styles-wrapper) .aprp-heading{margin-block:64px 40px}
  :is(#main,.editor-styles-wrapper) .aprp-heading__en{margin-bottom:28px;font-size:5vw;line-height:1}
  :is(#main,.editor-styles-wrapper) h2.aprp-heading__title{font-size:clamp(1.9rem,8vw,2.5rem);line-height:1.4;letter-spacing:.03em}
  :is(#main,.editor-styles-wrapper) .aprp-heading__lead{margin-top:28px}
  :is(#main,.editor-styles-wrapper) .aprp-cards,:is(#main,.editor-styles-wrapper) .aprp-strength{grid-template-columns:1fr}
  :is(#main,.editor-styles-wrapper) .aprp-flow__item{grid-template-columns:60px minmax(0,1fr);gap:0 20px}
  :is(#main,.editor-styles-wrapper) .aprp-flow__num{width:60px;height:60px;font-size:1.1rem}
}

/* Work detail pages: the theme prints the_content() without .apr-entry__content, so give it the same body-text styles */
.apr-work-detail .apr-work-block p:not(.apr-component-title){margin:0 0 1.6rem;line-height:2}
.apr-work-detail .apr-work-block a{color:var(--apr-deep);text-decoration:underline;text-underline-offset:.2rem}
.apr-work-detail .apr-work-block ul,.apr-work-detail .apr-work-block ol{margin:1.5rem 0;padding-left:1.5rem}
.apr-work-detail .apr-work-block li{margin:.45rem 0}
.apr-work-detail .apr-work-block blockquote{margin:2.5rem 0;padding:1.4rem 1.7rem;border-left:4px solid var(--apr-teal);background:var(--apr-surface-gray);color:var(--apr-muted)}
.apr-work-detail .apr-work-block table{width:100%;border-collapse:collapse;margin:2rem 0}
.apr-work-detail .apr-work-block th,.apr-work-detail .apr-work-block td{padding:1rem;border:1px solid var(--apr-line);text-align:left}
.apr-work-detail .apr-work-block th{background:var(--apr-surface-gray);font-weight:700}
.apr-work-detail .apr-work-block figure{margin:2.5rem 0}
.apr-work-detail .apr-work-block figcaption{margin-top:.6rem;color:var(--apr-muted);font-size:.75rem;text-align:center}
.apr-work-detail .apr-work-block :is(.apr-link-card,.apr-work-card,.apr-related-card,.apr-button,.apr-download,.apr-post-tags a,.apr-social-share a,.apr-post-nav a){text-decoration:none}

/* Work detail: headings inside the post content (the theme's own "制作ポイント" h2 follows .apr-component-title and is left as is) */
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h2:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *):not(.apr-component-title + h2){position:relative;margin:3.5rem 0 1.4rem;padding:0 0 .55em;border:0;font-size:clamp(1.35rem,2vw,2.05rem);font-weight:700;line-height:1.55}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h2:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *):not(.apr-component-title + h2)::after{content:"";position:absolute;right:0;bottom:0;left:0;height:1px;background:var(--aprp-teal)}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h2:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *):not(.apr-component-title + h2)::before{content:"";position:absolute;z-index:1;right:0;bottom:0;width:8px;height:8px;border-radius:50%;background:var(--aprp-teal);transform:translateY(44%)}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h3:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *){position:relative;margin:2.6rem 0 1rem;padding:.08em 0 .08em .85em;border:0;border-left:3px solid var(--aprp-teal);font-size:clamp(1.05rem,1.35vw,1.35rem);font-weight:700;line-height:1.65}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h3:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *)::before{content:"";position:absolute;top:-4px;left:-5px;width:7px;height:7px;border:2px solid #fff;border-radius:50%;background:var(--aprp-teal)}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h4:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *){margin:2.2rem 0 .9rem;font-size:clamp(1.12rem,1.8vw,1.5rem);font-weight:700;line-height:1.6}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h5:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *){margin:2rem 0 .8rem;font-size:1.05rem;font-weight:700;line-height:1.7}
:is(#main,.editor-styles-wrapper) .apr-work-detail .apr-work-block h6:not([class*="aprp-"]):not(:is(.apr-compact-cta,.apr-common-cta,.apr-price-sheet) *){margin:1.8rem 0 .7rem;color:var(--aprp-deep);font-size:.9rem;font-weight:700;line-height:1.7;letter-spacing:.06em}
