/* 岩浅税理士事務所 スマートフォン対応用CSS (Dreamweaver 2021) */
/* パソコン表示は既存の750pxデザインを維持します。 */
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; }
  body { margin: 0; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
  img { max-width: 100%; height: auto; }
  a { overflow-wrap: anywhere; }
  body > div { width: 100%; max-width: 100%; box-sizing: border-box; }
  .site-header, .site-layout, .site-footer { width: 100% !important; max-width: 100%; }
  .site-header, .site-header tbody, .site-header tr, .site-header td,
  .site-layout, .site-layout tbody, .site-layout tr, .site-layout td,
  .site-footer, .site-footer tbody, .site-footer tr, .site-footer td {
    box-sizing: border-box;
  }
  .site-header { display: block; }
  .site-header > tbody, .site-header > tbody > tr { display: block; width: 100%; }
  .site-header > tbody > tr > td { display: block; width: 100%; }
  .site-header > tbody > tr:nth-child(1) img,
  .site-header > tbody > tr:nth-child(2) img { display: block; width: 100%; height: auto; }
  .site-header > tbody > tr:nth-child(3) > td {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px;
    padding: 8px; background: #f3f6f8;
  }
  .site-header > tbody > tr:nth-child(3) a { display: block; min-width: 0; }
  .site-header > tbody > tr:nth-child(3) img { width: 100%; height: auto; display: block; }
  .site-layout { display: block; padding: 0 14px; }
  .site-layout > tbody { display: block; }
  .site-layout > tbody > tr { display: flex; flex-wrap: wrap; }
  .site-layout > tbody > tr > td { display: block; width: 100% !important; max-width: 100%; }
  /* 5列構成の左右余白・中央仕切りを非表示 */
  .site-layout > tbody > tr > td:nth-child(1),
  .site-layout > tbody > tr > td:nth-child(3),
  .site-layout > tbody > tr > td:nth-child(5) { display: none; }
  /* 本文を先に、お知らせを後に表示 */
  .site-layout > tbody > tr > td:nth-child(4) { order: 1; }
  .site-layout > tbody > tr > td:nth-child(2) { order: 2; }
  .site-layout > tbody > tr:first-child > td:nth-child(2) { order: 2; margin-top: 16px; }
  .site-layout > tbody > tr:first-child > td:nth-child(4) { order: 1; }
  .site-layout > tbody > tr > td img { max-width: 100%; height: auto; }
  .site-layout > tbody > tr > td p { max-width: 100%; }
  /* お知らせ欄の内部表を画面幅いっぱいにする */
  .news-inner { width: 100% !important; table-layout: auto; }
  .news-inner td:first-child { width: 0 !important; padding: 0; }
  .news-inner td { vertical-align: top; }
  .news-inner img { max-width: 100%; height: auto; }
  .site-footer { display: block; padding: 8px 14px; }
  .site-footer tbody, .site-footer tr, .site-footer td { display: block; width: 100%; }
  .footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 8px; }
  .footer-nav > img:first-child { flex-basis: 100%; width: 220px; object-fit: contain; }
  .footer-nav a { display: inline-block; }
  .footer-nav a img { height: 36px; width: auto; max-width: 100%; }
  .fb-like-box { max-width: 100%; }
}


/* 2026 改良版: 共通の読みやすさとタップ操作 */
.mobile-welcome { display:none; }
@media screen and (max-width:767px) {
  body { background:#f7f9fb; color:#23313d; font-family:"Yu Gothic","Hiragino Kaku Gothic ProN",Meiryo,sans-serif; }
  body > div { background:#fff; }
  .site-header > tbody > tr:nth-child(3) { display:none; }
  .mobile-welcome { display:block; text-align:left; padding:22px 16px 16px; background:linear-gradient(135deg,#f0f6f9,#fff); }
  .mobile-eyebrow { color:#316178; font-size:13px; font-weight:bold; margin:0 0 6px; }
  .mobile-welcome h1 { font-size:26px; margin:0 0 10px; color:#173b51; line-height:1.35; }
  .mobile-welcome p { margin:0 0 14px; }
  .mobile-actions { display:grid; grid-template-columns:1fr; gap:9px; margin:14px 0 20px; }
  .mobile-actions a { display:block; padding:13px 12px; border:1px solid #1a566f; border-radius:8px; text-align:center; font-weight:bold; background:#fff; color:#1a566f; text-decoration:none; }
  .mobile-actions a.primary { background:#1a566f; color:#fff; }
  .mobile-menu { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .mobile-menu a { display:block; background:#fff; border:1px solid #d7e2e8; border-radius:8px; padding:12px 8px; text-align:center; font-weight:bold; color:#24465a; text-decoration:none; min-height:44px; box-sizing:border-box; }
  .site-layout > tbody > tr > td:nth-child(4) { background:#fff; padding:10px 4px; }
  .site-layout > tbody > tr > td:nth-child(2) { border-top:3px solid #1a566f; margin-top:20px; padding-top:12px; }
  .site-layout p { line-height:1.85; }
  .site-layout a { text-decoration:underline; text-underline-offset:2px; }
  .site-layout img { border-radius:3px; }
  .footer-nav { display:none; }
  .site-footer { background:#f5f8fa; }
  input,textarea,select { max-width:100%; box-sizing:border-box; font-size:16px; }
  a { touch-action:manipulation; }
}
/* 他ページにも適用できる安全な共通ルール。固定幅テーブルは個別調整が必要 */
@media screen and (max-width:767px) {
  body:not(.iwasa-home) img { max-width:100%; height:auto; }
  body:not(.iwasa-home) table { max-width:100%; }
  body:not(.iwasa-home) p,body:not(.iwasa-home) td { overflow-wrap:anywhere; }
}

/* 下層ページ: スマホ表示専用。PC版の元デザインは変更しない */
.mobile-subheader {display:none}
@media screen and (max-width:767px) {
 html,body {max-width:100%;margin:0;overflow-x:clip;-webkit-text-size-adjust:100%}
 body.iwasa-subpage {font:16px/1.8 "Yu Gothic",Meiryo,sans-serif;color:#243746;background:#f5f8fa}
 .mobile-subheader {display:block;background:#fff;padding:16px 12px 14px;border-bottom:3px solid #1a566f;text-align:left}
 .mobile-brand {font-size:23px;font-weight:700;color:#173b51!important;text-decoration:none}
 .mobile-subheader p {font-size:13px;margin:0 0 14px;color:#536b78}
 .mobile-subnav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .mobile-subnav a {padding:10px 4px;border:1px solid #cddde4;border-radius:7px;text-align:center;min-height:44px;box-sizing:border-box;background:#f7fafc;color:#234a60!important;text-decoration:none;font-weight:bold;font-size:14px}
 .mobile-subnav a[aria-current="page"] {background:#1a566f;color:white!important}
 body.iwasa-subpage > div:not(.mobile-subheader), body.iwasa-subpage > p {max-width:100%;box-sizing:border-box}
 body.iwasa-subpage img {max-width:100%;height:auto}
 body.iwasa-subpage a {overflow-wrap:anywhere}
 body.iwasa-subpage table {max-width:100%;box-sizing:border-box}
 body.iwasa-subpage .responsive-main-table {display:block!important;width:100%!important;max-width:100%;padding:10px 14px;background:white;margin:0 auto 12px}
 .responsive-main-table > tbody {display:block!important;width:100%}
 .responsive-main-table > tbody > tr {display:flex!important;flex-direction:column;width:100%;height:auto!important}
 .responsive-main-table > tbody > tr > td {display:block!important;width:100%!important;max-width:100%!important;height:auto!important;box-sizing:border-box;padding:4px 0!important;text-align:left;vertical-align:top}
 /* 原レイアウトの余白・仕切り画像を抑制 */
 .responsive-main-table > tbody > tr > td[background*="line1.gif"] {display:none!important}
 .responsive-main-table > tbody > tr > td > img[src*="/line2.gif"],.responsive-main-table > tbody > tr > td > img[src*="/line3.gif"] {display:none!important}
 .responsive-main-table > tbody > tr > td > table {width:100%!important;max-width:100%;table-layout:auto}
 .responsive-main-table table td {max-width:100%;overflow-wrap:anywhere}
 body.iwasa-subpage input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),body.iwasa-subpage textarea,body.iwasa-subpage select {max-width:100%!important;width:100%;min-height:42px;box-sizing:border-box;font-size:16px;padding:8px;border:1px solid #aabac5;border-radius:5px}
 body.iwasa-subpage input[type="checkbox"],body.iwasa-subpage input[type="radio"] {width:20px;height:20px;vertical-align:middle}
 body.iwasa-subpage input[type="submit"],body.iwasa-subpage input[type="reset"] {background:#1a566f;color:white;font-weight:bold;margin:6px 0}
 body.iwasa-subpage p {max-width:100%;overflow-wrap:anywhere}
 body.iwasa-subpage [width="750"],body.iwasa-subpage [width="800"] {max-width:100%!important}
 /* 旧ヘッダー画像メニューとフッターナビはスマホでは重複表示しない */
 body.iwasa-subpage > div:not(.mobile-subheader) > p:first-child > a:has(img[src*="topimg2/"]) {display:none}
 body.iwasa-subpage > div:not(.mobile-subheader) > p:first-child > a:has(img[src*="topimg2/1.jpg"]) {display:none}
 body.iwasa-subpage > div:not(.mobile-subheader) > p:first-child > img[src*="topimg2/"] {display:none}
 body.iwasa-subpage .responsive-main-table img {object-fit:contain}
}
