/* Local mobile adaptation. Original desktop styles remain authoritative at 1050px+. */
@media (max-width: 1049px) {
  *, *::before, *::after { box-sizing: border-box; }
  body { min-width: 0; font-size: 14px; line-height: 1.55; }
  .container { width: 100%; max-width: 1050px; padding: 0; }
  #outer-container, #wrapper-header, #wrapper-content, #wrapper-footer, #after-footer { min-width: 0; }
  #content, #footer, #copyright, #nav-container, #slider-container { margin-left: 12px; margin-right: 12px; }
  #main, #content.innerpage #main { padding: 20px 14px; }
  #maincontent, #maincontent.full, #maincontent.positionleft, #maincontent.positionright {
    float: none; width: 100%; min-width: 0; padding: 0;
  }
  #sidebar { float: none; width: 100%; padding: 0; margin-top: 30px; }
  #sidebar > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  #sidebar .widget-container { min-width: 0; margin-bottom: 16px; }
  #sidebar iframe { display: block; width: 100%; max-width: 100%; }
  #main-footer { padding: 20px 14px 0; }
  #main-footer .footcol1, #main-footer .footcol2, #main-footer .footcol3, #main-footer .footcol4 {
    width: 100%; float: none; margin-right: 0;
  }
  #copyright { padding: 18px 14px; }
  img { max-width: 100%; height: auto; }
  .imgframe img { display: block; }
  h1, h2, h3, h4, h5, h6, .pagetitle, .posttitle { line-height: 1.2; overflow-wrap: break-word; }
  .pagetitle { font-size: clamp(30px, 5vw, 38px); }
  .intro { font-size: 17px; line-height: 1.55; }
  p, #sidebar a { overflow-wrap: break-word; }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #a24e40; outline-offset: 3px;
  }

  /* The original logo and both ornamental images scale together. */
  #logo {
    display: flex; align-items: center; justify-content: center;
    gap: clamp(8px, 2vw, 20px); width: auto; height: auto;
    margin: 0 12px; padding: 25px 0 20px;
  }
  #logo a { display: block; flex: 0 1 322px; min-width: 0; }
  #logo a img { display: block; float: none; width: 100%; height: auto; }
  .logo-l, .logo-r {
    display: block; float: none; flex: 0 1 84px; min-width: 24px;
    width: clamp(24px, 9vw, 84px); height: 29px;
    margin: 0; background-size: contain; background-position: center;
  }

  /* With JavaScript unavailable all navigation links remain visible. */
  #nav-main { padding: 0; }
  #nav {
    width: 100%; height: auto; min-height: 60px; margin: 0;
    background: #692c0c;
  }
  #topnav {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static; float: none; right: auto; bottom: auto;
    width: 100%; margin: 0; padding: 8px 12px 12px; gap: 0;
  }
  #topnav > li, #topnav > li:first-child {
    display: block; float: none; width: auto; min-width: 0; margin: 0;
  }
  #topnav > li:has(ul) { grid-column: 1 / -1; }
  #topnav a, #topnav ul li a {
    display: block; min-height: 44px; padding: 11px 12px !important;
    font-size: 15px; line-height: 22px; white-space: normal;
  }
  #topnav ul, #topnav li:hover ul, #topnav li.sfHover ul {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static !important; float: none; top: auto !important; left: auto !important;
    width: 100% !important; height: auto !important; margin: 0 0 8px; padding: 0 8px;
    opacity: 1 !important; visibility: visible !important; background: #5c280e;
  }
  #topnav ul li { width: auto !important; float: none; margin: 0; background: none; }
  #topnav .sf-sub-indicator { display: none; }
  #nav.mobile-nav-ready #topnav { display: none; }
  #nav.mobile-nav-ready.mobile-nav-open #topnav { display: grid; }
  .mobile-menu-toggle {
    display: flex; align-items: center; justify-content: center;
    min-height: 60px; width: 100%; padding: 14px 20px;
    border: 0; border-radius: 0; background: transparent; color: #fff;
    font: 24px/1.25 Georgia, "Times New Roman", serif; text-align: center; cursor: pointer;
  }
  .mobile-menu-toggle[aria-expanded="true"] { border-bottom: 1px solid #a6907c; }

  /* Cycle retains its fade and slide selection; only its fixed dimensions change. */
  #slider-main { padding: 12px 10px 0; }
  #slider { padding: 10px; }
  #feature_gallery {
    --caption-space: 104px;
    position: relative; width: 100% !important; height: auto !important;
    min-width: 0; overflow: hidden;
  }
  #feature_gallery .bigimgs {
    position: relative; width: 100% !important; height: auto !important;
    aspect-ratio: 908 / 422; padding-bottom: var(--caption-space);
    box-sizing: content-box;
  }
  #feature_gallery .bigimg {
    width: 100% !important; height: auto !important; min-height: 0;
    top: 0 !important; left: 0 !important;
  }
  #feature_gallery img.change {
    display: block; width: 100% !important; height: auto !important;
    aspect-ratio: 908 / 422; object-fit: contain;
  }
  #feature_gallery .slidedesc {
    position: static; display: block; bottom: auto; width: 100%; min-height: var(--caption-space);
    padding: 10px; margin: 0; color: #fff; font-size: 14px; line-height: 21px;
    overflow-wrap: break-word;
  }
  #feature_gallery .jcarousel-container, #feature_gallery .jcarousel-clip {
    width: 100% !important; height: auto !important; max-width: 100%;
    padding: 0; margin: 12px 0 0; overflow: visible !important;
  }
  #feature_gallery .jcarousel-clip { margin: 0; }
  #feature_gallery ul#feature_gallery_pager {
    display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
    position: static !important; left: 0 !important; top: 0 !important;
    width: 100% !important; height: auto !important; margin: 0; padding: 0;
    overflow: visible !important; transform: none !important;
  }
  #feature_gallery_pager li, #feature_gallery_pager li.jcarousel-item {
    float: none; width: auto !important; height: auto !important;
    margin: 0 !important; padding: 0; min-width: 0;
  }
  #feature_gallery ul#feature_gallery_pager li a {
    display: flex; align-items: center; justify-content: center; float: none;
    width: 100%; height: auto; min-height: 44px; padding: 3px;
  }
  #feature_gallery img.thumb { display: block; width: 100%; height: auto; }
  #feature_gallery_pager a.activeSlide { outline: 2px solid #372a23; outline-offset: -2px; }
  #pager-container { display: none; }

  /* Original image frames, with intrinsic image proportions. */
  #ts-display-pf-col-1 { margin: 0; }
  #ts-display-pf-col-1 li { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 18px; }
  #ts-display-pf-col-1 .ts-display-pf-img, #ts-display-pf-col-1 .ts-display-pf-img a.image {
    width: 100%; height: auto; float: none;
  }
  #ts-display-pf-col-1 .ts-display-pf-text { width: auto; min-width: 0; padding: 0; float: none; }
  #ts-display-pf-col-1 .ts-display-clear { display: none; }
  #ts-display-pf-col-2, #ts-display-pf-col-3, #ts-display-pf-col-4 {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
    margin: 0; padding: 0;
  }
  #ts-display-pf-col-2 li, #ts-display-pf-col-3 li, #ts-display-pf-col-4 li,
  #ts-display-pf-col-2 li.nomargin, #ts-display-pf-col-3 li.nomargin, #ts-display-pf-col-4 li.nomargin {
    width: auto; min-width: 0; float: none; margin: 0 !important; padding: 0;
  }
  #ts-display-pf-col-2 .ts-display-pf-img, #ts-display-pf-col-3 .ts-display-pf-img, #ts-display-pf-col-4 .ts-display-pf-img,
  #ts-display-pf-col-2 .ts-display-pf-img a.image, #ts-display-pf-col-3 .ts-display-pf-img a.image, #ts-display-pf-col-4 .ts-display-pf-img a.image {
    width: 100%; height: auto;
  }
  .ts-display-pf-img img { display: block; width: 100%; height: auto; }
  .ts-display-pf-img a .rollover { max-width: 100%; }
  #ts-display-pf-col-4 .ts-display-clear { display: none; }

  h2.trigger { height: auto; min-height: 67px; padding: 10px 16px; }
  h2.trigger span { height: auto; min-height: 44px; padding: 10px 48px 10px 24px; line-height: 22px; background-position: 0 17px; }
  .toggle_container { padding: 15px; }
  #contactform label { width: auto; float: none; display: block; margin: 12px 0 5px; }
  #contactform input:not([type="submit"]), #contactform textarea, #contactform select {
    display: block; width: 100%; max-width: 100%; min-height: 44px;
    margin: 0 0 10px; padding: 10px; font-size: 16px; line-height: 1.4;
  }
  #contactform textarea { min-height: 160px; resize: vertical; }
  #contactform .button, #contactform input[type="submit"] {
    width: 137px; min-height: 44px; height: auto; margin: 16px 0 0;
    padding: 10px 15px !important; background-color: #6d5548; background-size: 100% 100%;
  }
  #formular table { width: 100% !important; max-width: 100%; table-layout: fixed; margin-right: 0; }
  #formular td { padding: 8px; vertical-align: top; }
  #formular center { width: 100%; }
  #contactform .error { padding-right: 0; }
  #ui-datepicker-div { max-width: calc(100vw - 24px); }

  .bullet li, #sidebar li li a { background-image: none; position: relative; }
  .bullet li::before, #sidebar li li a::before { content: "\2713"; position: absolute; left: 0; color: #a24e40; }
  h2.trigger span, h2.active span { background-image: none; position: relative; }
  h2.trigger span::before { content: "\2713"; position: absolute; left: 0; }
}

@media (min-width: 600px) and (max-width: 1049px) {
  #feature_gallery { --caption-space: 62px; }
}

@media (max-width: 699px) {
  .one_half, .one_third, .two_third, .three_fourth, .one_fourth, .one_fifth,
  .two_fifth, .three_fifth, .four_fifth, .one_sixth, .five_sixth,
  .two_fourth, .two_sixth, .three_sixth, .four_sixth {
    width: 100%; float: none; margin-left: 0; margin-right: 0; margin-bottom: 26px;
  }
  #sidebar > ul { grid-template-columns: minmax(0, 1fr); }
  #ts-display-pf-col-1 li { grid-template-columns: minmax(0, 1fr); }
  #ts-display-pf-col-2, #ts-display-pf-col-3, #ts-display-pf-col-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  #ts-display-portfolio > .one_fourth { width: 100%; text-align: center; }
  #ts-display-portfolio > .one_fourth img { width: auto; max-width: 100%; }
  img.alignleft, img.alignright, .alignleft, .alignright { float: none; display: block; margin-left: 0; margin-right: 0; }
}

@media (max-width: 399px) {
  #main { padding: 18px 12px; }
  #content, #footer, #copyright, #nav-container, #slider-container { margin-left: 8px; margin-right: 8px; }
  #slider-main { padding: 8px 6px 0; }
  #slider { padding: 8px; }
  #topnav { padding-left: 6px; padding-right: 6px; }
  #topnav a { padding-left: 8px !important; padding-right: 8px !important; font-size: 14px; }
  #formular table, #formular tbody, #formular tr, #formular td { display: block; width: 100%; }
  #formular td { text-align: left; }
  #formular center { text-align: left; }
  #ts-display-pf-col-2, #ts-display-pf-col-3, #ts-display-pf-col-4 { gap: 10px; }
}

/* Keep the original facebook lightbox artwork while overriding its legacy sizing. */
@media (max-width: 1049px) {
  div.pp_pic_holder.facebook {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: calc(100vw - 32px) !important;
    max-width: 650px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    transform: translate(-50%, -50%);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  div.pp_pic_holder.facebook .pp_content,
  div.pp_pic_holder.facebook .pp_fade {
    width: 100% !important;
    height: auto !important;
    min-width: 0;
  }
  div.pp_pic_holder.facebook .pp_fade { position: relative; }
  div.pp_pic_holder.facebook #pp_full_res { width: 100%; text-align: center; }
  div.pp_pic_holder.facebook #fullResImage {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    margin: 0 auto;
    object-fit: contain;
  }
  div.pp_pic_holder.facebook .pp_hoverContainer {
    top: 0;
    left: 0;
    bottom: 66px;
    width: 100% !important;
    height: auto !important;
  }
  div.pp_pic_holder.facebook .pp_details {
    width: 100% !important;
    min-height: 56px;
    float: none;
    margin: 10px 0 0;
  }
  div.pp_pic_holder.facebook .pp_nav {
    width: calc(100% - 44px);
    min-height: 44px;
    margin: 0;
  }
  div.pp_pic_holder.facebook .pp_nav p {
    margin: 0;
    padding: 0 2px;
    line-height: 44px;
    font-size: 14px;
  }
  div.pp_pic_holder.facebook .pp_nav a {
    position: relative;
    margin: 11px !important;
    overflow: visible;
  }
  div.pp_pic_holder.facebook a.pp_close { top: 11px; right: 11px; }
  div.pp_pic_holder.facebook .pp_nav a::after,
  div.pp_pic_holder.facebook a.pp_close::after {
    content: "";
    position: absolute;
    inset: -11px;
  }
  div.pp_pic_holder.facebook .pp_description { margin-right: 44px; }
  div.pp_pic_holder.facebook .ppt { width: auto !important; margin: 0 20px 5px; }
  div.pp_pic_holder.facebook a.pp_expand,
  div.pp_pic_holder.facebook a.pp_contract { display: none !important; }
  div.pp_pic_holder.facebook a:focus-visible { outline: 2px solid #a24e40; outline-offset: 4px; }
}
