<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    {{-- CSRF --}}
    <meta name="csrf-token" content="{{ csrf_token() }}">

    {{-- Canonical/Title/Description (중복 금지) --}}
    @php
        $defaultTitle = 'PIN FOR YOU';
        $defaultDesc  = '상품권, 모바일 교환권, 구글플레이, 문화상품권 등 다양한 모바일 쿠폰을 안전하고 빠르게 할인 구매하세요.';
        $canonicalUrl = trim($__env->yieldContent('canonical', url()->current()));
    @endphp

    <title>@yield('title', $defaultTitle)</title>
    <meta name="description" content="@yield('meta_description', $defaultDesc)">
    <meta name="robots" content="@yield('robots', 'index,follow')">
    <link rel="canonical" href="{{ $canonicalUrl }}">

    {{-- Open Graph --}}
    <meta property="og:site_name" content="PIN FOR YOU">
    <meta property="og:title" content="@yield('og_title', trim($__env->yieldContent('title', $defaultTitle)))">
    <meta property="og:description" content="@yield('og_description', trim($__env->yieldContent('meta_description', $defaultDesc)))">
    <meta property="og:url" content="@yield('og_url', $canonicalUrl)">
    <meta property="og:type" content="@yield('og_type', 'website')">
    <meta property="og:locale" content="ko_KR">
    {{-- 대표 이미지 준비되면 사용 (없으면 생략 가능)
    <meta property="og:image" content="@yield('og_image', asset('assets/images/common/og-default.png'))">
    --}}

    {{-- Twitter Card (선택이지만 권장) --}}
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="@yield('tw_title', trim($__env->yieldContent('title', $defaultTitle)))">
    <meta name="twitter:description" content="@yield('tw_description', trim($__env->yieldContent('meta_description', $defaultDesc)))">
    {{-- <meta name="twitter:image" content="@yield('tw_image', asset('assets/images/common/og-default.png'))"> --}}

    {{-- (선택) 기본 키워드는 큰 의미 없어서 생략 권장 --}}
    {{-- <meta name="keywords" content="..."> --}}

    {{-- Font --}}
    <link rel="stylesheet" href="{{ asset('assets/css/pretendard.css') }}">
    <link rel="preload"
          href="{{ asset('assets/fonts/pretendard/PretendardVariable.woff2') }}"
          as="font" type="font/woff2" crossorigin>

    {{-- Web Bundle --}}
    @stack('styles')
    @vite(['resources/css/web.css', 'resources/js/web.js'])

    {{-- 페이지별 추가 head --}}
    @yield('head')
</head>

<body class="@yield('body_class') {{ !empty($mypageActive) ? 'is-mypage' : '' }}">

{{-- Header --}}
@include('web.company.header')

<main>
    {{-- ✅ 페이지에서 @section('content')가 여기로 들어옴 --}}
    @yield('content')
</main>

{{-- Footer --}}
@include('web.company.footer')

{{-- 페이지별 스크립트 추가용 --}}
@stack('recaptcha')
@stack('scripts')
@include('web.partials.ui-dialog')

{{--@php 개발모드에서만 세션표시--}}
@include('web.partials.dev_session_overlay')
</body>
</html>
