| /* ========================================================================== |
| Tiba Photography — Modern, Accessible, Responsive CSS |
| - Clean base styles and components for a photography portfolio |
| - Works with semantic HTML and common WordPress classes |
| - No external dependencies |
| ========================================================================== */ |
|
|
| /* 1) CSS Custom Properties (Themes, spacing, radii, shadows) */ |
| :root { |
| color-scheme: light dark; |
|
|
| /* Palette */ |
| --bg: |
| --bg-elev: |
| --bg-soft: |
| --text: |
| --text-dim: |
| --muted: |
| --border: |
| --accent: |
| --accent-2: |
| --link: var(--accent); |
| --link-hover: |
|
|
| /* Layout */ |
| --max-w: 1200px; |
| --gutter: clamp(16px, 4vw, 32px); |
| --radius-s: 8px; |
| --radius: 14px; |
| --radius-l: 22px; |
|
|
| /* Typography */ |
| --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; |
| --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; |
| --fs-1: clamp(42px, 6vw, 72px); |
| --fs-2: clamp(28px, 4vw, 44px); |
| --fs-3: clamp(20px, 2.5vw, 28px); |
| --fs-4: 16px; |
|
|
| /* Motion and effects */ |
| --shadow-1: 0 2px 12px rgba(0,0,0,.25); |
| --shadow-2: 0 8px 32px rgba(0,0,0,.35); |
| --ring: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent); |
| --speed-1: 150ms; |
| --speed-2: 260ms; |
| --easing: cubic-bezier(.22,.61,.36,1); |
| } |
|
|
| @media (prefers-color-scheme: light) { |
| :root { |
| --bg: |
| --bg-elev: |
| --bg-soft: |
| --text: |
| --text-dim: |
| --muted: |
| --border: |
| --link: |
| --link-hover: |
| --shadow-1: 0 2px 10px rgba(16,19,24,.06); |
| --shadow-2: 0 16px 48px rgba(16,19,24,.12); |
| } |
| } |
|
|
| /* 2) Modern CSS Reset (opinionated and accessible) */ |
| *, |
| *::before, |
| *::after { box-sizing: border-box; } |
|
|
| html, body { height: 100%; } |
|
|
| html:focus-within { scroll-behavior: smooth; } |
|
|
| body { |
| margin: 0; |
| font-family: var(--font-sans); |
| font-size: var(--fs-4); |
| line-height: 1.6; |
| color: var(--text); |
| background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 96%, transparent) 0%, var(--bg) 60%) fixed; |
| background-color: var(--bg); |
| -webkit-font-smoothing: antialiased; |
| text-rendering: optimizeLegibility; |
| } |
|
|
| img, |
| svg, |
| video, |
| canvas { |
| display: block; |
| max-width: 100%; |
| height: auto; |
| } |
|
|
| picture { display: contents; } |
|
|
| :where(h1,h2,h3,h4) { |
| margin: 0 0 .6em; |
| line-height: 1.15; |
| letter-spacing: -0.01em; |
| } |
|
|
| h1 { font-size: var(--fs-1); } |
| h2 { font-size: var(--fs-2); } |
| h3 { font-size: var(--fs-3); } |
|
|
| p { margin: 0 0 1em; color: var(--text-dim); } |
|
|
| a { |
| color: var(--link); |
| text-decoration: none; |
| text-underline-offset: 2px; |
| transition: color var(--speed-1) var(--easing); |
| } |
| a:hover { color: var(--link-hover); } |
| a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; } |
|
|
| button, |
| [role="button"], |
| input, |
| select, |
| textarea { |
| font: inherit; |
| color: inherit; |
| } |
|
|
| :where(ul,ol) { margin: 0; padding: 0; list-style: none; } |
|
|
| ::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); } |
|
|
| /* 3) Layout utilities */ |
| .container { |
| width: min(100% - 2*var(--gutter), var(--max-w)); |
| margin-inline: auto; |
| } |
|
|
| .stack > * + * { margin-block-start: clamp(16px, 2.4vw, 28px); } |
|
|
| .cluster { |
| display: flex; |
| flex-wrap: wrap; |
| gap: clamp(10px, 2vw, 20px); |
| align-items: center; |
| } |
|
|
| .grid { |
| display: grid; |
| gap: clamp(12px, 2.5vw, 24px); |
| } |
|
|
| .hidden { display: none !important; } |
|
|
| .visually-hidden { |
| position: absolute !important; |
| width: 1px; height: 1px; |
| padding: 0; margin: -1px; |
| overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; |
| } |
|
|
| /* 4) Header / Navigation (handles many links gracefully) */ |
| .site-header { |
| position: sticky; |
| top: 0; inset-inline: 0; |
| z-index: 50; |
| backdrop-filter: saturate(120%) blur(8px); |
| background: color-mix(in oklab, var(--bg-elev) 75%, transparent); |
| border-bottom: 1px solid var(--border); |
| } |
|
|
| .site-header .bar { |
| display: grid; |
| grid-template-columns: 1fr auto; |
| align-items: center; |
| gap: var(--gutter); |
| padding: 14px var(--gutter); |
| } |
|
|
| .brand { |
| display: inline-flex; |
| align-items: center; |
| gap: 12px; |
| min-width: 0; |
| } |
|
|
| .brand-mark { |
| width: 124px; |
| height: 26px; |
| background: no-repeat center/contain url("https://tibalism.com/wp-content/uploads/2022/10/logo.jpg"); |
| filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); |
| } |
| .brand-title { |
| font-weight: 600; |
| letter-spacing: .02em; |
| color: var(--text); |
| white-space: nowrap; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| } |
|
|
| /* Primary nav: scrollable on small, wrapping on large */ |
| .nav { |
| border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent); |
| background: color-mix(in oklab, var(--bg-elev) 92%, transparent); |
| } |
| @media (min-width: 920px) { |
| .nav { border-top: none; background: transparent; } |
| } |
|
|
| .nav .menu { |
| display: flex; |
| gap: clamp(10px, 1.4vw, 18px); |
| padding: 10px var(--gutter); |
| overflow-x: auto; |
| scrollbar-width: thin; |
| scrollbar-color: color-mix(in oklab, var(--muted) 45%, transparent) transparent; |
| scroll-snap-type: x proximity; |
| } |
| .nav .menu::-webkit-scrollbar { height: 8px; } |
| .nav .menu::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--muted) 35%, transparent); border-radius: 999px; } |
|
|
| @media (min-width: 1100px) { |
| .nav .menu { |
| flex-wrap: wrap; |
| overflow: visible; |
| } |
| } |
|
|
| .nav a { |
| display: inline-block; |
| padding: 10px 14px; |
| border-radius: 999px; |
| color: var(--text-dim); |
| background: color-mix(in oklab, var(--bg-soft) 35%, transparent); |
| border: 1px solid color-mix(in oklab, var(--border) 70%, transparent); |
| transition: transform var(--speed-1) var(--easing), background var(--speed-1), color var(--speed-1), border-color var(--speed-1); |
| scroll-snap-align: start; |
| white-space: nowrap; |
| } |
| .nav a:hover { |
| color: var(--text); |
| background: color-mix(in oklab, var(--bg-soft) 60%, transparent); |
| border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); |
| transform: translateY(-1px); |
| } |
| .nav a[aria-current="page"] { |
| color: var(--text); |
| background: color-mix(in oklab, var(--accent) 16%, transparent); |
| border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); |
| } |
|
|
| /* Optional burger toggle (if a checkbox |
| .nav-toggle { |
| display: inline-flex; |
| align-items: center; |
| gap: 10px; |
| background: transparent; |
| border: 1px solid var(--border); |
| color: var(--text); |
| padding: 8px 12px; |
| border-radius: 10px; |
| cursor: pointer; |
| } |
| .nav-toggle .burger { |
| width: 20px; height: 14px; position: relative; |
| } |
| .nav-toggle .burger::before, |
| .nav-toggle .burger::after, |
| .nav-toggle .burger span { |
| content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--speed-2) var(--easing), opacity var(--speed-2); |
| } |
| .nav-toggle .burger::before { top: 0; } |
| .nav-toggle .burger span { top: 6px; } |
| .nav-toggle .burger::after { bottom: 0; } |
|
|
| |
| |
| @media (max-width: 919px) { |
| |
| |
| } |
| @media (min-width: 920px) { |
| .nav-toggle { display: none; } |
| } |
|
|
| /* 5) Hero section */ |
| .hero { |
| position: relative; |
| isolation: isolate; |
| min-height: min(72vh, 820px); |
| display: grid; |
| place-items: center; |
| text-align: center; |
| padding: clamp(48px, 8vw, 96px) 0; |
| background: |
| radial-gradient(1200px 600px at 80% -20%, color-mix(in oklab, var(--accent) 10%, transparent), transparent), |
| radial-gradient(900px 600px at -20% 100%, color-mix(in oklab, var(--accent-2) 12%, transparent), transparent); |
| border-bottom: 1px solid var(--border); |
| } |
| .hero .inner { |
| width: min(100% - 2*var(--gutter), 980px); |
| margin-inline: auto; |
| } |
| .hero h1 { |
| font-weight: 800; |
| background: linear-gradient(90deg, var(--text) 0%, color-mix(in oklab, var(--text) 85%, var(--accent)) 40%, color-mix(in oklab, var(--text) 80%, var(--accent-2)) 100%); |
| -webkit-background-clip: text; |
| background-clip: text; |
| color: transparent; |
| } |
| .hero p { |
| font-size: clamp(18px, 2.2vw, 22px); |
| margin-top: 14px; |
| } |
| .hero .cta { |
| margin-top: clamp(18px, 3vw, 28px); |
| display: inline-flex; |
| gap: 12px; |
| } |
| .btn { |
| display: inline-flex; |
| align-items: center; |
| gap: 10px; |
| padding: 12px 18px; |
| border-radius: 12px; |
| border: 1px solid color-mix(in oklab, var(--accent) 36%, var(--border)); |
| background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 20%, var(--bg-elev)) 0%, var(--bg-elev) 100%); |
| color: var(--text); |
| font-weight: 600; |
| box-shadow: var(--shadow-1); |
| transition: transform var(--speed-1) var(--easing), box-shadow var(--speed-2), background var(--speed-2); |
| } |
| .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); } |
| .btn:active { transform: translateY(0); } |
| .btn.secondary { |
| border-color: var(--border); |
| background: color-mix(in oklab, var(--bg-soft) 70%, var(--bg-elev)); |
| color: var(--text-dim); |
| } |
|
|
| /* 6) Gallery grid */ |
| .gallery { |
| padding: clamp(36px, 7vw, 72px) 0; |
| background: linear-gradient(180deg, var(--bg) 0%, color-mix(in oklab, var(--bg-soft) 40%, var(--bg)) 100%); |
| } |
| .gallery .head { |
| display: flex; |
| align-items: end; |
| justify-content: space-between; |
| gap: 16px; |
| margin-bottom: clamp(18px, 3vw, 26px); |
| } |
| .filters { |
| display: flex; |
| gap: 10px; |
| flex-wrap: wrap; |
| } |
| .filter { |
| padding: 8px 12px; |
| border-radius: 999px; |
| border: 1px solid var(--border); |
| color: var(--text-dim); |
| background: color-mix(in oklab, var(--bg-elev) 70%, var(--bg)); |
| cursor: pointer; |
| } |
| .filter[aria-pressed="true"] { |
| color: var(--text); |
| border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); |
| background: color-mix(in oklab, var(--accent) 16%, var(--bg-elev)); |
| } |
|
|
| .gallery-grid { |
| display: grid; |
| grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); |
| gap: clamp(10px, 1.8vw, 18px); |
| content-visibility: auto; |
| contain-intrinsic-size: 600px; |
| } |
|
|
| .card { |
| position: relative; |
| overflow: clip; |
| border-radius: var(--radius); |
| background: var(--bg-elev); |
| border: 1px solid var(--border); |
| box-shadow: var(--shadow-1); |
| transition: transform var(--speed-2) var(--easing), box-shadow var(--speed-2), border-color var(--speed-1); |
| } |
| .card:hover { |
| transform: translateY(-2px); |
| box-shadow: var(--shadow-2); |
| border-color: color-mix(in oklab, var(--accent) 35%, var(--border)); |
| } |
|
|
| .card figure { |
| margin: 0; position: relative; overflow: hidden; |
| aspect-ratio: 3 / 2; |
| background: linear-gradient(135deg, color-mix(in oklab, var(--bg-soft) 80%, var(--bg-elev)), var(--bg-elev)); |
| } |
| .card img { |
| width: 100%; height: 100%; object-fit: cover; |
| transform: scale(1.02); |
| transition: transform 450ms var(--easing); |
| } |
| .card:hover img { transform: scale(1.06); } |
|
|
| .card .meta { |
| padding: 12px 14px 14px; |
| display: grid; |
| gap: 6px; |
| } |
| .card .title { |
| font-weight: 600; color: var(--text); |
| text-wrap: balance; |
| } |
| .card .sub { |
| font-size: 14px; color: var(--muted); |
| } |
|
|
| /* 7) Pure-CSS Lightbox (:target pattern; add anchor IDs in markup) */ |
| .lightbox { |
| position: fixed; |
| inset: 0; |
| background: color-mix(in oklab, |
| display: grid; |
| place-items: center; |
| padding: 4vmin; |
| opacity: 0; |
| pointer-events: none; |
| transition: opacity var(--speed-2) var(--easing); |
| } |
| .lightbox:target { opacity: 1; pointer-events: all; } |
| .lightbox .frame { |
| max-width: 96vw; max-height: 90vh; |
| border-radius: var(--radius-l); |
| overflow: hidden; |
| background: var(--bg-elev); |
| border: 1px solid var(--border); |
| box-shadow: var(--shadow-2); |
| } |
| .lightbox img { display: block; width: 100%; height: auto; } |
| .lightbox .close { |
| position: absolute; top: 18px; right: 18px; |
| width: 38px; height: 38px; border-radius: 999px; |
| display: grid; place-items: center; |
| color: var(--text); |
| background: color-mix(in oklab, var(--bg) 60%, transparent); |
| border: 1px solid var(--border); |
| text-decoration: none; |
| } |
|
|
| /* 8) Forms (search/contact) */ |
| .input, |
| select, |
| textarea { |
| width: 100%; |
| padding: 12px 14px; |
| border-radius: 12px; |
| border: 1px solid var(--border); |
| background: color-mix(in oklab, var(--bg-elev) 85%, var(--bg)); |
| color: var(--text); |
| transition: border-color var(--speed-1), box-shadow var(--speed-1), background var(--speed-1); |
| } |
| .input::placeholder { color: var(--muted); } |
| .input:focus, |
| textarea:focus, |
| select:focus { |
| outline: none; |
| border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); |
| box-shadow: var(--ring); |
| } |
|
|
| /* 9) Footer */ |
| .site-footer { |
| border-top: 1px solid var(--border); |
| background: color-mix(in oklab, var(--bg-elev) 85%, var(--bg)); |
| color: var(--text-dim); |
| padding: clamp(28px, 5vw, 48px) 0; |
| } |
| .site-footer .grid { |
| grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); |
| align-items: start; |
| } |
| .site-footer a { color: var(--text-dim); } |
| .site-footer a:hover { color: var(--text); } |
|
|
| /* 10) WordPress specifics (safe overrides) */ |
| .wp-site-blocks { gap: unset; } |
| .wp-block-navigation a { border-radius: 999px; } |
| .wp-block-image img { border-radius: var(--radius); } |
| .alignwide { width: min(100% - 2*var(--gutter), var(--max-w) + 240px); margin-inline: auto; } |
| .alignfull { width: 100%; } |
|
|
| /* 11) Media queries */ |
| @media (max-width: 599px) { |
| .hero { min-height: 64vh; } |
| .brand-title { display: none; } /* Save space on tiny screens */ |
| .gallery .head { flex-direction: column; align-items: start; } |
| } |
|
|
| /* 12) Reduced motion */ |
| @media (prefers-reduced-motion: reduce) { |
| * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } |
| } |
|
|
| /* 13) Print */ |
| @media print { |
| .site-header, .nav, .hero .cta, .filters, .lightbox { display: none !important; } |
| body { background: |
| .card, .site-footer { box-shadow: none; border-color: |
| } |
|
|
| /* 14) Helpful attribute-based defaults */ |
| [aria-busy="true"] { cursor: progress; } |
| [disabled] { cursor: not-allowed; opacity: .6; } |
| [aria-current="page"] { font-weight: 700; } |
|
|
| /* 15) Optional helper: aspect ratio utilities */ |
| .ratio-1x1 { aspect-ratio: 1 / 1; } |
| .ratio-4x3 { aspect-ratio: 4 / 3; } |
| .ratio-3x2 { aspect-ratio: 3 / 2; } |
| .ratio-16x9 { aspect-ratio: 16 / 9; } |
|
|
| /* 16) Optional: subtle entrance effect for cards */ |
| @media (prefers-reduced-motion: no-preference) { |
| .card { opacity: 0; transform: translateY(8px); } |
| .gallery-grid .card { animation: rise-in .7s var(--easing) both; } |
| .gallery-grid .card:nth-child(2) { animation-delay: 60ms; } |
| .gallery-grid .card:nth-child(3) { animation-delay: 120ms; } |
| .gallery-grid .card:nth-child(4) { animation-delay: 180ms; } |
| @keyframes rise-in { |
| to { opacity: 1; transform: translateY(0); } |
| } |
| } |