/*  
Theme Name: Destination Hikers
Description: Clean, minimal hiking blog theme
Theme URI: https://destinationhikers.com
Author: Casey
Author URI: https://destinationhikers.com
Version: 1.0
License: GNU/GPL Version 2 or later
License URI: http://www.gnu.org/licenses/gpl.html
*/

/* ==========================================================================
   1. Reset & Base
   ========================================================================== */

html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,address,cite,code,del,dfn,em,img,ins,q,small,strong,sub,sup,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;margin:0;padding:0}
article,aside,figure,figure img,figcaption,hgroup,footer,header,nav,section,video,object{display:block}
a img{border:0}
figure{position:relative}
figure img{width:100%}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.clearfix:after { content: "\00A0"; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
.clearfix { display: block; }

/* ==========================================================================
   2. Typography & Body
   ========================================================================== */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #333;
}

/* Dark theme colors */
:root {
    --accent-color: #DE543E;
    --dark-bg: #333;
    --darker-bg: #2a2a2a;
    --light-text: #ccc;
    --white: #fff;
}

img, .imgwrap { max-width: 100%; height: auto; }

ol, ul { list-style: none; margin: 0; }
ul.children { margin-left: 15px; }

a, a:hover {
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease-in;
}

a:hover { color: #666; }

.fl { float: left !important; }
.fr { float: right !important; }
.cntr { text-align: center; }

.tranz {
    transition: all .5s ease;
}

/* ==========================================================================
   3. Headings
   ========================================================================== */

h1, h2, h3, h4, h5, h6 { 
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 1.2;
}

h1 {
    margin: 15px 0;
    padding: 0;
    font-size: 28px;
    letter-spacing: -0.06em;
}

h1.entry-title {
    margin: 25px 40px 35px 0;
}

h2 {
    margin: 15px 0;
    padding: 0;
    font-size: 22px;
    letter-spacing: -0.02em;
}

h2.post {
    margin: 35px 40px 20px 0;
}

h2.block {
    font-size: 28px;
    text-transform: uppercase;
    margin: 0 0 30px 0;
    padding: 0 0 15px 0;
    border-bottom: 1px solid #ddd;
}

h2.block span {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: normal;
    letter-spacing: 1px;
}

/* Archive header styling */
.archive-header {
    margin-bottom: 30px;
}

h3 {
    margin: 15px 0;
    padding: 0;
    font-size: 18px;
    letter-spacing: -0.025em;
}

h4 {
    margin: 15px 0 5px 0;
    padding: 0;
    font-size: 16px;
}

h5, h6 {
    margin: 5px 0;
    padding: 0;
    font-size: 14px;
}

/* ==========================================================================
   4. Layout - Wrapper & Container
   ========================================================================== */

#wrapper {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.container_alt,
#content { overflow: visible; }

#content-inn { 
    padding: 5px 40px 20px 40px; 
    margin: 0;
    overflow: hidden;
}

.single #content-inn,
.page #content-inn { 
    padding: 40px 40px 20px 40px; 
}

.my-builder #content-inn { 
    padding: 40px; 
    overflow: hidden;
}

/* Columns */
.eightcol, .fourcol, .sixcol, .threecol {
    float: left;
    min-height: 1px;
}

.eightcol { width: 70.5%; background: #fff !important; }
.fourcol { width: 29.5%; padding: 40px 3.5%; background: #333 !important; color: #ccc !important; }
.sixcol { width: 50%; }
.threecol { width: 25%; padding: 5px 3.3%; }

/* ==========================================================================
   5. Header
   ========================================================================== */

#header {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
    position: relative;
    background: #333 !important;
    background: var(--dark-bg) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

#header h1 {
    line-height: 1;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: -2px;
    display: block;
    position: relative;
    z-index: 10;
    margin: 0;
    padding: 15px 0;
    flex-shrink: 0;
}

#header h1 a {
    color: #DE543E !important;
    color: var(--accent-color) !important;
    font-weight: 800;
    white-space: nowrap;
}

#header h1 img { 
    margin: 0; 
    max-width: 200px;
    height: auto;
}

/* ==========================================================================
   6. Navigation
   ========================================================================== */

#navigation {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-start;
    margin-left: 30px;
}

.nav {
    position: relative;
    padding: 0;
    list-style: none;
    line-height: 1;
    display: flex;
    flex-wrap: wrap;
    z-index: 99;
    margin: 0;
}

.nav a {
    position: relative;
    display: block;
    z-index: 1;
    padding: 12px 0;
    text-decoration: none;
    color: var(--white);
}

.nav > li > a {
    display: block;
    padding: 16px 10px 14px 10px;
    text-decoration: none;
    line-height: 1;
    border-bottom: none;
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
}

.nav > li > a:hover,
.nav > li.current-menu-item > a,
.nav > li.current-menu-parent > a,
.nav > li.current_page_item > a {
    background: var(--accent-color);
    color: var(--white);
}

.nav li {
    display: block;
    position: relative;
    overflow: visible;
}

.nav > li {
    margin: 0;
}

/* Dropdown menus */
.nav li ul {
    margin: 0;
    padding: 10px 0;
    width: 200px;
    position: absolute;
    z-index: 99;
    background: var(--white);
    left: -999em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav li ul li > a {
    margin: 0 10px;
    padding: 14px 10px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    line-height: 1;
    font-weight: normal !important;
    color: #333;
    max-width: 220px !important;
}

.nav li ul li > a:hover {
    background: var(--accent-color);
    color: var(--white);
}

.nav li ul li:last-child a { border-bottom: none; }

.nav > li > ul {
    border: 1px solid #ddd;
    z-index: 99;
    margin: 0 0 0 -1px;
}

.nav > li > ul:after {
    border-color: var(--white) transparent;
    border-style: solid;
    border-width: 0 6px 6px;
    bottom: 100%;
    content: "";
    height: 0;
    position: absolute;
    left: 15px;
    width: 0;
}

.nav > li > ul > li,
.nav li ul ul li { width: 100%; max-width: 200px; }

.nav li ul ul {
    margin: -52px 0 0 198px;
    border: 1px solid #ddd;
}

.nav li:hover ul,
.nav li li:hover ul,
.nav li li li:hover ul {
    left: auto;
}

.nav li:hover ul ul,
.nav li:hover ul ul ul {
    left: -999em;
}

#main-nav > li:first-child { margin-left: 0; }
#main-nav > li > a { 
    padding: 12px 15px; 
    margin: 0 3px 10px 0; 
    text-transform: uppercase; 
}

/* Mobile menu trigger */
a#navtrigger {
    text-indent: -9999px;
    padding: 15px;
    height: 40px;
    width: 40px;
    background: var(--accent-color) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>') center no-repeat;
    background-size: 24px;
    margin: 0 auto 20px auto;
    display: none;
    z-index: 999;
    position: relative;
}

/* ==========================================================================
   7. Content & Posts
   ========================================================================== */

ul.medpost { width: 105.5%; }

ul.medpost li { 
    width: 100%; 
    margin: 0 0 40px 0; 
    float: left; 
    overflow: hidden; 
    position: relative;
    list-style: none;
}

ul.medpost li p.teaser { margin: 20px 60px 10px 0; }

ul.medpost li a.mainbutton { margin: 0 60px 0 0; font-size: 12px !important; }

img.standard { 
    float: left; 
    margin: 0 0 30px 0;
    max-width: 100% !important;
}

.post iframe {
    float: left;
    margin: 0 0 1px 0; 
    max-width: 100%;
}

.entry { margin: 0; }

.page .entry { margin: 0 40px 0 0; }

.entry p { margin: 0 60px 15px 0; }

.entry ul { margin: 0 60px 25px 20px; }
.entry ul li { list-style-position: inside; list-style: circle; }
.entry ol { margin: 5px 0 15px 2px; }
.entry ol li { list-style: decimal; list-style-position: inside; }

.entry blockquote {
    border-left: 2px solid #ddd;
    padding: 5px 30px !important;
    margin: 25px 60px 25px 20px;
    font-style: italic;
    line-height: 1.9em;
}

.entry blockquote p { margin: 0; }

.entryhead iframe { 
    overflow: hidden; 
    margin: 0 0 30px 0; 
    float: left; 
    max-width: 100%;
}

/* Meta */
.meta {
    font-size: 12px;
    line-height: 2;
    overflow: hidden;
}

span.meta { opacity: .7; }

.meta_full { line-height: 1 !important; margin: 0; }

.meta_full i { 
    padding: 6px; 
    margin: -6px 7px -6px 0;
    background: rgba(0,0,0,0.05);
}

.meta_full > span { 
    padding: 6px 14px 6px 0; 
    display: inline; 
    float: left; 
    margin: 0 1px 1px 0; 
    line-height: 1 !important;
    background: rgba(0,0,0,0.05);
}

.meta_full span, .meta_full > span a { font-size: 11px !important; }

/* Post info & author */
.postinfo {
    overflow: hidden;
    margin: 30px 0;
    padding: 0 60px 0 0;
}

.postinfo p { margin: 0; }

.postauthor { 
    overflow: hidden; 
    margin: 0 0 20px 0; 
    padding: 0;
}

#content .postauthor img.avatar { 
    float: left !important; 
    margin: 10px 25px 0 0 !important;
}

/* Related posts */
ul.related { 
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.related li { 
    flex: 1 1 calc(25% - 20px);
    min-width: 150px;
    max-width: 220px;
    overflow: hidden;
    padding: 0;
}

.related li h2 { 
    font-size: 13px; 
    font-weight: 600;
    line-height: 1.4; 
    margin: 8px 0 4px 0; 
    padding: 0; 
    text-align: center; 
}

.related li a img { 
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

.related li h2 a {
    color: #333;
    text-decoration: none;
}

.related li h2 a:hover {
    color: var(--accent-color);
}

.related li .meta {
    display: block;
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* ==========================================================================
   8. Sidebar
   ========================================================================== */

#sidebar { 
    padding-bottom: 30px; 
    background: #333 !important;
    background: var(--dark-bg) !important;
    color: #ccc !important;
    color: var(--light-text) !important;
}

#sidebar a { color: var(--white); }
#sidebar a:hover { color: var(--accent-color); }

#sidebar p { margin: 0; padding: 0 0 15px 0; }

#sidebar h2,
#sidebar h2.widget {
    padding-top: 15px;
    padding-bottom: 15px;
    margin: 0;
    overflow: hidden;
    border-bottom: 1px solid #444;
    margin-bottom: 15px;
    width: 100%;
    font-size: 14px;
    color: var(--white);
    text-transform: uppercase;
}

#sidebar h3 { font-size: 12px; color: var(--white); }

#sidebar form { overflow: hidden; }

#sidebar > ul,
#sidebar > div > ul {
    list-style: none;
    float: none;
    overflow: hidden;
    width: 100%;
    margin-bottom: 10px;
}

#sidebar select {
    margin: 5px 0 30px 0;
    width: 100%;
    font-size: 100% !important;
    clear: both;
    float: none;
}

#sidebar .searchform {
    margin: 0 0 20px 0;
    float: none;
    clear: both;
    overflow: hidden;
}

#sidebar .searchform input.s {
    background: var(--darker-bg);
    border: 1px solid #555;
    color: var(--white);
}

#sidebar .searchform input.s::placeholder {
    color: #888;
}

#sidebar .searchform .searchSubmit {
    background: var(--accent-color);
    color: var(--white);
}

#sidebar ul li.cat-item,
#sidebar ul li.page_item {
    padding: 0 0 5px 0;
    margin: 0;
    list-style: square;
    list-style-position: inside;
}

/* Widget styles */
.widget { margin-bottom: 30px; }

.tagcloud { padding: 0 0 25px 0 !important; overflow: hidden; }
.tagcloud a { 
    float: left; 
    font-size: 12px !important; 
    padding: 4px 10px; 
    border: 1px solid #555; 
    margin: 0 8px 8px 0;
    color: var(--light-text);
    background: var(--darker-bg);
}
.tagcloud a:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
}

/* Tabs widget */
#hometab {
    float: left;
    width: 100%;
    padding: 0 0 25px 0;
    margin: 0 0 10px 0;
    overflow: hidden;
    position: relative;
}

ul#serinfo-nav {
    position: relative;
    z-index: 6;
    margin: 0 !important;
    background: var(--darker-bg);
    overflow: hidden;
}

ul#serinfo-nav > li {
    padding: 7px 0;
    float: left;
    margin-right: 0;
    width: 33.33%;
    text-align: center;
    cursor: pointer;
    color: var(--light-text);
    font-size: 12px;
    text-transform: uppercase;
}

#serinfo-nav li.current {
    color: var(--white) !important;
    position: relative;
    z-index: 6;
    background: var(--accent-color);
}

ul#serinfo {
    position: relative;
    z-index: 5;
    float: left;
    padding: 0;
    overflow: hidden;
    margin-top: -1px;
    width: 100%;
}

.tab-post {
    min-height: 100px;
    overflow: hidden;
    border-bottom: 1px solid #444;
    margin: 0;
    padding: 20px 0;
    line-height: 18px;
    width: 100%;
}

.tab-post h4 { 
    margin: 0 0 10px 0; 
    font-size: 12px !important; 
    color: var(--white);
}

.tab-post img {
    padding: 0;
    margin: 5px 20px 5px 0 !important;
    float: left;
    width: 92px;
}

/* Date badge in sidebar */
.tab-post .meta,
.tab-post span.meta {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 2px 8px;
    font-size: 10px;
    margin-top: 5px;
}

/* ==========================================================================
   9. Comments
   ========================================================================== */

#comments {
    clear: both;
    margin-right: 60px;
    padding-top: 30px;
    border-top: 1px solid #ddd;
}

h3#comments-title,
h3#reply-title {
    padding: 5px 0 10px 0;
    margin: 0 0 15px 0;
}

.commentlist {
    list-style: none;
    margin: 30px 0 0 0 !important;
}

.commentlist li.comment {
    border-bottom: 1px solid #eee;
    line-height: 24px;
    margin: 0 0 25px 0;
    padding: 0 0 25px 80px;
    position: relative;
    list-style: none;
}

.commentlist .avatar {
    position: absolute;
    top: 8px;
    left: 0;
}

.comment-author cite {
    color: #000;
    font-style: normal;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.comment-meta {
    margin: 0 0 20px 0;
    font-size: 12px;
    color: #888;
}

.commentlist .children {
    list-style: none;
    margin: 0 0 0 20px;
}

/* Comment form */
#respond {
    margin: 0;
    overflow: hidden;
    position: relative;
}

.comment-form-author,
.comment-form-email,
.comment-form-url { 
    width: 31.3%; 
    float: left; 
    margin-right: 3% !important;
}

.comment-form-url { margin-right: 0 !important; }

input#author,
input#email,
input#url { 
    width: 99.7% !important; 
    margin-bottom: 20px !important; 
    border: 1px solid #ddd;
    padding: 10px;
}

#respond textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
}

#respond .form-submit input {
    font-size: 14px;
    width: auto;
    margin: 20px 1px;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   10. Forms & Search
   ========================================================================== */

input, textarea, select {
    border: 1px solid #ddd;
    padding: 10px;
    margin: 0 0 5px 0;
    line-height: 1 !important;
    font-family: inherit;
    font-size: 14px;
}

.searchform {
    position: relative;
    float: left;
    width: 100%;
    margin: 0 0 0 25px;
}

#navigation .searchform { 
    margin-left: auto;
    width: 220px; 
}

.searchform input.s {
    padding: 12px 4.5%;
    margin: 0 0 20px 0;
    font-size: 12px !important;
    width: 99.5%;
    height: 38px;
    border: 1px solid #d9d9d9;
}

.searchSubmit {
    position: absolute;
    height: 32px;
    width: 32px;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 5px;
    top: 3px;
    right: 5px;
    font-size: 12px !important;
    background: transparent;
}

/* ==========================================================================
   11. Footer
   ========================================================================== */

#footer {
    width: 100%;
    margin: 0 auto;
    padding: 40px 0 0 0;
    overflow: hidden;
    position: relative;
    background: var(--dark-bg);
    color: var(--light-text);
}

#footer a { color: var(--white); }
#footer a:hover { color: var(--accent-color); }

#footer .threecol { 
    border-left: 1px solid #444;
    border-right: 1px solid #444;
    width: 25%;
    padding: 5px 3.3%;
    min-height: 200px;
    float: left;
}

#footer .threecol.first {
    border-left: none;
}

#footer .threecol h2 {
    border-bottom: 1px solid #444; 
    padding-bottom: 15px;
    color: var(--white);
    text-transform: uppercase;
    font-size: 14px;
}

#footer ul { margin: 0 0 20px 0; }
#footer p { margin: 0 0 15px 0; }

#footer .threecol > ul > li { 
    margin: 0 0 8px 0;
    padding: 0 0 0 5px; 
    list-style: inside square;
}

#copyright { 
    font-size: 11px; 
    padding: 20px 40px; 
    overflow: hidden; 
    border-top: 1px solid #444;
    color: #999;
    clear: both;
}

#copyright p { margin: 0; padding: 5px 0; }

.bottom-menu { float: left; margin: 0 0 0 -15px; }
.bottom-menu li { float: left; list-style: none; }
.bottom-menu li a { 
    float: left; 
    padding: 5px 10px 5px 15px;
    color: var(--light-text);
}

/* ==========================================================================
   12. Buttons & Pagination
   ========================================================================== */

a.mainbutton {
    margin: 20px 0 0 0;
    padding: 11px 15px 10px 15px;
    text-align: center;
    display: inline-block;
    min-width: 130px;
    text-transform: uppercase;
    background: var(--accent-color);
    color: var(--white) !important;
    border: none !important;
    font-size: 12px;
    font-weight: 600;
}

a.mainbutton:hover {
    background: var(--dark-bg);
    color: var(--white);
}

.pagination { 
    height: 40px; 
    margin: 25px 0 20px 0; 
    float: none; 
    padding: 5px 0; 
    overflow: hidden;
}

a.page-numbers { 
    background: rgba(0,0,0,0.05); 
    padding: 6px 10px;
    margin: 0 8px -1px 0;
}

.page-numbers.current { 
    font-weight: bold;
    padding: 6px 10px;
    margin: 0 8px -1px 0; 
    color: var(--white); 
    background: var(--accent-color);
}

/* Scroll to top */
.scrollTo_top {
    position: fixed;
    bottom: 50px;
    right: 50px;
    z-index: 99;
}

.scrollTo_top a {
    display: block;
    padding: 12px 16px;
    background: var(--accent-color);
    color: var(--white);
    font-size: 20px;
}

.scrollTo_top a:hover {
    background: var(--dark-bg);
}

/* ==========================================================================
   Category Archive Grid
   ========================================================================== */

.archive .medpost,
.category .medpost {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.archive .medpost li,
.category .medpost li {
    width: 31%;
    margin: 0 2% 30px 0;
    float: left;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.archive .medpost li:nth-child(3n),
.category .medpost li:nth-child(3n) {
    margin-right: 0;
}

.archive .medpost li .entryhead,
.category .medpost li .entryhead {
    position: relative;
    overflow: hidden;
}

.archive .medpost li .entryhead img,
.category .medpost li .entryhead img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.archive .medpost li h2.post,
.category .medpost li h2.post {
    font-size: 14px;
    margin: 15px;
    line-height: 1.4;
}

.archive .medpost li .teaser,
.category .medpost li .teaser {
    font-size: 13px;
    margin: 0 15px 15px;
    color: #666;
}

.archive .medpost li .meta_full,
.category .medpost li .meta_full {
    display: none;
}

.archive .medpost li a.mainbutton,
.category .medpost li a.mainbutton {
    margin: 0 15px 15px;
    min-width: auto;
    padding: 8px 12px;
    font-size: 11px;
}

/* Date badge on archive images */
.archive .medpost li .entryhead .date-badge,
.category .medpost li .entryhead .date-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 4px 10px;
    font-size: 11px;
}

/* ==========================================================================
   13. Images & Galleries
   ========================================================================== */

img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    float: none;
}

img.alignright {
    margin: 4px 1px 10px 20px !important;
    display: inline;
    float: right;
}

img.alignleft {
    margin: 4px 20px 10px 1px !important;
    display: inline;
    float: left;
}

.alignright { float: right; margin-left: 15px; }
.alignleft { float: left; margin-right: 15px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

.wp-caption {
    text-align: center;
    padding-top: 8px;
    margin-bottom: 10px;
    max-width: 100%;
    background: rgba(0,0,0,0.05);
    overflow: hidden;
}

.wp-caption img {
    margin: 0;
    padding: 0;
    border: 0 none;
    max-width: 98%;
}

.wp-caption p.wp-caption-text {
    font-size: 12px;
    padding: 0 15px;
    margin: 2px 0 10px 0;
}

/* Gallery */
/* WordPress Classic Gallery */
.gallery {
    margin: 0 auto 30px auto !important;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.gallery .gallery-item {
    margin: 0 !important;
    text-align: center;
    overflow: hidden;
    flex-grow: 1;
}

.gallery-columns-2 .gallery-item { width: calc(50% - 3px); }
.gallery-columns-3 .gallery-item { width: calc(33.33% - 4px); }
.gallery-columns-4 .gallery-item { width: calc(25% - 4px); }

.gallery .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* WordPress Block Gallery */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 30px;
}

.wp-block-gallery .wp-block-image {
    margin: 0;
    flex-grow: 1;
}

.wp-block-gallery.columns-2 .wp-block-image { width: calc(50% - 3px); }
.wp-block-gallery.columns-3 .wp-block-image { width: calc(33.33% - 4px); }

.wp-block-gallery .wp-block-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Multi-photo grid layout (2+1 style) */
.photo-grid {
    display: grid;
    gap: 5px;
    margin-bottom: 30px;
}

.photo-grid-2x1 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

.photo-grid-2x1 .grid-item:nth-child(3) {
    grid-column: 1 / -1;
}

.photo-grid img {
    width: 100%;
    height: auto;
    display: block;
}
}

.gallery img { border: none !important; float: left; }

/* ==========================================================================
   14. Responsive / Mobile
   ========================================================================== */

@media screen and (max-width: 1030px) {
    .container { width: 100%; margin: 0; padding: 0; }
    #header h1 { max-width: 200px !important; margin-top: 40px !important; margin-bottom: 40px !important; }
    #main-nav { margin: 0; padding-left: 200px !important; }
    ul.medpost { width: 106.5%; }
}

@media screen and (max-width: 770px) {
    #navigation .searchform { display: none; }
    .my-builder #content-inn { padding: 20px; }
    .fourcol { padding: 10px 3.5%; }
}

@media handheld, only screen and (max-width: 740px) {
    body {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        font-size: 16px;
    }

    .container_alt { overflow: hidden; }

    #header,
    .eightcol, .fourcol, .sixcol {
        width: auto;
        float: none !important;
        padding-left: 20px;
        padding-right: 20px;
        margin-left: 0;
        margin-right: 0;
    }

    .fourcol {
        padding: 0 !important;
        max-width: 290px;
        float: none;
        margin: 0 auto 30px auto;
    }

    #content-inn {
        overflow: hidden;
        padding: 20px !important;
        margin: 0 !important;
    }

    #content {
        padding-left: 0;
        padding-right: 0;
        margin-top: 0;
    }

    #sidebar, #footer {
        float: none !important; 
        margin: 0 auto !important; 
        padding: 40px 20px !important; 
        max-width: 360px !important;
    }

    #copyright { padding: 0 5%; }

    .pagination { margin-bottom: 40px; height: 35px; }

    /* Legacy mobile styles - overridden by newer responsive rules */
    #header h1 img { float: none; margin: 0 auto; text-align: center; max-width: 100%; }

    /* Mobile menu */
    a#navtrigger { display: block; }

    #navigation { 
        display: none; 
        position: relative; 
        top: auto; 
        margin: -80px 0 0 0 !important; 
        padding: 80px 0 0 0; 
        background: #333;
    }
    
    #navigation a { color: #eee !important; }
    #navigation.active { display: block; }

    ul.nav,
    #main-nav { width: 100% !important; margin: 0 !important; padding: 0 !important; }

    ul.nav li,
    .nav li ul { 
        width: 100% !important; 
        background-color: transparent; 
        border: none !important; 
        float: none; 
        display: block;
        margin: 0 !important; 
        position: relative !important; 
        left: auto !important;
    }

    .nav li ul li > a { border-bottom: 1px dotted #444; }

    ul.nav li a { 
        width: 100% !important; 
        text-align: left; 
        padding: 12px 20px !important; 
        margin: 0 0 0 20px;
    }

    #main-nav > li > a { margin: 0 !important; }

    #navigation .searchform { 
        width: 300px; 
        max-width: 100%;
        display: block; 
        float: none; 
        margin: 20px auto;
    }

    ul.medpost { width: 100%; }

    .entry p,
    ul.medpost li p.teaser { margin: 0 0 15px 0; }

    #comments,
    ul.medpost li a.mainbutton { margin-right: 0; }

    .page .entry { margin: 0; }

    .entryhead img.standard,
    .entryhead iframe { max-width: 100% !important; }

    h1.entry-title,
    h2.post { margin: 25px 0 35px 0; font-size: 25px !important; }

    .related li { flex: 1 1 calc(50% - 20px); max-width: none; }

    .comment-form-author,
    .comment-form-email,
    .comment-form-url { width: 100%; }

    #respond textarea { width: 99.5%; }

    .scrollTo_top { right: 20px; bottom: 20px; }
}

@media only screen and (max-width: 570px) {
    ul.medpost li { width: 100% !important; margin: 0; }

    h1.entry-title,
    h2.post { font-size: 22px !important; }

    .related li { flex: 1 1 100%; max-width: none; }
}

/* ==========================================================================
   15. Post Carousel
   ========================================================================== */

.dh-carousel {
    position: relative;
    width: 100%;
    margin: 0 0 30px 0;
    overflow: hidden;
    background: #000;
}

.carousel-slides {
    position: relative;
    width: 100%;
    min-height: 500px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
    z-index: 2;
}

.carousel-slide .carousel-image {
    display: block;
    width: 100%;
}

.carousel-slide .carousel-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    opacity: 0.75;
}

.carousel-content {
    position: absolute;
    bottom: 0;
    left: 60px;
    right: 60px;
    padding: 30px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: var(--white);
}

.carousel-content h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.carousel-content h2 a {
    color: var(--white);
}

.carousel-content h2 a:hover {
    color: var(--accent-color);
}

.carousel-meta {
    font-size: 13px;
    margin-bottom: 15px;
}

.carousel-meta .date {
    margin-right: 15px;
    color: #fff;
}

.carousel-meta .category a {
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    padding: 2px 8px;
    border-radius: 3px;
}

.carousel-content p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.carousel-content .mainbutton {
    display: inline-block;
    margin: 0;
    float: none;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
    z-index: 10;
}

.carousel-nav button {
    pointer-events: auto;
    background: var(--accent-color);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s;
    border-radius: 3px;
}

.carousel-nav button:hover {
    opacity: 1;
}

.carousel-dots {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: var(--white);
}

/* ==========================================================================
   16. Utility Classes
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.sticky { 
    background: rgba(0,0,0,0.02); 
    padding: 5px 40px 40px 40px; 
    border: 1px solid #ddd;
}

/* Grayscale hover effect - disabled by default */
/* To enable grayscale: add class "use-grayscale" to parent element */
.use-grayscale .grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.use-grayscale .grayscale-fade:hover {
    filter: grayscale(0%);
}

/* Gallery styles now handled by DH Gallery plugin */

/* Lazy load placeholder */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* ==========================================================================
   17. Gutenberg Block Styles
   ========================================================================== */

/* UAGB Section blocks */
.wp-block-uagb-section {
    margin-bottom: 30px;
}

.uagb-section__wrap {
    padding: 20px;
    overflow: hidden;
}

.uagb-section__background-color {
    background-color: #eeeeee;
}

.uagb-section__inner-wrap {
    max-width: 100%;
}

/* UAGB Info Box */
.wp-block-uagb-info-box {
    padding: 20px;
}

.uagb-ifb-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.uagb-ifb-icon-wrap svg {
    width: 50px;
    height: 50px;
    fill: currentColor;
}

/* Tables in content */
.entry table,
#content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.entry table td,
.entry table th,
#content table td,
#content table th {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.entry table th,
#content table th {
    background: #f5f5f5;
    font-weight: bold;
}

/* Amazon affiliate boxes */
.aawp-box,
.aawp-product {
    border: 1px solid #ddd;
    padding: 15px;
    margin: 20px 0;
    background: #fff;
}

/* Spacer blocks */
.wp-block-spacer {
    clear: both;
}

/* ==========================================================================
   18. Homepage Enhancements
   ========================================================================== */

/* Recent Posts Grid */
.recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 30px 0;
}

.recent-post-card {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.recent-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.recent-post-card .card-image {
    position: relative;
    overflow: hidden;
}

.recent-post-card .card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.recent-post-card:hover .card-image img {
    transform: scale(1.05);
}

.recent-post-card .card-content {
    padding: 20px;
}

.recent-post-card .card-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.recent-post-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.recent-post-card .card-title a {
    color: #333;
}

.recent-post-card .card-title a:hover {
    color: var(--accent-color);
}

.recent-post-card .card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ==========================================================================
   19. Mobile Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {
    .carousel-slides {
        min-height: 450px;
    }
    
    .carousel-slide .carousel-image img {
        height: 450px;
    }
    
    .recent-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header - flexbox layout for mobile */
    #header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 15px !important;
        flex-wrap: nowrap !important;
        min-height: 60px !important;
    }
    
    #header h1 {
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        flex: 0 1 auto !important;
        text-align: left !important;
        max-width: calc(100% - 55px) !important;
    }
    
    #header h1 a {
        font-size: 18px !important;
        display: block;
    }
    
    /* Mobile menu trigger - MUST show */
    a#navtrigger {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        position: static !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        background-color: #DE543E !important;
        background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>') !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-size: 24px !important;
        z-index: 1000 !important;
    }
    
    /* Navigation hidden by default on mobile */
    #navigation {
        order: 3 !important;
    }
    
    /* Carousel */
    .carousel-slides {
        min-height: 380px;
    }
    
    .carousel-slide .carousel-image img {
        height: 380px;
    }
    
    .carousel-content {
        left: 50px;
        right: 50px;
        padding: 20px;
        bottom: 10px;
    }
    
    .carousel-content h2 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .carousel-content p {
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 15px;
    }
    
    .carousel-nav {
        padding: 0 5px;
    }
    
    .carousel-nav button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .carousel-meta {
        font-size: 12px;
    }
    
    /* Layout */
    .my-builder {
        padding: 0 15px;
    }
    
    .eightcol,
    .fourcol {
        width: 100% !important;
        float: none !important;
    }
    
    #sidebar {
        margin-top: 30px;
    }
    
    /* Recent posts */
    .recent-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .recent-post-card .card-image img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    /* Header */
    #header h1 a {
        font-size: 16px;
    }
    
    /* Carousel */
    .carousel-slides {
        min-height: 320px;
    }
    
    .carousel-slide .carousel-image img {
        height: 320px;
    }
    
    .carousel-content {
        left: 40px;
        right: 40px;
        padding: 15px;
        bottom: 5px;
    }
    
    .carousel-content h2 {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .carousel-content p {
        font-size: 11px;
        -webkit-line-clamp: 2;
        margin-bottom: 10px;
    }
    
    .carousel-content .mainbutton {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    .carousel-meta {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .carousel-meta .category a {
        font-size: 10px;
        padding: 1px 5px;
    }
    
    .carousel-nav button {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    /* Ensure hamburger stays visible at small screens */
    a#navtrigger {
        display: block !important;
        visibility: visible !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
    
    #header h1 {
        max-width: calc(100% - 50px) !important;
    }
}
