/*
Theme Name: TOFFS The Terrace
Theme URI: https://www.toffs.com/the-terrace
Author: TOFFS
Description: Custom blog theme matching TOFFS production design
Version: 1.0
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: "Favorit", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1b1d;
    background: #fff;
    min-width: 320px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

a { color: #1a1b1d; text-decoration: none; }
a:hover { color: #222; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ===== FONTS ===== */
@font-face {
    font-family: "Favorit";
    src: url("https://www.toffs.com/static/version1760716082/frontend/icom/toffs/en_GB/css/fonts/Favorit-Medium.woff2") format("woff2"),
         url("https://www.toffs.com/static/version1760716082/frontend/icom/toffs/en_GB/css/fonts/Favorit-Medium.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1328px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== HEADER ===== */
.site-header {
    background: #1a1b1d;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-sizing: border-box;
}

/* Compensate for fixed header height */
body {
    padding-top: 64px;
}

.header__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1328px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
}

.header__logo img {
    height: 36px;
    width: auto;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header__nav a {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.header__nav a:hover,
.header__nav a.active {
    border-bottom-color: #fff;
    text-decoration: none;
}

.header__tagline {
    color: #fff;
    font-size: 13px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .header__nav { display: none; }
    .header__wrapper { height: 56px; }
    .header__logo img { height: 28px; }
    body { padding-top: 56px; }
}

/* WordPress admin bar compensation */
.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
    .admin-bar body { padding-top: calc(56px + 46px); }
}
@media screen and (min-width: 783px) {
    .admin-bar body { padding-top: calc(64px + 32px); }
}

/* ===== BLOG BANNER ===== */
.blog-banner {
    background: #1a1b1d;
    color: #fff;
    padding: 48px 16px 40px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.blog-banner__title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.blog-banner__subtitle {
    font-size: 15px;
    opacity: 0.7;
    margin: 0;
}

@media (max-width: 768px) {
    .blog-banner__title { font-size: 26px; }
    .blog-banner { padding: 32px 16px 28px; }
}

/* ===== MAIN CONTENT ===== */
.site-main {
    padding: 40px 0 64px;
}

/* ===== BLOG GRID (listing page) ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ===== BLOG CARD ===== */
.blog-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}

.blog-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.blog-card__image-wrap {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
}

.blog-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card__image-wrap img {
    transform: scale(1.03);
}

.blog-card__no-image {
    width: 100%;
    height: 100%;
    background: #1a1b1d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card__no-image span {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    opacity: 0.3;
}

.blog-card__body {
    padding: 20px;
}

.blog-card__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e7577;
    margin-bottom: 8px;
    display: block;
}

.blog-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1b1d;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__excerpt {
    font-size: 14px;
    color: #6e7577;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6e7577;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: 4px;
}

.blog-card__read-more {
    font-size: 13px;
    font-weight: 700;
    color: #1a1b1d;
    text-decoration: none;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-card__read-more::after {
    content: "→";
}

.blog-card__views {
    font-size: 11px;
    color: #9aa0a4;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: flex-end;
    padding: 24px 0 40px;
}

.pagination ul.page-numbers {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination ul.page-numbers li {
    display: block;
    margin: 0;
    padding: 0;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e8e8e8;
    font-size: 14px;
    color: #1a1b1d;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.pagination a.page-numbers:hover {
    background: #1a1b1d;
    color: #fff;
    border-color: #1a1b1d;
    text-decoration: none;
}

.pagination span.page-numbers.current {
    background: #1a1b1d;
    color: #fff;
    border-color: #1a1b1d;
}

.pagination span.page-numbers.dots {
    border: none;
    background: transparent;
}

/* ===== SINGLE POST ===== */
/* WordPress adds single-post class to body — prevent it from constraining page width */
body.single-post {
    max-width: none;
    margin: 0;
    padding: 0;
    padding-top: 64px;
}

.single-post {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px;
}

.single-post__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6e7577;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.single-post__back:hover { color: #1a1b1d; text-decoration: none; }
.single-post__back::before { content: "←"; }

.single-post__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e7577;
    margin-bottom: 12px;
    display: block;
}

.single-post__title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #1a1b1d;
    margin-bottom: 16px;
}

.single-post__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #6e7577;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

.single-post__views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.single-post__views::before {
    content: "👁";
    font-size: 12px;
}

.single-post__featured-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 36px;
}

.single-post__content {
    font-size: 16px;
    line-height: 1.75;
    color: #1a1b1d;
}

.single-post__content h1,
.single-post__content h2,
.single-post__content h3,
.single-post__content h4 {
    font-weight: 700;
    line-height: 1.3;
    margin: 32px 0 16px;
    color: #1a1b1d;
}

.single-post__content h2 { font-size: 26px; }
.single-post__content h3 { font-size: 21px; }
.single-post__content h4 { font-size: 17px; }

.single-post__content p { margin-bottom: 20px; }

.single-post__content ul,
.single-post__content ol {
    margin: 0 0 20px 24px;
}

.single-post__content li { margin-bottom: 8px; }

.single-post__content a {
    color: #1a1b1d;
    text-decoration: underline;
}

.single-post__content a:hover { opacity: 0.7; }

.single-post__content img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    margin: 24px 0;
}

/* Prevent Magento PageBuilder inline-width divs from overflowing */
.single-post__content div,
.single-post__content figure {
    max-width: 100% !important;
}

.single-post__content blockquote {
    border-left: 4px solid #1a1b1d;
    padding: 12px 20px;
    margin: 24px 0;
    font-style: italic;
    background: #f7f7f7;
}

.single-post__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.single-post__content table th,
.single-post__content table td {
    border: 1px solid #e8e8e8;
    padding: 10px 14px;
    text-align: left;
}

.single-post__content table th { background: #f5f5f5; font-weight: 700; }

/* ===== RELATED POSTS ===== */
.related-posts {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
}

.related-posts__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .single-post__title { font-size: 26px; }
    .related-posts__grid { grid-template-columns: 1fr; }
}

/* ===== FOOTER ===== */
.site-footer {    background: #1a1b1d;    color: #fff;    padding: 48px 0 32px;    margin-top: 64px;    display: block;    width: 100%;}

.footer__inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

@media (max-width: 768px) {
    .footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

.footer__col h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 16px;
}

.footer__col ul { list-style: none; }

.footer__col ul li { margin-bottom: 8px; }

.footer__col ul li a {
    color: #aaa;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer__col ul li a:hover { color: #fff; text-decoration: none; }

.footer__col p {
    color: #aaa;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.footer__col a {
    color: #aaa;
    text-decoration: none;
}

.footer__col a:hover { color: #fff; text-decoration: none; }

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    border-top: 1px solid #333;
    padding-top: 24px;
    margin-top: 24px;
}

.footer__copyright {
    font-size: 13px;
    color: #6e7577;
}

.footer__logo img { height: 28px; filter: brightness(0) invert(1); opacity: 0.6; }

/* ===== NO RESULTS ===== */
.no-posts {
    text-align: center;
    padding: 80px 16px;
    color: #6e7577;
}
