/* DAIWA V6.14 | 26 October 2026
 * Fix verified on the original V6.10 file supplied by the user.
 * Keep HEADER markup / geometry untouched. Match CONTENT and FOOTER to it.
 * Header geometry from assets/daiwa-v64.css:
 *   Desktop (>550px): width:calc(100% - 36px); max-width:1680px
 *   Small (<=550px): width:calc(100% - 20px)
 *   Tiny (<=320px):  width:calc(100% - 12px)
 * THESE VALUES ARE MIRRORED, not overridden on the header.
 */

/* 1. One exact horizontal grid for the entire custom website.
 * Target only main+footer so header position, nav, controls and toggles remain unchanged.
 */
html body.daiwa-site .daiwa-page-content.daiwa-v5 .wrap,
html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .wrap {
  box-sizing:border-box!important;
  width:calc(100% - 36px)!important;
  max-width:1680px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:0!important;
  padding-right:0!important;
}

/* Header's original CSS in daiwa-v64.css uses these same viewport breakpoints.
 * 36/20/12px are total width deductions (two equal side gutters).
 */
@media (max-width:550px){
  html body.daiwa-site .daiwa-page-content.daiwa-v5 .wrap,
  html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .wrap {
    width:calc(100% - 20px)!important;
  }
}
@media (max-width:320px){
  html body.daiwa-site .daiwa-page-content.daiwa-v5 .wrap,
  html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .wrap {
    width:calc(100% - 12px)!important;
  }
}

/* 2. Replace V6.10's very high specificity Times New Roman overrides.
 * The logo icon is a real local PNG; we don't substitute another image.
 * Japanese glyphs fall back to Noto Sans JP/Yu Gothic/Meiryo naturally.
 */
html body.daiwa-site,
html body.daiwa-site #wrapper,
html body.daiwa-site #main,
html body.daiwa-site .daiwa-v5,
html body.daiwa-site .daiwa-v5 :is(h1,h2,h3,h4,h5,h6,p,a,button,input,textarea,select,option,label,span,small,li,strong,th,td,em,blockquote,time,figcaption),
html body.daiwa-site #main :is(h1,h2,h3,h4,h5,h6,p,a,button,input,textarea,select,option,label,span,small,li,strong,th,td,em,blockquote,time,figcaption),
html body.daiwa-site .daiwa-v5 .footer-map-toolbar {
  font-family:'Roboto','Noto Sans JP','Yu Gothic','Meiryo','Segoe UI',Arial,sans-serif!important;
}
html body.daiwa-site .daiwa-v5{font-size:16px;line-height:1.6;letter-spacing:0;}
html body.daiwa-site .daiwa-v5 :is(h1,h2,h3,h4,h5,h6){
  font-weight:700;
  letter-spacing:-.024em;
  line-height:1.17;
}
html body.daiwa-site .daiwa-v5 :is(p,li){line-height:1.7;}
/* Maintain contrast and hierarchy of hero headline while using Roboto. */
html body.daiwa-site .daiwa-v5 .hero-main h1{
  font-weight:800!important;
  letter-spacing:-.035em!important;
  line-height:1.02!important;
}
/* Do not alter header dimensions, nav visibility rules or button locations. */

/* 3. Non-virtual WordPress article/page entry containers. Flatsome still owns
 * its internal columns, but their outer page container uses the matching width.
 * No changes to the WP database or published post content.
 */
html body.daiwa-site:not(.daiwa-custom-page) #main > .container,
html body.daiwa-site:not(.daiwa-custom-page) #main > .page-wrapper > .container {
  box-sizing:border-box!important;
  max-width:1680px!important;
  width:calc(100% - 36px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
@media(max-width:550px){
  html body.daiwa-site:not(.daiwa-custom-page) #main > .container,
  html body.daiwa-site:not(.daiwa-custom-page) #main > .page-wrapper > .container{
    width:calc(100% - 20px)!important;
  }
}
@media(max-width:320px){
  html body.daiwa-site:not(.daiwa-custom-page) #main > .container,
  html body.daiwa-site:not(.daiwa-custom-page) #main > .page-wrapper > .container{
    width:calc(100% - 12px)!important;
  }
}

/* 4. Fix inherited V6.10 responsive regression: premium.css sets the intro
 * back to two columns after base.css had correctly stacked it on tablets.
 * Keep all desktop section layouts unchanged. */
@media(max-width:820px){
  html body.daiwa-site .daiwa-page-content.daiwa-v5 :is(.split-grid,.profile-grid,.env-split,.transpar-grid){
    grid-template-columns:minmax(0,1fr)!important;
    gap:32px!important;
  }
  html body.daiwa-site .daiwa-page-content.daiwa-v5 :is(.split-copy,.picture-stack){
    min-width:0;
  }
}


/* 5. Footer brand cleanup per user feedback:
 * - remove the white tile behind the footer logo
 * - use the original logo directly on the footer background
 * - remove the extra company-name line below the logo (markup removed in daiwa-pages.php)
 */
html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .footer-brand img{
  background:transparent!important;
  padding:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  display:block;
  width:265px;
  max-width:100%;
  margin:0 0 18px;
}
html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .footer-brand small{
  margin-top:0!important;
}
@media (max-width:768px){
  html body.daiwa-site .daiwa-shared-footer.daiwa-v5 .footer-brand img{
    width:235px;
    margin-bottom:16px;
  }
}


/* DAIWA V6.17 - FAC-2 factory imagery fix
 * The facility card uses assets/sourced/fac2.jpg via PHP.
 * The factory 2 page hero previously displayed a hard-coded illustration.
 * This uses the same FAC-2 photo for both the listing card and hero.
 * A valid Customizer image still takes precedence via the existing WP inline style.
 */
html body.daiwa-site .daiwa-page-content.daiwa-v5 .page-hero-fac2 {
  background-image:
    linear-gradient(100deg, rgba(2,28,54,.92) 0%, rgba(3,44,77,.78) 53%, rgba(5,59,83,.35) 100%),
    url("sourced/fac2.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}


/* DAIWA V6.18: high-resolution factory photos.
 * Do not apply the inherited extra contrast filter to factory photos;
 * this accentuated pixel/compression artifacts on large screens.
 * Natural cover-cropping remains responsive without distorting the photo.
 */
html body.daiwa-site .daiwa-page-content.daiwa-v5 .facility-feature .facility-photo img {
  object-fit: cover;
  object-position: center center;
  image-rendering: auto !important;
  filter: none !important;
  transform: none !important;
}
